summaryrefslogtreecommitdiff
path: root/tests/bugs/buffer-swizzle-store.slang
blob: ca09cded9245a115b9639cd842379cefa159ccf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type

//TEST_INPUT: RWTexture2D(format=R16G16_FLOAT, size=4, content = one, mipMaps = 1):name g_test
[format("rg16f")]
RWTexture2D<float2> g_test;

//TEST_INPUT:ubuffer(data=[0], stride=4):out,name outputBuffer
RWStructuredBuffer<float> outputBuffer;

[numthreads(1,1,1)]
void computeMain( uint2 dispatchThreadID : SV_DispatchThreadID )
{
    g_test[dispatchThreadID].xy = float2(0.0, 1.0);
    outputBuffer[dispatchThreadID.x] = g_test[dispatchThreadID].y;
}