Commit d8db866a by Jamie Madill Committed by Shannon Woods

Handle the new error case with VAOs introduced in GLES 3 involving a user VAO…

Handle the new error case with VAOs introduced in GLES 3 involving a user VAO and non-null data pointers. TRAC #23392 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang Authored-by: Jamie Madill
parent d1028548
...@@ -659,6 +659,11 @@ GLuint Context::getRenderbufferHandle() const ...@@ -659,6 +659,11 @@ GLuint Context::getRenderbufferHandle() const
return mState.renderbuffer.id(); return mState.renderbuffer.id();
} }
GLuint Context::getVertexArrayHandle() const
{
return mState.vertexArray;
}
GLuint Context::getArrayBufferHandle() const GLuint Context::getArrayBufferHandle() const
{ {
return mState.arrayBuffer.id(); return mState.arrayBuffer.id();
......
...@@ -224,6 +224,7 @@ class Context ...@@ -224,6 +224,7 @@ class Context
GLuint getReadFramebufferHandle() const; GLuint getReadFramebufferHandle() const;
GLuint getDrawFramebufferHandle() const; GLuint getDrawFramebufferHandle() const;
GLuint getRenderbufferHandle() const; GLuint getRenderbufferHandle() const;
GLuint getVertexArrayHandle() const;
GLuint getArrayBufferHandle() const; GLuint getArrayBufferHandle() const;
......
...@@ -8146,6 +8146,15 @@ void __stdcall glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLbo ...@@ -8146,6 +8146,15 @@ void __stdcall glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLbo
if (context) if (context)
{ {
// [OpenGL ES 3.0.2] Section 2.8 page 24:
// An INVALID_OPERATION error is generated when a non-zero vertex array object
// is bound, zero is bound to the ARRAY_BUFFER buffer object binding point,
// and the pointer argument is not NULL.
if (context->getVertexArrayHandle() != 0 && context->getArrayBufferHandle() == 0 && ptr != NULL)
{
return gl::error(GL_INVALID_OPERATION);
}
context->setVertexAttribState(index, context->getArrayBuffer(), size, type, context->setVertexAttribState(index, context->getArrayBuffer(), size, type,
normalized == GL_TRUE, false, stride, ptr); normalized == GL_TRUE, false, stride, ptr);
} }
...@@ -9624,6 +9633,15 @@ void __stdcall glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLs ...@@ -9624,6 +9633,15 @@ void __stdcall glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLs
if (context) if (context)
{ {
// [OpenGL ES 3.0.2] Section 2.8 page 24:
// An INVALID_OPERATION error is generated when a non-zero vertex array object
// is bound, zero is bound to the ARRAY_BUFFER buffer object binding point,
// and the pointer argument is not NULL.
if (context->getVertexArrayHandle() != 0 && context->getArrayBufferHandle() == 0 && pointer != NULL)
{
return gl::error(GL_INVALID_OPERATION);
}
context->setVertexAttribState(index, context->getArrayBuffer(), size, type, false, true, context->setVertexAttribState(index, context->getArrayBuffer(), size, type, false, true,
stride, pointer); stride, pointer);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment