diff --git a/src/gallium/drivers/panfrost/ci/deqp-panfrost-g52-fails.txt b/src/gallium/drivers/panfrost/ci/deqp-panfrost-g52-fails.txt index 3a5644f6bd8..a3ac4fe074f 100644 --- a/src/gallium/drivers/panfrost/ci/deqp-panfrost-g52-fails.txt +++ b/src/gallium/drivers/panfrost/ci/deqp-panfrost-g52-fails.txt @@ -12,16 +12,8 @@ dEQP-GLES31.functional.draw_buffers_indexed.random.max_implementation_draw_buffe dEQP-GLES31.functional.draw_buffers_indexed.random.max_required_draw_buffers.10,Fail dEQP-GLES31.functional.draw_indirect.draw_elements_indirect.line_strip.instanced_attributes,Fail dEQP-GLES31.functional.draw_indirect.random.31,Fail -dEQP-GLES31.functional.layout_binding.image.image2d.vertex_binding_array,Fail dEQP-GLES31.functional.layout_binding.image.image2d.vertex_binding_max_array,Fail -dEQP-GLES31.functional.layout_binding.image.image2d.vertex_binding_max,Fail -dEQP-GLES31.functional.layout_binding.image.image2d.vertex_binding_multiple,Fail -dEQP-GLES31.functional.layout_binding.image.image2d.vertex_binding_single,Fail -dEQP-GLES31.functional.layout_binding.image.image3d.vertex_binding_array,Fail dEQP-GLES31.functional.layout_binding.image.image3d.vertex_binding_max_array,Fail -dEQP-GLES31.functional.layout_binding.image.image3d.vertex_binding_max,Fail -dEQP-GLES31.functional.layout_binding.image.image3d.vertex_binding_multiple,Fail -dEQP-GLES31.functional.layout_binding.image.image3d.vertex_binding_single,Fail dEQP-GLES31.functional.separate_shader.random.23,Fail dEQP-GLES31.functional.separate_shader.random.35,Fail dEQP-GLES31.functional.separate_shader.random.49,Fail diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 0c39f5cad5d..d67e685e3f8 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -809,6 +809,25 @@ bi_emit_image_coord(bi_builder *b, bi_index coord) bi_half(bi_word(coord, 1), false)); } +static bi_index +bi_emit_image_index(bi_builder *b, nir_intrinsic_instr *instr) +{ + nir_src src = instr->src[0]; + bi_index index = bi_src_index(&src); + bi_context *ctx = b->shader; + + /* Images come after vertex attributes, so handle an explicit offset */ + unsigned offset = (ctx->stage == MESA_SHADER_VERTEX) ? + util_bitcount64(ctx->nir->info.inputs_read) : 0; + + if (offset == 0) + return index; + else if (nir_src_is_const(src)) + return bi_imm_u32(nir_src_as_uint(src) + offset); + else + return bi_iadd_u32(b, index, bi_imm_u32(offset), false); +} + static void bi_emit_image_load(bi_builder *b, nir_intrinsic_instr *instr) { @@ -822,7 +841,7 @@ bi_emit_image_load(bi_builder *b, nir_intrinsic_instr *instr) bi_ld_attr_tex_to(b, bi_dest_index(&instr->dest), bi_emit_image_coord(b, coords), bi_emit_image_coord(b, bi_word(coords, 2)), - bi_src_index(&instr->src[0]), + bi_emit_image_index(b, instr), bi_reg_fmt_for_nir(nir_intrinsic_dest_type(instr)), instr->num_components - 1); } @@ -845,7 +864,7 @@ bi_emit_lea_image(bi_builder *b, nir_intrinsic_instr *instr) bi_index zw = bi_emit_image_coord(b, bi_word(coords, 2)); bi_instr *I = bi_lea_attr_tex_to(b, bi_temp(b->shader), xy, zw, - bi_src_index(&instr->src[0]), type); + bi_emit_image_index(b, instr), type); /* LEA_ATTR_TEX defaults to the secondary attribute table, but our ABI * has all images in the primary attribute table */