yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
ae1a5e408
master
1//TEST:SIMPLE(filecheck=METAL_ERROR): -target metal -entry computeMain -stage compute 2//TEST:SIMPLE(filecheck=METALLIB): -target metallib -entry computeMain -stage compute 3// Metal currently lacks multisampled texture write support. 4// Due to this, Metal compute test is disabled 5//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUF): -slang -output-using-type -shaderobj -mtl 6//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUF): -slang -output-using-type -shaderobj -vk 7 8//METAL_ERROR: error 41402 9//METALLIB: error 41402 10 11//TEST_INPUT: RWTexture2D(format=RGBA8Sint, size=4, content = zero, sampleCount=two, mipMaps = 1):name outputTexture2DMS 12RWTexture2DMS<int4> outputTexture2DMS; 13 14//TEST_INPUT: RWTexture2D(format=RGBA8Sint, size=4, content = zero, arrayLength=2, sampleCount=two, mipMaps = 1):name outputTexture2DMSArray 15RWTexture2DMSArray<int4> outputTexture2DMSArray; 16 17//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer 18RWStructuredBuffer<uint> outputBuffer; 19 20 21[numthreads(1,1,1)] 22void computeMain() 23{ 24 25 outputTexture2DMS[0, 0].xz = int2(1,2); 26 outputTexture2DMS[int2(0, 0), 1].xz = int2(3,4); 27 28 outputTexture2DMSArray[0, 0].xz = int2(1,2); 29 outputTexture2DMSArray[int3(0, 0, 1), 1].xz = int2(3,4); 30 31 outputBuffer[0] = uint(true 32 && all(outputTexture2DMS[0, 0] == int4(1, 0, 2, 0)) == true 33 && all(outputTexture2DMS[int2(0, 0), 1] == int4(3, 0, 4, 0)) == true 34 35 && all(outputTexture2DMSArray[0, 0] == int4(1, 0, 2, 0)) == true 36 && all(outputTexture2DMSArray[int3(0, 0, 1), 1] == int4(3, 0, 4, 0)) == true 37 ); 38} 39 40//BUF: 1