WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
223757
Embiggen maximum HashTable size when not using ANGLE
https://bugs.webkit.org/show_bug.cgi?id=223757
Summary
Embiggen maximum HashTable size when not using ANGLE
Don Olmstead
Reported
2021-03-25 12:09:48 PDT
A HashMap of sh::ShaderVariable is over the limit introduced in
https://trac.webkit.org/changeset/274603/webkit
In file included from ../../Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:30: In file included from ../../Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:30: In file included from ../../Source/WebCore/platform/graphics\GraphicsContextGL.h:32: In file included from ../../Source/WebCore/platform/graphics/Image.h:30: In file included from ../../Source/WebCore/platform/graphics/DecodingOptions.h:28: In file included from ../../Source/WebCore/platform/graphics\IntSize.h:29: In file included from WTF/Headers\wtf/JSONValues.h:35: In file included from WTF/Headers\wtf/HashMap.h:25: WTF/Headers\wtf/HashTable.h:671:9: error: static_assert failed due to requirement 'sizeof(WTF::String) + sizeof(WTF::KeyValuePair<WTF::String, sh::ShaderVariable>) < 250' "Your HashTable types are too big to efficiently move when rehashing. Consider using UniqueRef instead" static_assert(sizeof(Key) + sizeof(Value) < 250, "Your HashTable types are too big to efficiently move when rehashing. Consider using UniqueRef instead"); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .... ^ ../../Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:301:63: note: in instantiation of member function 'WTF::HashMap<WTF::String, sh::ShaderVariable, WTF::DefaultHash<WTF::String>, WTF::HashTraits<WTF::String>, WTF::HashTraits<sh::ShaderVariable> >::find' requested here const auto& fragmentSymbol = fragmentEntry.varyingMap.find(symbolName);
Attachments
Patch
(2.23 KB, patch)
2021-03-25 12:30 PDT
,
Don Olmstead
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Don Olmstead
Comment 1
2021-03-25 12:30:00 PDT
Created
attachment 424267
[details]
Patch
Alex Christensen
Comment 2
2021-03-25 12:30:58 PDT
Comment on
attachment 424267
[details]
Patch Unfortunately, this is the most straightforward solution.
EWS
Comment 3
2021-03-25 13:20:52 PDT
Committed
r275053
: <
https://commits.webkit.org/r275053
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 424267
[details]
.
Radar WebKit Bug Importer
Comment 4
2021-03-25 13:21:15 PDT
<
rdar://problem/75850257
>
Sam Weinig
Comment 5
2021-03-28 18:58:03 PDT
Out of interest, what makes using a UniqueRef, as the assert suggests should be done here, not feasible?
Alex Christensen
Comment 6
2021-03-29 09:55:55 PDT
The maps that are hitting this assertion are our use of ShaderSymbolMap. The value, sh::ShaderVariable, is too big. Since sh::ShaderVariable isn't fast allocated, we can't use UniqueRef or makeUnique as they stand. Our solutions were either 1. Make sh::ShaderVariable fast allocated which would require ANGLE to use WTF 2. Use makeUniqueRefWithoutFastMallocCheck 3. This, which doesn't change existing behavior at all. Given that ports are moving away from !USE(ANGLE), we decided it would be best to just keep the status quo until that happens.
Sam Weinig
Comment 7
2021-03-29 10:08:46 PDT
(In reply to Alex Christensen from
comment #6
)
> The maps that are hitting this assertion are our use of ShaderSymbolMap. > The value, sh::ShaderVariable, is too big. Since sh::ShaderVariable isn't > fast allocated, we can't use UniqueRef or makeUnique as they stand. Our > solutions were either > > 1. Make sh::ShaderVariable fast allocated which would require ANGLE to use > WTF > 2. Use makeUniqueRefWithoutFastMallocCheck > 3. This, which doesn't change existing behavior at all. > > Given that ports are moving away from !USE(ANGLE), we decided it would be > best to just keep the status quo until that happens.
I don't understand why makeUniqueRefWithoutFastMallocCheck wouldn't be the right answer here. Having !USE(ANGLE) in the middle of HashTable seems like more invasive change.
Alex Christensen
Comment 8
2021-03-29 10:13:20 PDT
True. makeUniqueRefWithoutFastMallocCheck would be better.
Alex Christensen
Comment 9
2021-03-29 10:38:18 PDT
The best solution is to remove all the !USE(ANGLE) code, but this is just in the interim.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug