diff options
| author | Anders Leino <aleino@nvidia.com> | 2025-02-11 02:42:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-10 16:42:08 -0800 |
| commit | 3c2d46aa1c8575dc046d7457793e77c7a4789093 (patch) | |
| tree | b333f6f799b975ca4e18fadd3cec0a144d8ec082 /docs/proposals/005-write-only-textures.md | |
| parent | 133bd259c00984c6a01869f71951a7feb919463a (diff) | |
Remove the docs/proposals directory (#6313)
* Remove the docs/proposals directory
This directory will get added to the spec repository in the following PR:
https://github.com/shader-slang/spec/pull/6
This closes #6155.
* Remove entry from .github/CODEOWNERS file
* Redirect some proposal references
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'docs/proposals/005-write-only-textures.md')
| -rw-r--r-- | docs/proposals/005-write-only-textures.md | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/docs/proposals/005-write-only-textures.md b/docs/proposals/005-write-only-textures.md deleted file mode 100644 index 698ea6e86..000000000 --- a/docs/proposals/005-write-only-textures.md +++ /dev/null @@ -1,61 +0,0 @@ -SP #005: Write-Only Textures -================= - -Add Write-Only texture types to Slang's core module. - - -Status ------- - -Status: Design Review. - -Implementation: N/A - -Author: Yong He - -Reviewer: - -Background ----------- - -Slang inherits HLSL's RWTexture types to represent UAV/storage texture resources, this works well for HLSL, GLSL, CUDA and SPIRV targets. -However Metal has the notion of write only textures, and WebGPU has limited support of read-write textures. In WebGPU, a read-write texture can only have -uncompressed single-channel 32bit texel format, which means a `RWTexture2D` cannot be used to write to a `rgba8unorm` texture. - -To provide better mapping to write-only textures on Metal and WebGPU, we propose to add write-only textures to Slang to allow writing portable code -without relying on backend workarounds. - -Proposed Approach ------------------ - -Slang's core module already defines all texture types as a single generic `_Texture<T, ..., access, ...>` type, where `access` is a value parameter -representing the allowed access of the texture. The valid values of access are: - -``` -kCoreModule_ResourceAccessReadOnly -kCoreModule_ResourceAccessReadWrite -kCoreModule_ResourceAccessRasterizerOrdered -kCoreModule_ResourceAccessFeedback -``` - -We propose to add another case: - -``` -kCoreModule_ResourceAccessWriteOnly -``` - -to represent write-only textures. - - -Also add the typealiases prefixed with "W" for all write only textures: -``` -WTexture1D, WTexture2D, ... -``` - -These types will be reported in the reflection API with `access=SLANG_RESOURCE_ACCESS_WRITE`. - -Write-only textures support `GetDimension` and `Store(coord, value)` methods. `Load` or `subscript` is not defined for write-only texture types, -so the user cannot write code that reads from a write-only texture. - -Write only textures are supported on all targets. For traditional HLSL, GLSL, SPIRV and CUDA targets, they are translated -exactly the same as `RW` textures. For Metal, they map to `access::write`, and for WGSL, they map to `texture_storage_X<format, write>`. |
