mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Chore] (MG_Test/ProgramTest): add more checks to ProgramTest
This commit is contained in:
@@ -207,6 +207,10 @@ TEST_F(ProgramTest, UniformMatrixFunctions) {
|
||||
|
||||
UseProgram(program);
|
||||
|
||||
int uniformCount = 0;
|
||||
GetProgramiv(program, GL_ACTIVE_UNIFORMS, &uniformCount);
|
||||
ASSERT_LT(uniformCount, 4000);
|
||||
|
||||
// Test UniformMatrix2fv
|
||||
auto locProjMat = GetUniformLocation(program, "ProjMat");
|
||||
ASSERT_NE(locProjMat, -1);
|
||||
@@ -268,6 +272,10 @@ TEST_F(ProgramTest, UniformMatrixTranspose) {
|
||||
|
||||
UseProgram(program);
|
||||
|
||||
int uniformCount = 0;
|
||||
GetProgramiv(program, GL_ACTIVE_UNIFORMS, &uniformCount);
|
||||
ASSERT_LT(uniformCount, 4000);
|
||||
|
||||
// Test 2x2 matrix transpose
|
||||
auto locMat2 = GetUniformLocation(program, "TestMat2");
|
||||
ASSERT_NE(locMat2, -1);
|
||||
@@ -428,6 +436,10 @@ TEST_F(ProgramTest, UniformLocationGaps) {
|
||||
|
||||
UseProgram(program);
|
||||
|
||||
int uniformCount = 0;
|
||||
GetProgramiv(program, GL_ACTIVE_UNIFORMS, &uniformCount);
|
||||
ASSERT_LT(uniformCount, 4000);
|
||||
|
||||
// Test that uniform locations are correctly assigned even with gaps
|
||||
// ProjMat is at location 0
|
||||
ASSERT_EQ(GetUniformLocation(program, "ProjMat"), 0);
|
||||
|
||||
Reference in New Issue
Block a user