Hash :
f0f65290
Author :
Date :
2024-09-10T15:30:30
Translator: Add check for atomic counter offset
For GLSL shaders, atomic counter offset should not exceed the
maximum atomic counter buffer size. This issue was seen on a dEQP
test when increasing the LimitToInt() limitation from INT_MAX/2
to INT_MAX+1 or INT_MAX.
* Added check to the translator to make sure the offset does not
go beyond the max atomic counter buffer size.
* Packed the existing checks into a single function.
* (checkAtomicCounterOffsetIsValid())
* Added mMaxAtomicCounterBufferSize to TParseContext for the check.
* Also added the related cap (maxShaderStorageBlockSize) for D3D11.
* Increased the limitation in LimitToInt() to (INT_MAX / 2 + 1).
* Added test based on dEQP test that failed on some platforms as
a result of updating said limitation.
* From KHR-GLES31.core.shader_atomic_counters.negative-large-offset
Bug: angleproject:361369308
Change-Id: Id6128c75e12445b2a0029f4a2eb2bdb379cad48d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5851650
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>