Extended test to include a test for GL uniform array of size 1

ie.
uniform float2_struct M[1];
This commit is contained in:
Jake Turner
2023-09-05 08:26:27 +01:00
parent df3b17a265
commit bfe89e4c17
2 changed files with 15 additions and 1 deletions
+9
View File
@@ -342,6 +342,7 @@ uniform uvec2 I;
uniform uvec3 J;
uniform uvec4 K;
uniform ivec4 L;
uniform float2_struct M[1];
void main()
{
@@ -355,6 +356,7 @@ void main()
blah *= vertIn.uv.z;
if(H < 1 || I.x < 1 || J.x < 1 || K.x < 1) blah *= 0.1f;
if(L.x > 1) blah *= 0.1f;
blah += M[0].x + M[0].y;
Color = blah + test + vec4(0.1f, 0.0f, 0.0f, 0.0f);
}
@@ -622,6 +624,13 @@ void main()
if(location != -1)
glUniform4i(location, -24000, -25000, -26000, -27000);
location = glGetUniformLocation(program, "M[0].x");
if(location != -1)
glUniform1f(location, 28001.0);
location = glGetUniformLocation(program, "M[0].y");
if(location != -1)
glUniform1f(location, -28000.0);
glViewport(0, 0, GLsizei(screenWidth), GLsizei(screenHeight));
glDrawArrays(GL_TRIANGLES, 0, 3);
+6 -1
View File
@@ -428,7 +428,7 @@ class GL_CBuffer_Zoo(rdtest.TestCase):
rdtest.log.success("CBuffer variables are as expected")
self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.5, 0.5, [536.1, 537.0, 538.0, 539.0])
self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.5, 0.5, [537.1, 538.0, 539.0, 540.0])
rdtest.log.success("Picked value is as expected")
@@ -577,6 +577,11 @@ class GL_CBuffer_Zoo(rdtest.TestCase):
var_check.check('J').cols(3).rows(1).value([17000, 18000, 19000])
var_check.check('K').cols(4).rows(1).value([20000, 21000, 22000, 23000])
var_check.check('L').cols(4).rows(1).value([-24000, -25000, -26000, -27000])
# float2_struct M[1];
var_check.check('M').cols(0).rows(0).arraySize(2).members({
0: lambda x: x.cols(1).rows(1).value([28001.0]),
1: lambda x: x.cols(1).rows(1).value([-28000.0]),
})
var_check.done()