#version 460
#extension GL_NV_ray_tracing : require

struct Payload
{
    float a;
    float b;
};

struct Block
{
    float a;
    float b;
    Payload c;
    Payload d;
};

layout(set = 0, binding = 1) uniform accelerationStructureNV as;
layout(location = 1) rayPayloadNV Payload payload2;
layout(location = 0) rayPayloadNV float payload1;
layout(location = 2) rayPayloadNV Block _71;
layout(set = 0, binding = 0, rgba8) uniform writeonly image2D image;

vec4 trace_in_function()
{
    vec4 result = vec4(0.0);
    vec3 origin = vec3(1.0, 0.0, 0.0);
    vec3 direction = vec3(0.0, 1.0, 0.0);
    traceNV(as, 0u, 255u, 0u, 1u, 0u, origin, 0.0, direction, 1000.0, 1);
    result += vec4(payload2.a);
    result += vec4(payload2.b);
    return result;
}

void main()
{
    vec3 origin = vec3(1.0, 0.0, 0.0);
    vec3 direction = vec3(0.0, 1.0, 0.0);
    traceNV(as, 0u, 255u, 0u, 1u, 0u, origin, 0.0, direction, 1000.0, 0);
    vec4 result = vec4(payload1);
    vec4 _62 = trace_in_function();
    result += _62;
    traceNV(as, 0u, 255u, 0u, 1u, 0u, origin, 0.0, direction, 1000.0, 2);
    result += vec4(((((_71.a + _71.b) + _71.c.a) + _71.c.b) + _71.d.a) + _71.d.b);
    imageStore(image, ivec2(gl_LaunchIDNV.xy), result);
}

