r600: set never as the depth compare function when depth compare is disabled

This is the backport of 0c0b978938 "radeonsi: set NEVER as
the depth compare func if depth compare is disabled".

The function r600_tex_compare arguments are updated with the "const"
keyword.

This change fixes the test below which was broken after 0c6e56c391:
khr-gl4[5-6]/incomplete_texture_access/sampler: fail pass

Fixes: 0c6e56c391 ("mesa: (more) correctly handle incomplete depth textures")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Acked-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35968>
This commit is contained in:
Patrick Lerda
2025-07-04 14:46:13 +02:00
committed by Marge Bot
parent 47ef60cbf1
commit d9baadcfb5
4 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -616,7 +616,7 @@ static void *evergreen_create_sampler_state(struct pipe_context *ctx,
S_03C000_XY_MIN_FILTER(eg_tex_filter(state->min_img_filter, max_aniso)) |
S_03C000_MIP_FILTER(r600_tex_mipfilter(state->min_mip_filter)) |
S_03C000_MAX_ANISO_RATIO(max_aniso_ratio) |
S_03C000_DEPTH_COMPARE_FUNCTION(r600_tex_compare(state->compare_func)) |
S_03C000_DEPTH_COMPARE_FUNCTION(r600_tex_compare(state->compare_mode, state->compare_func)) |
S_03C000_BORDER_COLOR_TYPE(ss->border_color_use ? V_03C000_SQ_TEX_BORDER_COLOR_REGISTER : 0);
/* R_03C004_SQ_TEX_SAMPLER_WORD1_0 */
ss->tex_sampler_words[1] =
+2 -1
View File
@@ -848,7 +848,8 @@ uint32_t r600_translate_stencil_op(int s_op);
uint32_t r600_translate_fill(uint32_t func);
unsigned r600_tex_wrap(unsigned wrap);
unsigned r600_tex_mipfilter(unsigned filter);
unsigned r600_tex_compare(unsigned compare);
unsigned r600_tex_compare(const unsigned mode,
const unsigned compare);
bool sampler_state_needs_border_color(const struct pipe_sampler_state *state);
unsigned r600_get_swizzle_combined(const unsigned char *swizzle_format,
const unsigned char *swizzle_view,
+1 -1
View File
@@ -598,7 +598,7 @@ static void *r600_create_sampler_state(struct pipe_context *ctx,
S_03C000_XY_MIN_FILTER(r600_tex_filter(state->min_img_filter, max_aniso)) |
S_03C000_MIP_FILTER(r600_tex_mipfilter(state->min_mip_filter)) |
S_03C000_MAX_ANISO_RATIO(max_aniso_ratio) |
S_03C000_DEPTH_COMPARE_FUNCTION(r600_tex_compare(state->compare_func)) |
S_03C000_DEPTH_COMPARE_FUNCTION(r600_tex_compare(state->compare_mode, state->compare_func)) |
S_03C000_BORDER_COLOR_TYPE(ss->border_color_use ? V_03C000_SQ_TEX_BORDER_COLOR_REGISTER : 0);
/* R_03C004_SQ_TEX_SAMPLER_WORD1_0 */
ss->tex_sampler_words[1] =
+5 -1
View File
@@ -3107,8 +3107,12 @@ unsigned r600_tex_mipfilter(unsigned filter)
}
}
unsigned r600_tex_compare(unsigned compare)
unsigned r600_tex_compare(const unsigned mode,
const unsigned compare)
{
if (unlikely(mode == PIPE_TEX_COMPARE_NONE))
return V_03C000_SQ_TEX_DEPTH_COMPARE_NEVER;
switch (compare) {
default:
case PIPE_FUNC_NEVER: