r300: Set more shadow sampler lowering in precompiles.
authorPavel Ondračka <pavel.ondracka@gmail.com>
Sun, 21 Aug 2022 08:37:47 +0000 (10:37 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 22 Aug 2022 11:21:24 +0000 (11:21 +0000)
This extends the commit 17cea74b8cd3b1a56d923edeb40772b3e8b18ab2
also for rectangular textures. They are otherwise lowered to MOV
dst temp[0].0000 and deadcode elimitation goes crazy.

Fixes shader-db with tesseract shaders from https://gitlab.freedesktop.org/mesa/mesa/-/issues/6771

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18168>

src/gallium/drivers/r300/r300_state.c

index 2e9126d..33144ad 100644 (file)
@@ -1064,7 +1064,8 @@ static void* r300_create_fs_state(struct pipe_context* pipe,
     tgsi_scan_shader(fs->state.tokens, &info);
     for (int i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
         if (info.sampler_targets[i] == TGSI_TEXTURE_SHADOW1D ||
-            info.sampler_targets[i] == TGSI_TEXTURE_SHADOW2D) {
+            info.sampler_targets[i] == TGSI_TEXTURE_SHADOW2D ||
+            info.sampler_targets[i] == TGSI_TEXTURE_SHADOWRECT) {
             precompile_state.unit[i].compare_mode_enabled = true;
             precompile_state.unit[i].texture_compare_func = PIPE_FUNC_LESS;
         }