summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2012-11-12 15:24:59 -0800
committerIan Romanick <ian.d.romanick@intel.com>2012-11-16 16:07:02 -0800
commitcad3ba37df8ab81e00e8601028a6691a66e61442 (patch)
treea5b747d7e09dc3314a4f617a69d07cdcc2e4da39
parent8a4d4bdfa1dea88b009e44d23cba2c4ae6b25ee3 (diff)
shader_runner: Set a VAO in a GL 3.1 context
There's no default VAO (without GL_ARB_compatibility), so we have to create and bind one. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--tests/shaders/shader_runner.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 5b313854..d89abdb0 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1626,8 +1626,16 @@ piglit_init(int argc, char **argv)
process_test_script(argv[1]);
link_and_use_shaders();
- if (vertex_data_start != NULL)
+ if (vertex_data_start != NULL) {
+ if (gl_version >= 31) {
+ GLuint vao;
+
+ glGenVertexArrays(1, &vao);
+ glBindVertexArray(vao);
+ }
+
num_vbo_rows = setup_vbo_from_text(prog, vertex_data_start,
vertex_data_end);
+ }
setup_ubos();
}