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

Spec allows resolveTarget to be 3d but doesn't allow selecting a depth slice #4600

Open
kainino0x opened this issue Apr 24, 2024 · 2 comments
Labels
api resolved Resolved - waiting for a change to the API specification api WebGPU API bug needs-cts-issue This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet
Milestone

Comments

@kainino0x
Copy link
Contributor

In #4254 we allowed view to be 3d and added depthSlice to select which slice of view to render to.

However the change to allow 3d views in the "renderable texture views" algorithm also applies to resolveTarget. So the spec now says resolveTarget can be 3d, but there is no way to select a depth slice of it.

3d textures cannot be multisampled, but there is one scenario in which this matters: view is 2d multisampled, and resolveTarget is 3d. I do not know if this is actually possible, but the spec seems to allow it.

There are several options here depending on what the backends can support:

  • Disallow resolveTarget from being 3d
  • Similarly, require view and resolveTarget to have the same dimensionality, then this scenario doesn't work
    • (but it could be an issue later if 3d textures become multisample-able)
  • Add a resolveTargetDepthSlice

cc @haoxli

@kainino0x kainino0x added the needs investigation Requires an investigation into implementation constraints label Apr 24, 2024
@kainino0x kainino0x added this to the Milestone 1 milestone Apr 24, 2024
@kainino0x kainino0x added the api WebGPU API label Apr 30, 2024
@magcius
Copy link

magcius commented May 2, 2024

I imagine resolving directly into a 3D texture is something that's relatively untested on most devices, especially on mobile devices and tilers where I would expect resolveTo matters the most. Making the user do their own copy (resolve 2DMS -> 2D, and then use copyTextureToTexture to copy 2D -> 3D slice) seems fine.

@kainino0x kainino0x added api resolved Resolved - waiting for a change to the API specification bug labels May 8, 2024
haoxli added a commit to haoxli/gpuweb that referenced this issue May 13, 2024
Fixes gpuweb#4607, gpuweb#4600
- Allow 2d-array texture view as renderable texture view
- Disable 3d texture view used in render target
haoxli added a commit that referenced this issue May 14, 2024
Fixes #4607, #4600
- Allow 2d-array texture view as renderable texture view
- Disallow 3d texture view used in resolve target
@Kangz
Copy link
Contributor

Kangz commented May 14, 2024

GPU Web WG 2024-05-08 Pacific-time
  • KN: (summary)
  • HL: Not sure if any motivation for a 2d multisampled render target with a 3d resolve target.
  • KG: Jasper and others’ instinct is that this may not work well. There are most likely devices we want to target that would have bugs here. Would want to be cautious about adding this feature, test carefully. So disallow for now.
  • (No objections)
  • Consensus: Disallow 3d textures in resolveTarget.
  • HL: Once we allow 2d array textures in view, want to allow it in resolveTarget?
  • KG: I expect that 2d arrays would work fine here, because that’s what VR would do normally. It’s just that 3d is unlikely to work well enough on already-deployed devices.
  • KN: Require resolveTarget to be 2d for now (as the spec bugfix) and then allow 2d-array when allowed as part of Allow 2d-array texture view as renderable texture view #4607?
  • KG: As long as end state allows 2d-array in both places.
  • MM: Who will do the analysis to find out if 3d works?
    • KN: Honestly don’t think it’s important enough anyone needs to investigate it yet.
    • KG: “Investigations welcome” though.

@kainino0x kainino0x added needs-cts-issue This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet and removed needs investigation Requires an investigation into implementation constraints labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api resolved Resolved - waiting for a change to the API specification api WebGPU API bug needs-cts-issue This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet
Projects
None yet
Development

No branches or pull requests

3 participants