summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/uninitialized-struct-from-constructor.slang
blob: a422ac765078ba5332d8f81d04867e2fffe3feeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//TEST:SIMPLE(filecheck=CHK): -target spirv -entry computeMain

struct TangentSpace
{
    static const float3 localNormal = {0, 1, 0};

    float4x4 tangentTransform;
    float3 geometryNormal;
	
    __init(in float3 normal, in float3 inRay)
    {
        // Should not warn here
        tangentTransform = getMatrix(normal, inRay);
        geometryNormal = localNormal;
    }

    float4x4 getMatrix(in float3 normal, in float3 inRay)
    {
        return float4x4(0.0f);
    }
}

//CHK-NOT: warning 41020
//CHK-NOT: warning 41021

[Shader("compute")]
[NumThreads(4, 1, 1)]
void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
}