diff options
author | Rhys Perry <pendingchaos02@gmail.com> | 2022-04-25 19:42:30 +0100 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2022-04-26 09:06:12 -0700 |
commit | 893922435040cabf2363907befc9de6f2347b859 (patch) | |
tree | b5bbcc7af362ebbc918ad1790c1bda5287b99d06 | |
parent | 3dd54edd121b29a2bfa05fe9afd42e14826ec40b (diff) |
radv: fix clearing of TRUNC_COORD with tg4 and immutable samplers
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 15640e58d96 ("radv,aco: lower texture descriptor loads in NIR")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16148>
(cherry picked from commit f97d82c52bec095a4592c40e19869f95fa07f561)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/vulkan/radv_nir_apply_pipeline_layout.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index 8d5a16145b4..2d4039c58bb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -265,7 +265,7 @@ "description": "radv: fix clearing of TRUNC_COORD with tg4 and immutable samplers", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "15640e58d96c5db0cd78769a06b6b204dcd60799" }, diff --git a/src/amd/vulkan/radv_nir_apply_pipeline_layout.c b/src/amd/vulkan/radv_nir_apply_pipeline_layout.c index 004999ffeed..abd23aec0bb 100644 --- a/src/amd/vulkan/radv_nir_apply_pipeline_layout.c +++ b/src/amd/vulkan/radv_nir_apply_pipeline_layout.c @@ -251,8 +251,9 @@ get_sampler_desc(nir_builder *b, apply_layout_state *state, nir_deref_instr *der } } + uint32_t dword0_mask = tex->op == nir_texop_tg4 ? C_008F30_TRUNC_COORD : 0xffffffffu; const uint32_t *samplers = radv_immutable_samplers(layout, binding); - return nir_imm_ivec4(b, samplers[constant_index * 4 + 0], samplers[constant_index * 4 + 1], + return nir_imm_ivec4(b, samplers[constant_index * 4 + 0] & dword0_mask, samplers[constant_index * 4 + 1], samplers[constant_index * 4 + 2], samplers[constant_index * 4 + 3]); } |