Mesa (master): glsl: take EXT_gpu_shader4 in to account when adding round

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 18 06:20:35 UTC 2020


Module: Mesa
Branch: master
Commit: 5805f5ab0161d597432adfa646557f2c8c25d278
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5805f5ab0161d597432adfa646557f2c8c25d278

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Tue Sep 15 17:05:00 2020 +0300

glsl: take EXT_gpu_shader4 in to account when adding round

GL_EXT_gpu_shader4 adds truncate() and round() builtins.

Fixes: 12567de2be7 ("glsl: mark some builtins with correct glsl(es) version check")
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6731>

---

 src/compiler/glsl/builtin_functions.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 2731cee3f2e..ae7c3da2a41 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -1586,6 +1586,18 @@ builtin_builder::create_builtins()
                 _##NAME(fp64, glsl_type::dvec4_type),      \
                 NULL);
 
+#define FD130GS4(NAME)                          \
+   add_function(#NAME,                          \
+                _##NAME(v130_or_gpu_shader4, glsl_type::float_type), \
+                _##NAME(v130_or_gpu_shader4, glsl_type::vec2_type),  \
+                _##NAME(v130_or_gpu_shader4, glsl_type::vec3_type),  \
+                _##NAME(v130_or_gpu_shader4, glsl_type::vec4_type),  \
+                _##NAME(fp64, glsl_type::double_type),  \
+                _##NAME(fp64, glsl_type::dvec2_type),    \
+                _##NAME(fp64, glsl_type::dvec3_type),     \
+                _##NAME(fp64, glsl_type::dvec4_type),      \
+                NULL);
+
 #define FDGS5(NAME)                                 \
    add_function(#NAME,                          \
                 _##NAME(gpu_shader5_es, glsl_type::float_type), \
@@ -1797,7 +1809,7 @@ builtin_builder::create_builtins()
    FI64(sign)
    FD(floor)
    FD130(trunc)
-   FD130(round)
+   FD130GS4(round)
    FD130(roundEven)
    FD(ceil)
    FD(fract)



More information about the mesa-commit mailing list