[Piglit] [PATCH] glean/tstencil2: check for extension before calling getProcAddress()

Brian Paul brianp at vmware.com
Thu Aug 15 12:17:56 PDT 2013


Otherwise, with NVIDIA's driver we were just exiting (with SKIP result)
when getProcAddress("glStencilOpSeparateATI") failed.  Now the test
actually runs.
---
 tests/glean/tstencil2.cpp |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/tests/glean/tstencil2.cpp b/tests/glean/tstencil2.cpp
index a7ff1d3..fe5e13e 100644
--- a/tests/glean/tstencil2.cpp
+++ b/tests/glean/tstencil2.cpp
@@ -74,15 +74,17 @@ Stencil2Result::Stencil2Result()
 void
 Stencil2Test::get_ext_functions(void)
 {
-	// ATI
-	glStencilOpSeparateATI_func = (PFNGLSTENCILOPSEPARATEATIPROC)
-		GLUtils::getProcAddress("glStencilOpSeparateATI");
-	glStencilFuncSeparateATI_func = (PFNGLSTENCILFUNCSEPARATEATIPROC)
-		GLUtils::getProcAddress("glStencilFuncSeparateATI");
-
-	// EXT
-	glActiveStencilFaceEXT_func = (PFNGLACTIVESTENCILFACEEXTPROC)
-		GLUtils::getProcAddress("glActiveStencilFaceEXT");
+	if (have_ATI_separate_stencil()) {
+		glStencilOpSeparateATI_func = (PFNGLSTENCILOPSEPARATEATIPROC)
+			GLUtils::getProcAddress("glStencilOpSeparateATI");
+		glStencilFuncSeparateATI_func = (PFNGLSTENCILFUNCSEPARATEATIPROC)
+			GLUtils::getProcAddress("glStencilFuncSeparateATI");
+	}
+
+	if (have_EXT_stencil_two_side()) {
+		glActiveStencilFaceEXT_func = (PFNGLACTIVESTENCILFACEEXTPROC)
+			GLUtils::getProcAddress("glActiveStencilFaceEXT");
+	}
 
 	// GL2
 	glStencilOpSeparate_func = (PFNGLSTENCILOPSEPARATEPROC)
-- 
1.7.10.4



More information about the Piglit mailing list