Allow the application to implicitly create buffers by binding them at indexed…

Allow the application to implicitly create buffers by binding them at indexed binding points, without previously calling GenBuffers or BufferData. TRAC #22958 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2298 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent e2865d02
...@@ -8670,14 +8670,7 @@ void __stdcall glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLi ...@@ -8670,14 +8670,7 @@ void __stdcall glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLi
return gl::error(GL_INVALID_ENUM); return gl::error(GL_INVALID_ENUM);
} }
gl::Buffer *bufferObject = context->getBuffer(buffer); if (buffer != 0 && size <= 0)
if (!bufferObject)
{
// Buffer index must not have been valid
return gl::error(GL_INVALID_VALUE);
}
if (size <= 0 || static_cast<unsigned int>(offset + size) > bufferObject->size())
{ {
return gl::error(GL_INVALID_VALUE); return gl::error(GL_INVALID_VALUE);
} }
...@@ -8748,13 +8741,6 @@ void __stdcall glBindBufferBase(GLenum target, GLuint index, GLuint buffer) ...@@ -8748,13 +8741,6 @@ void __stdcall glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
return gl::error(GL_INVALID_ENUM); return gl::error(GL_INVALID_ENUM);
} }
gl::Buffer *bufferObject = context->getBuffer(buffer);
if (!bufferObject)
{
// Buffer index must not have been valid
return gl::error(GL_INVALID_VALUE);
}
switch (target) switch (target)
{ {
case GL_TRANSFORM_FEEDBACK_BUFFER: case GL_TRANSFORM_FEEDBACK_BUFFER:
......
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