From 3c2d46aa1c8575dc046d7457793e77c7a4789093 Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Tue, 11 Feb 2025 02:42:08 +0200 Subject: 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 --- docs/proposals/005-write-only-textures.md | 61 ------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 docs/proposals/005-write-only-textures.md (limited to 'docs/proposals/005-write-only-textures.md') 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` 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`. -- cgit v1.2.3