KhronosGroup / KhronosGroup/WebGL
Define behavior of uniform blocks with not enough storage bound
- Dominant language
- HTML
- Stars
- 2.9k
- Forks
- 703
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
In #1829 it was discovered that if there is an active uniform block in a shader and it has a buffer bound to it that isn't large enough to cover it, or if there is no buffer bound, the behavior is undefined. Per section 2.12.6 "Uniform variables" in the ES 3.0.4 spec:
"If any active uniform block is not backed by a sufficiently large buffer object, the results of shader execution are undefined, and may result in GL interruption or termination."
This is unfortunate, and will have to be addressed in the WebGL 2.0 spec before shipment. My first instinct is to generate an INVALID_OPERATION error for draw calls with programs that have active uniform blocks which don't have sufficient storage bound to them. KHR_robust_buffer_access_behavior probably defines this situation well enough to write a conformance test for it (i.e., fetches of the uniforms that go beyond the end of the storage return the zero value), but this can't be the only defined behavior in WebGL 2.0; it would be impossible to emulate this behavior when KHR_robust_buffer_access_behavior isn't present.
Contributor guide
Research direction
No source file or test is named. Start by reviewing the WebGL 2.0 specification and ES 3.0.4 section 2.12.6, then compare the proposed error behavior with KHR_robust_buffer_access_behavior. Done means the handling of undersized or missing uniform-block storage is defined for WebGL 2.0 and can be covered by a conformance test.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100