Permalink
Browse files

tests: uniforms with initializers

  • Loading branch information...
1 parent 2bb29ae commit c9c72cf0aa9eee16b01ae84f8a1907e8f571e8c1 @aras-p committed Jan 23, 2013
@@ -0,0 +1,9 @@
+#line 1 "uniforms-in.txt"
+float uni1 : register(c0);
+uniform float uni2 : register(c1);
+
+float uniInit1 = 13.0;
+uniform float uniInit2 = 14.0;
+fixed4 main (float4 uv:TEXCOORD0, uniform float4 unicolor, uniform float4 reg : register(c2), uniform float4 lights[2]) : COLOR0 {
+ return uv + unicolor + fixed4(uni1+uni2) + reg + lights[1] + uniInit1.xxxx + uniInit2.xxxx;
+}
@@ -0,0 +1,31 @@
+#version 120
+
+#line 1
+uniform float uni1;
+uniform float uni2;
+uniform float uniInit1 = 13.0;
+#line 5
+uniform float uniInit2 = 14.0;
+vec4 xlat_main( in vec4 uv, vec4 unicolor, vec4 reg, vec4 lights[2] );
+#line 6
+vec4 xlat_main( in vec4 uv, vec4 unicolor, vec4 reg, vec4 lights[2] ) {
+ return ((((((uv + unicolor) + vec4( (uni1 + uni2))) + reg) + lights[1]) + vec4( uniInit1)) + vec4( uniInit2));
+}
+uniform vec4 xlu_unicolor;
+uniform vec4 xlu_reg;
+uniform vec4 xlu_lights[2];
+varying vec4 xlv_TEXCOORD0;
+void main() {
+ vec4 xl_retval;
+ xl_retval = xlat_main( vec4(xlv_TEXCOORD0), xlu_unicolor, xlu_reg, xlu_lights);
+ gl_FragData[0] = vec4(xl_retval);
+}
+
+// uniforms:
+// unicolor:<none> type 12 arrsize 0
+// reg:<none> type 12 arrsize 0
+// lights:<none> type 12 arrsize 2
+// uni1:<none> type 9 arrsize 0
+// uni2:<none> type 9 arrsize 0
+// uniInit1:<none> type 9 arrsize 0
+// uniInit2:<none> type 9 arrsize 0
@@ -0,0 +1,31 @@
+#version 120
+
+#line 1
+uniform float uni1;
+uniform float uni2;
+uniform float uniInit1 = 13.0;
+#line 5
+uniform float uniInit2 = 14.0;
+vec4 xlat_main( in vec4 uv, vec4 unicolor, vec4 reg, vec4 lights[2] );
+#line 6
+vec4 xlat_main( in vec4 uv, vec4 unicolor, vec4 reg, vec4 lights[2] ) {
+ return ((((((uv + unicolor) + vec4( (uni1 + uni2))) + reg) + lights[1]) + vec4( uniInit1)) + vec4( uniInit2));
+}
+uniform vec4 xlu_unicolor;
+uniform vec4 xlu_reg;
+uniform vec4 xlu_lights[2];
+varying vec4 xlv_TEXCOORD0;
+void main() {
+ vec4 xl_retval;
+ xl_retval = xlat_main( vec4(xlv_TEXCOORD0), xlu_unicolor, xlu_reg, xlu_lights);
+ gl_FragData[0] = vec4(xl_retval);
+}
+
+// uniforms:
+// unicolor:<none> type 12 arrsize 0
+// reg:<none> type 12 arrsize 0
+// lights:<none> type 12 arrsize 2
+// uni1:<none> type 9 arrsize 0
+// uni2:<none> type 9 arrsize 0
+// uniInit1:<none> type 9 arrsize 0
+// uniInit2:<none> type 9 arrsize 0
@@ -1,6 +1,9 @@
#line 1 "uniforms-in.txt"
float uni1 : register(c0);
uniform float uni2 : register(c1);
+
+float uniInit1 = 13.0;
+uniform float uniInit2 = 14.0;
fixed4 main (float4 uv:TEXCOORD0, uniform float4 unicolor, uniform float4 reg : register(c2), uniform float4 lights[2]) : COLOR0 {
- return uv + unicolor + fixed4(uni1+uni2) + reg + lights[1];
+ return uv + unicolor + fixed4(uni1+uni2) + reg + lights[1] + uniInit1.xxxx + uniInit2.xxxx;
}
@@ -2,10 +2,13 @@
#line 1
uniform float uni1;
uniform float uni2;
+uniform float uniInit1 = 13.0;
+#line 5
+uniform float uniInit2 = 14.0;
vec4 xlat_main( in vec4 uv, vec4 unicolor, vec4 reg, vec4 lights[2] );
-#line 3
+#line 6
vec4 xlat_main( in vec4 uv, vec4 unicolor, vec4 reg, vec4 lights[2] ) {
- return ((((uv + unicolor) + vec4( (uni1 + uni2))) + reg) + lights[1]);
+ return ((((((uv + unicolor) + vec4( (uni1 + uni2))) + reg) + lights[1]) + vec4( uniInit1)) + vec4( uniInit2));
}
uniform vec4 xlu_unicolor;
uniform vec4 xlu_reg;
@@ -23,3 +26,5 @@ void main() {
// lights:<none> type 12 arrsize 2
// uni1:<none> type 9 arrsize 0
// uni2:<none> type 9 arrsize 0
+// uniInit1:<none> type 9 arrsize 0
+// uniInit2:<none> type 9 arrsize 0
@@ -2,10 +2,13 @@
#line 1
uniform highp float uni1;
uniform highp float uni2;
+uniform highp float uniInit1 = 13.0;
+#line 5
+uniform highp float uniInit2 = 14.0;
lowp vec4 xlat_main( in highp vec4 uv, highp vec4 unicolor, highp vec4 reg, highp vec4 lights[2] );
-#line 3
+#line 6
lowp vec4 xlat_main( in highp vec4 uv, highp vec4 unicolor, highp vec4 reg, highp vec4 lights[2] ) {
- return ((((uv + unicolor) + vec4( (uni1 + uni2))) + reg) + lights[1]);
+ return ((((((uv + unicolor) + vec4( (uni1 + uni2))) + reg) + lights[1]) + vec4( uniInit1)) + vec4( uniInit2));
}
uniform highp vec4 xlu_unicolor;
uniform highp vec4 xlu_reg;
@@ -23,3 +26,5 @@ void main() {
// lights:<none> type 12 arrsize 2
// uni1:<none> type 9 arrsize 0
// uni2:<none> type 9 arrsize 0
+// uniInit1:<none> type 9 arrsize 0
+// uniInit2:<none> type 9 arrsize 0

0 comments on commit c9c72cf

Please sign in to comment.