summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/uninitialized-struct-from-constructor.slang
blob: e3c44dca17ff5c3e79beac23fb0201e02622ef93 (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
//TEST:SIMPLE(filecheck=CHK): -target spirv

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