From 0909a57b631f2b200a7422907df6302a72930252 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 31 Aug 2018 07:55:07 -0500 Subject: radeonsi/nir: Set vs_inputs_dual_locations and let NIR do the remap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were going out of our way to disable dual-location re-mapping in NIR only to then do the remapping in st_glsl_to_nir.cpp. Presumably, this was so that double_inputs would be correct for the core state tracker. However, now that we've it to gl_program::DualSlotInputs which is unaffected by NIR lowering, we can let NIR lower things for us. The one tricky bit here is that we have to remap the inputs_read bitfield back to the single-slot convention for the gallium state tracker to use. Since radeonsi is the only NIR-capable gallium driver that also supports GL_ARB_vertex_attrib_64bit, we only have to worry about radeonsi when making core gallium state tracker changes. Acked-by: Marek Olšák Reviewed-by: Timothy Arceri --- src/compiler/nir/nir_lower_io_arrays_to_elements.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/compiler/nir') diff --git a/src/compiler/nir/nir_lower_io_arrays_to_elements.c b/src/compiler/nir/nir_lower_io_arrays_to_elements.c index 16f6233f614..af33d153ea5 100644 --- a/src/compiler/nir/nir_lower_io_arrays_to_elements.c +++ b/src/compiler/nir/nir_lower_io_arrays_to_elements.c @@ -36,9 +36,6 @@ static unsigned get_io_offset(nir_builder *b, nir_deref_instr *deref, nir_variable *var, unsigned *element_index, nir_ssa_def **vertex_index) { - bool vs_in = (b->shader->info.stage == MESA_SHADER_VERTEX) && - (var->data.mode == nir_var_shader_in); - nir_deref_path path; nir_deref_path_init(&path, deref, NULL); @@ -60,7 +57,7 @@ get_io_offset(nir_builder *b, nir_deref_instr *deref, nir_variable *var, assert(c); /* must not be indirect dereference */ - unsigned size = glsl_count_attribute_slots((*p)->type, vs_in); + unsigned size = glsl_count_attribute_slots((*p)->type, false); offset += size * c->u32[0]; unsigned num_elements = glsl_type_is_array((*p)->type) ? -- cgit v1.2.3