Skip to content

Change RO texture usage to be restricted#1864

Closed
kvark wants to merge 3 commits intogpuweb:mainfrom
kvark:ro-texture-storage
Closed

Change RO texture usage to be restricted#1864
kvark wants to merge 3 commits intogpuweb:mainfrom
kvark:ro-texture-storage

Conversation

@kvark
Copy link
Contributor

@kvark kvark commented Jun 21, 2021

Alternative to #1794

It completely changes the semantics of RO texture bindings, so that:

  • their usage scoping is restricted, it's not compatible with SAMPLED
  • it's available only on a subset of texture formats

The idea here, which @Kangz has been trying to convey, is that RO usage is still going to be potentially useful, even with those extra restrictions. It takes a different code path from SAMPLED in the driver, changes the caching policy of obtained samples, and it can't be replaced by "read-write" because we don't have it today.


Preview | Diff

@github-actions
Copy link
Contributor

Previews, as seen when this build job started (d22ee06):
WebGPU | IDL
WGSL
Explainer

@github-actions
Copy link
Contributor

Previews, as seen when this build job started (42a5eef):
WebGPU | IDL
WGSL
Explainer

@kvark
Copy link
Contributor Author

kvark commented Jun 21, 2021

Updated the table based on FL11_0 tables (thanks @kainino0x !). It leaves only 3 formats (R32Xxx) with RO capability... which is quite useless, I'd say.

@github-actions
Copy link
Contributor

Previews, as seen when this build job started (42a6ec0):
WebGPU | IDL
WGSL
Explainer

Copy link
Contributor

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change LGTM if we decide to go this way

@kvark
Copy link
Contributor Author

kvark commented Jul 7, 2021

@kainino0x you mentioned previously that you didn't think we should go this route. If you are still feeling this way, could you try to express that point in a comment here? The next call is not soon.

@kvark
Copy link
Contributor Author

kvark commented Jul 12, 2021

Thinking about this versus #1794, I'm seeing a new concern. If we keep RO storage textures, users may be confused because of the difference in validation versus RO storage buffers. I.e. the storage buffers can be combined with other usages, but storage textures can't. This is unexpected.

@kainino0x
Copy link
Contributor

you mentioned previously that you didn't think we should go this route

I don't remember my exact feeling, but two things are on my mind:

  • We know there's theoretically some value to this feature, because it goes through different hardware paths and is likely to have rather different performance than textureLoad.
  • But if we're not that sure of the value, probably better to leave it out until we figure it out.

I do think the old RO storage textures and the new RO storage textures are sufficiently different that it makes sense to think of this as two separate changes:

  • Remove SRV RO storage textures
  • Add UAV RO storage textures

So I think from that point of view I support removing them first.

@kvark
Copy link
Contributor Author

kvark commented Jul 13, 2021

We can close this since the group agreed to just remove RO storage textures for now.

@kvark kvark closed this Jul 13, 2021
@kvark
Copy link
Contributor Author

kvark commented Jul 14, 2021

Found another small reason why RO texture storage would be marginally useful: we could allow it in VS stage, unlike read-write storage, even if for the same formats. Edit: although, the same old argument still applies: users can use a regular sampled texture there.

bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jul 14, 2021
1652: Switch read-only storage textures to be exclusive and behind a feature r=cwfitzgerald a=kvark

**Connections**
See gpuweb/gpuweb#1864 and gpuweb/gpuweb#1794

**Description**
WebGPU API doesn't have RO storage textures right now. However, since `wgpu` already had a way to expose read-write storage textures, I figured we can just use it to gate read-only storage.

**Testing**
No examples currently exercise this path.


Co-authored-by: Dzmitry Malyshau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants