diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-07-10 10:55:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-10 10:55:07 -0700 |
| commit | 59343c18928e476b7949a8700c5a792820da8656 (patch) | |
| tree | d4dfd04c760cfa8c7b24b929ce0a64c793945821 /tests | |
| parent | 4a247244715e35872ab2359e9bc7cd55b5ea27d4 (diff) | |
Support status argument for GatherXXX (#4490)
* Support status argument for GatherXXX
This commit adds an argument to all texture GatherXXX functions.
The new argument is for "status" as described in SM5.0 definision.
Close #4466
Limit Gather with status to HLSL
Exclude Gather-status test from VK
* Fix capability errors
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hlsl-intrinsic/texture/texture-intrinsics.slang | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/tests/hlsl-intrinsic/texture/texture-intrinsics.slang b/tests/hlsl-intrinsic/texture/texture-intrinsics.slang index 09b7c30fb..8ae3b2fda 100644 --- a/tests/hlsl-intrinsic/texture/texture-intrinsics.slang +++ b/tests/hlsl-intrinsic/texture/texture-intrinsics.slang @@ -43,6 +43,8 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) uint numLevels = 0, elements = 0; float fnumLevels = 0.0f, felements = 0.0f; + uint status; + /* <Template Type> Object.SampleLevel() */ @@ -244,6 +246,28 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) f4 = t2DArray.Gather(samplerState, float3(u, u, 0), int2(0, 0)); val += f4.x; val += f4.y; val += f4.z; val += f4.w; + // Object.GatherGreen() + f4 = t2D.GatherGreen(samplerState, float2(u, u), int2(1, 2)); + val += f4.x; val += f4.y; val += f4.z; val += f4.w; + + f4 = t2D.GatherGreen(samplerState, float2(u, u), int2(1, 2), int2(3, 4), int2(5, 6), int2(7, 8)); + val += f4.x; val += f4.y; val += f4.z; val += f4.w; + + f4 = tCubeArray.GatherGreen(samplerState, float4(1.5, 1.5, 1.5, 1.5)); + val += f4.x; val += f4.y; val += f4.z; val += f4.w; + + // status variant +#if !defined(VK) + f4 = t2D.GatherGreen(samplerState, float2(u, u), int2(1, 2), status); + val += f4.x; val += f4.y; val += f4.z; val += f4.w; + + f4 = t2D.GatherGreen(samplerState, float2(u, u), int2(1, 2), int2(3, 4), int2(5, 6), int2(7, 8), status); + val += f4.x; val += f4.y; val += f4.z; val += f4.w; + + f4 = tCubeArray.GatherGreen(samplerState, float4(1.5, 1.5, 1.5, 1.5), status); + val += f4.x; val += f4.y; val += f4.z; val += f4.w; +#endif + /* ret Object.Load() */ @@ -289,15 +313,15 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) // DX11: 313 // DX11: 313 // DX11: 313 -// DX12: 316 -// DX12: 316 -// DX12: 316 -// DX12: 316 -// DX12CS6: 339 -// DX12CS6: 339 -// DX12CS6: 339 -// DX12CS6: 339 -// VK: 339 -// VK: 339 -// VK: 339 -// VK: 339
\ No newline at end of file +// DX12: 340 +// DX12: 340 +// DX12: 340 +// DX12: 340 +// DX12CS6: 363 +// DX12CS6: 363 +// DX12CS6: 363 +// DX12CS6: 363 +// VK: 351 +// VK: 351 +// VK: 351 +// VK: 351 |
