Bug 214116 - Implement uniform* and getUniform for WebGL 2 types
Summary: Implement uniform* and getUniform for WebGL 2 types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: James Darpinian
URL:
Keywords: InRadar
Depends on:
Blocks: 126404 126938
  Show dependency treegraph
 
Reported: 2020-07-08 17:59 PDT by James Darpinian
Modified: 2020-07-14 17:48 PDT (History)
12 users (show)

See Also:


Attachments
Patch (50.58 KB, patch)
2020-07-08 18:01 PDT, James Darpinian
no flags Details | Formatted Diff | Diff
fix gtk build and rebaseline tests (57.25 KB, patch)
2020-07-09 17:05 PDT, James Darpinian
no flags Details | Formatted Diff | Diff
rebase (57.30 KB, patch)
2020-07-10 14:57 PDT, James Darpinian
no flags Details | Formatted Diff | Diff
review feedback (61.82 KB, patch)
2020-07-13 17:38 PDT, James Darpinian
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Darpinian 2020-07-08 17:59:52 PDT
Implement uniform* and getUniform for WebGL 2 types
Comment 1 James Darpinian 2020-07-08 18:01:10 PDT
Created attachment 403830 [details]
Patch
Comment 2 James Darpinian 2020-07-09 17:05:39 PDT
Created attachment 403933 [details]
fix gtk build and rebaseline tests
Comment 3 James Darpinian 2020-07-10 14:57:55 PDT
Created attachment 404005 [details]
rebase
Comment 4 Kenneth Russell 2020-07-10 15:08:07 PDT
Comment on attachment 404005 [details]
rebase

View in context: https://bugs.webkit.org/attachment.cgi?id=404005&action=review

Great work James. LGTM - I don't have reviewer privileges.

> Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:1285
> +    if (location->program() != m_currentProgram) {

Maybe we should add a bool validateUniformLocation(WebGLUniformLocation*, const char* functionName).
Comment 5 Dean Jackson 2020-07-10 18:05:27 PDT
Comment on attachment 404005 [details]
rebase

View in context: https://bugs.webkit.org/attachment.cgi?id=404005&action=review

>> Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:1285
>> +    if (location->program() != m_currentProgram) {
> 
> Maybe we should add a bool validateUniformLocation(WebGLUniformLocation*, const char* functionName).

Agreed.

> Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:1329
> +    m_context->uniform1uiv(location->location(), value.data(), srcOffset, srcLength ? srcLength : (value.length() - srcOffset) / 1);

Maybe remove the "/1"?

Also, do we need to validate the case where srcLength is 0 and srcOffset is > value.length?

> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3409
> +            // Can't handle this type

Nit: End with a .

> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3471
> +            // Can't handle this type

Nit: end with a .

> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:6900
> +    GCGLsizei actualSize = size - srcOffset;
> +    if (srcLength > 0) {
> +        if (srcLength > static_cast<GCGLuint>(actualSize)) {
> +            synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "invalid srcOffset + srcLength");
> +            return false;
> +        }
> +        actualSize = srcLength;

Oh, you did it here :)

> Source/WebCore/platform/graphics/GraphicsContextGL.h:1026
> +    virtual void getUniformuiv(PlatformGLObject program, GCGLint location, GCGLuint* value) = 0;

Huh. I wonder how I missed this.
Comment 6 Kenneth Russell 2020-07-13 14:58:34 PDT
Comment on attachment 404005 [details]
rebase

View in context: https://bugs.webkit.org/attachment.cgi?id=404005&action=review

>> Source/WebCore/platform/graphics/GraphicsContextGL.h:1026
>> +    virtual void getUniformuiv(PlatformGLObject program, GCGLint location, GCGLuint* value) = 0;
> 
> Huh. I wonder how I missed this.

Unsigned integer uniforms are new in WebGL 2.0 and this patch is the first one referencing them.
Comment 7 James Darpinian 2020-07-13 17:38:40 PDT
Created attachment 404195 [details]
review feedback
Comment 8 James Darpinian 2020-07-13 22:54:11 PDT
Comment on attachment 404195 [details]
review feedback

All review feedback addressed. Thanks!
Comment 9 EWS 2020-07-14 12:59:05 PDT
Committed r264371: <https://trac.webkit.org/changeset/264371>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404195 [details].
Comment 10 Radar WebKit Bug Importer 2020-07-14 13:00:18 PDT
<rdar://problem/65559641>