summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoyan Ding <[email protected]>2016-10-31 14:45:48 +0800
committerMatt Turner <[email protected]>2017-01-09 17:58:33 -0800
commit41b1d9a558d620df339738aa4aa569fe14298b83 (patch)
tree4071617950ef6167db86a691b0c0ace031d6eb23
parent5b4fa21d5309662ab7e8e15e7f20f90bb8ebc944 (diff)
glsl: Do not allow scalar types in vector relational functions
According to OpenGL Shading Language 4.50 spec, Section 8.7 "Vector Relational Functions", functions of this type do not operate on scalar types, so remove scalar types from signature definitions to make the behavior consistent with glslangValidator and other drivers. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Boyan Ding <[email protected]>
-rw-r--r--src/compiler/glsl/builtin_functions.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 797af08b6c6..6d3b950572a 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -1200,23 +1200,19 @@ builtin_builder::create_builtins()
_##NAME(fp64, glsl_type::dvec4_type), \
NULL);
-#define FIUD(NAME) \
+#define FIUD_VEC(NAME) \
add_function(#NAME, \
- _##NAME(always_available, glsl_type::float_type), \
_##NAME(always_available, glsl_type::vec2_type), \
_##NAME(always_available, glsl_type::vec3_type), \
_##NAME(always_available, glsl_type::vec4_type), \
\
- _##NAME(always_available, glsl_type::int_type), \
_##NAME(always_available, glsl_type::ivec2_type), \
_##NAME(always_available, glsl_type::ivec3_type), \
_##NAME(always_available, glsl_type::ivec4_type), \
\
- _##NAME(v130, glsl_type::uint_type), \
_##NAME(v130, glsl_type::uvec2_type), \
_##NAME(v130, glsl_type::uvec3_type), \
_##NAME(v130, glsl_type::uvec4_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), \
@@ -1235,29 +1231,24 @@ builtin_builder::create_builtins()
_##NAME(glsl_type::uvec4_type), \
NULL);
-#define FIUBD(NAME) \
+#define FIUBD_VEC(NAME) \
add_function(#NAME, \
- _##NAME(always_available, glsl_type::float_type), \
_##NAME(always_available, glsl_type::vec2_type), \
_##NAME(always_available, glsl_type::vec3_type), \
_##NAME(always_available, glsl_type::vec4_type), \
\
- _##NAME(always_available, glsl_type::int_type), \
_##NAME(always_available, glsl_type::ivec2_type), \
_##NAME(always_available, glsl_type::ivec3_type), \
_##NAME(always_available, glsl_type::ivec4_type), \
\
- _##NAME(v130, glsl_type::uint_type), \
_##NAME(v130, glsl_type::uvec2_type), \
_##NAME(v130, glsl_type::uvec3_type), \
_##NAME(v130, glsl_type::uvec4_type), \
\
- _##NAME(always_available, glsl_type::bool_type), \
_##NAME(always_available, glsl_type::bvec2_type), \
_##NAME(always_available, glsl_type::bvec3_type), \
_##NAME(always_available, glsl_type::bvec4_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), \
@@ -1573,12 +1564,12 @@ builtin_builder::create_builtins()
_transpose(fp64, glsl_type::dmat4x2_type),
_transpose(fp64, glsl_type::dmat4x3_type),
NULL);
- FIUD(lessThan)
- FIUD(lessThanEqual)
- FIUD(greaterThan)
- FIUD(greaterThanEqual)
- FIUBD(notEqual)
- FIUBD(equal)
+ FIUD_VEC(lessThan)
+ FIUD_VEC(lessThanEqual)
+ FIUD_VEC(greaterThan)
+ FIUD_VEC(greaterThanEqual)
+ FIUBD_VEC(notEqual)
+ FIUBD_VEC(equal)
add_function("any",
_any(glsl_type::bvec2_type),
@@ -2993,8 +2984,8 @@ builtin_builder::create_builtins()
#undef F
#undef FI
-#undef FIUD
-#undef FIUBD
+#undef FIUD_VEC
+#undef FIUBD_VEC
#undef FIU2_MIXED
}