RESOLVED FIXED 52833
shaderSource needs to preserve original source
https://bugs.webkit.org/show_bug.cgi?id=52833
Summary shaderSource needs to preserve original source
Kenneth Russell
Reported 2011-01-20 12:45:16 PST
After the removal of comments implemented in bug 52390, shaderSource needs to preserve the original source so that it can be returned from getShaderSource.
Attachments
Patch (14.42 KB, patch)
2011-01-26 14:04 PST, Zhenyao Mo
no flags
Patch (7.08 KB, patch)
2011-01-26 17:27 PST, Zhenyao Mo
kbr: review+
Zhenyao Mo
Comment 1 2011-01-26 14:04:30 PST
Zhenyao Mo
Comment 2 2011-01-26 14:09:06 PST
Note that shader source is cached in both WebGLRenderingContext (before comments removal) and GraphicsContext3D (before ANGLE). In this patch the cached copy in GraphicsContext3D is released once the shader is compiled. ASSERT_NOT_REACHED() is added in this level for getShaderSource() and getShaderiv(SHADER_SOURCE_LENGTH). This is under the assumption that WebGLRenderingContext is the only place that calls these two functions. Will need to do the same in chromium two ports to reduce memory usage.
Kenneth Russell
Comment 3 2011-01-26 14:41:33 PST
Comment on attachment 80232 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=80232&action=review > Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:1220 > + ASSERT_NOT_REACHED(); WebGLRenderingContext isn't the only client of this code; for example, the accelerated 2D canvas code may go through it, and Chromium's accelerated compositor is built on top of GraphicsContext3D. Please restore this functionality. The required (slightly redundant) caches are negligible as shaders are tiny. I don't think any changes are needed in the Chromium port either. We really just need the additional caching to preserve any Unicode characters in comments for WebGL content. > Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:1257 > + ASSERT_NOT_REACHED(); Same here.
Zhenyao Mo
Comment 4 2011-01-26 17:27:19 PST
Zhenyao Mo
Comment 5 2011-01-26 17:31:12 PST
One question: how do we count the length if shader source is not all UTF8? String::length() count a UTF16 char as 1. However, do we want to count it as 2?
Kenneth Russell
Comment 6 2011-01-26 17:59:09 PST
(In reply to comment #5) > One question: how do we count the length if shader source is not all UTF8? > > String::length() count a UTF16 char as 1. However, do we want to count it as 2? That's a good question. I think the queries of the shader source length and info log length are useless in this API, since the queries of the logs return DOMStrings. Do you want to raise that on the working group email list?
Kenneth Russell
Comment 7 2011-01-27 10:45:18 PST
Comment on attachment 80276 [details] Patch The code changes look fine. Thanks for raising the issue of removing the useless query of shader source length on the WebGL working group list.
Zhenyao Mo
Comment 8 2011-01-27 10:59:18 PST
Note You need to log in before you can comment on or make changes to this bug.