#version 460
#extension GL_EXT_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 accelerationStructureEXT as;
layout(location = 0) rayPayloadEXT Payload payload2;
layout(location = 1) rayPayloadEXT float payload1;
layout(location = 2) rayPayloadEXT 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);
    traceRayEXT(as, 0u, 255u, 0u, 1u, 0u, origin, 0.0, direction, 1000.0, 0);
    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);
    traceRayEXT(as, 0u, 255u, 0u, 1u, 0u, origin, 0.0, direction, 1000.0, 1);
    vec4 result = vec4(payload1);
    vec4 _62 = trace_in_function();
    result += _62;
    traceRayEXT(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_LaunchIDEXT.xy), result);
}

