On Tue May 2 18:44:06 2023 +0000, Nikolay Sivov wrote:
What would you call a sampler type for RWBuffer<> or RWStructuredBuffer<>, or append/consume ones ? What do you mean by SRV form?
A d3d10/11 SRV ("shader resource view") is one way of exposing resources to a shader read-only. These resources can be buffers or textures. Textures are accessed via HLSL's Texture1D, Texture2D, etc. types. Buffers are accessed via HLSL's Buffer, StructuredBuffer, ByteAddressBuffer types. Almost all SRV types correspond with a UAV type, by adding "RW" to the front of the type name.
We use HLSL_TYPE_TEXTURE for texture SRVs, and I think we should probably continue to use it for buffer SRVs. The naming is perhaps questionable and could be adjusted accordingly (though on the other hand, GL calls the equivalent feature a "buffer texture"). Similarly, "sampler_dim" is not a great name given that buffers can't be sampled, we could change that to "resource_dim" or something.