Add test of integer bare uniforms on GL

This commit is contained in:
baldurk
2022-06-17 13:52:29 +01:00
parent ef003ec881
commit 20b496fc7a
2 changed files with 33 additions and 0 deletions
+27
View File
@@ -337,6 +337,11 @@ uniform mat2x3 D;
uniform float E[3];
uniform vec4 F[3][2][2];
uniform nested G[2];
uniform uint H;
uniform uvec2 I;
uniform uvec3 J;
uniform uvec4 K;
uniform ivec4 L;
void main()
{
@@ -348,6 +353,8 @@ void main()
blah += A.z + B.x + C.y + D[0][1] + E[2] + F[1][0][0].y + F[1][0][1].y;
blah += G[0].a.b + G[1].a.b + G[1].b[3].w + G[1].c[3].a.y;
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;
Color = blah + test + vec4(0.1f, 0.0f, 0.0f, 0.0f);
}
@@ -595,6 +602,26 @@ void main()
if(location != -1)
glUniform1f(location, 1390.0f);
location = glGetUniformLocation(program, "H");
if(location != -1)
glUniform1ui(location, 14000);
location = glGetUniformLocation(program, "I");
if(location != -1)
glUniform2ui(location, 15000, 16000);
location = glGetUniformLocation(program, "J");
if(location != -1)
glUniform3ui(location, 17000, 18000, 19000);
location = glGetUniformLocation(program, "K");
if(location != -1)
glUniform4ui(location, 20000, 21000, 22000, 23000);
location = glGetUniformLocation(program, "L");
if(location != -1)
glUniform4i(location, -24000, -25000, -26000, -27000);
glViewport(0, 0, GLsizei(screenWidth), GLsizei(screenHeight));
glDrawArrays(GL_TRIANGLES, 0, 3);
+6
View File
@@ -572,6 +572,12 @@ class GL_CBuffer_Zoo(rdtest.TestCase):
}),
})
var_check.check('H').cols(1).rows(1).value([14000])
var_check.check('I').cols(2).rows(1).value([15000, 16000])
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])
var_check.done()
rdtest.log.success("Bare uniform variables are as expected")