From 5881a9d9da39cdc894aba2bb2d94c0940757d04c Mon Sep 17 00:00:00 2001 From: Piotr Byszewski Date: Thu, 6 Jul 2017 12:41:37 +0200 Subject: [PATCH] Fix ShaderExecutor usage for core OpenGL Tessellation shader tests were failing on GL43 due to INVALID_OPERATION error generated by glDrawArrays(). The error was generated due to lack of a vertex array being bound. Components: AOSP Change-Id: I56f7430f93ee3ae861b0168e852a948fbb0f9bed --- modules/glshared/glsShaderExecUtil.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/glshared/glsShaderExecUtil.cpp b/modules/glshared/glsShaderExecUtil.cpp index 3c6de94..3773746 100644 --- a/modules/glshared/glsShaderExecUtil.cpp +++ b/modules/glshared/glsShaderExecUtil.cpp @@ -1373,10 +1373,17 @@ void TessControlExecutor::execute (int numValues, const void* const* inputs, voi gl.bindBufferBase(GL_SHADER_STORAGE_BUFFER, OUTPUT_BUFFER_BINDING, getOutputBuffer()); + deUint32 vertexArray; + gl.genVertexArrays(1, &vertexArray); + gl.bindVertexArray(vertexArray); + // Render patches gl.patchParameteri(GL_PATCH_VERTICES, 3); gl.drawArrays(GL_PATCHES, 0, 3*numValues); + gl.bindVertexArray(0); + gl.deleteVertexArrays(1, &vertexArray); + // Read back data readOutputBuffer(outputs, numValues); } @@ -1491,10 +1498,17 @@ void TessEvaluationExecutor::execute (int numValues, const void* const* inputs, gl.bindBufferBase(GL_SHADER_STORAGE_BUFFER, OUTPUT_BUFFER_BINDING, getOutputBuffer()); + deUint32 vertexArray; + gl.genVertexArrays(1, &vertexArray); + gl.bindVertexArray(vertexArray); + // Render patches gl.patchParameteri(GL_PATCH_VERTICES, 2); gl.drawArrays(GL_PATCHES, 0, alignedValues); + gl.bindVertexArray(0); + gl.deleteVertexArrays(1, &vertexArray); + // Read back data readOutputBuffer(outputs, numValues); } -- 2.7.4