diff --git a/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt b/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt index 732e12ce7c7..5b6ec4796e1 100644 --- a/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt +++ b/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt @@ -87,7 +87,6 @@ spec@arb_seamless_cube_map@arb_seamless_cubemap,Fail spec@arb_shader_storage_buffer_object@array-ssbo-binding,Crash spec@arb_shader_texture_lod@execution@arb_shader_texture_lod-texgrad,Fail spec@arb_tessellation_shader@arb_tessellation_shader-tes-gs-max-output -small -scan 1 50,Crash -spec@arb_texture_buffer_object@indexed,Fail spec@arb_texture_buffer_object@render-no-bo,Crash spec@arb_texture_buffer_range@ranges-2 compat,Fail spec@arb_texture_cube_map_array@arb_texture_cube_map_array-sampler-cube-array-shadow,Fail diff --git a/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c b/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c index 4cfc68ead99..ca38e308bf5 100644 --- a/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c +++ b/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c @@ -100,15 +100,16 @@ static nir_ssa_def *lower_vri_intrin_lvd(struct nir_builder *b, return nir_vec2(b, index, nir_imm_int(b, 0)); } -static int lower_vri_instr_tex_deref(nir_tex_instr *tex, - nir_tex_src_type deref_src_type, - gl_shader_stage stage, - struct lvp_pipeline_layout *layout) +static unsigned +lower_vri_instr_tex_deref(nir_tex_instr *tex, + nir_tex_src_type deref_src_type, + gl_shader_stage stage, + struct lvp_pipeline_layout *layout) { int deref_src_idx = nir_tex_instr_src_index(tex, deref_src_type); if (deref_src_idx < 0) - return -1; + return 0; nir_deref_instr *deref_instr = nir_src_as_deref(tex->src[deref_src_idx].src); nir_variable *var = nir_deref_instr_get_variable(deref_instr); @@ -142,19 +143,28 @@ static int lower_vri_instr_tex_deref(nir_tex_instr *tex, tex->sampler_index = value; else tex->texture_index = value; - return value; + + if (deref_instr->deref_type == nir_deref_type_array) { + assert(glsl_type_is_array(var->type)); + assert(value >= 0); + unsigned size = glsl_get_aoa_size(var->type); + return u_bit_consecutive(value, size); + } else + return 1u << value; } static void lower_vri_instr_tex(struct nir_builder *b, nir_tex_instr *tex, void *data_cb) { struct lvp_pipeline_layout *layout = data_cb; - int tex_value = 0; + unsigned textures_used; lower_vri_instr_tex_deref(tex, nir_tex_src_sampler_deref, b->shader->info.stage, layout); - tex_value = lower_vri_instr_tex_deref(tex, nir_tex_src_texture_deref, b->shader->info.stage, layout); - if (tex_value >= 0) - BITSET_SET(b->shader->info.textures_used, tex_value); + textures_used = lower_vri_instr_tex_deref(tex, nir_tex_src_texture_deref, b->shader->info.stage, layout); + while (textures_used) { + int i = u_bit_scan(&textures_used); + BITSET_SET(b->shader->info.textures_used, i); + } } static nir_ssa_def *lower_vri_instr(struct nir_builder *b,