diff options
author | Timothy Arceri <[email protected]> | 2017-12-16 14:06:23 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-01-30 09:08:47 +1100 |
commit | f63e05ae9ea0be38a8fb2dd0ae8f391b8699e757 (patch) | |
tree | a8560935b10101db258f692e50dff41efb996367 /src/compiler/glsl | |
parent | f6cc15dccd54ff70be987457af790cac1c8fe5bb (diff) |
compiler: tidy up double_inputs_read uses
First we move double_inputs_read into a vs struct in the union,
double_inputs_read is only used for vs inputs so this will
save space and also allows us to add a new double_inputs field.
We add the new field because c2acf97fcc9b changed the behaviour
of double_inputs_read, and while it's no longer used to track
actual reads in i965 we do still want to track this for gallium
drivers.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 9 | ||||
-rw-r--r-- | src/compiler/glsl/ir_set_program_inouts.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index c4ef4f5ce14..29e32cde53c 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -133,13 +133,13 @@ static void nir_remap_attributes(nir_shader *shader) { nir_foreach_variable(var, &shader->inputs) { - var->data.location += _mesa_bitcount_64(shader->info.double_inputs_read & + var->data.location += _mesa_bitcount_64(shader->info.vs.double_inputs & BITFIELD64_MASK(var->data.location)); } /* Once the remap is done, reset double_inputs_read, so later it will have * which location/slots are doubles */ - shader->info.double_inputs_read = 0; + shader->info.vs.double_inputs = 0; } nir_shader * @@ -363,10 +363,11 @@ nir_visitor::visit(ir_variable *ir) } /* Mark all the locations that require two slots */ - if (glsl_type_is_dual_slot(glsl_without_array(var->type))) { + if (shader->info.stage == MESA_SHADER_VERTEX && + glsl_type_is_dual_slot(glsl_without_array(var->type))) { for (uint i = 0; i < glsl_count_attribute_slots(var->type, true); i++) { uint64_t bitfield = BITFIELD64_BIT(var->data.location + i); - shader->info.double_inputs_read |= bitfield; + shader->info.vs.double_inputs |= bitfield; } } break; diff --git a/src/compiler/glsl/ir_set_program_inouts.cpp b/src/compiler/glsl/ir_set_program_inouts.cpp index 90b06b9f417..1b6c8d750b9 100644 --- a/src/compiler/glsl/ir_set_program_inouts.cpp +++ b/src/compiler/glsl/ir_set_program_inouts.cpp @@ -118,7 +118,7 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len, /* double inputs read is only for vertex inputs */ if (stage == MESA_SHADER_VERTEX && var->type->without_array()->is_dual_slot()) - prog->info.double_inputs_read |= bitfield; + prog->info.vs.double_inputs_read |= bitfield; if (stage == MESA_SHADER_FRAGMENT) { prog->info.fs.uses_sample_qualifier |= var->data.sample; |