|
Blender V4.3
|
#include <eevee_shadow.hh>
Public Member Functions | |
Tile map pool | |
| ShadowTileMapPool () | |
| ShadowTileMap * | acquire () |
| void | release (Span< ShadowTileMap * > free_list) |
| void | end_sync (ShadowModule &module) |
Public Attributes | |
| Vector< uint > | free_indices |
| Pool< ShadowTileMap > | tilemap_pool |
| ShadowTileMapDataBuf | tilemaps_data = {"tilemaps_data"} |
| ShadowTileMapDataBuf | tilemaps_unused = {"tilemaps_unused"} |
| ShadowTileDataBuf | tiles_data = {"tiles_data"} |
| ShadowTileMapClipBuf | tilemaps_clip = {"tilemaps_clip"} |
| Texture | tilemap_tx = {"tilemap_tx"} |
| int64_t | last_free_len = 0 |
Static Public Attributes | |
| static constexpr int64_t | maps_per_row = SHADOW_TILEMAP_PER_ROW |
The tile-maps are managed on CPU and associated with each light shadow object.
The number of tile-maps & tiles is unbounded (to the limit of SSBOs), but the actual number used for rendering is caped to 4096. This is to simplify tile-maps management on CPU.
At sync end, all tile-maps are grouped by light inside the ShadowTileMapDataBuf so that each light has a contiguous range of tile-maps to refer to.
Definition at line 128 of file eevee_shadow.hh.
| blender::eevee::ShadowTileMapPool::ShadowTileMapPool | ( | ) |
Definition at line 144 of file eevee_shadow.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::draw::Texture::clear(), blender::draw::Texture::ensure_2d(), free_indices, GPU_R32UI, GPU_TEXTURE_USAGE_ATTACHMENT, GPU_TEXTURE_USAGE_SHADER_READ, GPU_TEXTURE_USAGE_SHADER_WRITE, maps_per_row, min_ii(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), SHADOW_MAX_TILEMAP, SHADOW_TILEDATA_PER_TILEMAP, blender::eevee::ShadowTileMap::tile_map_resolution, and tilemap_tx.
| ShadowTileMap * blender::eevee::ShadowTileMapPool::acquire | ( | ) |
Definition at line 162 of file eevee_shadow.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), free_indices, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::Vector< T, InlineBufferCapacity, Allocator >::pop_last(), SHADOW_MAX_TILEMAP, SHADOW_TILEDATA_PER_TILEMAP, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and tilemap_pool.
Referenced by blender::eevee::ShadowDirectional::end_sync(), and blender::eevee::ShadowPunctual::end_sync().
| void blender::eevee::ShadowTileMapPool::end_sync | ( | ShadowModule & | module | ) |
Definition at line 182 of file eevee_shadow.cc.
References blender::draw::StorageVectorBuffer< T, len >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), blender::draw::StorageVectorBuffer< T, len >::clear(), blender::eevee::ShadowTileMapData::clip_data_index, free_indices, blender::eevee::ShadowTileMapData::grid_shift, last_free_len, blender::eevee::ShadowTileMapData::projection_type, blender::draw::detail::StorageCommon< T, len, device_only >::push_update(), blender::draw::StorageArrayBuffer< T, len, device_only >::resize(), blender::eevee::SHADOW_PROJECTION_CUBEFACE, SHADOW_TILEDATA_PER_TILEMAP, SHADOW_TILEMAP_RES, blender::draw::StorageArrayBuffer< T, len, device_only >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), tilemap_pool, tilemaps_clip, tilemaps_data, tilemaps_unused, tiles_data, and blender::eevee::ShadowTileMapData::tiles_index.
Referenced by blender::eevee::ShadowModule::end_sync().
| void blender::eevee::ShadowTileMapPool::release | ( | Span< ShadowTileMap * > | free_list | ) |
Push the given list of ShadowTileMap onto the free stack. Their pages will be free.
Definition at line 174 of file eevee_shadow.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), free_indices, and tilemap_pool.
Referenced by blender::eevee::ShadowDirectional::release_excess_tilemaps(), blender::eevee::ShadowPunctual::release_excess_tilemaps(), blender::eevee::ShadowDirectional::~ShadowDirectional(), and blender::eevee::ShadowPunctual::~ShadowPunctual().
Vector containing available offset to tile range in the ShadowTileDataBuf.
Definition at line 134 of file eevee_shadow.hh.
Referenced by acquire(), end_sync(), release(), and ShadowTileMapPool().
| int64_t blender::eevee::ShadowTileMapPool::last_free_len = 0 |
Number of free tile-maps at the end of the previous sync.
Definition at line 148 of file eevee_shadow.hh.
Referenced by end_sync().
|
staticconstexpr |
Limit the width of the texture.
Definition at line 131 of file eevee_shadow.hh.
Referenced by ShadowTileMapPool().
| Pool<ShadowTileMap> blender::eevee::ShadowTileMapPool::tilemap_pool |
Pool containing shadow tile structure on CPU.
Definition at line 136 of file eevee_shadow.hh.
Referenced by acquire(), end_sync(), and release().
| Texture blender::eevee::ShadowTileMapPool::tilemap_tx = {"tilemap_tx"} |
Texture equivalent of ShadowTileDataBuf but grouped by light.
Definition at line 146 of file eevee_shadow.hh.
Referenced by blender::eevee::ShadowModule::bind_resources(), blender::eevee::ShadowModule::end_sync(), and ShadowTileMapPool().
| ShadowTileMapClipBuf blender::eevee::ShadowTileMapPool::tilemaps_clip = {"tilemaps_clip"} |
Clip range for directional shadows. Updated on GPU. Persistent.
Definition at line 144 of file eevee_shadow.hh.
Referenced by blender::eevee::ShadowModule::end_sync(), and end_sync().
| ShadowTileMapDataBuf blender::eevee::ShadowTileMapPool::tilemaps_data = {"tilemaps_data"} |
Sorted descriptions for each tile-map in the pool. Updated each frame.
Definition at line 138 of file eevee_shadow.hh.
Referenced by blender::eevee::ShadowModule::begin_sync(), blender::eevee::ShadowModule::debug_end_sync(), blender::eevee::ShadowDirectional::end_sync(), blender::eevee::ShadowModule::end_sync(), blender::eevee::ShadowPunctual::end_sync(), and end_sync().
| ShadowTileMapDataBuf blender::eevee::ShadowTileMapPool::tilemaps_unused = {"tilemaps_unused"} |
Previously used tile-maps that needs to release their tiles/pages. Updated each frame.
Definition at line 140 of file eevee_shadow.hh.
Referenced by blender::eevee::ShadowModule::end_sync(), and end_sync().
| ShadowTileDataBuf blender::eevee::ShadowTileMapPool::tiles_data = {"tiles_data"} |
All possible tiles. A range of tiles tile is referenced by a tile-map.
Definition at line 142 of file eevee_shadow.hh.
Referenced by blender::eevee::ShadowModule::begin_sync(), blender::eevee::ShadowModule::debug_end_sync(), blender::eevee::ShadowModule::end_sync(), and end_sync().