From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Jason Ekstrand <jason@jlekstrand.net>
Subject: [PATCH 1/8] nir: add nir_var_all enum
Date: Mon, 19 Oct 2015 15:47:54 -0400 [thread overview]
Message-ID: <1445284081-29532-2-git-send-email-robdclark@gmail.com> (raw)
In-Reply-To: <1445284081-29532-1-git-send-email-robdclark@gmail.com>
Otherwise, passing -1 gets you:
error: invalid conversion from 'int' to 'nir_variable_mode' [-fpermissive]
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
src/glsl/nir/nir.c | 4 ++++
src/glsl/nir/nir.h | 1 +
src/glsl/nir/nir_lower_io.c | 2 +-
src/mesa/drivers/dri/i965/brw_nir.c | 3 ++-
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index 793bdaf..caa9ffc 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -107,6 +107,10 @@ void
nir_shader_add_variable(nir_shader *shader, nir_variable *var)
{
switch (var->data.mode) {
+ case nir_var_all:
+ assert(!"invalid mode");
+ break;
+
case nir_var_local:
assert(!"nir_shader_add_variable cannot be used for local variables");
break;
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index c867e6d..2a84cb0 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -82,6 +82,7 @@ typedef struct {
} nir_state_slot;
typedef enum {
+ nir_var_all = -1,
nir_var_shader_in,
nir_var_shader_out,
nir_var_global,
diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
index 688b48f..b4ed857 100644
--- a/src/glsl/nir/nir_lower_io.c
+++ b/src/glsl/nir/nir_lower_io.c
@@ -176,7 +176,7 @@ nir_lower_io_block(nir_block *block, void *void_state)
nir_variable_mode mode = intrin->variables[0]->var->data.mode;
- if (state->mode != -1 && state->mode != mode)
+ if (state->mode != nir_var_all && state->mode != mode)
continue;
switch (intrin->intrinsic) {
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index af9d041..e22f5fa 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -219,7 +219,8 @@ brw_create_nir(struct brw_context *brw,
nir_assign_var_locations(&nir->uniforms,
&nir->num_uniforms,
is_scalar ? type_size_scalar : type_size_vec4);
- nir_lower_io(nir, -1, is_scalar ? type_size_scalar : type_size_vec4);
+ nir_lower_io(nir, nir_var_all,
+ is_scalar ? type_size_scalar : type_size_vec4);
nir_validate_shader(nir);
nir_remove_dead_variables(nir);
--
2.5.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-10-19 19:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 19:47 [RFCv0 0/8] gallium: add support for NIR as alternate IR Rob Clark
2015-10-19 19:47 ` Rob Clark [this message]
2015-10-19 19:47 ` [RFCv0 2/8] gallium: refactor pipe_shader_state to support multiple IR's Rob Clark
2015-10-19 19:47 ` [RFCv0 3/8] gallium: add NIR as a possible IR Rob Clark
2015-10-19 19:47 ` [RFCv0 4/8] mesa/st: add support for NIR as possible driver IR Rob Clark
2015-10-19 19:47 ` [RFCv0 5/8] freedreno/ir3: drop tokens arg Rob Clark
2015-10-19 19:47 ` [RFCv0 6/8] freedreno/ir3: add support for NIR as preferred IR Rob Clark
2015-10-19 19:48 ` [RFCv0 7/8] freedreno/ir3: fix const_index handling for uniforms Rob Clark
2015-10-19 19:48 ` [RFCv0 8/8] freedreno/ir3: hack for mismatch on varying slots for glsl->tgsi->nir vs glsl->nir Rob Clark
2015-10-19 19:51 ` [RFCv0 0/8] gallium: add support for NIR as alternate IR Ilia Mirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1445284081-29532-2-git-send-email-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jason@jlekstrand.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.