Mesa (staging/22.0): intel/compiler: Fix sample_d messages on DG2
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Apr 13 17:56:02 UTC 2022
Module: Mesa
Branch: staging/22.0
Commit: ec3b69f1c35a8a4fe0324b223a4aa1411a6cd8d2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec3b69f1c35a8a4fe0324b223a4aa1411a6cd8d2
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Wed Apr 6 14:12:09 2022 -0700
intel/compiler: Fix sample_d messages on DG2
DG2 can only do sample_d and sample_d_c on 1D and 2D surfaces. The
maximum number of gradient components and coordinate components should
be 2. In spite of this limitation, the Bspec lists a mysterious R
component before the min_lod, so the maximum coordinate components is 3.
Fixes the following Vulkan CTS failures on DG2:
dEQP-VK.glsl.texture_functions.texturegradclamp.isampler1d_fragment
dEQP-VK.glsl.texture_functions.texturegradclamp.isampler2d_fragment
dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1d_fixed_fragment
dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1d_float_fragment
dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2d_fixed_fragment
dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2d_float_fragment
dEQP-VK.glsl.texture_functions.texturegradclamp.usampler1d_fragment
dEQP-VK.glsl.texture_functions.texturegradclamp.usampler2d_fragment
The Fixes: tag below is a bit misleading. This commit fixes some test
cases similar to ones fixed by the Fixes: commit. I just want to make
sure this commit gets applied everywhere that commit was also applied.
Fixes: 635ed58e527 ("intel/compiler: Lower txd for 3D samplers on XeHP.")
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15781>
(cherry picked from commit c08302670bd737baf9c4503e09ce91c647a42531)
---
.pick_status.json | 2 +-
src/intel/compiler/brw_fs.cpp | 19 ++++++++++++++++---
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index fd0faaaf9c5..3e9d720a795 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2260,7 +2260,7 @@
"description": "intel/compiler: Fix sample_d messages on DG2",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"because_sha": "635ed58e527f1a1c0b11eca0552e892f56f8ccf6"
},
{
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index fd3b921f714..cb7713bfbb4 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -5214,9 +5214,22 @@ lower_sampler_logical_send_gfx7(const fs_builder &bld, fs_inst *inst, opcode op,
if (min_lod.file != BAD_FILE) {
/* Account for all of the missing coordinate sources */
- length += 4 - coord_components;
- if (op == SHADER_OPCODE_TXD)
- length += (3 - grad_components) * 2;
+ if (op == SHADER_OPCODE_TXD && devinfo->verx10 >= 125) {
+ /* On DG2 and newer platforms, sample_d can only be used with 1D and
+ * 2D surfaces, so the maximum number of gradient components is 2.
+ * In spite of this limitation, the Bspec lists a mysterious R
+ * component before the min_lod, so the maximum coordinate components
+ * is 3.
+ *
+ * Wa_1209978020
+ */
+ length += 3 - coord_components;
+ length += (2 - grad_components) * 2;
+ } else {
+ length += 4 - coord_components;
+ if (op == SHADER_OPCODE_TXD)
+ length += (3 - grad_components) * 2;
+ }
bld.MOV(sources[length++], min_lod);
}
More information about the mesa-commit
mailing list