diff --git a/tests/hlsl-intrinsic/texture/partial-resident-texture-combined.slang b/tests/hlsl-intrinsic/texture/partial-resident-texture-combined.slang index 018f220f2b6..2281118b751 100644 --- a/tests/hlsl-intrinsic/texture/partial-resident-texture-combined.slang +++ b/tests/hlsl-intrinsic/texture/partial-resident-texture-combined.slang @@ -37,7 +37,7 @@ Sampler1DArray st1DArray_f32v4; //TEST_INPUT: TextureSampler2D(size=4, content = one, arrayLength=2):name st2DArray_f32v4 Sampler2DArray st2DArray_f32v4; -//TEST_INPUT: TextureSampler2D(size=4, content = one):name st2DMS_f32v4 +//TEST_INPUT: TextureSampler2D(size=4, content = one, sampleCount = two, mipMaps=1, format=RGBA32Float):name st2DMS_f32v4 Sampler2DMS st2DMS_f32v4; // @@ -71,9 +71,9 @@ typealias CombinedDepth2d_array = _Texture< >; -//TEST_INPUT: TextureSampler2D(size=4, content = zero):name cd2D +//TEST_INPUT: TextureSampler2D(size=4, content = zero, format=D32Float):name cd2D CombinedDepth2d cd2D; -//TEST_INPUT: TextureSampler2D(size=4, content = zero, arrayLength=2):name cd2DArray +//TEST_INPUT: TextureSampler2D(size=4, content = zero, arrayLength=2, format=D32Float):name cd2DArray CombinedDepth2d_array cd2DArray; uint getNotMapped() diff --git a/tests/hlsl-intrinsic/texture/partial-resident-texture.slang b/tests/hlsl-intrinsic/texture/partial-resident-texture.slang index edf67ddc114..2997463afb4 100644 --- a/tests/hlsl-intrinsic/texture/partial-resident-texture.slang +++ b/tests/hlsl-intrinsic/texture/partial-resident-texture.slang @@ -48,7 +48,7 @@ Texture2DArray t2DArray_f32v4; //TEST_INPUT: TextureCube(size=4, content = one, arrayLength=2):name tCubeArray_f32v4 TextureCubeArray tCubeArray_f32v4; -//TEST_INPUT: Texture2D(size=4, content = one):name t2DMS_f32v4 +//TEST_INPUT: Texture2D(size=4, content = one, format=RGBA32Float, sampleCount=two):name t2DMS_f32v4 Texture2DMS t2DMS_f32v4; // @@ -106,9 +106,9 @@ typealias depthcube_array = _Texture< format >; -//TEST_INPUT: Texture2D(size=4, content = zero):name d2D +//TEST_INPUT: Texture2D(size=4, content = zero, format=D32Float):name d2D depth2d d2D; -//TEST_INPUT: Texture2D(size=4, content = zero, arrayLength=2):name d2DArray +//TEST_INPUT: Texture2D(size=4, content = zero, arrayLength=2, format=D32Float):name d2DArray depth2d_array d2DArray; uint getNotMapped() @@ -235,6 +235,7 @@ bool TEST_load( int3 iuvs = int3(iuv, sampleIndex); return true + && (status = getNotMapped(), all(TN(T(1)) == t2DMS.Load(iuv, sampleIndex, offset, status))) && CheckAccessFullyMapped(status) && (status = getNotMapped(), all(TN(T(1)) == t2D.Load(iuvs, offset, status))) && CheckAccessFullyMapped(status) // SPIRV does not support sparse buffer loads. diff --git a/tests/hlsl-intrinsic/texture/texture-intrinsics.slang b/tests/hlsl-intrinsic/texture/texture-intrinsics.slang index 60b616a7f90..a848353a199 100644 --- a/tests/hlsl-intrinsic/texture/texture-intrinsics.slang +++ b/tests/hlsl-intrinsic/texture/texture-intrinsics.slang @@ -5,25 +5,34 @@ //TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=VK):-vk -emit-spirv-directly -compute -shaderobj -output-using-type -render-feature hardware-device -xslang -DVK //DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-cuda -compute -shaderobj -output-using-type -//TEST_INPUT: Texture1D(size=4, content = one):name t1D +//TEST_INPUT: Texture1D(size=4, format=D32Float, content = one):name t1D Texture1D t1D; -//TEST_INPUT: Texture2D(size=4, content = one):name t2D +//TEST_INPUT: Texture2D(size=4, format=D32Float, content = one):name t2D Texture2D t2D; -//TEST_INPUT: Texture3D(size=4, content = one):name t3D +//TEST_INPUT: Texture3D(size=4, format=D32Float, content = one):name t3D Texture3D t3D; -//TEST_INPUT: TextureCube(size=4, content = one):name tCube +//TEST_INPUT: TextureCube(size=4, format=D32Float, content = one):name tCube TextureCube tCube; -//TEST_INPUT: Texture1D(size=4, content = one, arrayLength=2):name t1DArray +//TEST_INPUT: Texture1D(size=4, format=D32Float, content = one, arrayLength=2):name t1DArray Texture1DArray t1DArray; -//TEST_INPUT: Texture2D(size=4, content = one, arrayLength=2):name t2DArray +//TEST_INPUT: Texture2D(size=4, format=D32Float, content = one, arrayLength=2):name t2DArray Texture2DArray t2DArray; -//TEST_INPUT: TextureCube(size=4, content = one, arrayLength=2):name tCubeArray +//TEST_INPUT: TextureCube(size=4, format=D32Float, content = one, arrayLength=2):name tCubeArray TextureCubeArray tCubeArray; +//TEST_INPUT: Texture2D(size=4, content = one):name t2D_RGBA +Texture2D t2D_RGBA; +//TEST_INPUT: Texture2D(size=4, content = one, arrayLength=2):name t2DArray_RGBA +Texture2DArray t2DArray_RGBA; +//TEST_INPUT: TextureCube(size=4, content = one):name tCube_RGBA +TextureCube tCube_RGBA; +//TEST_INPUT: TextureCube(size=4, content = one, arrayLength=2):name tCubeArray_RGBA +TextureCubeArray tCubeArray_RGBA; + //TEST_INPUT: Sampler:name samplerState SamplerState samplerState; -//TEST_INPUT: Sampler:name shadowSampler +//TEST_INPUT: Sampler(depthCompare):name shadowSampler SamplerComparisonState shadowSampler; @@ -83,6 +92,7 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) float Object.SampleCmpLevelZero() */ // NOTE: These are having issues with vulkan (glsl) + // SampleCmpLevelZero() requires format with VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT. val += t1D.SampleCmpLevelZero(shadowSampler, u, 0); val += t2D.SampleCmpLevelZero(shadowSampler, float2(u, u), 0); val += t1DArray.SampleCmpLevelZero(shadowSampler, float2(u, u), 0); @@ -96,7 +106,8 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) // TextureCube does not have an offset version of this // Status variant -#if !defined(VK) + #if !defined(VK) + val += t1D.SampleCmpLevelZero(shadowSampler, u, 0, 0, status); val += t2D.SampleCmpLevelZero(shadowSampler, float2(u, u), 0, int2(0, 0), status); @@ -268,44 +279,44 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) /*