[Mesa-dev] [PATCH 08/10] glsl: Add a test for not array splitting function arguments.
Eric Anholt
eric at anholt.net
Mon Apr 16 16:59:52 PDT 2012
I wouldn't be able to trigger this at the piglit level because of
inlining. And the bug I was concerned about can't be triggered
because we don't do array splitting on in/out variables (though I've
wanted to change that).
---
src/glsl/tests/.gitignore | 1 +
src/glsl/tests/lower_jumps/.gitignore | 1 -
.../array_split_function.opt_test | 12 +++
.../array_split_function.opt_test.expected | 92 ++++++++++++++++++++
4 files changed, 105 insertions(+), 1 deletion(-)
delete mode 100644 src/glsl/tests/lower_jumps/.gitignore
create mode 100755 src/glsl/tests/optimize_array_splitting/array_split_function.opt_test
create mode 100644 src/glsl/tests/optimize_array_splitting/array_split_function.opt_test.expected
diff --git a/src/glsl/tests/.gitignore b/src/glsl/tests/.gitignore
index f3c7a7c..8d245c0 100644
--- a/src/glsl/tests/.gitignore
+++ b/src/glsl/tests/.gitignore
@@ -1 +1,2 @@
+*/*.out
Makefile
diff --git a/src/glsl/tests/lower_jumps/.gitignore b/src/glsl/tests/lower_jumps/.gitignore
deleted file mode 100644
index f47cb20..0000000
--- a/src/glsl/tests/lower_jumps/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.out
diff --git a/src/glsl/tests/optimize_array_splitting/array_split_function.opt_test b/src/glsl/tests/optimize_array_splitting/array_split_function.opt_test
new file mode 100755
index 0000000..9f3d2bf
--- /dev/null
+++ b/src/glsl/tests/optimize_array_splitting/array_split_function.opt_test
@@ -0,0 +1,12 @@
+#!/bin/bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If a loop contains a conditional break at the bottom of it,
+# it should not be lowered if it is in the then-clause.
+../glsl_test optpass --quiet 'optimize_split_arrays' <<EOF
+vec4 func(vec4[2] arg)
+{
+ return arg[1];
+}
+EOF
diff --git a/src/glsl/tests/optimize_array_splitting/array_split_function.opt_test.expected b/src/glsl/tests/optimize_array_splitting/array_split_function.opt_test.expected
new file mode 100644
index 0000000..52d5b55
--- /dev/null
+++ b/src/glsl/tests/optimize_array_splitting/array_split_function.opt_test.expected
@@ -0,0 +1,92 @@
+(
+(declare (out ) vec4 gl_Position)
+(declare (out ) float gl_PointSize)
+(declare (in ) vec4 gl_Vertex)
+(declare (in ) vec3 gl_Normal)
+(declare (in ) vec4 gl_Color)
+(declare (in ) vec4 gl_SecondaryColor)
+(declare (in ) vec4 gl_MultiTexCoord0)
+(declare (in ) vec4 gl_MultiTexCoord1)
+(declare (in ) vec4 gl_MultiTexCoord2)
+(declare (in ) vec4 gl_MultiTexCoord3)
+(declare (in ) vec4 gl_MultiTexCoord4)
+(declare (in ) vec4 gl_MultiTexCoord5)
+(declare (in ) vec4 gl_MultiTexCoord6)
+(declare (in ) vec4 gl_MultiTexCoord7)
+(declare (in ) float gl_FogCoord)
+(declare (out ) vec4 gl_ClipVertex)
+(declare (out ) vec4 gl_FrontColor)
+(declare (out ) vec4 gl_BackColor)
+(declare (out ) vec4 gl_FrontSecondaryColor)
+(declare (out ) vec4 gl_BackSecondaryColor)
+(declare (out ) float gl_FogFragCoord)
+(declare (uniform ) mat4 gl_ModelViewMatrix)
+(declare (uniform ) mat4 gl_ProjectionMatrix)
+(declare (uniform ) mat4 gl_ModelViewProjectionMatrix)
+(declare (uniform ) mat3 gl_NormalMatrix)
+(declare (uniform ) mat4 gl_ModelViewMatrixInverse)
+(declare (uniform ) mat4 gl_ProjectionMatrixInverse)
+(declare (uniform ) mat4 gl_ModelViewProjectionMatrixInverse)
+(declare (uniform ) mat4 gl_ModelViewMatrixTranspose)
+(declare (uniform ) mat4 gl_ProjectionMatrixTranspose)
+(declare (uniform ) mat4 gl_ModelViewProjectionMatrixTranspose)
+(declare (uniform ) mat4 gl_ModelViewMatrixInverseTranspose)
+(declare (uniform ) mat4 gl_ProjectionMatrixInverseTranspose)
+(declare (uniform ) mat4 gl_ModelViewProjectionMatrixInverseTranspose)
+(declare (uniform ) float gl_NormalScale)
+(declare (uniform ) gl_LightModelParameters gl_LightModel)
+(declare (uniform ) vec2 gl_BumpRotMatrix0MESA)
+(declare (uniform ) vec2 gl_BumpRotMatrix1MESA)
+(declare (uniform ) vec4 gl_FogParamsOptimizedMESA)
+(declare () int gl_MaxLights)
+(declare () int gl_MaxClipPlanes)
+(declare () int gl_MaxTextureUnits)
+(declare () int gl_MaxTextureCoords)
+(declare () int gl_MaxVertexAttribs)
+(declare () int gl_MaxVertexUniformComponents)
+(declare () int gl_MaxVaryingFloats)
+(declare () int gl_MaxVertexTextureImageUnits)
+(declare () int gl_MaxCombinedTextureImageUnits)
+(declare () int gl_MaxTextureImageUnits)
+(declare () int gl_MaxFragmentUniformComponents)
+(declare (uniform ) (array mat4 2) gl_TextureMatrix)
+(declare (uniform ) (array mat4 2) gl_TextureMatrixInverse)
+(declare (uniform ) (array mat4 2) gl_TextureMatrixTranspose)
+(declare (uniform ) (array mat4 2) gl_TextureMatrixInverseTranspose)
+(declare (uniform ) gl_DepthRangeParameters gl_DepthRange)
+(declare (uniform ) (array vec4 6) gl_ClipPlane)
+(declare (uniform ) gl_PointParameters gl_Point)
+(declare (uniform ) gl_MaterialParameters gl_FrontMaterial)
+(declare (uniform ) gl_MaterialParameters gl_BackMaterial)
+(declare (uniform ) (array gl_LightSourceParameters 8) gl_LightSource)
+(declare (uniform ) gl_LightModelProducts gl_FrontLightModelProduct)
+(declare (uniform ) gl_LightModelProducts gl_BackLightModelProduct)
+(declare (uniform ) (array gl_LightProducts 8) gl_FrontLightProduct)
+(declare (uniform ) (array gl_LightProducts 8) gl_BackLightProduct)
+(declare (uniform ) (array vec4 2) gl_TextureEnvColor)
+(declare (uniform ) (array vec4 2) gl_EyePlaneS)
+(declare (uniform ) (array vec4 2) gl_EyePlaneT)
+(declare (uniform ) (array vec4 2) gl_EyePlaneR)
+(declare (uniform ) (array vec4 2) gl_EyePlaneQ)
+(declare (uniform ) (array vec4 2) gl_ObjectPlaneS)
+(declare (uniform ) (array vec4 2) gl_ObjectPlaneT)
+(declare (uniform ) (array vec4 2) gl_ObjectPlaneR)
+(declare (uniform ) (array vec4 2) gl_ObjectPlaneQ)
+(declare (uniform ) gl_FogParameters gl_Fog)
+(declare (uniform ) (array vec4 33) gl_CurrentAttribVertMESA)
+(declare (uniform ) (array vec4 32) gl_CurrentAttribFragMESA)
+(declare (out ) (array vec4 0) gl_TexCoord)
+(declare () int gl_MaxDrawBuffers)
+(function func
+ (signature vec4
+ (parameters
+ (declare (in ) (array vec4 2) arg)
+ )
+ (
+ (return (array_ref (var_ref arg) (constant int (1)) ) )
+ ))
+
+)
+
+
+)
\ No newline at end of file
--
1.7.10
More information about the mesa-dev
mailing list