[Piglit] [PATCH 7/7] getuniform-02: Fix when using ARB_shader_objects

Eric Anholt eric at anholt.net
Mon Jul 11 17:43:13 PDT 2011


---
 tests/shaders/getuniform-02.c |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/tests/shaders/getuniform-02.c b/tests/shaders/getuniform-02.c
index 8874cb7..f5c5dd6 100644
--- a/tests/shaders/getuniform-02.c
+++ b/tests/shaders/getuniform-02.c
@@ -85,7 +85,7 @@ piglit_init(int argc, char **argv)
 
    piglit_UseProgram(prog);
 
-   glGetProgramiv(prog, GL_ACTIVE_UNIFORMS, &numUniforms);
+   piglit_GetProgramiv(prog, GL_ACTIVE_UNIFORMS, &numUniforms);
    if (numUniforms != expectedNum) {
       printf("%s: incorrect number of uniforms (found %d, expected %d)\n",
              TestName, numUniforms, expectedNum);
@@ -100,8 +100,9 @@ piglit_init(int argc, char **argv)
       GLenum type, expectedType;
       GLint loc;
 
-      glGetActiveUniformARB(prog, i, sizeof(name), &len, &size, &type, name);
-      loc = glGetUniformLocation(prog, name);
+      piglit_GetActiveUniform(prog,
+				 i, sizeof(name), &len, &size, &type, name);
+      loc = piglit_GetUniformLocation(prog, name);
 
       if (loc < 0) {
          printf("%s: bad uniform location for %s: %d\n", TestName, name, loc);
@@ -136,47 +137,47 @@ piglit_init(int argc, char **argv)
 
    /* Check setting/getting values */
 
-   loc_f1 = glGetUniformLocation(prog, "f1");
-   loc_f2 = glGetUniformLocation(prog, "f2");
-   loc_sa = glGetUniformLocation(prog, "s.a");
-   loc_sd = glGetUniformLocation(prog, "s.d");
-   loc_v1 = glGetUniformLocation(prog, "v[1]");
+   loc_f1 = piglit_GetUniformLocation(prog, "f1");
+   loc_f2 = piglit_GetUniformLocation(prog, "f2");
+   loc_sa = piglit_GetUniformLocation(prog, "s.a");
+   loc_sd = piglit_GetUniformLocation(prog, "s.d");
+   loc_v1 = piglit_GetUniformLocation(prog, "v[1]");
 
-   glUniform1fARB(loc_f1, 5.0);
-   glUniform1fARB(loc_f2, 10.0);
-   glUniform1fARB(loc_sa, 15.0);
-   glUniform1fARB(loc_sd, 20.0);
-   glUniform4fvARB(loc_v1, 1, vVals);
+   piglit_Uniform1f(loc_f1, 5.0);
+   piglit_Uniform1f(loc_f2, 10.0);
+   piglit_Uniform1f(loc_sa, 15.0);
+   piglit_Uniform1f(loc_sd, 20.0);
+   piglit_Uniform4fv(loc_v1, 1, vVals);
 
-   glGetUniformfvARB(prog, loc_f1, v);
+   piglit_GetUniformfv(prog, loc_f1, v);
    if (v[0] != 5.0) {
       printf("%s: wrong value for f1 (found %f, expected %f)\n",
              TestName, v[0], 5.0);
       piglit_report_result(PIGLIT_FAIL);
    }
 
-   glGetUniformfvARB(prog, loc_f2, v);
+   piglit_GetUniformfv(prog, loc_f2, v);
    if (v[0] != 10.0) {
       printf("%s: wrong value for f2 (found %f, expected %f)\n",
              TestName, v[0], 10.0);
       piglit_report_result(PIGLIT_FAIL);
    }
 
-   glGetUniformfvARB(prog, loc_sa, v);
+   piglit_GetUniformfv(prog, loc_sa, v);
    if (v[0] != 15.0) {
       printf("%s: wrong value for s.a (found %f, expected %f)\n",
              TestName, v[0], 15.0);
       piglit_report_result(PIGLIT_FAIL);
    }
 
-   glGetUniformfvARB(prog, loc_sd, v);
+   piglit_GetUniformfv(prog, loc_sd, v);
    if (v[0] != 20.0) {
       printf("%s: wrong value for s.d (found %f, expected %f)\n",
              TestName, v[0], 20.0);
       piglit_report_result(PIGLIT_FAIL);
    }
 
-   glGetUniformfvARB(prog, loc_v1, v);
+   piglit_GetUniformfv(prog, loc_v1, v);
    if (v[0] != 30.0 ||
        v[1] != 31.0 ||
        v[2] != 32.0 ||
-- 
1.7.5.4



More information about the Piglit mailing list