Remove the read-only texture storage bindings#1794
Conversation
spec/index.bs
Outdated
| const GPUFlagsConstant SAMPLED = 0x04; | ||
| const GPUFlagsConstant STORAGE = 0x08; | ||
| const GPUFlagsConstant SHADER_READ = 0x04; | ||
| const GPUFlagsConstant SHADER_WRITE = 0x08; |
There was a problem hiding this comment.
This means I can have a texture with only SHADER_WRITE that's bound to a var t : [[access(read)]] texture_storage_2d<r32float>?
There was a problem hiding this comment.
RO storage textures are removed from WGSL as well, so you can't have that
There was a problem hiding this comment.
Weird, so we'll have write, read_write in the future (with potentially coercions between them) but not read?
There was a problem hiding this comment.
Would you need SHADER_READ | SHADER_WRITE for read_write, or just SHADER_WRITE? If the latter, maybe SHADER_READ/SHADER_READWRITE?
There was a problem hiding this comment.
Never mind, I see you addressed this while I was writing the comment :)
There was a problem hiding this comment.
@Kangz correct, yes. Slightly weird for people coming from GLSL/Vulkan (not for anybody else), but I think it's ok.
@kainino0x we talked about this on office hours earlier today, and concluded that STORAGE needs to be the name for the mutable usage, still, instead of SHADER_WRITE. So once read-write is added, it's still in STORAGE usage, and it's less confusing.
|
This PR is doing a bit too many things at the same time, we should discuss the removal of |
|
Renaming the texture usages would be plain wrong if RO storage textures is still a thing. Keeping the old names would make little sense if the RO storage textures are gone. |
|
Following up on the discussion from the meeting yesterday. There are two reasons why I think we shouldn't remove readonly storage texture:
If we decide to keep readonly storage texture, then we'll need to make sure they can be used as UAV in D3D12, so we'll need to change the "internal usages" to have different usages for readonly storage buffers / textures. My suggestion is to set all texture storage usages (readwrite, readonly or writeonly) as "storage" and allowed to be used together, but I'd be ok fine with having readonly-storage be its own thing. As a side-note: the "storage-write" internal usage doesn't seem useful at the moment, since its compatible usage list is fully included in the "storage" internal usage. |
|
Want to stress on something I said during the last call. We aren't keeping the current r/o storage texture semantics. We are either changing it into the new semantic that maps to D3D12's UAV, or removing it. I believe a good investigation is in order before we can consider it. For example, loading from D3D12's UAVs requires the "UAV Typed Load" capability, which is the same as what we'll require for read-write storage textures. This means, effectively, that at least on D3D12 the set of texture formats supporting the newly suggested r/o storage semantics is the same as the future r/w storage. In this case, r/o storage brings no benefit: the only advantage versus r/w is being available on more formats, which isn't the case for D3D12. With this in mind, I think we should proceed with removing the current semantics, and then follow-up with an investigation and a proposal, just like for any other new feature being discussed. |
|
I'm not sure this is worth debating this change more until we have read-write storage textures, especially since like you said @kvark there's limited D3D12 formats that can be written through UAVs. It's unfortunate that we'll remove them to add them back (at least that's my belief) but we have more important topics now. |
|
Resolved: Remove current read-only storage textures (since we have to), and don't add the new ones yet, pending developer requests. |
Co-authored-by: Kai Ninomiya <[email protected]>
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]>
|
Did we mean to rename |
|
@Kangz we didn't want to keep SAMPLED for sure. If I understand your concern, once we have read-write or the new read-only storages, then people are going to be confused about SHADER_READ. What are the other options to name it? |
This was used in the old FP testing framework and is no longer used. It wasn't flagged as deadcode since the unittests referenced it, and I missed my TODO comments. Fixes gpuweb#1794
Closes #1785
I think, it's another case of: if you have trouble naming something, then it's not a naming problem, it's an architecture problem. So in this case, the confusion is resolved by removing one of the ambiguous variants, and aligning the naming accordingly (
SHADER_READ/SHADER_WRITEusages).Preview | Diff