summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/struct-field-initializers/struct-field-initializer-shadowed-member.slang
blob: c2b95d5b359e26c769740d2fcc6c7ab739ede777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain 
//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -emit-spirv-directly
//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-cpu -compute -entry computeMain
//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-dx12 -compute -entry computeMain

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

struct TextureHandle
{
    uint32_t packedData = 0;
    __init(uint32_t packedData) { this.packedData = packedData; }
};

[numthreads(1, 1, 1)]
void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
{
    TextureHandle texHandle = TextureHandle(1);
    // BUF: 1
    outputBuffer[0] = true
        && texHandle.packedData == 1
        ;
}