[Mesa-dev] [PATCH 2/2] radv: do not lower float comparisons because they have to be exact

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Nov 29 15:20:11 UTC 2018


This fixes two test failures in the VKD3D testsuite.
(ie. in test_shader_instructions().

26260 shaders in 13493 tests
Totals:
SGPRS: 1203796 -> 1203948 (0.01 %)
VGPRS: 844968 -> 845052 (0.01 %)
Spilled SGPRs: 21844 -> 21821 (-0.11 %)
Spilled VGPRs: 122 -> 122 (0.00 %)
Code Size: 44707992 -> 44635672 (-0.16 %) bytes
Max Waves: 219539 -> 219529 (-0.00 %)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/vulkan/radv_shader.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 456c462a230..870105fa85c 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -71,7 +71,8 @@ static const struct nir_shader_compiler_options nir_options = {
 	.lower_extract_word = true,
 	.lower_ffma = true,
 	.lower_fpow = true,
-	.max_unroll_iterations = 32
+	.max_unroll_iterations = 32,
+	.exact_float_comparisons = true,
 };
 
 VkResult radv_CreateShaderModule(
-- 
2.19.2



More information about the mesa-dev mailing list