Allow sparse color attachments and ignored FS outputs#2562
Allow sparse color attachments and ignored FS outputs#2562kainino0x merged 2 commits intogpuweb:mainfrom
Conversation
kvark
left a comment
There was a problem hiding this comment.
blocking on investigation, which wasn't done yet
|
No qualms about the API shape, assuming the group agrees this feature is feasible. @kvark: Doing a quick review of the linked issues it's not clear to me what needs to be investigated still? #1250 (comment) seems to confirm that it's technically feasible at least. |
|
Yeah I should have more clearly linked to that investigation. The behavior works on all APIs we targeted, even running with the debug layers. |
kainino0x
left a comment
There was a problem hiding this comment.
I just realized that using nullable here means both null and undefined work, which is great because I think it should mean actual sparse arrays work (don't have to explicitly specify null). OTOH I may prefer @kvark's suggestion to add a location member to these dictionaries similar to vertex attributeLocation.
Also need to update:
-
For each |colorTarget| in |descriptor|.{{GPURenderPipelineDescriptor/fragment}}.{{GPUFragmentState/targets}}:
-
In alpha-to-coverage mode, an additional alpha-to-coverage mask
of MSAA samples is generated based on the |alpha| component of the
fragment shader output value of the {{GPURenderPipelineDescriptor/fragment}}.{{GPUFragmentState/targets}}[0]. -
Definition of
colorAttachmentsshould explain how it works -
derive render targets layout from pass
kvark
left a comment
There was a problem hiding this comment.
Investigation approved:)
Considered alternative approach - not going to work out.
So we can proceed with this in principle, although @kainino0x had ideas on making the shape of the API more usable.
One last thing to address
If we want to allow a |
kainino0x
left a comment
There was a problem hiding this comment.
no further comments, happy to go with this design option
|
Sorry, I'm not going to be able to address review comments anytime soon. Can someone take over when/if the group decides to go forward with this? |
|
@Kangz I'll push to this PR and merge |
4db41e6 to
e822402
Compare
SHA: b9b28d6 Reason: push, by @kainino0x Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Ah, merging this closed 2 issues. Are they both fully resolved? #2060 in particular. |
SHA: b9b28d6 Reason: push, by @kainino0x Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: b9b28d6 Reason: push, by @kainino0x Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Yeah #2060 is fixed: there's the note, and the fragment processing description says:
Which is imprecise bit supports sparse attachments correctly. (ideally it should be a loop that says, for each attachment color, take the value if it is present, or fill with (0, 0, 0, 1)). |
Fixes #1250
Fixes #2060
Preview | Diff