diff options
author | Jason Ekstrand <[email protected]> | 2017-09-14 19:52:38 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2017-10-20 12:49:17 -0700 |
commit | 59fb59ad54d368683d5cc3b149f021452bddc05f (patch) | |
tree | 734e742be190df8ae7a19a975c59ba7eeeded6eb /src/compiler/spirv/vtn_variables.c | |
parent | 341529dbee5c2b17fdcb7990484a383459bed305 (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/compiler/spirv/vtn_variables.c')
-rw-r--r-- | src/compiler/spirv/vtn_variables.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 997b66f5420..1cf9d597cf0 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -1048,7 +1048,7 @@ vtn_get_builtin_location(struct vtn_builder *b, set_mode_system_value(mode); break; case SpvBuiltInPrimitiveId: - if (b->shader->stage == MESA_SHADER_FRAGMENT) { + if (b->shader->info.stage == MESA_SHADER_FRAGMENT) { assert(*mode == nir_var_shader_in); *location = VARYING_SLOT_PRIMITIVE_ID; } else if (*mode == nir_var_shader_out) { @@ -1064,18 +1064,18 @@ vtn_get_builtin_location(struct vtn_builder *b, break; case SpvBuiltInLayer: *location = VARYING_SLOT_LAYER; - if (b->shader->stage == MESA_SHADER_FRAGMENT) + if (b->shader->info.stage == MESA_SHADER_FRAGMENT) *mode = nir_var_shader_in; - else if (b->shader->stage == MESA_SHADER_GEOMETRY) + else if (b->shader->info.stage == MESA_SHADER_GEOMETRY) *mode = nir_var_shader_out; else unreachable("invalid stage for SpvBuiltInLayer"); break; case SpvBuiltInViewportIndex: *location = VARYING_SLOT_VIEWPORT; - if (b->shader->stage == MESA_SHADER_GEOMETRY) + if (b->shader->info.stage == MESA_SHADER_GEOMETRY) *mode = nir_var_shader_out; - else if (b->shader->stage == MESA_SHADER_FRAGMENT) + else if (b->shader->info.stage == MESA_SHADER_FRAGMENT) *mode = nir_var_shader_in; else unreachable("invalid stage for SpvBuiltInViewportIndex"); @@ -1355,11 +1355,11 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member, if (dec->decoration == SpvDecorationLocation) { unsigned location = dec->literals[0]; bool is_vertex_input; - if (b->shader->stage == MESA_SHADER_FRAGMENT && + if (b->shader->info.stage == MESA_SHADER_FRAGMENT && vtn_var->mode == vtn_variable_mode_output) { is_vertex_input = false; location += FRAG_RESULT_DATA0; - } else if (b->shader->stage == MESA_SHADER_VERTEX && + } else if (b->shader->info.stage == MESA_SHADER_VERTEX && vtn_var->mode == vtn_variable_mode_input) { is_vertex_input = true; location += VERT_ATTRIB_GENERIC0; @@ -1653,7 +1653,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val, int array_length = -1; struct vtn_type *interface_type = var->type; - if (is_per_vertex_inout(var, b->shader->stage)) { + if (is_per_vertex_inout(var, b->shader->info.stage)) { /* In Geometry shaders (and some tessellation), inputs come * in per-vertex arrays. However, some builtins come in * non-per-vertex, hence the need for the is_array check. In |