restir_di.wgsl
Constants
Bindings
@group(1)
@binding(0)
var
view_output:
texture_storage_2d<rgba16float, read_write>
@group(1)
@binding(2)
var<storage, read_write>
light_tile_resolved_samples:
array<ResolvedLightSamplePacked>
@group(1)
@binding(3)
var
di_reservoirs_a:
texture_storage_2d<rgba32uint, read_write>
@group(1)
@binding(4)
var
di_reservoirs_b:
texture_storage_2d<rgba32uint, read_write>
@group(1)
@binding(7)
var
gbuffer:
texture_2d<u32>
@group(1)
@binding(8)
var
depth_buffer:
texture_depth_2d
@group(1)
@binding(9)
var
motion_vectors:
texture_2d<f32>
@group(1)
@binding(10)
var
previous_gbuffer:
texture_2d<u32>
@group(1)
@binding(11)
var
previous_depth_buffer:
texture_depth_2d
Structures
struct
Reservoir
{
}
Functions
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(8, 8, 1)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(8, 8, 1)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn
load_temporal_reservoir
(
pixel_id:
vec2<u32>
,
depth:
f32
,
world_position:
vec3<f32>
,
world_normal:
vec3<f32>
)
->
NeighborInfo
fn
load_temporal_reservoir_inner
(
temporal_pixel_id:
vec2<u32>
,
depth:
f32
,
world_position:
vec3<f32>
,
world_normal:
vec3<f32>
)
->
NeighborInfo
fn
load_spatial_reservoir
(
pixel_id:
vec2<u32>
,
depth:
f32
,
world_position:
vec3<f32>
,
world_normal:
vec3<f32>
,
rng:
ptr<function, u32>
)
->
NeighborInfo
fn
merge_reservoirs
(
canonical_reservoir:
Reservoir
,
canonical_world_position:
vec3<f32>
,
canonical_world_normal:
vec3<f32>
,
canonical_diffuse_brdf:
vec3<f32>
,
other_reservoir:
Reservoir
,
other_world_position:
vec3<f32>
,
other_world_normal:
vec3<f32>
,
other_diffuse_brdf:
vec3<f32>
,
rng:
ptr<function, u32>
)
->
ReservoirMergeResult
fn
reservoir_contribution
(
reservoir:
Reservoir
,
world_position:
vec3<f32>
,
world_normal:
vec3<f32>
,
diffuse_brdf:
vec3<f32>
)
->
ReservoirContribution