Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional feature dual_source_blending #4621

Merged
merged 43 commits into from
Jun 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7ee65b1
Add optional feature dual_source_blending
Jiawei-Shao May 6, 2024
ba12281
Fix
Jiawei-Shao May 6, 2024
5583b86
Add blend_src_attr.syntax.bs.include
Jiawei-Shao May 7, 2024
2d1ef2d
Update wgsl/syntax.bnf
Jiawei-Shao May 7, 2024
8619b93
dos2unix
Jiawei-Shao May 7, 2024
ba36153
Fix more wgsl include files
Jiawei-Shao May 7, 2024
e41e5f0
Improve the statements
Jiawei-Shao May 7, 2024
9c596ab
Fix
Jiawei-Shao May 7, 2024
cd5aaf6
Improve the statements
Jiawei-Shao May 7, 2024
1e5c07c
Further refactoring of the api validation
kainino0x May 8, 2024
c2c5eb4
fix typos
kainino0x May 8, 2024
43e53f1
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 8, 2024
4ca6452
Address reviewers' comments
Jiawei-Shao May 8, 2024
0b8efef
Small fix
Jiawei-Shao May 8, 2024
add28f1
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 9, 2024
94a1689
Add `Feature` column in the `GPUBlendFactor` table
Jiawei-Shao May 9, 2024
bafaa41
Address Alan's comments
Jiawei-Shao May 11, 2024
7718b21
Fix typo
Jiawei-Shao May 11, 2024
8aec9dc
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 14, 2024
7c8d300
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 16, 2024
cb35343
Sort builtins alphabetically.
Jiawei-Shao May 16, 2024
c084773
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 20, 2024
45b5c0e
Don't apply `location overlapping` rules on `blend_src` members
Jiawei-Shao May 20, 2024
fa9f445
`blend_src` can only be specified on fragment outputs
Jiawei-Shao May 20, 2024
b914f26
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 21, 2024
097aaf1
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 23, 2024
34a2eb7
Address Kai's comments
Jiawei-Shao May 23, 2024
9f4e8d7
Small fix
Jiawei-Shao May 23, 2024
939387a
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 29, 2024
df42b25
Require all the @location(0) @blend_src(N) outputs have same type
Jiawei-Shao May 29, 2024
0e2b419
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 30, 2024
c04f859
Address reviewers' comments
Jiawei-Shao May 30, 2024
0f7d944
Small fix
Jiawei-Shao May 30, 2024
3b66fbd
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao May 31, 2024
1b00d2a
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao Jun 5, 2024
775c2d4
Require `@blend_src` must be used together with `@location`
Jiawei-Shao Jun 5, 2024
66f5a8a
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao Jun 7, 2024
e3fad84
Require all the outputs with `@blend_src` have same type
Jiawei-Shao Jun 7, 2024
d5ffbb7
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao Jun 11, 2024
07cc9d7
Address reviewer's comment
Jiawei-Shao Jun 11, 2024
d0f5259
Remove tabs
Jiawei-Shao Jun 11, 2024
4bbb2fe
Merge branch 'main' into add-dual-source-blending
Jiawei-Shao Jun 12, 2024
b98a4b0
Small fixes
Jiawei-Shao Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
Jiawei-Shao committed May 7, 2024
commit 9c596ab4f2870ff08bff211b0d210433c127daae
43 changes: 23 additions & 20 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -8080,33 +8080,36 @@ dictionary GPUFragmentState
</dl>
Jiawei-Shao marked this conversation as resolved.
Show resolved Hide resolved
- If |colorState|.{{GPUColorTargetState/blend}} is [=map/exist|provided=]:
- If |colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/srcFactor}} or
|colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/dstFactor}} or
|colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/alpha}}.{{GPUBlendComponent/srcFactor}} or
|colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/alpha}}.{{GPUBlendComponent/dstFactor}}
uses source1 (is any of {{GPUBlendFactor/"src1"}}, {{GPUBlendFactor/"one-minus-src1"}},
{{GPUBlendFactor/"src1-alpha"}}, {{GPUBlendFactor/"one-minus-src1-alpha"}}), then:
- Set |UseDualSourceBlending| to `true`.
|colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/dstFactor}} or
|colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/alpha}}.{{GPUBlendComponent/srcFactor}} or
|colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/alpha}}.{{GPUBlendComponent/dstFactor}}
uses source1 (is any of {{GPUBlendFactor/"src1"}}, {{GPUBlendFactor/"one-minus-src1"}},
{{GPUBlendFactor/"src1-alpha"}}, {{GPUBlendFactor/"one-minus-src1-alpha"}}), then:
- Set |UseDualSourceBlending| to `true`.
- If |colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/srcFactor}}
or |colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/dstFactor}}
uses the source alpha (is any of {{GPUBlendFactor/"src-alpha"}},
{{GPUBlendFactor/"one-minus-src-alpha"}} or
{{GPUBlendFactor/"src-alpha-saturated"}}) and the [=blend_src=] attribute of
|output| is `0`, then:
- |output| must have an alpha channel (that is, it must be a vec4).
or |colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/dstFactor}}
uses the source alpha (is any of {{GPUBlendFactor/"src-alpha"}},
{{GPUBlendFactor/"one-minus-src-alpha"}} or
{{GPUBlendFactor/"src-alpha-saturated"}}) and the [=blend_src=] attribute of
|output| is `0`, then:
kainino0x marked this conversation as resolved.
Show resolved Hide resolved
- |output| must have an alpha channel (that is, it must be a vec4).

Otherwise, since there is no shader output for the attachment:
kainino0x marked this conversation as resolved.
Show resolved Hide resolved

- |colorState|.{{GPUColorTargetState/writeMask}} must be 0.
- If |UseDualSourceBlending| is `true`:
- All the [=shader stage output=] values of
[$get the entry point$]({{GPUShaderStage/FRAGMENT}}, |descriptor|) must have a
[=blend_src=] attribute.
[$get the entry point$]({{GPUShaderStage/FRAGMENT}}, |descriptor|) must have a
[=blend_src=] attribute.
- |descriptor|.{{GPUFragmentState/targets}}.length must be `1`.
- If |colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/srcFactor}} or
|colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/dstFactor}}
uses the source1 alpha (is any of {{GPUBlendFactor/"src1-alpha"}} or
{{GPUBlendFactor/"one-minus-src1-alpha"}}), then:
- The [=shader stage output=] value of
[$get the entry point$]({{GPUShaderStage/FRAGMENT}}, |descriptor|) with [=blend_src=]
attribute equal to `1` must have an alpha channel (that is, it must be a vec4).
|colorState|.{{GPUColorTargetState/blend}}.{{GPUBlendState/color}}.{{GPUBlendComponent/dstFactor}}
uses the source1 alpha (is any of {{GPUBlendFactor/"src1-alpha"}} or
{{GPUBlendFactor/"one-minus-src1-alpha"}}), then:
- The [=shader stage output=] value of
[$get the entry point$]({{GPUShaderStage/FRAGMENT}}, |descriptor|) with
[=blend_src=] attribute equal to `1` must have an alpha channel (that is, it
must be a vec4).
- [$Validating GPUFragmentState's color attachment bytes per sample$](|device|, |descriptor|.{{GPUFragmentState/targets}}) succeeds.
</div>

Expand Down
Loading