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
return mState.renderbuffer.id();
}
GLuint Context::getVertexArrayHandle() const
{
return mState.vertexArray;
}
GLuint Context::getArrayBufferHandle() const
{
return mState.arrayBuffer.id();
......
......@@ -224,6 +224,7 @@ class Context
GLuint getReadFramebufferHandle() const;
GLuint getDrawFramebufferHandle() const;
GLuint getRenderbufferHandle() const;
GLuint getVertexArrayHandle() const;
GLuint getArrayBufferHandle() const;
......
......@@ -8146,6 +8146,15 @@ void __stdcall glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLbo
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,
normalized == GL_TRUE, false, stride, ptr);
}
......@@ -9624,6 +9633,15 @@ void __stdcall glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLs
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,
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