Add tests for out-param aliasing against other variables
authorAitor Camacho <aitor@lunarg.com>
Thu, 20 Oct 2022 11:11:11 +0000 (13:11 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 18 Nov 2022 00:06:45 +0000 (00:06 +0000)
VK-GL-CTS Issue: 3658

New tests:
*.function.*

Components: OpenGL, OpenGL ES
Change-Id: I1443b77db7eb8f6b7182a1c49bd656c79d7e8e67

47 files changed:
AndroidGen.mk
android/cts/main/gles2-master-2022-03-01.txt
android/cts/main/gles2-master.txt
android/cts/main/gles3-master-2022-03-01.txt
android/cts/main/gles3-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl33-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl40-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl41-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl42-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl43-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl44-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl45-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl46-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl33-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl40-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl41-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl42-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl43-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl44-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl45-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl46-master.txt
external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.5.x/gles2-master.txt
external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.5.x/gles3-master.txt
external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.6.x/gles2-master.txt
external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.6.x/gles3-master.txt
external/openglcts/data/mustpass/gles/aosp_mustpass/main/gles2-master.txt
external/openglcts/data/mustpass/gles/aosp_mustpass/main/gles3-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.5.x/gles3-khr-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.5.x/gles32-khr-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.6.x/gles3-khr-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.6.x/gles32-khr-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/main/gles3-khr-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/main/gles32-khr-master.txt
external/openglcts/modules/common/CMakeLists.txt
external/openglcts/modules/common/glcShaderFunctionTests.cpp [new file with mode: 0644]
external/openglcts/modules/common/glcShaderFunctionTests.hpp [new file with mode: 0644]
external/openglcts/modules/gl/gl3cTestPackages.cpp
external/openglcts/modules/gles3/es3cTestPackage.cpp
external/openglcts/modules/gles32/es32cTestPackage.cpp
modules/gles2/functional/CMakeLists.txt
modules/gles2/functional/es2fFunctionalTests.cpp
modules/gles2/functional/es2fShaderFunctionTests.cpp [new file with mode: 0644]
modules/gles2/functional/es2fShaderFunctionTests.hpp [new file with mode: 0644]
modules/gles3/functional/CMakeLists.txt
modules/gles3/functional/es3fFunctionalTests.cpp
modules/gles3/functional/es3fShaderFunctionTests.cpp [new file with mode: 0644]
modules/gles3/functional/es3fShaderFunctionTests.hpp [new file with mode: 0644]

index ad144f5..cce2c76 100644 (file)
@@ -960,6 +960,7 @@ LOCAL_SRC_FILES := \
        modules/gles2/functional/es2fShaderDiscardTests.cpp \
        modules/gles2/functional/es2fShaderExecuteTest.cpp \
        modules/gles2/functional/es2fShaderFragDataTests.cpp \
+       modules/gles2/functional/es2fShaderFunctionTests.cpp \
        modules/gles2/functional/es2fShaderIndexingTests.cpp \
        modules/gles2/functional/es2fShaderInvarianceTests.cpp \
        modules/gles2/functional/es2fShaderLoopTests.cpp \
@@ -1090,6 +1091,7 @@ LOCAL_SRC_FILES := \
        modules/gles3/functional/es3fShaderDerivateTests.cpp \
        modules/gles3/functional/es3fShaderDiscardTests.cpp \
        modules/gles3/functional/es3fShaderFragDataTests.cpp \
+       modules/gles3/functional/es3fShaderFunctionTests.cpp \
        modules/gles3/functional/es3fShaderIndexingTests.cpp \
        modules/gles3/functional/es3fShaderInvarianceTests.cpp \
        modules/gles3/functional/es3fShaderLoopTests.cpp \
index 8b13789..1a40c8f 100644 (file)
@@ -1 +1,4 @@
-
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_fragment
index 1111e5c..ad1d43f 100644 (file)
@@ -12438,6 +12438,10 @@ dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.geometric.n
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.geometric.normalize_vec3_fragment
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.geometric.normalize_vec4_vertex
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.geometric.normalize_vec4_fragment
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.0
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.1
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.2
index 24dedf5..458b3aa 100644 (file)
@@ -231,6 +231,10 @@ dEQP-GLES3.functional.shaders.keywords.allowed_keywords.image1DArrayShadow_verte
 dEQP-GLES3.functional.shaders.keywords.allowed_keywords.image1DArrayShadow_fragment
 dEQP-GLES3.functional.shaders.keywords.allowed_keywords.image2DArrayShadow_vertex
 dEQP-GLES3.functional.shaders.keywords.allowed_keywords.image2DArrayShadow_fragment
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES3.functional.shaders.switch.default_only_static_vertex
 dEQP-GLES3.functional.shaders.switch.default_only_static_fragment
 dEQP-GLES3.functional.shaders.switch.default_only_uniform_vertex
index f129ecd..ea59c07 100644 (file)
@@ -26628,6 +26628,10 @@ dEQP-GLES3.functional.shaders.discard.function_static_loop_never
 dEQP-GLES3.functional.shaders.discard.function_static_loop_uniform
 dEQP-GLES3.functional.shaders.discard.function_static_loop_dynamic
 dEQP-GLES3.functional.shaders.discard.function_static_loop_texture
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_static_read
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_dynamic_read
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_static_loop_read
index 18f6c6f..1b6f8f6 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL33.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL33.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL33.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL33.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL33.shaders.function.local_variable_aliasing_vertex
+KHR-GL33.shaders.function.local_variable_aliasing_fragment
+KHR-GL33.shaders.function.global_variable_aliasing_vertex
+KHR-GL33.shaders.function.global_variable_aliasing_fragment
 KHR-GL33.shaders.struct.local.basic_vertex
 KHR-GL33.shaders.struct.local.basic_fragment
 KHR-GL33.shaders.struct.local.nested_vertex
index 54b9eb8..7d85915 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL40.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL40.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL40.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL40.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL40.shaders.function.local_variable_aliasing_vertex
+KHR-GL40.shaders.function.local_variable_aliasing_fragment
+KHR-GL40.shaders.function.global_variable_aliasing_vertex
+KHR-GL40.shaders.function.global_variable_aliasing_fragment
 KHR-GL40.shaders.struct.local.basic_vertex
 KHR-GL40.shaders.struct.local.basic_fragment
 KHR-GL40.shaders.struct.local.nested_vertex
index b80ebe8..07d669f 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL41.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL41.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL41.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL41.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL41.shaders.function.local_variable_aliasing_vertex
+KHR-GL41.shaders.function.local_variable_aliasing_fragment
+KHR-GL41.shaders.function.global_variable_aliasing_vertex
+KHR-GL41.shaders.function.global_variable_aliasing_fragment
 KHR-GL41.shaders.struct.local.basic_vertex
 KHR-GL41.shaders.struct.local.basic_fragment
 KHR-GL41.shaders.struct.local.nested_vertex
index 0f89a78..45d9d9b 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL42.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL42.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL42.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL42.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL42.shaders.function.local_variable_aliasing_vertex
+KHR-GL42.shaders.function.local_variable_aliasing_fragment
+KHR-GL42.shaders.function.global_variable_aliasing_vertex
+KHR-GL42.shaders.function.global_variable_aliasing_fragment
 KHR-GL42.shaders.struct.local.basic_vertex
 KHR-GL42.shaders.struct.local.basic_fragment
 KHR-GL42.shaders.struct.local.nested_vertex
index 3c29760..c2eef60 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL43.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL43.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL43.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL43.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL43.shaders.function.local_variable_aliasing_vertex
+KHR-GL43.shaders.function.local_variable_aliasing_fragment
+KHR-GL43.shaders.function.global_variable_aliasing_vertex
+KHR-GL43.shaders.function.global_variable_aliasing_fragment
 KHR-GL43.shaders.struct.local.basic_vertex
 KHR-GL43.shaders.struct.local.basic_fragment
 KHR-GL43.shaders.struct.local.nested_vertex
index 13bf101..eb0bc38 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL44.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL44.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL44.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL44.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL44.shaders.function.local_variable_aliasing_vertex
+KHR-GL44.shaders.function.local_variable_aliasing_fragment
+KHR-GL44.shaders.function.global_variable_aliasing_vertex
+KHR-GL44.shaders.function.global_variable_aliasing_fragment
 KHR-GL44.shaders.struct.local.basic_vertex
 KHR-GL44.shaders.struct.local.basic_fragment
 KHR-GL44.shaders.struct.local.nested_vertex
index a5b3de8..cd2732b 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL45.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL45.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL45.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL45.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL45.shaders.function.local_variable_aliasing_vertex
+KHR-GL45.shaders.function.local_variable_aliasing_fragment
+KHR-GL45.shaders.function.global_variable_aliasing_vertex
+KHR-GL45.shaders.function.global_variable_aliasing_fragment
 KHR-GL45.shaders.struct.local.basic_vertex
 KHR-GL45.shaders.struct.local.basic_fragment
 KHR-GL45.shaders.struct.local.nested_vertex
index 9e49c73..6b47fd1 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL46.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL46.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL46.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL46.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL46.shaders.function.local_variable_aliasing_vertex
+KHR-GL46.shaders.function.local_variable_aliasing_fragment
+KHR-GL46.shaders.function.global_variable_aliasing_vertex
+KHR-GL46.shaders.function.global_variable_aliasing_fragment
 KHR-GL46.shaders.struct.local.basic_vertex
 KHR-GL46.shaders.struct.local.basic_fragment
 KHR-GL46.shaders.struct.local.nested_vertex
index 18f6c6f..1b6f8f6 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL33.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL33.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL33.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL33.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL33.shaders.function.local_variable_aliasing_vertex
+KHR-GL33.shaders.function.local_variable_aliasing_fragment
+KHR-GL33.shaders.function.global_variable_aliasing_vertex
+KHR-GL33.shaders.function.global_variable_aliasing_fragment
 KHR-GL33.shaders.struct.local.basic_vertex
 KHR-GL33.shaders.struct.local.basic_fragment
 KHR-GL33.shaders.struct.local.nested_vertex
index 54b9eb8..7d85915 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL40.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL40.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL40.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL40.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL40.shaders.function.local_variable_aliasing_vertex
+KHR-GL40.shaders.function.local_variable_aliasing_fragment
+KHR-GL40.shaders.function.global_variable_aliasing_vertex
+KHR-GL40.shaders.function.global_variable_aliasing_fragment
 KHR-GL40.shaders.struct.local.basic_vertex
 KHR-GL40.shaders.struct.local.basic_fragment
 KHR-GL40.shaders.struct.local.nested_vertex
index b80ebe8..07d669f 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL41.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL41.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL41.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL41.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL41.shaders.function.local_variable_aliasing_vertex
+KHR-GL41.shaders.function.local_variable_aliasing_fragment
+KHR-GL41.shaders.function.global_variable_aliasing_vertex
+KHR-GL41.shaders.function.global_variable_aliasing_fragment
 KHR-GL41.shaders.struct.local.basic_vertex
 KHR-GL41.shaders.struct.local.basic_fragment
 KHR-GL41.shaders.struct.local.nested_vertex
index 0f89a78..45d9d9b 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL42.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL42.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL42.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL42.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL42.shaders.function.local_variable_aliasing_vertex
+KHR-GL42.shaders.function.local_variable_aliasing_fragment
+KHR-GL42.shaders.function.global_variable_aliasing_vertex
+KHR-GL42.shaders.function.global_variable_aliasing_fragment
 KHR-GL42.shaders.struct.local.basic_vertex
 KHR-GL42.shaders.struct.local.basic_fragment
 KHR-GL42.shaders.struct.local.nested_vertex
index 3c29760..c2eef60 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL43.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL43.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL43.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL43.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL43.shaders.function.local_variable_aliasing_vertex
+KHR-GL43.shaders.function.local_variable_aliasing_fragment
+KHR-GL43.shaders.function.global_variable_aliasing_vertex
+KHR-GL43.shaders.function.global_variable_aliasing_fragment
 KHR-GL43.shaders.struct.local.basic_vertex
 KHR-GL43.shaders.struct.local.basic_fragment
 KHR-GL43.shaders.struct.local.nested_vertex
index 13bf101..eb0bc38 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL44.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL44.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL44.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL44.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL44.shaders.function.local_variable_aliasing_vertex
+KHR-GL44.shaders.function.local_variable_aliasing_fragment
+KHR-GL44.shaders.function.global_variable_aliasing_vertex
+KHR-GL44.shaders.function.global_variable_aliasing_fragment
 KHR-GL44.shaders.struct.local.basic_vertex
 KHR-GL44.shaders.struct.local.basic_fragment
 KHR-GL44.shaders.struct.local.nested_vertex
index a5b3de8..cd2732b 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL45.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL45.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL45.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL45.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL45.shaders.function.local_variable_aliasing_vertex
+KHR-GL45.shaders.function.local_variable_aliasing_fragment
+KHR-GL45.shaders.function.global_variable_aliasing_vertex
+KHR-GL45.shaders.function.global_variable_aliasing_fragment
 KHR-GL45.shaders.struct.local.basic_vertex
 KHR-GL45.shaders.struct.local.basic_fragment
 KHR-GL45.shaders.struct.local.nested_vertex
index 9e49c73..6b47fd1 100644 (file)
@@ -2626,6 +2626,10 @@ KHR-GL46.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_ver
 KHR-GL46.shaders.preprocessor.operator_precedence.logical_and_vs_bitwise_and_fragment
 KHR-GL46.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_vertex
 KHR-GL46.shaders.preprocessor.operator_precedence.logical_or_vs_logical_and_fragment
+KHR-GL46.shaders.function.local_variable_aliasing_vertex
+KHR-GL46.shaders.function.local_variable_aliasing_fragment
+KHR-GL46.shaders.function.global_variable_aliasing_vertex
+KHR-GL46.shaders.function.global_variable_aliasing_fragment
 KHR-GL46.shaders.struct.local.basic_vertex
 KHR-GL46.shaders.struct.local.basic_fragment
 KHR-GL46.shaders.struct.local.nested_vertex
index 1662414..bc105b3 100644 (file)
@@ -8329,6 +8329,10 @@ dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_rela
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec3_fragment
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec4_vertex
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec4_fragment
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.0
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.1
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.2
index c61d5e5..6deab7c 100644 (file)
@@ -6136,6 +6136,10 @@ dEQP-GLES3.functional.shaders.discard.function_static_loop_never
 dEQP-GLES3.functional.shaders.discard.function_static_loop_uniform
 dEQP-GLES3.functional.shaders.discard.function_static_loop_dynamic
 dEQP-GLES3.functional.shaders.discard.function_static_loop_texture
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_static_read
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_dynamic_read
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_static_loop_read
index 1662414..bc105b3 100644 (file)
@@ -8329,6 +8329,10 @@ dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_rela
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec3_fragment
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec4_vertex
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec4_fragment
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.0
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.1
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.2
index c61d5e5..6deab7c 100644 (file)
@@ -6136,6 +6136,10 @@ dEQP-GLES3.functional.shaders.discard.function_static_loop_never
 dEQP-GLES3.functional.shaders.discard.function_static_loop_uniform
 dEQP-GLES3.functional.shaders.discard.function_static_loop_dynamic
 dEQP-GLES3.functional.shaders.discard.function_static_loop_texture
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_static_read
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_dynamic_read
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_static_loop_read
index 1662414..bc105b3 100644 (file)
@@ -8329,6 +8329,10 @@ dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_rela
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec3_fragment
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec4_vertex
 dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.vector_relational.not_bvec4_fragment
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES2.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.0
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.1
 dEQP-GLES2.functional.shaders.random.basic_expression.vertex.2
index c61d5e5..6deab7c 100644 (file)
@@ -6136,6 +6136,10 @@ dEQP-GLES3.functional.shaders.discard.function_static_loop_never
 dEQP-GLES3.functional.shaders.discard.function_static_loop_uniform
 dEQP-GLES3.functional.shaders.discard.function_static_loop_dynamic
 dEQP-GLES3.functional.shaders.discard.function_static_loop_texture
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.local_variable_aliasing_fragment
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_vertex
+dEQP-GLES3.functional.shaders.function.global_variable_aliasing_fragment
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_static_read
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_dynamic_read
 dEQP-GLES3.functional.shaders.indexing.varying_array.float_static_write_static_loop_read
index c3cb136..e846de2 100644 (file)
@@ -26,6 +26,10 @@ KHR-GLES3.shaders.fragdepth.compare.uniform_conditional_write
 KHR-GLES3.shaders.fragdepth.compare.dynamic_conditional_write
 KHR-GLES3.shaders.fragdepth.compare.uniform_loop_write
 KHR-GLES3.shaders.fragdepth.compare.write_in_function
+KHR-GLES3.shaders.function.local_variable_aliasing_vertex
+KHR-GLES3.shaders.function.local_variable_aliasing_fragment
+KHR-GLES3.shaders.function.global_variable_aliasing_vertex
+KHR-GLES3.shaders.function.global_variable_aliasing_fragment
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_dynamic_read
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_static_loop_read
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_dynamic_loop_read
index 35d0b24..e1e1533 100644 (file)
@@ -4,6 +4,10 @@ KHR-GLES32.info.version
 KHR-GLES32.info.shading_language_version
 KHR-GLES32.info.extensions
 KHR-GLES32.info.render_target
+KHR-GLES32.shaders.function.local_variable_aliasing_vertex
+KHR-GLES32.shaders.function.local_variable_aliasing_fragment
+KHR-GLES32.shaders.function.global_variable_aliasing_vertex
+KHR-GLES32.shaders.function.global_variable_aliasing_fragment
 KHR-GLES32.shaders.shader_integer_mix.define
 KHR-GLES32.shaders.shader_integer_mix.prototypes-extension
 KHR-GLES32.shaders.shader_integer_mix.prototypes
index c3cb136..e846de2 100644 (file)
@@ -26,6 +26,10 @@ KHR-GLES3.shaders.fragdepth.compare.uniform_conditional_write
 KHR-GLES3.shaders.fragdepth.compare.dynamic_conditional_write
 KHR-GLES3.shaders.fragdepth.compare.uniform_loop_write
 KHR-GLES3.shaders.fragdepth.compare.write_in_function
+KHR-GLES3.shaders.function.local_variable_aliasing_vertex
+KHR-GLES3.shaders.function.local_variable_aliasing_fragment
+KHR-GLES3.shaders.function.global_variable_aliasing_vertex
+KHR-GLES3.shaders.function.global_variable_aliasing_fragment
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_dynamic_read
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_static_loop_read
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_dynamic_loop_read
index 35d0b24..e1e1533 100644 (file)
@@ -4,6 +4,10 @@ KHR-GLES32.info.version
 KHR-GLES32.info.shading_language_version
 KHR-GLES32.info.extensions
 KHR-GLES32.info.render_target
+KHR-GLES32.shaders.function.local_variable_aliasing_vertex
+KHR-GLES32.shaders.function.local_variable_aliasing_fragment
+KHR-GLES32.shaders.function.global_variable_aliasing_vertex
+KHR-GLES32.shaders.function.global_variable_aliasing_fragment
 KHR-GLES32.shaders.shader_integer_mix.define
 KHR-GLES32.shaders.shader_integer_mix.prototypes-extension
 KHR-GLES32.shaders.shader_integer_mix.prototypes
index c3cb136..e846de2 100644 (file)
@@ -26,6 +26,10 @@ KHR-GLES3.shaders.fragdepth.compare.uniform_conditional_write
 KHR-GLES3.shaders.fragdepth.compare.dynamic_conditional_write
 KHR-GLES3.shaders.fragdepth.compare.uniform_loop_write
 KHR-GLES3.shaders.fragdepth.compare.write_in_function
+KHR-GLES3.shaders.function.local_variable_aliasing_vertex
+KHR-GLES3.shaders.function.local_variable_aliasing_fragment
+KHR-GLES3.shaders.function.global_variable_aliasing_vertex
+KHR-GLES3.shaders.function.global_variable_aliasing_fragment
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_dynamic_read
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_static_loop_read
 KHR-GLES3.shaders.indexing.varying_array.float_static_write_dynamic_loop_read
index 35d0b24..e1e1533 100644 (file)
@@ -4,6 +4,10 @@ KHR-GLES32.info.version
 KHR-GLES32.info.shading_language_version
 KHR-GLES32.info.extensions
 KHR-GLES32.info.render_target
+KHR-GLES32.shaders.function.local_variable_aliasing_vertex
+KHR-GLES32.shaders.function.local_variable_aliasing_fragment
+KHR-GLES32.shaders.function.global_variable_aliasing_vertex
+KHR-GLES32.shaders.function.global_variable_aliasing_fragment
 KHR-GLES32.shaders.shader_integer_mix.define
 KHR-GLES32.shaders.shader_integer_mix.prototypes-extension
 KHR-GLES32.shaders.shader_integer_mix.prototypes
index bcca653..512b009 100644 (file)
@@ -63,6 +63,8 @@ set(GLCTS_COMMON_SRCS
        glcSeparableProgramsTransformFeedbackTests.hpp
        glcShaderConstExprTests.hpp
        glcShaderConstExprTests.cpp
+       glcShaderFunctionTests.cpp
+       glcShaderFunctionTests.hpp
        glcShaderGroupVoteTests.cpp
        glcShaderGroupVoteTests.hpp
        glcShaderIndexingTests.cpp
diff --git a/external/openglcts/modules/common/glcShaderFunctionTests.cpp b/external/openglcts/modules/common/glcShaderFunctionTests.cpp
new file mode 100644 (file)
index 0000000..7a3c999
--- /dev/null
@@ -0,0 +1,230 @@
+/*-------------------------------------------------------------------------
+ * OpenGL Conformance Test Suite
+ * -----------------------------
+ *
+ * Copyright (c) 2016 Google Inc.
+ * Copyright (c) 2016 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */ /*!
+ * \file
+ * \brief Shader struct tests.
+ */ /*-------------------------------------------------------------------*/
+
+#include "glcShaderFunctionTests.hpp"
+#include "glcShaderRenderCase.hpp"
+#include "gluTexture.hpp"
+#include "tcuStringTemplate.hpp"
+#include "tcuTextureUtil.hpp"
+
+using namespace glu;
+
+namespace deqp
+{
+
+typedef void (*SetupUniformsFunc)(const glw::Functions& gl, deUint32 programID, const tcu::Vec4& constCoords);
+
+class ShaderFunctionCase : public ShaderRenderCase
+{
+public:
+       ShaderFunctionCase(Context& context, const char* name, const char* description, bool isVertexCase, bool usesTextures,
+                                        ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniformsFunc, const char* vertShaderSource,
+                                        const char* fragShaderSource);
+       ~ShaderFunctionCase(void);
+
+       void init(void);
+       void deinit(void);
+
+       virtual void setupUniforms(deUint32 programID, const tcu::Vec4& constCoords);
+
+private:
+       ShaderFunctionCase(const ShaderFunctionCase&);
+       ShaderFunctionCase& operator=(const ShaderFunctionCase&);
+
+       SetupUniformsFunc m_setupUniforms;
+       bool                      m_usesTexture;
+
+       glu::Texture2D* m_gradientTexture;
+};
+
+ShaderFunctionCase::ShaderFunctionCase(Context& context, const char* name, const char* description, bool isVertexCase,
+                                                                  bool usesTextures, ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniformsFunc,
+                                                                  const char* vertShaderSource, const char* fragShaderSource)
+       : ShaderRenderCase(context.getTestContext(), context.getRenderContext(), context.getContextInfo(), name,
+                                          description, isVertexCase, evalFunc)
+       , m_setupUniforms(setupUniformsFunc)
+       , m_usesTexture(usesTextures)
+       , m_gradientTexture(DE_NULL)
+{
+       m_vertShaderSource = vertShaderSource;
+       m_fragShaderSource = fragShaderSource;
+}
+
+ShaderFunctionCase::~ShaderFunctionCase(void)
+{
+}
+
+void ShaderFunctionCase::init(void)
+{
+       if (m_usesTexture)
+       {
+               m_gradientTexture = new glu::Texture2D(m_renderCtx, GL_RGBA8, 128, 128);
+
+               m_gradientTexture->getRefTexture().allocLevel(0);
+               tcu::fillWithComponentGradients(m_gradientTexture->getRefTexture().getLevel(0), tcu::Vec4(0.0f),
+                                                                               tcu::Vec4(1.0f));
+               m_gradientTexture->upload();
+
+               m_textures.push_back(TextureBinding(
+                       m_gradientTexture, tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
+                                                                                       tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::LINEAR, tcu::Sampler::LINEAR)));
+               DE_ASSERT(m_textures.size() == 1);
+       }
+       ShaderRenderCase::init();
+}
+
+void ShaderFunctionCase::deinit(void)
+{
+       if (m_usesTexture)
+       {
+               delete m_gradientTexture;
+       }
+       ShaderRenderCase::deinit();
+}
+
+void ShaderFunctionCase::setupUniforms(deUint32 programID, const tcu::Vec4& constCoords)
+{
+       ShaderRenderCase::setupUniforms(programID, constCoords);
+       if (m_setupUniforms)
+               m_setupUniforms(m_renderCtx.getFunctions(), programID, constCoords);
+}
+
+static ShaderFunctionCase* createStructCase(Context& context, const char* name, const char* description,
+                                                                                 glu::GLSLVersion glslVersion, bool isVertexCase, bool usesTextures,
+                                                                                 ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniforms,
+                                                                                 const LineStream& shaderSrc)
+{
+       const std::string versionDecl = glu::getGLSLVersionDeclaration(glslVersion);
+
+       const std::string defaultVertSrc = versionDecl + "\n"
+                                                                                                        "in highp vec4 a_position;\n"
+                                                                                                        "in highp vec4 a_coords;\n"
+                                                                                                        "out mediump vec4 v_coords;\n\n"
+                                                                                                        "void main (void)\n"
+                                                                                                        "{\n"
+                                                                                                        "   v_coords = a_coords;\n"
+                                                                                                        "   gl_Position = a_position;\n"
+                                                                                                        "}\n";
+       const std::string defaultFragSrc = versionDecl + "\n"
+                                                                                                        "in mediump vec4 v_color;\n"
+                                                                                                        "layout(location = 0) out mediump vec4 o_color;\n\n"
+                                                                                                        "void main (void)\n"
+                                                                                                        "{\n"
+                                                                                                        "   o_color = v_color;\n"
+                                                                                                        "}\n";
+
+       // Fill in specialization parameters.
+       std::map<std::string, std::string> spParams;
+       if (isVertexCase)
+       {
+               spParams["HEADER"] = versionDecl + "\n"
+                                                                                  "in highp vec4 a_position;\n"
+                                                                                  "in highp vec4 a_coords;\n"
+                                                                                  "out mediump vec4 v_color;";
+               spParams["COORDS"]       = "a_coords";
+               spParams["DST"]            = "v_color";
+               spParams["ASSIGN_POS"] = "gl_Position = a_position;";
+       }
+       else
+       {
+               spParams["HEADER"] = versionDecl + "\n"
+                                                                                  "#ifdef GL_ES\n"
+                                                                                  "    precision mediump float;\n"
+                                                                                  "#endif\n"
+                                                                                  "\n"
+                                                                                  "in mediump vec4 v_coords;\n"
+                                                                                  "layout(location = 0) out mediump vec4 o_color;";
+               spParams["COORDS"]       = "v_coords";
+               spParams["DST"]            = "o_color";
+               spParams["ASSIGN_POS"] = "";
+       }
+
+       if (isVertexCase)
+               return new ShaderFunctionCase(context, name, description, isVertexCase, usesTextures, evalFunc, setupUniforms,
+                                                                       tcu::StringTemplate(shaderSrc.str()).specialize(spParams).c_str(),
+                                                                       defaultFragSrc.c_str());
+       else
+               return new ShaderFunctionCase(context, name, description, isVertexCase, usesTextures, evalFunc, setupUniforms,
+                                                                       defaultVertSrc.c_str(),
+                                                                       tcu::StringTemplate(shaderSrc.str()).specialize(spParams).c_str());
+}
+
+ShaderFunctionTests::ShaderFunctionTests(Context& context, glu::GLSLVersion glslVersion)
+       : TestCaseGroup(context, "function", "Function Tests"), m_glslVersion(glslVersion)
+{
+}
+
+ShaderFunctionTests::~ShaderFunctionTests(void)
+{
+}
+
+void ShaderFunctionTests::init(void)
+{
+#define FUNCTION_CASE(NAME, DESCRIPTION, SHADER_SRC, EVAL_FUNC_BODY)                                      \
+       do                                                                                                    \
+       {                                                                                                     \
+               struct Eval_##NAME                                                                                \
+               {                                                                                                 \
+                       static void eval(ShaderEvalContext& c) EVAL_FUNC_BODY                                         \
+               };                                                                                                \
+               addChild(createStructCase(m_context, #NAME "_vertex", DESCRIPTION, m_glslVersion, true, false,    \
+                                                                 &Eval_##NAME::eval, DE_NULL, SHADER_SRC));                              \
+               addChild(createStructCase(m_context, #NAME "_fragment", DESCRIPTION, m_glslVersion, false, false, \
+                                                                 &Eval_##NAME::eval, DE_NULL, SHADER_SRC));                              \
+       } while (deGetFalse())
+
+       FUNCTION_CASE(local_variable_aliasing, "Function out parameter aliases local variable",
+                                 LineStream() << "${HEADER}"
+                                                          << ""
+                                                          << "bool out_params_are_distinct(float x, out float y) {"
+                                                          << "    y = 2.;"
+                                                          << "    return x == 1. && y == 2.;"
+                                                          << "}"
+                                                          << ""
+                                                          << "void main (void)"
+                                                          << "{"
+                                                          << "    float x = 1.;"
+                                                          << "    ${DST} = out_params_are_distinct(x, x) ? vec4(0.,1.,0.,1.) : vec4(1.,0.,0.,1.);"
+                                                          << "    ${ASSIGN_POS}"
+                                                          << "}",
+                                 { c.color.xyz() = tcu::Vec3(0.0f, 1.0f, 0.0f); });
+
+       FUNCTION_CASE(global_variable_aliasing, "Function out parameter aliases global variable",
+                                 LineStream() << "${HEADER}"
+                                                          << ""
+                                                          << "float x = 1.;"
+                                                          << "bool out_params_are_distinct_from_global(out float y) {"
+                                                          << "    y = 2.;"
+                                                          << "    return x == 1. && y == 2.;"
+                                                          << "}"
+                                                          << ""
+                                                          << "void main (void)"
+                                                          << "{"
+                                                          << "    ${DST} = out_params_are_distinct_from_global(x) ? vec4(0.,1.,0.,1.) : vec4(1.,0.,0.,1.);"
+                                                          << "    ${ASSIGN_POS}"
+                                                          << "}",
+                                 { c.color.xyz() = tcu::Vec3(0.0f, 1.0f, 0.0f); });
+}
+
+} // deqp
diff --git a/external/openglcts/modules/common/glcShaderFunctionTests.hpp b/external/openglcts/modules/common/glcShaderFunctionTests.hpp
new file mode 100644 (file)
index 0000000..32702c8
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef _GLCSHADERFUNCTIONTESTS_HPP
+#define _GLCSHADERFUNCTIONTESTS_HPP
+/*-------------------------------------------------------------------------
+ * OpenGL Conformance Test Suite
+ * -----------------------------
+ *
+ * Copyright (c) 2016 Google Inc.
+ * Copyright (c) 2016 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */ /*!
+ * \file
+ * \brief Shader struct tests.
+ */ /*-------------------------------------------------------------------*/
+
+#include "glcTestCase.hpp"
+#include "gluShaderUtil.hpp"
+
+namespace deqp
+{
+
+class ShaderFunctionTests : public TestCaseGroup
+{
+public:
+       ShaderFunctionTests(Context& context, glu::GLSLVersion glslVersion);
+       virtual ~ShaderFunctionTests(void);
+
+       virtual void init(void);
+
+private:
+       ShaderFunctionTests(const ShaderFunctionTests&);                        // not allowed!
+       ShaderFunctionTests& operator=(const ShaderFunctionTests&); // not allowed!
+
+       glu::GLSLVersion m_glslVersion;
+};
+
+} // deqp
+
+#endif // _GLCSHADERFUNCTIONTESTS_HPP
index 75a61d9..83c1287 100644 (file)
@@ -38,6 +38,7 @@
 #include "glcInfoTests.hpp"
 #include "glcPackedDepthStencilTests.hpp"
 #include "glcPackedPixelsTests.hpp"
+#include "glcShaderFunctionTests.hpp"
 #include "glcShaderIndexingTests.hpp"
 #include "glcShaderIntegerMixTests.hpp"
 #include "glcShaderLibrary.hpp"
@@ -256,6 +257,7 @@ public:
                addChild(new deqp::ShaderLoopTests(m_context, glu::GLSL_VERSION_330));
                addChild(
                        new deqp::ShaderLibraryGroup(m_context, "preprocessor", "Preprocessor Tests", "gl33/preprocessor.test"));
+               addChild(new deqp::ShaderFunctionTests(m_context, glu::GLSL_VERSION_330));
                addChild(new deqp::ShaderStructTests(m_context, glu::GLSL_VERSION_330));
                addChild(new deqp::UniformBlockTests(m_context, glu::GLSL_VERSION_330));
                addChild(new deqp::ShaderIntegerMixTests(m_context, glu::GLSL_VERSION_330));
index d01cd0b..ff49e97 100644 (file)
@@ -35,6 +35,7 @@
 #include "glcPackedPixelsTests.hpp"
 #include "glcParallelShaderCompileTests.hpp"
 #include "glcShaderConstExprTests.hpp"
+#include "glcShaderFunctionTests.hpp"
 #include "glcShaderIndexingTests.hpp"
 #include "glcShaderIntegerMixTests.hpp"
 #include "glcShaderLibrary.hpp"
@@ -142,6 +143,7 @@ public:
        {
                addChild(new deqp::ShaderLibraryGroup(m_context, "declarations", "Declaration Tests", "declarations.test"));
                addChild(new deqp::FragDepthTests(m_context, glu::GLSL_VERSION_300_ES));
+               addChild(new deqp::ShaderFunctionTests(m_context, glu::GLSL_VERSION_300_ES));
                addChild(new deqp::ShaderIndexingTests(m_context, glu::GLSL_VERSION_300_ES));
                addChild(new deqp::ShaderLoopTests(m_context, glu::GLSL_VERSION_300_ES));
                addChild(new deqp::ShaderLibraryGroup(m_context, "preprocessor", "Preprocessor Tests", "preprocessor.test"));
index 5257bec..a4fab9b 100644 (file)
@@ -31,6 +31,7 @@
 #include "glcInternalformatTests.hpp"
 #include "glcSeparableProgramsTransformFeedbackTests.hpp"
 #include "glcShaderConstExprTests.hpp"
+#include "glcShaderFunctionTests.hpp"
 #include "glcShaderIndexingTests.hpp"
 #include "glcShaderIntegerMixTests.hpp"
 #include "glcShaderLibrary.hpp"
@@ -159,6 +160,7 @@ void ES32TestPackage::init(void)
                addChild(new deqp::InfoTests(getContext()));
 
                tcu::TestCaseGroup* shadersGroup = new tcu::TestCaseGroup(getTestContext(), "shaders", "");
+               shadersGroup->addChild(new deqp::ShaderFunctionTests(getContext(), glu::GLSL_VERSION_320_ES));
                shadersGroup->addChild(new deqp::ShaderIntegerMixTests(getContext(), glu::GLSL_VERSION_320_ES));
                shadersGroup->addChild(new deqp::ShaderNegativeTests(getContext(), glu::GLSL_VERSION_320_ES));
                shadersGroup->addChild(new deqp::ShaderStructTests(getContext(), glu::GLSL_VERSION_320_ES));
index d9cfcb5..bb74302 100644 (file)
@@ -59,6 +59,8 @@ set(DEQP_GLES2_FUNCTIONAL_SRCS
        es2fShaderDiscardTests.hpp
        es2fShaderExecuteTest.cpp
        es2fShaderExecuteTest.hpp
+       es2fShaderFunctionTests.cpp
+       es2fShaderFunctionTests.hpp
        es2fShaderIndexingTests.cpp
        es2fShaderIndexingTests.hpp
        es2fShaderLoopTests.cpp
index f62916d..642b48e 100644 (file)
@@ -77,6 +77,7 @@
 #include "es2fShaderBuiltinVarTests.hpp"
 #include "es2fShaderConstExprTests.hpp"
 #include "es2fShaderDiscardTests.hpp"
+#include "es2fShaderFunctionTests.hpp"
 #include "es2fShaderIndexingTests.hpp"
 #include "es2fShaderLoopTests.hpp"
 #include "es2fShaderOperatorTests.hpp"
@@ -154,6 +155,7 @@ public:
                addChild(new ShaderFragDataTests                (m_context));
                addChild(new ShaderAlgorithmTests               (m_context));
                addChild(new ShaderConstExprTests               (m_context));
+               addChild(new ShaderFunctionTests                (m_context));
 
                addChild(new RandomShaderTests(m_context));
        }
diff --git a/modules/gles2/functional/es2fShaderFunctionTests.cpp b/modules/gles2/functional/es2fShaderFunctionTests.cpp
new file mode 100644 (file)
index 0000000..a8134e0
--- /dev/null
@@ -0,0 +1,202 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 2.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Shader struct tests.
+ *//*--------------------------------------------------------------------*/
+
+#include "es2fShaderFunctionTests.hpp"
+#include "glsShaderRenderCase.hpp"
+#include "gluTexture.hpp"
+#include "tcuStringTemplate.hpp"
+#include "tcuTextureUtil.hpp"
+
+using namespace deqp::gls;
+
+namespace deqp
+{
+namespace gles2
+{
+namespace Functional
+{
+
+typedef void (*SetupUniformsFunc) (const glw::Functions& gl, deUint32 programID, const tcu::Vec4& constCoords);
+
+class ShaderFunctionCase : public ShaderRenderCase
+{
+public:
+                                                       ShaderFunctionCase              (Context& context, const char* name, const char* description, bool isVertexCase, ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniformsFunc, const char* vertShaderSource, const char* fragShaderSource);
+                                                       ~ShaderFunctionCase             (void);
+
+       void                                    init                                    (void);
+       void                                    deinit                                  (void);
+
+       virtual void                    setupUniforms                   (int programID, const tcu::Vec4& constCoords);
+
+private:
+                                                       ShaderFunctionCase              (const ShaderFunctionCase&);
+       ShaderFunctionCase&             operator=                               (const ShaderFunctionCase&);
+
+       const SetupUniformsFunc m_setupUniforms;
+
+       glu::Texture2D*                 m_brickTexture;
+};
+
+ShaderFunctionCase::ShaderFunctionCase (Context& context, const char* name, const char* description, bool isVertexCase, ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniformsFunc, const char* vertShaderSource, const char* fragShaderSource)
+       : ShaderRenderCase      (context.getTestContext(), context.getRenderContext(), context.getContextInfo(), name, description, isVertexCase, evalFunc)
+       , m_setupUniforms       (setupUniformsFunc)
+       , m_brickTexture        (DE_NULL)
+{
+       m_vertShaderSource      = vertShaderSource;
+       m_fragShaderSource      = fragShaderSource;
+}
+
+ShaderFunctionCase::~ShaderFunctionCase (void)
+{
+       delete m_brickTexture;
+}
+
+void ShaderFunctionCase::init (void)
+{
+       gls::ShaderRenderCase::init();
+}
+
+void ShaderFunctionCase::deinit (void)
+{
+       gls::ShaderRenderCase::deinit();
+       delete m_brickTexture;
+       m_brickTexture = DE_NULL;
+}
+
+void ShaderFunctionCase::setupUniforms (int programID, const tcu::Vec4& constCoords)
+{
+       ShaderRenderCase::setupUniforms(programID, constCoords);
+       if (m_setupUniforms)
+               m_setupUniforms(m_renderCtx.getFunctions(), programID, constCoords);
+}
+
+static ShaderFunctionCase* createStructCase (Context& context, const char* name, const char* description, bool isVertexCase, ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniforms, const LineStream& shaderSrc, const std::map<std::string, std::string>* additionalParams)
+{
+       static const char* defaultVertSrc =
+               "attribute highp vec4 a_position;\n"
+               "attribute highp vec4 a_coords;\n"
+               "varying mediump vec4 v_coords;\n\n"
+               "void main (void)\n"
+               "{\n"
+               "       v_coords = a_coords;\n"
+               "       gl_Position = a_position;\n"
+               "}\n";
+       static const char* defaultFragSrc =
+               "varying mediump vec4 v_color;\n\n"
+               "void main (void)\n"
+               "{\n"
+               "       gl_FragColor = v_color;\n"
+               "}\n";
+
+       // Fill in specialization parameters.
+       std::map<std::string, std::string> spParams;
+       if (isVertexCase)
+       {
+               spParams["DECLARATIONS"] =
+                       "attribute highp vec4 a_position;\n"
+                       "attribute highp vec4 a_coords;\n"
+                       "varying mediump vec4 v_color;";
+               spParams["COORDS"]              = "a_coords";
+               spParams["DST"]                 = "v_color";
+               spParams["ASSIGN_POS"]  = "gl_Position = a_position;";
+       }
+       else
+       {
+               spParams["DECLARATIONS"]        =
+                       "precision highp float;\n"
+                       "varying mediump vec4 v_coords;";
+               spParams["COORDS"]                      = "v_coords";
+               spParams["DST"]                         = "gl_FragColor";
+               spParams["ASSIGN_POS"]          = "";
+       }
+       if (additionalParams)
+               spParams.insert(additionalParams->begin(), additionalParams->end());
+
+       if (isVertexCase)
+               return new ShaderFunctionCase(context, name, description, isVertexCase, evalFunc, setupUniforms, tcu::StringTemplate(shaderSrc.str()).specialize(spParams).c_str(), defaultFragSrc);
+       else
+               return new ShaderFunctionCase(context, name, description, isVertexCase, evalFunc, setupUniforms, defaultVertSrc, tcu::StringTemplate(shaderSrc.str()).specialize(spParams).c_str());
+}
+
+ShaderFunctionTests::ShaderFunctionTests (Context& context)
+       : TestCaseGroup(context, "function", "Function Tests")
+{
+}
+
+ShaderFunctionTests::~ShaderFunctionTests (void)
+{
+}
+
+void ShaderFunctionTests::init (void)
+{
+       #define FUNCTION_CASE_PARAMETERIZED(NAME, DESCRIPTION, SHADER_SRC, EVAL_FUNC_BODY, PARAMS)                                                                              \
+               do {                                                                                                                                                                                                                                                                    \
+                       struct Eval_##NAME { static void eval (ShaderEvalContext& c) EVAL_FUNC_BODY };  /* NOLINT(EVAL_FUNC_BODY) */                                            \
+                       addChild(createStructCase(m_context, #NAME "_vertex", DESCRIPTION, true, &Eval_##NAME::eval, DE_NULL, SHADER_SRC, PARAMS));     \
+                       addChild(createStructCase(m_context, #NAME "_fragment", DESCRIPTION, false, &Eval_##NAME::eval, DE_NULL, SHADER_SRC, PARAMS));\
+               } while (deGetFalse())
+
+       #define FUNCTION_CASE(NAME, DESCRIPTION, SHADER_SRC, EVAL_FUNC_BODY)    \
+               FUNCTION_CASE_PARAMETERIZED(NAME, DESCRIPTION, SHADER_SRC, EVAL_FUNC_BODY, DE_NULL)
+
+       FUNCTION_CASE(local_variable_aliasing, "Function out parameter aliases local variable",
+               LineStream()
+               << "${DECLARATIONS}"
+               << ""
+               << "bool out_params_are_distinct(float x, out float y)"
+               << "{"
+               << "    y = 2.;"
+               << "    return x == 1. && y == 2.;"
+               << "}"
+               << ""
+               << "void main (void)"
+               << "{"
+               << "    float x = 1.;"
+               << "    ${DST} = out_params_are_distinct(x, x) ? vec4(0.,1.,0.,1.) : vec4(1.,0.,0.,1.);"
+               << "    ${ASSIGN_POS}"
+               << "}",
+               { c.color.xyz() = tcu::Vec3(0.0f, 1.0f, 0.0f); });
+
+       FUNCTION_CASE(global_variable_aliasing, "Function out parameter aliases global variable",
+               LineStream()
+               << "${DECLARATIONS}"
+               << ""
+               << ""
+               << "float x = 1.;"
+               << "bool out_params_are_distinct_from_global(out float y) {"
+               << "    y = 2.;"
+               << "    return x == 1. && y == 2.;"
+               << "}"
+               << ""
+               << "void main (void)"
+               << "{"
+               << "    ${DST} = out_params_are_distinct_from_global(x) ? vec4(0.,1.,0.,1.) : vec4(1.,0.,0.,1.);"
+               << "    ${ASSIGN_POS}"
+               << "}",
+               { c.color.xyz() = tcu::Vec3(0.0f, 1.0f, 0.0f); });
+}
+
+} // Functional
+} // gles2
+} // deqp
diff --git a/modules/gles2/functional/es2fShaderFunctionTests.hpp b/modules/gles2/functional/es2fShaderFunctionTests.hpp
new file mode 100644 (file)
index 0000000..1af8629
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef _ES2FSHADERFUNCTIONTESTS_HPP
+#define _ES2FSHADERFUNCTIONTESTS_HPP
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 2.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Shader struct tests.
+ *//*--------------------------------------------------------------------*/
+
+#include "tes2TestCase.hpp"
+
+namespace deqp
+{
+namespace gles2
+{
+namespace Functional
+{
+
+class ShaderFunctionTests : public TestCaseGroup
+{
+public:
+                                                       ShaderFunctionTests             (Context& context);
+       virtual                                 ~ShaderFunctionTests            (void);
+
+       virtual void                    init                                    (void);
+
+private:
+                                                       ShaderFunctionTests             (const ShaderFunctionTests&);           // not allowed!
+       ShaderFunctionTests&            operator=                               (const ShaderFunctionTests&);           // not allowed!
+};
+
+} // Functional
+} // gles2
+} // deqp
+
+#endif // _ES2FSHADERFUNCTIONTESTS_HPP
index ea01014..42ca0fd 100644 (file)
@@ -71,6 +71,8 @@ set(DEQP_GLES3_FUNCTIONAL_SRCS
        es3fShaderConstExprTests.hpp
        es3fShaderDiscardTests.cpp
        es3fShaderDiscardTests.hpp
+       es3fShaderFunctionTests.cpp
+       es3fShaderFunctionTests.hpp
        es3fShaderIndexingTests.cpp
        es3fShaderIndexingTests.hpp
        es3fShaderLoopTests.cpp
index 0d90c84..804f4c2 100644 (file)
@@ -66,6 +66,7 @@
 #include "es3fShaderApiTests.hpp"
 #include "es3fShaderConstExprTests.hpp"
 #include "es3fShaderDiscardTests.hpp"
+#include "es3fShaderFunctionTests.hpp"
 #include "es3fShaderIndexingTests.hpp"
 #include "es3fShaderLoopTests.hpp"
 #include "es3fShaderMatrixTests.hpp"
@@ -213,6 +214,7 @@ public:
                addChild(new ShaderLibraryTest                  (m_context, "invalid_implicit_conversions",     "Invalid Implicit Conversions"));
 
                addChild(new ShaderDiscardTests                 (m_context));
+               addChild(new ShaderFunctionTests                (m_context));
                addChild(new ShaderIndexingTests                (m_context));
                addChild(new ShaderLoopTests                    (m_context));
                addChild(new ShaderOperatorTests                (m_context));
diff --git a/modules/gles3/functional/es3fShaderFunctionTests.cpp b/modules/gles3/functional/es3fShaderFunctionTests.cpp
new file mode 100644 (file)
index 0000000..ee091b4
--- /dev/null
@@ -0,0 +1,216 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Shader struct tests.
+ *//*--------------------------------------------------------------------*/
+
+#include "es3fShaderFunctionTests.hpp"
+#include "glsShaderRenderCase.hpp"
+#include "gluTexture.hpp"
+#include "tcuStringTemplate.hpp"
+#include "tcuTextureUtil.hpp"
+
+using namespace deqp::gls;
+
+namespace deqp
+{
+namespace gles3
+{
+namespace Functional
+{
+
+typedef void (*SetupUniformsFunc) (const glw::Functions& gl, deUint32 programID, const tcu::Vec4& constCoords);
+
+class ShaderFunctionCase : public ShaderRenderCase
+{
+public:
+                                               ShaderFunctionCase              (Context& context, const char* name, const char* description, bool isVertexCase, bool usesTextures, ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniformsFunc, const char* vertShaderSource, const char* fragShaderSource);
+                                               ~ShaderFunctionCase             (void);
+
+       void                            init                                    (void);
+       void                            deinit                                  (void);
+
+       virtual void            setupUniforms                   (int programID, const tcu::Vec4& constCoords);
+
+private:
+                                               ShaderFunctionCase              (const ShaderFunctionCase&);
+       ShaderFunctionCase&     operator=                               (const ShaderFunctionCase&);
+
+       SetupUniformsFunc       m_setupUniforms;
+       bool                            m_usesTexture;
+
+       glu::Texture2D*         m_brickTexture;
+};
+
+ShaderFunctionCase::ShaderFunctionCase (Context& context, const char* name, const char* description, bool isVertexCase, bool usesTextures, ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniformsFunc, const char* vertShaderSource, const char* fragShaderSource)
+       : ShaderRenderCase      (context.getTestContext(), context.getRenderContext(), context.getContextInfo(), name, description, isVertexCase, evalFunc)
+       , m_setupUniforms       (setupUniformsFunc)
+       , m_usesTexture         (usesTextures)
+       , m_brickTexture        (DE_NULL)
+{
+       m_vertShaderSource      = vertShaderSource;
+       m_fragShaderSource      = fragShaderSource;
+}
+
+ShaderFunctionCase::~ShaderFunctionCase (void)
+{
+       delete m_brickTexture;
+}
+
+void ShaderFunctionCase::init (void)
+{
+       if (m_usesTexture)
+       {
+               m_brickTexture = glu::Texture2D::create(m_renderCtx, m_ctxInfo, m_testCtx.getArchive(), "data/brick.png");
+               m_textures.push_back(TextureBinding(m_brickTexture, tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
+                                                                                                                                                tcu::Sampler::LINEAR, tcu::Sampler::LINEAR)));
+               DE_ASSERT(m_textures.size() == 1);
+       }
+       gls::ShaderRenderCase::init();
+}
+
+void ShaderFunctionCase::deinit (void)
+{
+       gls::ShaderRenderCase::deinit();
+       delete m_brickTexture;
+       m_brickTexture = DE_NULL;
+}
+
+void ShaderFunctionCase::setupUniforms (int programID, const tcu::Vec4& constCoords)
+{
+       ShaderRenderCase::setupUniforms(programID, constCoords);
+       if (m_setupUniforms)
+               m_setupUniforms(m_renderCtx.getFunctions(), programID, constCoords);
+}
+
+static ShaderFunctionCase* createStructCase (Context& context, const char* name, const char* description, bool isVertexCase, bool usesTextures, ShaderEvalFunc evalFunc, SetupUniformsFunc setupUniforms, const LineStream& shaderSrc, const std::map<std::string, std::string>* additionalParams)
+{
+       static const char* defaultVertSrc =
+               "#version 300 es\n"
+               "in highp vec4 a_position;\n"
+               "in highp vec4 a_coords;\n"
+               "out mediump vec4 v_coords;\n\n"
+               "void main (void)\n"
+               "{\n"
+               "       v_coords = a_coords;\n"
+               "       gl_Position = a_position;\n"
+               "}\n";
+       static const char* defaultFragSrc =
+               "#version 300 es\n"
+               "in mediump vec4 v_color;\n"
+               "layout(location = 0) out mediump vec4 o_color;\n\n"
+               "void main (void)\n"
+               "{\n"
+               "       o_color = v_color;\n"
+               "}\n";
+
+       // Fill in specialization parameters.
+       std::map<std::string, std::string> spParams;
+       if (isVertexCase)
+       {
+               spParams["HEADER"] =
+                       "#version 300 es\n"
+                       "in highp vec4 a_position;\n"
+                       "in highp vec4 a_coords;\n"
+                       "out mediump vec4 v_color;";
+               spParams["COORDS"]              = "a_coords";
+               spParams["DST"]                 = "v_color";
+               spParams["ASSIGN_POS"]  = "gl_Position = a_position;";
+       }
+       else
+       {
+               spParams["HEADER"]      =
+                       "#version 300 es\n"
+                       "precision mediump float;\n"
+                       "in mediump vec4 v_coords;\n"
+                       "layout(location = 0) out mediump vec4 o_color;";
+               spParams["COORDS"]                      = "v_coords";
+               spParams["DST"]                         = "o_color";
+               spParams["ASSIGN_POS"]          = "";
+       }
+       if (additionalParams)
+               spParams.insert(additionalParams->begin(), additionalParams->end());
+
+       if (isVertexCase)
+               return new ShaderFunctionCase(context, name, description, isVertexCase, usesTextures, evalFunc, setupUniforms, tcu::StringTemplate(shaderSrc.str()).specialize(spParams).c_str(), defaultFragSrc);
+       else
+               return new ShaderFunctionCase(context, name, description, isVertexCase, usesTextures, evalFunc, setupUniforms, defaultVertSrc, tcu::StringTemplate(shaderSrc.str()).specialize(spParams).c_str());
+}
+
+ShaderFunctionTests::ShaderFunctionTests (Context& context)
+       : TestCaseGroup(context, "function", "Function Tests")
+{
+}
+
+ShaderFunctionTests::~ShaderFunctionTests (void)
+{
+}
+
+void ShaderFunctionTests::init (void)
+{
+       #define FUNCTION_CASE_PARAMETERIZED(NAME, DESCRIPTION, SHADER_SRC, EVAL_FUNC_BODY, PARAMS)                                                                                              \
+               do {                                                                                                                                                                                                                                                                    \
+                       struct Eval_##NAME { static void eval (ShaderEvalContext& c) EVAL_FUNC_BODY };  /* NOLINT(EVAL_FUNC_BODY) */                                            \
+                       addChild(createStructCase(m_context, #NAME "_vertex", DESCRIPTION, true, false, &Eval_##NAME::eval, DE_NULL, SHADER_SRC, PARAMS));      \
+                       addChild(createStructCase(m_context, #NAME "_fragment", DESCRIPTION, false, false,&Eval_##NAME::eval, DE_NULL, SHADER_SRC, PARAMS));\
+               } while (deGetFalse())
+
+       #define FUNCTION_CASE(NAME, DESCRIPTION, SHADER_SRC, EVAL_FUNC_BODY) \
+               FUNCTION_CASE_PARAMETERIZED(NAME, DESCRIPTION, SHADER_SRC, EVAL_FUNC_BODY, DE_NULL)
+
+       FUNCTION_CASE(local_variable_aliasing, "Function out parameter aliases local variable",
+               LineStream()
+               << "${HEADER}"
+               << ""
+               << "bool out_params_are_distinct(float x, out float y) {"
+               << "    y = 2.;"
+               << "    return x == 1. && y == 2.;"
+               << "}"
+               << ""
+               << "void main (void)"
+               << "{"
+               << "    float x = 1.;"
+               << "    ${DST} = out_params_are_distinct(x, x) ? vec4(0.,1.,0.,1.) : vec4(1.,0.,0.,1.);"
+               << "    ${ASSIGN_POS}"
+               << "}",
+               { c.color.xyz() = tcu::Vec3(0.0f, 1.0f, 0.0f); });
+
+       FUNCTION_CASE(global_variable_aliasing, "Function out parameter aliases global variable",
+               LineStream()
+               << "${HEADER}"
+               << ""
+               << ""
+               << "float x = 1.;"
+               << "bool out_params_are_distinct_from_global(out float y) {"
+               << "    y = 2.;"
+               << "    return x == 1. && y == 2.;"
+               << "}"
+               << ""
+               << "void main (void)"
+               << "{"
+               << "    ${DST} = out_params_are_distinct_from_global(x) ? vec4(0.,1.,0.,1.) : vec4(1.,0.,0.,1.);"
+               << "    ${ASSIGN_POS}"
+               << "}",
+               { c.color.xyz() = tcu::Vec3(0.0f, 1.0f, 0.0f); });
+}
+
+} // Functional
+} // gles3
+} // deqp
diff --git a/modules/gles3/functional/es3fShaderFunctionTests.hpp b/modules/gles3/functional/es3fShaderFunctionTests.hpp
new file mode 100644 (file)
index 0000000..5825fb5
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef _ES3FSHADERFUNCTIONTESTS_HPP
+#define _ES3FSHADERFUNCTIONTESTS_HPP
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Shader struct tests.
+ *//*--------------------------------------------------------------------*/
+
+#include "tes3TestCase.hpp"
+
+namespace deqp
+{
+namespace gles3
+{
+namespace Functional
+{
+
+class ShaderFunctionTests : public TestCaseGroup
+{
+public:
+                                                       ShaderFunctionTests             (Context& context);
+       virtual                                 ~ShaderFunctionTests    (void);
+
+       virtual void                    init                                    (void);
+
+private:
+                                                       ShaderFunctionTests             (const ShaderFunctionTests&);           // not allowed!
+       ShaderFunctionTests&    operator=                               (const ShaderFunctionTests&);           // not allowed!
+};
+
+} // Functional
+} // gles3
+} // deqp
+
+#endif // _ES3FSHADERFUNCTIONTESTS_HPP