diff options
| author | Yong He <yonghe@outlook.com> | 2023-11-16 14:32:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-16 14:32:33 -0800 |
| commit | 4c78efd0c34442866f20e9d00bbb6908115c9a01 (patch) | |
| tree | 03ca8584847f0937a926f6b27386dcd982ed7780 /tests/compute | |
| parent | 12f7237e4060388494c549623f4a640327b7ca08 (diff) | |
Unify stdlib `Texture` types into one generic type. (#3327)
* Unify Texture types in stdlib into 1 generic type.
* Fixes.
* Fix.
* Fixes.
* Fix reflection.
* Fix binding reflection.
* Add gather intrinsics.
* Fix gather intrinsics.
* Fix texture type toText.
* Fix intrinsic.
* fix cuda intrinsic.
* Fix project files.
* cleanup.
* Fix.
* Fix.
* Fix sampler feedback test.
* Fix getDimension intrinsics.
* Fix spirv sample image intrinsics.
* Fix test.
* Fix GLSL intrinsic.
* Cleanup.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/compute')
| -rw-r--r-- | tests/compute/half-texture.slang | 5 | ||||
| -rw-r--r-- | tests/compute/half-texture.slang.glsl | 26 |
2 files changed, 14 insertions, 17 deletions
diff --git a/tests/compute/half-texture.slang b/tests/compute/half-texture.slang index 6f131c568..c87f4359c 100644 --- a/tests/compute/half-texture.slang +++ b/tests/compute/half-texture.slang @@ -29,8 +29,7 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) half h = halfTexture[pos2]; half2 h2 = halfTexture2[pos2]; half4 h4 = halfTexture4[pos2]; -#endif - +#endif // Store a results halfTexture[pos] = h2.x + h2.y; halfTexture2[pos] = h4.xy; @@ -38,4 +37,4 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) int index = pos.x + pos.y * 4; outputBuffer[index] = index; -}
\ No newline at end of file +} diff --git a/tests/compute/half-texture.slang.glsl b/tests/compute/half-texture.slang.glsl index 16ff4d6e1..5e273234d 100644 --- a/tests/compute/half-texture.slang.glsl +++ b/tests/compute/half-texture.slang.glsl @@ -26,25 +26,23 @@ void main() { ivec2 pos_0 = ivec2(gl_GlobalInvocationID.xy); - int _S2 = pos_0.y; + int _S1 = pos_0.y; - int _S3 = pos_0.x; + int _S2 = pos_0.x; - uvec2 _S4 = uvec2(ivec2(3 - _S2, 3 - _S3)); + ivec2 _S3 = ivec2(uvec2(ivec2(3 - _S1, 3 - _S2))); - float16_t h_0 = (float16_t(imageLoad((halfTexture_0), ivec2((_S4))).x)); - f16vec2 h2_0 = (f16vec2(imageLoad((halfTexture2_0), ivec2((_S4))).xy)); - f16vec4 h4_0 = (f16vec4(imageLoad((halfTexture4_0), ivec2((_S4))))); + float16_t _S4 = (float16_t(imageLoad((halfTexture_0), (_S3)).x)); + f16vec2 _S5 = (f16vec2(imageLoad((halfTexture2_0), (_S3)).xy)); + f16vec4 _S6 = (f16vec4(imageLoad((halfTexture4_0), (_S3)))); + ivec2 _S7 = ivec2(uvec2(pos_0)); + imageStore((halfTexture_0), (_S7), f16vec4(_S5.x + _S5.y, float16_t(0), float16_t(0), float16_t(0))); + imageStore((halfTexture2_0), (_S7), f16vec4(_S6.xy, float16_t(0), float16_t(0))); + imageStore((halfTexture4_0), (_S7), f16vec4(_S5, _S4, _S4)); - uvec2 _S5 = uvec2(pos_0); - - imageStore((halfTexture_0), ivec2((_S5)), f16vec4(h2_0.x + h2_0.y, float16_t(0), float16_t(0), float16_t(0))); - imageStore((halfTexture2_0), ivec2((_S5)), f16vec4(h4_0.xy, float16_t(0), float16_t(0))); - imageStore((halfTexture4_0), ivec2((_S5)), f16vec4(h2_0, h_0, h_0)); - - int index_0 = _S3 + _S2 * 4; - ((outputBuffer_0)._data[(uint(index_0))]) = index_0; + int index_0 = _S2 + _S1 * 4; + outputBuffer_0._data[uint(index_0)] = index_0; return; } |
