Skip to content

Commit

Permalink
Metal compute tests (shader-slang#4292)
Browse files Browse the repository at this point in the history
  • Loading branch information
skallweitNV committed Jun 7, 2024
1 parent 72f10a8 commit 004fe27
Show file tree
Hide file tree
Showing 161 changed files with 236 additions and 61 deletions.
4 changes: 4 additions & 0 deletions source/core/slang-render-api-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Slang {
{ RenderApiType::Vulkan, "vk,vulkan", ""},
{ RenderApiType::D3D12, "dx12,d3d12", ""},
{ RenderApiType::D3D11, "dx11,d3d11", "hlsl,hlsl-rewrite,slang"},
{ RenderApiType::Metal, "mtl,metal", ""},
{ RenderApiType::CPU, "cpu", ""},
{ RenderApiType::CUDA, "cuda", "cuda,ptx"},
};
Expand Down Expand Up @@ -266,6 +267,9 @@ static bool _canLoadSharedLibrary(const char* libName)
#if SLANG_WINDOWS_FAMILY
case RenderApiType::OpenGl: return _canLoadSharedLibrary("opengl32");
case RenderApiType::Vulkan: return _canLoadSharedLibrary("vulkan-1") || _canLoadSharedLibrary("vk_swiftshader");
#elif SLANG_APPLE_FAMILY
case RenderApiType::Vulkan: return true;
case RenderApiType::Metal: return true;
#elif SLANG_UNIX_FAMILY
case RenderApiType::OpenGl: return true;
case RenderApiType::Vulkan: return true;
Expand Down
2 changes: 2 additions & 0 deletions source/core/slang-render-api-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum class RenderApiType
Vulkan,
D3D12,
D3D11,
Metal,
CPU,
CUDA,
CountOf,
Expand All @@ -29,6 +30,7 @@ struct RenderApiFlag
Vulkan = 1 << int(RenderApiType::Vulkan),
D3D12 = 1 << int(RenderApiType::D3D12),
D3D11 = 1 << int(RenderApiType::D3D11),
Metal = 1 << int(RenderApiType::Metal),
CPU = 1 << int(RenderApiType::CPU),
CUDA = 1 << int(RenderApiType::CUDA),
AllOf = (1 << int(RenderApiType::CountOf)) - 1 ///< All bits set
Expand Down
1 change: 1 addition & 0 deletions tests/autodiff-dstdlib/determinant.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/autodiff-dstdlib/dstdlib-mul-mat-mat.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/autodiff-dstdlib/dstdlib-mul-mat-vec.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/autodiff-dstdlib/dstdlib-mul-vec-mat.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/autodiff-dstdlib/dstdlib-sqrt.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
3 changes: 2 additions & 1 deletion tests/autodiff/custom-intrinsic.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down Expand Up @@ -118,4 +119,4 @@ void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
//outputBuffer[2] = g(dpa.p); // Expect: 1.381773
//outputBuffer[3] = __fwd_diff(g)(dpa).d; // Expect: -0.301168
}
}
}
1 change: 1 addition & 0 deletions tests/autodiff/global-param-hoisting.slang
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -output-using-type -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/autodiff/reverse-matrix-ops.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/bindings/nested-parameter-block-2.slang
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -d3d12 -use-dxil -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl
// nested-parameter-block-2.slang

struct CB
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/atomic-coerce.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 ], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;
Expand Down
3 changes: 2 additions & 1 deletion tests/bugs/buffer-swizzle-store.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT: RWTexture2D(format=R16G16_FLOAT, size=4, content = one, mipMaps = 1):name g_test
[format("rg16f")]
Expand All @@ -13,4 +14,4 @@ void computeMain( uint2 dispatchThreadID : SV_DispatchThreadID )
{
g_test[dispatchThreadID].xy = float2(0.0, 1.0);
outputBuffer[dispatchThreadID.x] = g_test[dispatchThreadID].y;
}
}
3 changes: 2 additions & 1 deletion tests/bugs/dxbc-double-problem.slang
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -output-using-type -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-dx12 -compute -use-dxil -output-using-type -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-dx12 -compute -output-using-type -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

// The problem this test shows is around handling of double with dxbc on D3D12. In that combination
// this code does not write the correct value into the first element - it appears as 0, where
Expand All @@ -27,4 +28,4 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
outputBuffer[1] = pi;
outputBuffer[2] = pi_180;
outputBuffer[3] = w;
}
}
1 change: 1 addition & 0 deletions tests/bugs/frexp-double.slang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type -render-feature double
//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -emit-spirv-directly -output-using-type -render-feature double
//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-cuda -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

// BUF: type: int32_t
// BUF-NEXT: 1
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/frexp.slang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type
//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -emit-spirv-directly -output-using-type
//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-cuda -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

