diff options
| author | Yong He <yonghe@outlook.com> | 2024-05-16 10:43:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-16 10:43:49 -0700 |
| commit | 725735a87b9d223c2afc83bbd049055b1e44a976 (patch) | |
| tree | 225f381774fb9b5209007ae7fc455a14f57a6fe6 /tests/hlsl | |
| parent | 0a6180299352d7a2ec850004564c7a95b37a41c4 (diff) | |
RasterizerOrder resource for spirv and metal. (#4175)
* RasterizerOrder resource for spirv and metal.
Also fixes the byte address buffer logic for metal.
* Fix.
* Delete commented lines.
---------
Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
Diffstat (limited to 'tests/hlsl')
| -rw-r--r-- | tests/hlsl/raster-order-resource.slang | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/hlsl/raster-order-resource.slang b/tests/hlsl/raster-order-resource.slang new file mode 100644 index 000000000..2db9f31dc --- /dev/null +++ b/tests/hlsl/raster-order-resource.slang @@ -0,0 +1,50 @@ +//TEST:SIMPLE(filecheck=SPIRV): -target spirv -fvk-use-entrypoint-name +//TEST:SIMPLE(filecheck=METAL): -target metal +//TEST:SIMPLE(filecheck=METALASM): -target metallib + + +// METAL-DAG: {{.*}}{{\[\[}}raster_order_group(0){{\]\]}} {{\[\[}}buffer(0) +// METAL-DAG: {{.*}}{{\[\[}}raster_order_group(0){{\]\]}} {{\[\[}}texture(0) +// METAL-DAG: {{.*}}{{\[\[}}raster_order_group(0){{\]\]}} {{\[\[}}buffer(1) + +// METALASM: @fragMain + +RasterizerOrderedByteAddressBuffer buffer; + +[shader("fragment")] +float4 fragMain() : SV_Target +{ + // SPIRV: %fragMain_0 = OpFunction + // SPIRV: OpBeginInvocationInterlockEXT + // SPIRV: OpEndInvocationInterlockEXT + + buffer.Store(0, 0x12345678); + return float4(1, 0, 0, 1); +} + +RasterizerOrderedTexture2D tex; + +[shader("fragment")] +float4 fragMain2() : SV_Target +{ + // SPIRV: %fragMain2_0 = OpFunction + // SPIRV: OpBeginInvocationInterlockEXT + // SPIRV: OpEndInvocationInterlockEXT + + tex[uint2(0, 0)] = float4(1, 0, 0, 1); + return float4(1, 0, 0, 1); +} + +RasterizerOrderedStructuredBuffer<float> buffer2; + +[shader("fragment")] +float4 fragMain3() : SV_Target +{ + // SPIRV: %fragMain3_0 = OpFunction + // SPIRV: OpBeginInvocationInterlockEXT + // SPIRV: OpEndInvocationInterlockEXT + + buffer2[0] = 1; + return float4(1, 0, 0, 1); +} + |
