Bug 238914 - Max Limits have been reduced
Summary: Max Limits have been reduced
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
: 239116 (view as bug list)
Depends on:
Blocks: 239116
  Show dependency treegraph
 
Reported: 2022-04-06 17:25 PDT by Dean Jackson
Modified: 2022-06-23 16:34 PDT (History)
8 users (show)

See Also:


Attachments
Patch (3.23 KB, patch)
2022-04-07 17:10 PDT, Kyle Piddington
no flags Details | Formatted Diff | Diff
Patch (4.08 KB, patch)
2022-04-07 17:32 PDT, Kyle Piddington
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2022-04-06 17:25:34 PDT
An internal reporter says:

It looks like WebGL capabilities have also changed between 15.3 and 15.4 (on MacOS + Metal, at any rate).
Iā€™m seeing GL_MAX_FRAGMENT_UNIFORM_VECTORS (and VERTEX too) drop from 1024 (15.3) to 256 (15.4) on several devices:
MacBook Pro intel
MacBook Pro radeon
MacBook Pro M1 Max
Presumably another side effect of the ANGLE bump.

(Apple folks - there is some discussion on Slack about what might have gone wrong - see radar)
Comment 1 Radar WebKit Bug Importer 2022-04-06 17:25:45 PDT
<rdar://problem/91384766>
Comment 2 Kyle Piddington 2022-04-07 17:10:19 PDT
Created attachment 456994 [details]
Patch
Comment 3 EWS Watchlist 2022-04-07 17:11:50 PDT
Note that there are important steps to take when updating ANGLE. See https://trac.webkit.org/wiki/UpdatingANGLE
Comment 4 Dean Jackson 2022-04-07 17:17:19 PDT
Comment on attachment 456994 [details]
Patch

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

> Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm:1294
> +
> +

Nit: Blank lines.
Comment 5 Kyle Piddington 2022-04-07 17:32:09 PDT
Created attachment 456997 [details]
Patch
Comment 6 Dean Jackson 2022-04-07 17:34:11 PDT
Comment on attachment 456997 [details]
Patch

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

> Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm:1286
> +            ANGLE_TRY(getBufferPool(context)->allocate(context,
> +                uniformBlock.uniformData.size(), &ptrOut, &mtlBufferOut, &offsetOut));

I'm not familiar with ANGLE but I expect you don't need to worry about deallocation?

> Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm:1288
> +            memcpy(ptrOut, uniformBlock.uniformData.data(), uniformBlock.uniformData.size());

And we don't need to worry about reading out of bounds here?
Comment 7 Kyle Piddington 2022-04-08 13:41:52 PDT
Comment on attachment 456997 [details]
Patch

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

>> Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm:1286
>> +                uniformBlock.uniformData.size(), &ptrOut, &mtlBufferOut, &offsetOut));
> 
> I'm not familiar with ANGLE but I expect you don't need to worry about deallocation?

That's correct, deallocation will happen when the buffer pool is destroyed. Any in-flight buffers can be reused.

>> Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm:1288
>> +            memcpy(ptrOut, uniformBlock.uniformData.data(), uniformBlock.uniformData.size());
> 
> And we don't need to worry about reading out of bounds here?

Also correct, ANGLE_TRY will return early if we fail to allocate a buffer of proper size.
Comment 8 Gphone 2022-04-12 21:28:31 PDT
the kDefaultUniformsMaxSize = 16 * 1024; is just one UBO buffer max size.
does it support that if i define many UBOs in one shader program each size is 16 * 1024?
Comment 9 EWS 2022-04-26 19:32:37 PDT
Committed r293494 (250027@main): <https://commits.webkit.org/250027@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456997 [details].
Comment 10 Brent Fulgham 2022-06-23 16:34:46 PDT
*** Bug 239116 has been marked as a duplicate of this bug. ***