From 5c672cef1f6ac6b5cd6cd71bd47489b7b7331adb Mon Sep 17 00:00:00 2001 From: "Sami Kiminki (NVIDIA)" <235843927+skiminki-nv@users.noreply.github.com> Date: Fri, 10 Oct 2025 19:39:13 +0300 Subject: 8503 wgsl depth texture (#8645) Add built-in type aliases for DepthTexture* and unify Sampler*Shadow Add the following type aliases: - DepthTexture1D, DepthTexture1DArray - DepthTexture2D, DepthTexture2DArray - DepthTexture2DMS, DepthTexture2DMSArray - DepthTexture3D - DepthTextureCube, DepthTextureCubeArray These match with the type aliases for non-depth textures. Also, unify the Sampler*Shadow type aliases with DepthTexture* ones. This adds the following: - Sampler2DMSShadow - Sampler2DMSArrayShadow and removes the Sampler3DArrayShadow type alias. As a side-effect, the descriptions of Sampler*ArrayShadow type aliases are fixed ("texture-sampler for shadow" ==> "texture-sampler array for shadow"). Update the slang tests to use the newly introduced type aliases instead of the custom type aliases that use _Texture<> directly. Add DepthTexture testing in hlsl-intrinsic/texture/texture-intrinsics. Do this by extracting the test logic of computeMain() in a separate function and parametrize it for non-depth/depth texture types. This adds basic coverage for the following types: - DepthTexture1D - DepthTexture2D - DepthTexture3D - DepthTextureCube - DepthTexture1DArray - DepthTexture2DArray - DepthTextureCubeArray Issue #6166 Issue #8503 --- tests/wgsl/texture-sampler-less.slang | 60 +++-------------------------------- 1 file changed, 4 insertions(+), 56 deletions(-) (limited to 'tests/wgsl/texture-sampler-less.slang') diff --git a/tests/wgsl/texture-sampler-less.slang b/tests/wgsl/texture-sampler-less.slang index 7868a9bcf..7048714b8 100644 --- a/tests/wgsl/texture-sampler-less.slang +++ b/tests/wgsl/texture-sampler-less.slang @@ -43,66 +43,14 @@ Sampler2DArray t2DArray_f32v4; //TEST_INPUT: TextureSamplerCube(size=4, content = zero, arrayLength=2):name tCubeArray_f32v4 SamplerCubeArray tCubeArray_f32v4; -__generic -typealias CombinedDepth2d = _Texture< - T, - __Shape2D, - 0, // isArray - 0, // isMS - sampleCount, - 0, // access - 1, // isShadow - 1, // isCombined - format ->; - -__generic -typealias CombinedDepth2d_array = _Texture< - T, - __Shape2D, - 1, // isArray - 0, // isMS - sampleCount, - 0, // access - 1, // isShadow - 1, // isCombined - format ->; - -__generic -typealias CombinedDepthcube = _Texture< - T, - __ShapeCube, - 0, // isArray - 0, // isMS - sampleCount, - 0, // access - 1, // isShadow - 1, // isCombined - format ->; - -__generic -typealias CombinedDepthcube_array = _Texture< - T, - __ShapeCube, - 1, // isArray - 0, // isMS - sampleCount, - 0, // access - 1, // isShadow - 1, // isCombined - format ->; - //TEST_INPUT: TextureSampler2D(size=4, content = zero):name d2D -CombinedDepth2d d2D; +Sampler2DShadow d2D; //TEST_INPUT: TextureSamplerCube(size=4, content = zero):name dCube -CombinedDepthcube dCube; +SamplerCubeShadow dCube; //TEST_INPUT: TextureSampler2D(size=4, content = zero, arrayLength=2):name d2DArray -CombinedDepth2d_array d2DArray; +Sampler2DArrayShadow d2DArray; //TEST_INPUT: TextureSamplerCube(size=4, content = zero, arrayLength=2):name dCubeArray -CombinedDepthcube_array dCubeArray; +SamplerCubeArrayShadow dCubeArray; //TEST_INPUT: ubuffer(data=[0], stride=4):out,name outputBuffer RWStructuredBuffer outputBuffer; -- cgit v1.2.3