#[compute] #version 450 VERSION_DEFINES layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; #ifdef MODE_RESOLVE_GI layout(set = 0, binding = 0) uniform sampler2DMS source_depth; layout(set = 0, binding = 1) uniform sampler2DMS source_normal_roughness; layout(r32f, set = 1, binding = 0) uniform restrict writeonly image2D dest_depth; layout(rgba8, set = 1, binding = 1) uniform restrict writeonly image2D dest_normal_roughness; #ifdef GIPROBE_RESOLVE layout(set = 2, binding = 0) uniform usampler2DMS source_giprobe; layout(rg8ui, set = 3, binding = 0) uniform restrict writeonly uimage2D dest_giprobe; #endif #endif layout(push_constant, binding = 16, std430) uniform Params { ivec2 screen_size; int sample_count; uint pad; } params; void main() { // Pixel being shaded ivec2 pos = ivec2(gl_GlobalInvocationID.xy); if (any(greaterThanEqual(pos, params.screen_size))) { //too large, do nothing return; } #ifdef MODE_RESOLVE_GI float best_depth = 1e20; vec4 best_normal_roughness = vec4(0.0); #ifdef GIPROBE_RESOLVE uvec2 best_giprobe; #endif #if 0 for(int i=0;i