|
|
DescriptionWebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer.
This change also removed items cached in VertexAttribState in WebGLVertexArrayObjectBase.
BUG=570453
Committed: https://crrev.com/ab18bc73dddce5b609a2d73239ab3874b2a5382d
Cr-Commit-Position: refs/heads/master@{#368015}
Patch Set 1 #Patch Set 2 : remove unused validations #
Total comments: 4
Patch Set 3 : addressed zmo@'s feedback: leave this CL to be only code-refactoring #Patch Set 4 : addressed kbr@'s feedback: remove most of cached items from VertexAttribState #Patch Set 5 : fix errors found by trybots #
Total comments: 3
Patch Set 6 : code rebase #Patch Set 7 : addressed feedback from zmo and kbr: remove VertexAttribState #
Total comments: 4
Patch Set 8 : addressed feedbacks from Zhenyao and Ken #
Messages
Total messages: 53 (26 generated)
Description was changed from ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer BUG= ========== to ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer BUG=570453 TEST=gpu_unittests ==========
yunchao.he@intel.com changed reviewers: + bajones@chromium.org, kbr@chromium.org, qiankun.miao@intel.com, zmo@chromium.org
Description was changed from ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer BUG=570453 TEST=gpu_unittests ========== to ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generated correct glErrors to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validation are remove when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ==========
Description was changed from ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generated correct glErrors to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validation are remove when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ========== to ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generated correct glErrors to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validations are remove when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ==========
Description was changed from ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generated correct glErrors to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validations are remove when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ========== to ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generated correct glErrors to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validations are removed when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ==========
Description was changed from ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generated correct glErrors to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validations are removed when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ========== to ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generates correct glError to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validations are removed when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ==========
Description was changed from ========== WebGL code refacotring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generates correct glError to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validations are removed when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ========== to ========== WebGL code refactoring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generates correct glError to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validations are removed when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ==========
Patchset #2 (id:20001) has been deleted
PTAL. Thanks a lot!
https://codereview.chromium.org/1555523002/diff/40001/gpu/command_buffer/serv... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/1555523002/diff/40001/gpu/command_buffer/serv... gpu/command_buffer/service/gles2_cmd_decoder.cc:8770: GL_INVALID_VALUE, This should also be INVALID_OPERATION. See https://www.opengl.org/registry/specs/ARB/vertex_attrib_binding.txt https://codereview.chromium.org/1555523002/diff/40001/gpu/command_buffer/serv... gpu/command_buffer/service/gles2_cmd_decoder.cc:8857: GL_INVALID_VALUE, Same here, INVALID_OPERATION. https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp (left): https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp:1526: m_boundVertexArrayObject->setVertexAttribState(index, bytesPerElement, size, type, false, stride, static_cast<GLintptr>(offset), m_boundArrayBuffer); When you remove the above validation, then you ended up caching the wrong here info if some args are invalid.
Thanks for your review, Zhenyao. Could you see the comments inline? I think this may be a common issue when we remove validations in Blink side. https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp (left): https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp:1526: m_boundVertexArrayObject->setVertexAttribState(index, bytesPerElement, size, type, false, stride, static_cast<GLintptr>(offset), m_boundArrayBuffer); On 2015/12/29 22:04:04, Zhenyao Mo wrote: > When you remove the above validation, then you ended up caching the wrong here > info if some args are invalid. Yeah, that's true. But Chromium will report error/failure soon in command buffer. So the web developers will know that their app have some bugs. The wrong data cached here will not be used then. I think this is OK. In my opinion, we need to make sure that intentional or unintentional wrong parameter(s) will trigger appropriate error. And it should not lead to some security problem(crash the browser, memory leak, etc). WDYT? I think we would have the similar cases when we do code-refactoring for other APIs.
Description was changed from ========== WebGL code refactoring: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also generates correct glError to fix 2 small bugs in command buffer. These bugs are exposed after the blink-side validations are removed when running webgl conformance tests. BUG=570453 TEST=gpu_unittests ========== to ========== WebGL code refactoring: remove validation code for vertexAttribPointer and vertexAttribIPointer. BUG=570453 ==========
On 2015/12/30 01:02:11, yunchao wrote: > Thanks for your review, Zhenyao. Could you see the comments inline? I think this > may be a common issue when we remove validations in Blink side. > > https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... > File third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp > (left): > > https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp:1526: > m_boundVertexArrayObject->setVertexAttribState(index, bytesPerElement, size, > type, false, stride, static_cast<GLintptr>(offset), m_boundArrayBuffer); > On 2015/12/29 22:04:04, Zhenyao Mo wrote: > > When you remove the above validation, then you ended up caching the wrong here > > info if some args are invalid. > > Yeah, that's true. But Chromium will report error/failure soon in command > buffer. So the web developers will know that their app have some bugs. The wrong > data cached here will not be used then. I think this is OK. In my opinion, we > need to make sure that intentional or unintentional wrong parameter(s) will > trigger appropriate error. And it should not lead to some security problem(crash > the browser, memory leak, etc). WDYT? > > I think we would have the similar cases when we do code-refactoring for other > APIs. I have a different opinion on this. When we cache the wrong data, the data can be used without the understanding that the data could be wrong. I'd rather not have to worry about this. Otherwise who knows what types of nasty bugs that manifest in seemingly unrelated places? It will be a maintenance cost.
On 2015/12/30 01:10:36, Zhenyao Mo wrote: > On 2015/12/30 01:02:11, yunchao wrote: > > Thanks for your review, Zhenyao. Could you see the comments inline? I think > this > > may be a common issue when we remove validations in Blink side. > > > > > https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... > > File third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp > > (left): > > > > > https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... > > third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp:1526: > > m_boundVertexArrayObject->setVertexAttribState(index, bytesPerElement, size, > > type, false, stride, static_cast<GLintptr>(offset), m_boundArrayBuffer); > > On 2015/12/29 22:04:04, Zhenyao Mo wrote: > > > When you remove the above validation, then you ended up caching the wrong > here > > > info if some args are invalid. > > > > Yeah, that's true. But Chromium will report error/failure soon in command > > buffer. So the web developers will know that their app have some bugs. The > wrong > > data cached here will not be used then. I think this is OK. In my opinion, we > > need to make sure that intentional or unintentional wrong parameter(s) will > > trigger appropriate error. And it should not lead to some security > problem(crash > > the browser, memory leak, etc). WDYT? > > > > I think we would have the similar cases when we do code-refactoring for other > > APIs. > > I have a different opinion on this. When we cache the wrong data, the data can > be used without the understanding that the data could be wrong. I'd rather not > have to worry about this. Otherwise who knows what types of nasty bugs that > manifest in seemingly unrelated places? It will be a maintenance cost. I agree 100% with Mo. If values are being cached at the Blink level then they need to be validated. We should try to remove as much caching and validation from the Blink side as possible.
On 2015/12/30 02:19:12, Ken Russell wrote: > On 2015/12/30 01:10:36, Zhenyao Mo wrote: > > On 2015/12/30 01:02:11, yunchao wrote: > > > Thanks for your review, Zhenyao. Could you see the comments inline? I think > > this > > > may be a common issue when we remove validations in Blink side. > > > > > > > > > https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... > > > File third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp > > > (left): > > > > > > > > > https://codereview.chromium.org/1555523002/diff/40001/third_party/WebKit/Sour... > > > third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp:1526: > > > m_boundVertexArrayObject->setVertexAttribState(index, bytesPerElement, size, > > > type, false, stride, static_cast<GLintptr>(offset), m_boundArrayBuffer); > > > On 2015/12/29 22:04:04, Zhenyao Mo wrote: > > > > When you remove the above validation, then you ended up caching the wrong > > here > > > > info if some args are invalid. > > > > > > Yeah, that's true. But Chromium will report error/failure soon in command > > > buffer. So the web developers will know that their app have some bugs. The > > wrong > > > data cached here will not be used then. I think this is OK. In my opinion, > we > > > need to make sure that intentional or unintentional wrong parameter(s) will > > > trigger appropriate error. And it should not lead to some security > > problem(crash > > > the browser, memory leak, etc). WDYT? > > > > > > I think we would have the similar cases when we do code-refactoring for > other > > > APIs. > > > > I have a different opinion on this. When we cache the wrong data, the data > can > > be used without the understanding that the data could be wrong. I'd rather > not > > have to worry about this. Otherwise who knows what types of nasty bugs that > > manifest in seemingly unrelated places? It will be a maintenance cost. > > I agree 100% with Mo. If values are being cached at the Blink level then they > need to be validated. We should try to remove as much caching and validation > from the Blink side as possible. Also: this CL is not a refactoring -- please see https://en.wikipedia.org/wiki/Code_refactoring -- a refactoring restructures existing code without changing its external behavior. This CL (probably) changes the visible behavior in error states. not lgtm
Patchset #4 (id:80001) has been deleted
Description was changed from ========== WebGL code refactoring: remove validation code for vertexAttribPointer and vertexAttribIPointer. BUG=570453 ========== to ========== Blink WebGL: remove validation code for vertexAttribPointer vertexAttribIPointer. BUG=570453 ==========
Description was changed from ========== Blink WebGL: remove validation code for vertexAttribPointer vertexAttribIPointer. BUG=570453 ========== to ========== WebGL: remove validation code for vertexAttribPointer vertexAttribIPointer. BUG=570453 ==========
> > > On 2015/12/29 22:04:04, Zhenyao Mo wrote: > > > > When you remove the above validation, then you ended up caching the wrong > > here > > > > info if some args are invalid. > > > > > > Yeah, that's true. But Chromium will report error/failure soon in command > > > buffer. So the web developers will know that their app have some bugs. The > > wrong > > > data cached here will not be used then. I think this is OK. In my opinion, > we > > > need to make sure that intentional or unintentional wrong parameter(s) will > > > trigger appropriate error. And it should not lead to some security > > problem(crash > > > the browser, memory leak, etc). WDYT? > > > > > > I think we would have the similar cases when we do code-refactoring for > other > > > APIs. > > > > I have a different opinion on this. When we cache the wrong data, the data > can > > be used without the understanding that the data could be wrong. I'd rather > not > > have to worry about this. Otherwise who knows what types of nasty bugs that > > manifest in seemingly unrelated places? It will be a maintenance cost. > > I agree 100% with Mo. If values are being cached at the Blink level then they > need to be validated. We should try to remove as much caching and validation > from the Blink side as possible. Hi, Ken and Zhenyao, I removed almost all cached data from VertexAttribState in WebGLVertexArrayObjectBase. Now only ArrayBuffer and ElementArrayBuffer are stored in Blink side VAO. Other items are removed. And these items have been cached in Command buffer already. VertexAttribPointer only store ArrayBuffer and index into VertexAttribState, both of them have been validated now. Could you have a look?
Description was changed from ========== WebGL: remove validation code for vertexAttribPointer vertexAttribIPointer. BUG=570453 ========== to ========== WebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also removed most of the items cached in VertexAttribState in WebGLVertexArrayObjectBase. BUG=570453 ==========
On 2015/12/31 14:38:14, yunchao wrote: > > > > On 2015/12/29 22:04:04, Zhenyao Mo wrote: > > > > > When you remove the above validation, then you ended up caching the > wrong > > > here > > > > > info if some args are invalid. > > > > > > > > Yeah, that's true. But Chromium will report error/failure soon in command > > > > buffer. So the web developers will know that their app have some bugs. The > > > wrong > > > > data cached here will not be used then. I think this is OK. In my opinion, > > we > > > > need to make sure that intentional or unintentional wrong parameter(s) > will > > > > trigger appropriate error. And it should not lead to some security > > > problem(crash > > > > the browser, memory leak, etc). WDYT? > > > > > > > > I think we would have the similar cases when we do code-refactoring for > > other > > > > APIs. > > > > > > I have a different opinion on this. When we cache the wrong data, the data > > can > > > be used without the understanding that the data could be wrong. I'd rather > > not > > > have to worry about this. Otherwise who knows what types of nasty bugs that > > > manifest in seemingly unrelated places? It will be a maintenance cost. > > > > I agree 100% with Mo. If values are being cached at the Blink level then they > > need to be validated. We should try to remove as much caching and validation > > from the Blink side as possible. > > Hi, Ken and Zhenyao, I removed almost all cached data from VertexAttribState in > WebGLVertexArrayObjectBase. Now only ArrayBuffer and ElementArrayBuffer are > stored in Blink side VAO. Other items are removed. And these items have been > cached in Command buffer already. > > VertexAttribPointer only store ArrayBuffer and index into VertexAttribState, > both of them have been validated now. > > Could you have a look? Apparently something was removed incorrectly as the conformance tests start failing.
On 2016/01/04 22:17:22, Zhenyao Mo wrote: > On 2015/12/31 14:38:14, yunchao wrote: > > > > > On 2015/12/29 22:04:04, Zhenyao Mo wrote: > > > > > > When you remove the above validation, then you ended up caching the > > wrong > > > > here > > > > > > info if some args are invalid. > > > > > > > > > > Yeah, that's true. But Chromium will report error/failure soon in > command > > > > > buffer. So the web developers will know that their app have some bugs. > The > > > > wrong > > > > > data cached here will not be used then. I think this is OK. In my > opinion, > > > we > > > > > need to make sure that intentional or unintentional wrong parameter(s) > > will > > > > > trigger appropriate error. And it should not lead to some security > > > > problem(crash > > > > > the browser, memory leak, etc). WDYT? > > > > > > > > > > I think we would have the similar cases when we do code-refactoring for > > > other > > > > > APIs. > > > > > > > > I have a different opinion on this. When we cache the wrong data, the > data > > > can > > > > be used without the understanding that the data could be wrong. I'd > rather > > > not > > > > have to worry about this. Otherwise who knows what types of nasty bugs > that > > > > manifest in seemingly unrelated places? It will be a maintenance cost. > > > > > > I agree 100% with Mo. If values are being cached at the Blink level then > they > > > need to be validated. We should try to remove as much caching and validation > > > from the Blink side as possible. > > > > Hi, Ken and Zhenyao, I removed almost all cached data from VertexAttribState > in > > WebGLVertexArrayObjectBase. Now only ArrayBuffer and ElementArrayBuffer are > > stored in Blink side VAO. Other items are removed. And these items have been > > cached in Command buffer already. > > > > VertexAttribPointer only store ArrayBuffer and index into VertexAttribState, > > both of them have been validated now. > > > > Could you have a look? > > Apparently something was removed incorrectly as the conformance tests start > failing. The failure is fixed. The other failures seem to be irrelevant. Could you have a look again? Zhenyao and Ken.
lgtm https://codereview.chromium.org/1555523002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h (right): https://codereview.chromium.org/1555523002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h:26: class VertexAttribState final : public GarbageCollected<VertexAttribState> { Do we still need this class? Can't we just put bufferBinding as a direct member of WebGLVertexArrayObjectBase?
The CQ bit was checked by yunchao.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1555523002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1555523002/140001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: A disapproval has been posted by following reviewers: kbr@chromium.org. Please make sure to get positive review before another CQ attempt.
Yunchao, thanks, this looks a lot better. lgtm at this point with one cleanup request. https://codereview.chromium.org/1555523002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h (right): https://codereview.chromium.org/1555523002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h:26: class VertexAttribState final : public GarbageCollected<VertexAttribState> { On 2016/01/05 21:13:21, Zhenyao Mo wrote: > Do we still need this class? Can't we just put bufferBinding as a direct member > of WebGLVertexArrayObjectBase? It looks to me like m_vertexAttribState could be changed to: HeapVector<Member<WebGLBuffer>> m_boundArrayBuffers; and yes, that this class could be removed.
The CQ bit was checked by yunchao.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1555523002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1555523002/140001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by yunchao.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1555523002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1555523002/160001
Thanks for your review, Zhenyao and Ken. I have updated the code to remove VertexAttribState from WebGLVertexArrayObject. PTAL again when you have time. Thanks a lot! https://codereview.chromium.org/1555523002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h (right): https://codereview.chromium.org/1555523002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h:26: class VertexAttribState final : public GarbageCollected<VertexAttribState> { On 2016/01/06 03:55:27, Ken Russell wrote: > On 2016/01/05 21:13:21, Zhenyao Mo wrote: > > Do we still need this class? Can't we just put bufferBinding as a direct > member > > of WebGLVertexArrayObjectBase? > > It looks to me like m_vertexAttribState could be changed to: > > HeapVector<Member<WebGLBuffer>> m_boundArrayBuffers; > > and yes, that this class could be removed. Thanks for your review, Zhenyao and Ken. I have tried to remove VertexAttribState, but It need some change in getVertexAttrib at that time. Please see the other comment. https://codereview.chromium.org/1555523002/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1555523002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:3482: return WebGLAny(scriptState, buffer.get()); The simplest way is to use "WebGLBuffer* buffer" to get ArrayBuffer for attrib. However, this line would treat "buffer" as "boolean" when overloading, but it treated m_boundArrayBuffer.get() as "WebGLBuffer *" when overloading,(interesting). It is not correct to return a bool to JS. I tried many methods to fix this bug today, like 1) PassRefPtr<WebGLBuffer> (It doesn't work), 2)adding a function variable in WebGLRenderingContextBase.h, say m_arrayBufferForAttrib, and trace it by the visitor(seems to be ugly). Now I found "WeakMember<WebGLBuffer>" . Seems that it is OK.
https://codereview.chromium.org/1555523002/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1555523002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:3482: return WebGLAny(scriptState, buffer.get()); On 2016/01/06 17:31:42, yunchao wrote: > The simplest way is to use "WebGLBuffer* buffer" to get ArrayBuffer for attrib. > However, this line would treat "buffer" as "boolean" when overloading, but it > treated m_boundArrayBuffer.get() as "WebGLBuffer *" when > overloading,(interesting). It is not correct to return a bool to JS. > > I tried many methods to fix this bug today, like 1) PassRefPtr<WebGLBuffer> (It > doesn't work), > 2)adding a function variable in WebGLRenderingContextBase.h, say > m_arrayBufferForAttrib, and trace it by the visitor(seems to be ugly). > > Now I found "WeakMember<WebGLBuffer>" . Seems that it is OK. Can't you just return WebGLAny(scriptState, m_boundVertexArrayObject->getArrayBufferForAttrb(index)? in getParameter(), we do the same for GL_ELEMENT_ARRAY_BUFFER_BINDING. I really can't imagine why it works there but not here.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/1555523002/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1555523002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:3482: return WebGLAny(scriptState, buffer.get()); On 2016/01/06 18:04:08, Zhenyao Mo wrote: > On 2016/01/06 17:31:42, yunchao wrote: > > The simplest way is to use "WebGLBuffer* buffer" to get ArrayBuffer for > attrib. > > However, this line would treat "buffer" as "boolean" when overloading, but it > > treated m_boundArrayBuffer.get() as "WebGLBuffer *" when > > overloading,(interesting). It is not correct to return a bool to JS. > > > > I tried many methods to fix this bug today, like 1) PassRefPtr<WebGLBuffer> > (It > > doesn't work), > > 2)adding a function variable in WebGLRenderingContextBase.h, say > > m_arrayBufferForAttrib, and trace it by the visitor(seems to be ugly). > > > > Now I found "WeakMember<WebGLBuffer>" . Seems that it is OK. > > Can't you just return WebGLAny(scriptState, > m_boundVertexArrayObject->getArrayBufferForAttrb(index)? > > in getParameter(), we do the same for GL_ELEMENT_ARRAY_BUFFER_BINDING. I really > can't imagine why it works there but not here. It should definitely be possible to do this. There's no reason the code should need to be different. The ScriptValue::createNull() code should be able to be deleted now. Using a WeakMember here is incorrect.
The CQ bit was checked by yunchao.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1555523002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1555523002/180001
Zhenyao and Ken, the code has been updated accordingly, please have a double-check. Thanks. https://codereview.chromium.org/1555523002/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1555523002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:3482: return WebGLAny(scriptState, buffer.get()); On 2016/01/06 20:53:54, Ken Russell wrote: > On 2016/01/06 18:04:08, Zhenyao Mo wrote: > > On 2016/01/06 17:31:42, yunchao wrote: > > > The simplest way is to use "WebGLBuffer* buffer" to get ArrayBuffer for > > attrib. > > > However, this line would treat "buffer" as "boolean" when overloading, but > it > > > treated m_boundArrayBuffer.get() as "WebGLBuffer *" when > > > overloading,(interesting). It is not correct to return a bool to JS. > > > > > > I tried many methods to fix this bug today, like 1) PassRefPtr<WebGLBuffer> > > (It > > > doesn't work), > > > 2)adding a function variable in WebGLRenderingContextBase.h, say > > > m_arrayBufferForAttrib, and trace it by the visitor(seems to be ugly). > > > > > > Now I found "WeakMember<WebGLBuffer>" . Seems that it is OK. > > > > Can't you just return WebGLAny(scriptState, > > m_boundVertexArrayObject->getArrayBufferForAttrb(index)? > > > > in getParameter(), we do the same for GL_ELEMENT_ARRAY_BUFFER_BINDING. I > really > > can't imagine why it works there but not here. > > It should definitely be possible to do this. There's no reason the code should > need to be different. The ScriptValue::createNull() code should be able to be > deleted now. Using a WeakMember here is incorrect. Ah... I have made a detour, and it turned out to be a wrong way.
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== WebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also removed most of the items cached in VertexAttribState in WebGLVertexArrayObjectBase. BUG=570453 ========== to ========== WebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also removed items cached in VertexAttribState in WebGLVertexArrayObjectBase. BUG=570453 ==========
The CQ bit was checked by yunchao.he@intel.com
The patchset sent to the CQ was uploaded after l-g-t-m from kbr@chromium.org Link to the patchset: https://codereview.chromium.org/1555523002/#ps180001 (title: "addressed feedbacks from Zhenyao and Ken")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1555523002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1555523002/180001
Message was sent while issue was closed.
Description was changed from ========== WebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also removed items cached in VertexAttribState in WebGLVertexArrayObjectBase. BUG=570453 ========== to ========== WebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also removed items cached in VertexAttribState in WebGLVertexArrayObjectBase. BUG=570453 ==========
Message was sent while issue was closed.
Committed patchset #8 (id:180001)
Message was sent while issue was closed.
Description was changed from ========== WebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also removed items cached in VertexAttribState in WebGLVertexArrayObjectBase. BUG=570453 ========== to ========== WebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer. This change also removed items cached in VertexAttribState in WebGLVertexArrayObjectBase. BUG=570453 Committed: https://crrev.com/ab18bc73dddce5b609a2d73239ab3874b2a5382d Cr-Commit-Position: refs/heads/master@{#368015} ==========
Message was sent while issue was closed.
Patchset 8 (id:??) landed as https://crrev.com/ab18bc73dddce5b609a2d73239ab3874b2a5382d Cr-Commit-Position: refs/heads/master@{#368015} |