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 c2acf97fcc 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 <marek.olsak@amd.com>
This commit is contained in:
Timothy Arceri
2017-12-16 14:06:23 +11:00
parent f6cc15dccd
commit f63e05ae9e
8 changed files with 24 additions and 13 deletions

View File

@@ -234,7 +234,8 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader)
glsl_type_is_dual_slot(glsl_without_array(var->type))) {
for (uint i = 0; i < glsl_count_attribute_slots(var->type, false); i++) {
int idx = var->data.location + i;
shader->info.double_inputs_read |= BITFIELD64_BIT(idx);
shader->info.vs.double_inputs |= BITFIELD64_BIT(idx);
shader->info.vs.double_inputs_read |= BITFIELD64_BIT(idx);
}
}
}
@@ -356,10 +357,13 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
shader->info.outputs_written = 0;
shader->info.outputs_read = 0;
shader->info.patch_outputs_read = 0;
shader->info.double_inputs_read = 0;
shader->info.patch_inputs_read = 0;
shader->info.patch_outputs_written = 0;
shader->info.system_values_read = 0;
if (shader->info.stage == MESA_SHADER_VERTEX) {
shader->info.vs.double_inputs = 0;
shader->info.vs.double_inputs_read = 0;
}
if (shader->info.stage == MESA_SHADER_FRAGMENT) {
shader->info.fs.uses_sample_qualifier = false;
}