Index: Source/modules/webgl/WebGL2RenderingContextBase.cpp |
diff --git a/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
index 234cbd6fbd2a8383012c72629f347131e8395dbd..fa95cfa7c3d154cb2a815963c1ec4cbbca891465 100644 |
--- a/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
+++ b/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
@@ -1594,9 +1594,13 @@ void WebGL2RenderingContextBase::resumeTransformFeedback() |
void WebGL2RenderingContextBase::bindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer) |
{ |
- if (isContextLost() || !validateWebGLObject("bindBufferBase", buffer)) |
+ if (isContextLost()) |
return; |
- |
+ bool deleted; |
+ if (!checkObjectToBeBound("bindBufferBase", buffer, deleted)) |
+ return; |
+ if (deleted) |
+ buffer = 0; |
Zhenyao Mo
2015/08/31 18:30:56
By the way, the spec says "If the buffer object na
Ken Russell (switch to Gerrit)
2015/08/31 18:41:53
It seems to me there isn't any difference in behav
|
webContext()->bindBufferBase(target, index, objectOrZero(buffer)); |
} |
@@ -2450,6 +2454,21 @@ WebGLBuffer* WebGL2RenderingContextBase::validateBufferDataTarget(const char* fu |
return buffer; |
} |
+bool WebGL2RenderingContextBase::validateBufferDataUsage(const char* functionName, GLenum usage) |
+{ |
+ switch (usage) { |
+ case GL_STREAM_READ: |
+ case GL_STREAM_COPY: |
+ case GL_STATIC_READ: |
+ case GL_STATIC_COPY: |
+ case GL_DYNAMIC_READ: |
+ case GL_DYNAMIC_COPY: |
+ return true; |
+ default: |
+ return WebGLRenderingContextBase::validateBufferDataUsage(functionName, usage); |
+ } |
+} |
+ |
void WebGL2RenderingContextBase::removeBoundBuffer(WebGLBuffer* buffer) |
{ |
if (m_boundCopyReadBuffer == buffer) |