[Piglit] [PATCH 12/16] util/gl: Unify vertex_attrib_description::setup() amongs APIs

Chad Versace chad.versace at linux.intel.com
Wed Jul 9 14:56:54 PDT 2014


Now that piglit-dispatch supports every OpenGL API, there is no
longer a need to provide separate implementations for GL and GLES.
Piglit can make API-based decisions at runtime rather than buildtime.

This patch brings us one step closer to unifying Piglit's CMake files.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 tests/util/piglit-vbo.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
index 3f9d655..109cef9 100644
--- a/tests/util/piglit-vbo.cpp
+++ b/tests/util/piglit-vbo.cpp
@@ -284,14 +284,12 @@ vertex_attrib_description::setup(size_t *offset, size_t stride) const
 		glVertexAttribPointer(this->index, this->count,
 				      this->data_type, GL_FALSE, stride,
 				      (void *) *offset);
-	} else {
-#if defined(PIGLIT_USE_OPENGL_ES2)
+	} else if (piglit_is_gles() and piglit_get_gl_version() < 30) {
 		fprintf(stderr,"vertex_attrib_description fail. no int support\n");
-#else
+	} else {
 		glVertexAttribIPointer(this->index, this->count,
 				       this->data_type, stride,
 				       (void *) *offset);
-#endif
 	}
 	glEnableVertexAttribArray(index);
 	*offset += ATTRIBUTE_SIZE * this->count;
-- 
2.0.0



More information about the Piglit mailing list