fix validation for constant blend functions#324
Merged
dhritzkiv merged 1 commit intostackgl:masterfrom Aug 12, 2025
Merged
Conversation
9e8ddd0 to
53cd2d4
Compare
Author
|
^fixing missing parentheses lint |
Member
|
Good catch. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating PR based on #323 (comment)
I think the validation for constant blend functions is currently too aggressive. In the spec its only an error to use a combination of "alpha" and "color" constants for srcRGB and dstRGB. using a constant color or alpha for both src and dst should be allowed
https://registry.khronos.org/webgl/specs/1.0/
6.13 Blending With Constant Color
In the WebGL API, constant color and constant alpha cannot be used together as source
and destination factors in the blend function. A call to blendFunc will generate an
INVALID_OPERATION error if one of the two factors is set to CONSTANT_COLOR or ONE_MINUS_CONSTANT_COLOR
and the other to CONSTANT_ALPHA or ONE_MINUS_CONSTANT_ALPHA. A call to blendFuncSeparate will generate an
INVALID_OPERATION error if srcRGB is set to CONSTANT_COLOR or ONE_MINUS_CONSTANT_COLOR and dstRGB is set to
CONSTANT_ALPHA or ONE_MINUS_CONSTANT_ALPHA or vice versa.