[Piglit] [PATCH] piglit/vbo: fix attribute size for doubles.

Dave Airlie airlied at gmail.com
Fri Feb 20 14:46:04 PST 2015


From: Dave Airlie <airlied at redhat.com>

This is required for 64-bit attribs.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 tests/util/piglit-vbo.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
index 506533a..6453d40 100644
--- a/tests/util/piglit-vbo.cpp
+++ b/tests/util/piglit-vbo.cpp
@@ -290,6 +290,7 @@ vertex_attrib_description::parse_datum(const char **text, void *data) const
 void
 vertex_attrib_description::setup(size_t *offset, size_t stride) const
 {
+	int attribute_size = ATTRIBUTE_SIZE;
 	switch (this->data_type) {
 	case GL_FLOAT:
 		glVertexAttribPointer(this->index, this->count,
@@ -304,6 +305,7 @@ vertex_attrib_description::setup(size_t *offset, size_t stride) const
 		glVertexAttribLPointer(this->index, this->count,
 				      this->data_type, stride,
 				      (void *) *offset);
+		attribute_size *= 2;
 		break;
 	default:
 		if (piglit_is_gles() && piglit_get_gl_version() < 30) {
@@ -316,7 +318,7 @@ vertex_attrib_description::setup(size_t *offset, size_t stride) const
 		break;
 	}
 	glEnableVertexAttribArray(index);
-	*offset += ATTRIBUTE_SIZE * this->count;
+	*offset += attribute_size * this->count;
 }
 
 
-- 
1.9.3



More information about the Piglit mailing list