// BUF: type: int32_t
// BUF-NEXT: 1
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/generic-default-matrix.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;
Expand Down
3 changes: 2 additions & 1 deletion tests/bugs/generic-groupshared.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;
Expand All @@ -26,4 +27,4 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
{
S<2> s;
outputBuffer[0] = s.doSomething();
}
}
3 changes: 2 additions & 1 deletion tests/bugs/generic-member-method.slang
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;
Expand Down Expand Up @@ -49,4 +50,4 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
Impl impl;
Nothing nothing;
outputBuffer[0] = impl.doThing(2);
}
}
1 change: 1 addition & 0 deletions tests/bugs/generic-type-duplication.slang
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

struct MyGeneric<let addOne: bool>
{
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/gh-2959.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUF): -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<uint> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/gh-3980.slang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-vk -compute -shaderobj -output-using-type -emit-spirv-directly
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cpu -compute -output-using-type
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cuda -compute -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

// Slang removes parentheses characters for the bitwise operators when they are not needed.
// DXC prints warning messages even when the expression is correct.
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/interface-type-self-ref.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;
Expand Down
3 changes: 2 additions & 1 deletion tests/bugs/mutating/buffer-write-dce.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

// Confirm that calling a mutating method to write to a buffer location doesn't
// get DCE'd.
Expand All @@ -25,4 +26,4 @@ void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
int tid = dispatchThreadID.x;
writeOutput(tid);
}
}
3 changes: 2 additions & 1 deletion tests/bugs/mutating/mutating-call-in-loop-dce.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

// Confirm that a SideEffectFree mutable method does not get DCE'd when
// it is called from within a loop.
Expand Down Expand Up @@ -37,4 +38,4 @@ void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
C c;
c.init();
outputBuffer[tid] = doSomething(c);
}
}
3 changes: 2 additions & 1 deletion tests/bugs/mutating/mutating-generic-method.slang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

// Confirm that a generic method marked `[mutating]`
// produces an `inout` parameter for `this`.
Expand Down Expand Up @@ -47,4 +48,4 @@ void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
int tid = dispatchThreadID.x;
int val = test(tid);
outputBuffer[tid] = val;
}
}
3 changes: 2 additions & 1 deletion tests/bugs/mutating/resource-specialization-inout.slang
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Bug related to resource specialization on unused resource typed fields.

//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT: Texture2D(size=4, content = one):name t2D
Texture2D t2D;
Expand Down Expand Up @@ -33,4 +34,4 @@ void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
int inputVal = tid;
int outputVal = test(inputVal);
gOutputBuffer[tid] = outputVal;
}
}
1 change: 1 addition & 0 deletions tests/bugs/negative-literal.slang
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/nested-existential-dyndispatch.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<float> outputBuffer;
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/nested-switch.slang
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//TEST(compute):COMPARE_COMPUTE: -shaderobj
//TEST(compute):COMPARE_COMPUTE:-vk -shaderobj
//TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

int test(int t, int r)
{
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/op-assignment-unify-mat.slang
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -vk
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -cpu
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<uint> outputBuffer;
Expand Down
3 changes: 2 additions & 1 deletion tests/bugs/operator-overload.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

// Tests operator overloading works in user space.

Expand Down Expand Up @@ -28,4 +29,4 @@ void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
int r = int(c.x + c.y);

outputBuffer[dispatchThreadID.x] = int(r);
}
}
3 changes: 2 additions & 1 deletion tests/bugs/specialize-existential-in-generic.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

[Specialize]
interface IAssoc
Expand Down Expand Up @@ -39,4 +40,4 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
int tid = dispatchThreadID.x;
GenType<Impl> val;
gOutputBuffer[tid] = val.doThing();
}
}
3 changes: 2 additions & 1 deletion tests/bugs/ssa-loop.slang
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Bug related to SSA form for loops

//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

int test(int val)
{
Expand All @@ -28,4 +29,4 @@ void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
int inputVal = tid;
int outputVal = test(inputVal);
gOutputBuffer[tid] = outputVal;
}
}
1 change: 1 addition & 0 deletions tests/bugs/static-method.slang
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// static-method.slang

//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

struct S
{
Expand Down
1 change: 1 addition & 0 deletions tests/bugs/texture2d-gather.hlsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(smoke):COMPARE_HLSL_RENDER:
//DISABLE_TEST(smoke):COMPARE_HLSL_RENDER:-mtl
//TEST_INPUT: Texture2D(size=16, content=chessboard, format=R32_FLOAT):name g_texture
//TEST_INPUT: Sampler :name g_sampler

Expand Down
3 changes: 2 additions & 1 deletion tests/bugs/type-legalize-bug-1.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE: -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):out,name outputBuffer
//TEST_INPUT:type_conformance A:IFoo=0
Expand Down Expand Up @@ -53,4 +54,4 @@ struct A : IFoo
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
user();
}
}
3 changes: 2 additions & 1 deletion tests/bugs/vec-compare.slang
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj
//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl

//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;
Expand Down Expand Up @@ -76,4 +77,4 @@ void computeMain(int2 pixelIndex : SV_DispatchThreadID)
}

outputBuffer[pixelIndex.x + pixelIndex.y * 4] = (coerceBits << 24) | (floatBits << 16) | (intBits << 8) | (uintBits);
}
}
Loading

0 comments on commit 004fe27

Please sign in to comment.