summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-09-14 19:52:38 -0700
committerJordan Justen <[email protected]>2017-10-20 12:49:17 -0700
commit59fb59ad54d368683d5cc3b149f021452bddc05f (patch)
tree734e742be190df8ae7a19a975c59ba7eeeded6eb /src/gallium
parent341529dbee5c2b17fdcb7990484a383459bed305 (diff)
nir: Get rid of nir_shader::stage
It's redundant with nir_shader::info::stage. Acked-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/nir/tgsi_to_nir.c2
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_cmdline.c4
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_nir.c4
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c22
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c2
5 files changed, 17 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index a3175523110..f8df4c10137 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -1867,7 +1867,7 @@ ttn_add_output_stores(struct ttn_compile *c)
nir_src src = nir_src_for_reg(c->output_regs[loc].reg);
src.reg.base_offset = c->output_regs[loc].offset;
- if (c->build.shader->stage == MESA_SHADER_FRAGMENT &&
+ if (c->build.shader->info.stage == MESA_SHADER_FRAGMENT &&
var->data.location == FRAG_RESULT_DEPTH) {
/* TGSI uses TGSI_SEMANTIC_POSITION.z for the depth output, while
* NIR uses a single float FRAG_RESULT_DEPTH.
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
index cfcb807de31..b2aa9f063a7 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
@@ -399,7 +399,7 @@ int main(int argc, char **argv)
v.key = key;
v.shader = &s;
- switch (nir->stage) {
+ switch (nir->info.stage) {
case MESA_SHADER_FRAGMENT:
s.type = v.type = SHADER_FRAGMENT;
break;
@@ -410,7 +410,7 @@ int main(int argc, char **argv)
s.type = v.type = SHADER_COMPUTE;
break;
default:
- errx(1, "unhandled shader stage: %d", nir->stage);
+ errx(1, "unhandled shader stage: %d", nir->info.stage);
}
info = "NIR compiler";
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
index d30543d760f..ef7facff332 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
@@ -167,11 +167,11 @@ ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
OPT_V(s, nir_lower_regs_to_ssa);
if (key) {
- if (s->stage == MESA_SHADER_VERTEX) {
+ if (s->info.stage == MESA_SHADER_VERTEX) {
OPT_V(s, nir_lower_clip_vs, key->ucp_enables);
if (key->vclamp_color)
OPT_V(s, nir_lower_clamp_color_outputs);
- } else if (s->stage == MESA_SHADER_FRAGMENT) {
+ } else if (s->info.stage == MESA_SHADER_FRAGMENT) {
OPT_V(s, nir_lower_clip_fs, key->ucp_enables);
if (key->fclamp_color)
OPT_V(s, nir_lower_clamp_color_outputs);
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index fce759b003d..a2d175364f8 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -124,10 +124,10 @@ void si_nir_scan_shader(const struct nir_shader *nir,
nir_function *func;
unsigned i;
- assert(nir->stage == MESA_SHADER_VERTEX ||
- nir->stage == MESA_SHADER_FRAGMENT);
+ assert(nir->info.stage == MESA_SHADER_VERTEX ||
+ nir->info.stage == MESA_SHADER_FRAGMENT);
- info->processor = pipe_shader_type_from_mesa(nir->stage);
+ info->processor = pipe_shader_type_from_mesa(nir->info.stage);
info->num_tokens = 2; /* indicate that the shader is non-empty */
info->num_instructions = 2;
@@ -138,7 +138,7 @@ void si_nir_scan_shader(const struct nir_shader *nir,
nir_foreach_variable(variable, &nir->inputs) {
unsigned semantic_name, semantic_index;
unsigned attrib_count = glsl_count_attribute_slots(variable->type,
- nir->stage == MESA_SHADER_VERTEX);
+ nir->info.stage == MESA_SHADER_VERTEX);
assert(attrib_count == 1 && "not implemented");
@@ -146,11 +146,11 @@ void si_nir_scan_shader(const struct nir_shader *nir,
* tracker has already mapped them to attributes via
* variable->data.driver_location.
*/
- if (nir->stage == MESA_SHADER_VERTEX)
+ if (nir->info.stage == MESA_SHADER_VERTEX)
continue;
/* Fragment shader position is a system value. */
- if (nir->stage == MESA_SHADER_FRAGMENT &&
+ if (nir->info.stage == MESA_SHADER_FRAGMENT &&
variable->data.location == VARYING_SLOT_POS) {
if (variable->data.pixel_center_integer)
info->properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER] =
@@ -231,7 +231,7 @@ void si_nir_scan_shader(const struct nir_shader *nir,
nir_foreach_variable(variable, &nir->outputs) {
unsigned semantic_name, semantic_index;
- if (nir->stage == MESA_SHADER_FRAGMENT) {
+ if (nir->info.stage == MESA_SHADER_FRAGMENT) {
tgsi_get_gl_frag_result_semantic(variable->data.location,
&semantic_name, &semantic_index);
} else {
@@ -336,7 +336,7 @@ si_lower_nir(struct si_shader_selector* sel)
nir_foreach_variable(variable, &sel->nir->outputs) {
variable->data.driver_location *= 4;
- if (sel->nir->stage == MESA_SHADER_FRAGMENT) {
+ if (sel->nir->info.stage == MESA_SHADER_FRAGMENT) {
if (variable->data.location == FRAG_RESULT_DEPTH)
variable->data.driver_location += 2;
else if (variable->data.location == FRAG_RESULT_STENCIL)
@@ -478,15 +478,15 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir)
unsigned fs_attr_idx = 0;
nir_foreach_variable(variable, &nir->inputs) {
unsigned attrib_count = glsl_count_attribute_slots(variable->type,
- nir->stage == MESA_SHADER_VERTEX);
+ nir->info.stage == MESA_SHADER_VERTEX);
unsigned input_idx = variable->data.driver_location;
for (unsigned i = 0; i < attrib_count; ++i) {
LLVMValueRef data[4];
- if (nir->stage == MESA_SHADER_VERTEX)
+ if (nir->info.stage == MESA_SHADER_VERTEX)
declare_nir_input_vs(ctx, variable, i, data);
- else if (nir->stage == MESA_SHADER_FRAGMENT)
+ else if (nir->info.stage == MESA_SHADER_FRAGMENT)
declare_nir_input_fs(ctx, variable, i, &fs_attr_idx, data);
for (unsigned chan = 0; chan < 4; chan++) {
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index bf7424bf28a..98cdfdf33ea 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -2467,7 +2467,7 @@ vc4_shader_state_create(struct pipe_context *pctx,
if (vc4_debug & VC4_DEBUG_NIR) {
fprintf(stderr, "%s prog %d NIR:\n",
- gl_shader_stage_name(s->stage),
+ gl_shader_stage_name(s->info.stage),
so->program_id);
nir_print_shader(s, stderr);
fprintf(stderr, "\n");