|
Blender V5.3
|
Namespaces | |
| namespace | usage |
Classes | |
| struct | Commands |
| struct | PageAllocator |
| struct | PageClear |
| struct | PageMask |
| struct | RendermapFinalize |
| struct | Statistics |
| struct | TagUpdate |
| struct | TilemapBounds |
| struct | TilemapBoundsCtx |
| struct | TilemapBoundsInit |
| struct | TilemapFinalize |
| struct | TilemapInit |
| struct | TileMaps |
| struct | Tiles |
| struct | VertIn |
| struct | VertOut |
| struct | ViewVisibility |
Typedefs | |
| using | PageAllocator = eevee::shadow::PageAllocator |
| using | Statistics = eevee::shadow::Statistics |
| using | TileMaps = eevee::shadow::TileMaps |
Functions | |
| void | allocate (PageAllocator &allocator, TileMaps &tilemaps, Statistics &stats, const uint3 global_id, const uint local_tile) |
| void | page_clear_comp (PageClear &srt, const uint3 global_id) |
| void | defrag (PageAllocator &allocator, Commands &cmds, Statistics &stats) |
| void | free (PageAllocator &allocator, TileMaps &tilemaps, const uint3 global_id, const uint local_tile) |
| int | shadow_tile_offset_lds (int2 tile, int lod) |
| bool | thread_mask (int2 tile_co, int lod) |
| void | mask (PageMask &srt, TileMaps &tilemaps, const uint3 global_id, const uint local_tile_index) |
| void | tag_update_vert (TagUpdate &srt, TileMaps &tilemaps, const int inst_per_tilemap_id, const VertIn &v_in, VertOut &v_out, float4 &out_position) |
| void | tag_update_frag (Tiles &tiles, TileMaps &tilemaps, const float4 frag_coord, const VertOut &v_out) |
| void | tag_propagate (Tiles &tiles, TileMaps &tilemaps, const uint3 global_id) |
| void | tilemap_bounds_clear (TilemapBoundsInit &srt, const uint3 global_id) |
| void | tilemap_bounds_min_max (TilemapBounds &srt, const uint3 global_id, const uint local_index) |
| int | viewport_select (int2 rect_size) |
| void | tilemap_finalize_main (TilemapFinalize &srt, const uint3 global_id, const uint local_index) |
| void | rendermap_finalize_main (RendermapFinalize &srt, const uint3 global_id) |
| void | tilemap_init_main (TilemapInit &srt, const uint3 global_id, const uint local_index) |
| void | comp_main (ViewVisibility &srt, const uint3 global_id) |
Virtual shadow-mapping: Allocation.
Allocates pages to tiles needing them. Note that allocation can fail, in this case the tile is left with no page.
Virtual shadow-mapping: Defragment.
Defragment the cached page buffer making one continuous array.
Also pop_front the cached pages if there is not enough free pages for the needed allocations. Here is an example of the behavior of this buffer during one update cycle:
Initial state: 5 cached pages. Buffer starts at index 2 and ends at 6. [--xxxxx---------] After page free step: 2 cached pages were removed (r), 3 pages were inserted in the cache (i). [--xrxrxiii------] After page defragment step: The buffer is compressed into only 6 pages. [----xxxxxx------]
Virtual shadow-mapping: Tile page freeing.
Releases the allocated pages held by tile-maps that have been become unused. Also reclaim cached pages if the tiles needs them. Note that we also count the number of new page allocations needed.
Virtual shadow-mapping: Usage un-tagging.
Remove used tag from masked tiles (LOD overlap) or for load balancing (reducing the number of views per shadow map).
Virtual shadow-mapping: Update tagging
Any updated shadow caster needs to tag the shadow map tiles it was in and is now into. This is done in 2 pass of this same shader. One for past object bounds and one for new object bounds. The bounding boxes are rasterized and each fragment shader invocation tags the appropriate tiles.
Virtual shadow-mapping: Bounds computation for directional shadows.
Iterate through all shadow casters and extract min/max per directional shadow. This needs to happen first in the pipeline to allow tagging all relevant tile-map as dirty if their range changes.
Virtual shadow-mapping: Setup phase for tile-maps.
Clear the usage flag. Also tag for update shifted tiles for directional shadow clip-maps. Dispatched with one local thread per LOD0 tile and one work-group per tile-map.
Compute visibility of each resource bounds for a given shadow view. Checks for shadow linking properties and issue one draw call for each view.
| using eevee::shadow::PageAllocator = eevee::shadow::PageAllocator |
Definition at line 18 of file eevee_shadow_page_allocate.bsl.hh.
| using eevee::shadow::Statistics = eevee::shadow::Statistics |
Definition at line 19 of file eevee_shadow_page_allocate.bsl.hh.
| using eevee::shadow::TileMaps = eevee::shadow::TileMaps |
Definition at line 20 of file eevee_shadow_page_allocate.bsl.hh.
| void eevee::shadow::allocate | ( | PageAllocator & | allocator, |
| TileMaps & | tilemaps, | ||
| Statistics & | stats, | ||
| const uint3 | global_id, | ||
| const uint | local_tile ) |
Definition at line 23 of file eevee_shadow_page_allocate.bsl.hh.
References allocate(), atomicAdd(), global_invocation_id, local_invocation_index, resource_table, tile, and tile_index.
Referenced by allocate().
| void eevee::shadow::comp_main | ( | ViewVisibility & | srt, |
| const uint3 | global_id ) |
Definition at line 63 of file eevee_shadow_visibility.bsl.hh.
References ViewCullingData::bound_sphere, ObjectBounds::bounding_corners, ObjectBounds::bounding_sphere, comp_main(), drw_bounds_are_valid(), draw::ViewCulling::get(), global_invocation_id, ObjectBounds::inner_sphere_radius(), draw::ViewCulling::intersect_view(), isect_box_setup(), resource_table, and shape_sphere().
Referenced by comp_main().
| void eevee::shadow::defrag | ( | PageAllocator & | allocator, |
| Commands & | cmds, | ||
| Statistics & | stats ) |
Definition at line 38 of file eevee_shadow_page_defrag.bsl.hh.
References defrag(), and resource_table.
Referenced by defrag().
| void eevee::shadow::free | ( | PageAllocator & | allocator, |
| TileMaps & | tilemaps, | ||
| const uint3 | global_id, | ||
| const uint | local_tile ) |
Definition at line 23 of file eevee_shadow_page_free.bsl.hh.
References atomicAdd(), free(), global_invocation_id, local_invocation_index, resource_table, tile, and tile_index.
Referenced by free().
| void eevee::shadow::mask | ( | PageMask & | srt, |
| TileMaps & | tilemaps, | ||
| const uint3 | global_id, | ||
| const uint | local_tile_index ) |
Definition at line 49 of file eevee_shadow_page_mask.bsl.hh.
References atomicAnd(), atomicOr(), barrier(), bitCount, findMSB, global_invocation_id, local_invocation_index, mask(), resource_table, SHADOW_TILE_AMENDED, SHADOW_TILE_MASKED, shadow_tile_offset(), shadow_tile_offset_lds(), ShadowTileDataPacked, and thread_mask().
Referenced by mask().
Virtual shadow-mapping: Page Clear.
Equivalent to a frame-buffer depth clear but only for pages pushed to the clear_page_buf.
Definition at line 24 of file eevee_shadow_page_clear.bsl.hh.
References floatBitsToUint, FLT_MAX, global_invocation_id, imageStoreFast, page_clear_comp(), and resource_table.
Referenced by page_clear_comp().
| void eevee::shadow::rendermap_finalize_main | ( | RendermapFinalize & | srt, |
| const uint3 | global_id ) |
Virtual shadow-mapping: Tile-map to render-map conversion.
For each shadow view, copy page atlas location to the indirection table before render.
Definition at line 227 of file eevee_shadow_tilemap_finalize.bsl.hh.
References all(), atomicAdd(), equal, global_invocation_id, lessThan, packUvec4x8(), rendermap_finalize_main(), resource_table, shadow_render_page_index_get(), shadow_tile_offset(), shadow_viewport_size_get(), tile, tile_index, int2::x, and int2::y.
Referenced by rendermap_finalize_main().
| int eevee::shadow::shadow_tile_offset_lds | ( | int2 | tile, |
| int | lod ) |
Definition at line 27 of file eevee_shadow_page_mask.bsl.hh.
References shadow_tile_offset(), shadow_tile_offset_lds(), and tile.
Referenced by mask(), and shadow_tile_offset_lds().
Definition at line 120 of file eevee_shadow_tag_update.bsl.hh.
References atomicOr(), global_invocation_id, resource_table, shadow_tile_offset(), tag_propagate(), tile_index, and tiles.
Referenced by tag_propagate().
| void eevee::shadow::tag_update_frag | ( | Tiles & | tiles, |
| TileMaps & | tilemaps, | ||
| const float4 | frag_coord, | ||
| const VertOut & | v_out ) |
Definition at line 103 of file eevee_shadow_tag_update.bsl.hh.
References atomicOr(), frag_coord, in, resource_table, shadow_tile_offset(), tag_update_frag(), tile_index, and tiles.
Referenced by tag_update_frag().
| void eevee::shadow::tag_update_vert | ( | TagUpdate & | srt, |
| TileMaps & | tilemaps, | ||
| const int | inst_per_tilemap_id, | ||
| const VertIn & | v_in, | ||
| VertOut & | v_out, | ||
| float4 & | out_position ) |
Definition at line 41 of file eevee_shadow_tag_update.bsl.hh.
References ObjectBounds::bounding_corners, ObjectBounds::bounding_sphere, drw_bounds_are_valid(), float, in, instance_id, max, N, NAN_FLT, normalize, out, P, position, resource_table, sign(), tag_update_vert(), transform_direction(), transform_point(), float3::x, float3::y, and float3::z.
Referenced by tag_update_vert().
| bool eevee::shadow::thread_mask | ( | int2 | tile_co, |
| int | lod ) |
Definition at line 34 of file eevee_shadow_page_mask.bsl.hh.
References all(), lessThan, and thread_mask().
Referenced by mask(), and thread_mask().
| void eevee::shadow::tilemap_bounds_clear | ( | TilemapBoundsInit & | srt, |
| const uint3 | global_id ) |
Definition at line 28 of file eevee_shadow_tilemap_bounds.bsl.hh.
References floatBitsToOrderedInt(), FLT_MAX, global_invocation_id, index, resource_table, and tilemap_bounds_clear().
Referenced by tilemap_bounds_clear().
| void eevee::shadow::tilemap_bounds_min_max | ( | TilemapBounds & | srt, |
| const uint3 | global_id, | ||
| const uint | local_index ) |
Definition at line 124 of file eevee_shadow_tilemap_bounds.bsl.hh.
References ObjectBounds::bounding_corners, eevee::shadow::TilemapBoundsCtx::box, drw_bounds_corners_are_valid(), eevee::light::foreach(), global_invocation_id, index, eevee::shadow::TilemapBoundsCtx::is_valid, eevee::shadow::TilemapBoundsCtx::local_id, local_invocation_index, min, resource_table, shape_box(), and tilemap_bounds_min_max().
Referenced by tilemap_bounds_min_max().
| void eevee::shadow::tilemap_finalize_main | ( | TilemapFinalize & | srt, |
| const uint3 | global_id, | ||
| const uint | local_index ) |
Virtual shadow-mapping: Tile-map to texture conversion.
For all visible light tile-maps, copy page coordinate to a texture. This avoids one level of indirection when evaluating shadows and allows to use a sampler instead of a SSBO bind.
Definition at line 61 of file eevee_shadow_tilemap_finalize.bsl.hh.
References all(), atomicAdd(), atomicMax(), atomicMin(), barrier(), equal, float, global_invocation_id, imageStoreFast, inverse, local_invocation_index, M_SQRT1_3, max, projection_orthographic(), projection_perspective(), resource_table, shadow_tile_coord_in_atlas(), shadow_tile_offset(), shadow_viewport_size_get(), ShadowSamplingTilePacked, ShadowTileDataPacked, tile, tile_index, tilemap_finalize_main(), viewport_index, viewport_select(), float2::x, int2::x, float2::y, and int2::y.
Referenced by tilemap_finalize_main().
| void eevee::shadow::tilemap_init_main | ( | TilemapInit & | srt, |
| const uint3 | global_id, | ||
| const uint | local_index ) |
Definition at line 50 of file eevee_shadow_tilemap_init.bsl.hh.
References all(), barrier(), clamp(), flag_test(), floatBitsToOrderedInt(), FLT_MAX, global_invocation_id, in_range_inclusive, lessThan, local_invocation_index, orderedIntBitsToFloat(), resource_table, shadow_tile_offset(), ShadowTileDataPacked, tile, and tilemap_init_main().
Referenced by tilemap_init_main().
| int eevee::shadow::viewport_select | ( | int2 | rect_size | ) |
Select the smallest viewport that can contain the given rect of tiles to render. Returns the viewport index.
Definition at line 22 of file eevee_shadow_tilemap_finalize.bsl.hh.
References findMSB, max, rect_size(), and viewport_select().
Referenced by tilemap_finalize_main(), and viewport_select().
| PipelineCompute eevee::shadow::page_allocate(allocate) | ( | allocate | ) |
| PipelineCompute eevee::shadow::page_clear(page_clear_comp) | ( | page_clear_comp | ) |
| PipelineCompute eevee::shadow::page_defrag(defrag) | ( | defrag | ) |
| PipelineCompute eevee::shadow::page_free(free) | ( | free | ) |
| PipelineCompute eevee::shadow::page_mask(mask) | ( | mask | ) |
|
staticconstexpr |
Definition at line 23 of file eevee_shadow_page_mask.bsl.hh.
Referenced by mask().
|
staticconstexpr |
Definition at line 25 of file eevee_shadow_page_mask.bsl.hh.
Referenced by mask().
| PipelineGraphic eevee::shadow::tag_update(tag_update_vert, tag_update_frag) | ( | tag_update_vert | , |
| tag_update_frag | ) |
| PipelineCompute eevee::shadow::tag_update_propagate(tag_propagate) | ( | tag_propagate | ) |
| PipelineCompute eevee::shadow::tag_usage_opaque(usage::tag_usage_opaque) | ( | usage::tag_usage_opaque | ) |
| PipelineCompute eevee::shadow::tag_usage_surfels(usage::tag_usage_surfel) | ( | usage::tag_usage_surfel | ) |
| PipelineGraphic eevee::shadow::tag_usage_transparent(usage::tag_usage_vert, usage::tag_usage_frag) | ( | usage::tag_usage_vert | , |
| usage::tag_usage_frag | ) |
| PipelineCompute eevee::shadow::tag_usage_volume(usage::tag_usage_volume) | ( | usage::tag_usage_volume | ) |
| PipelineCompute eevee::shadow::tilemap_bounds(tilemap_bounds_min_max) | ( | tilemap_bounds_min_max | ) |
| PipelineCompute eevee::shadow::tilemap_bounds_init(tilemap_bounds_clear) | ( | tilemap_bounds_clear | ) |
| PipelineCompute eevee::shadow::tilemap_finalize(eevee::shadow::tilemap_finalize_main) | ( | eevee::shadow::tilemap_finalize_main | ) |
| PipelineCompute eevee::shadow::tilemap_init(tilemap_init_main) | ( | tilemap_init_main | ) |
| PipelineCompute eevee::shadow::tilemap_rendermap(eevee::shadow::rendermap_finalize_main) | ( | eevee::shadow::rendermap_finalize_main | ) |
| PipelineCompute eevee::shadow::view_visibility(eevee::shadow::comp_main) | ( | eevee::shadow::comp_main | ) |