r600: enable EXT_texture_shadow_lod

The support needed only a minor adjustment.

Note: As far as rv770 is concerned: khr-gl33 (4/12),
the support needs some work and is disabled.

This change was tested on palm, barts and cayman: piglit (3/3)
khr-gl46 (15/16). The failing test: sampler2darrayshadow_vertex
is referenced as "Bug 21620051" (VK-GL-CTS) and seems to have
a problem.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39915>
This commit is contained in:
Patrick Lerda 2026-02-16 13:24:46 +01:00 committed by Marge Bot
parent 1c00172eec
commit 72dcc82618
2 changed files with 6 additions and 1 deletions

View file

@ -450,7 +450,8 @@ static void r600_init_screen_caps(struct r600_screen *rscreen)
caps->surface_reinterpret_blocks = true;
caps->compressed_surface_reinterpret_blocks_layered = true;
caps->query_memory_info = true;
caps->query_so_overflow = family >= CHIP_CEDAR;
caps->query_so_overflow =
caps->texture_shadow_lod = family >= CHIP_CEDAR;
caps->framebuffer_no_attachment = true;
caps->legacy_math_rules = true;
caps->can_bind_const_buffer_as_vertex = true;

View file

@ -154,6 +154,10 @@ lower_txl_txf_array_or_cube(nir_builder *b, nir_tex_instr *tex)
if (min_lod_idx >= 0)
lod = nir_fmax(b, lod, tex->src[min_lod_idx].src.ssa);
if (unlikely(tex->sampler_dim == GLSL_SAMPLER_DIM_2D && tex->is_shadow &&
tex->is_array))
lod = nir_fadd(b, lod, nir_imm_float(b, -1.0));
/* max lod? */
nir_def *lambda_exp = nir_fexp2(b, lod);