Blender V5.3
eevee_shadow_page_defrag.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
20
21#pragma once
22
25
26namespace eevee::shadow {
27
31
32struct Commands {
33 [[storage(5, write)]] DispatchCommand &clear_dispatch_buf;
34 [[storage(6, write)]] DrawCommandArray &tile_draw_buf;
35};
36
37[[compute, local_size(1)]]
39 [[resource_table]] Commands &cmds,
40 [[resource_table]] Statistics &stats)
41{
42 allocator.defrag();
43
44 /* Stats. */
45 stats.statistics_buf.page_used_count = 0;
46 stats.statistics_buf.page_update_count = 0;
47 stats.statistics_buf.page_allocated_count = 0;
48 stats.statistics_buf.page_rendered_count = 0;
49 stats.statistics_buf.view_needed_count = 0;
50
51 /* Reset clear command indirect buffer. */
52 cmds.clear_dispatch_buf.num_groups_x = SHADOW_PAGE_RES / SHADOW_PAGE_CLEAR_GROUP_SIZE;
53 cmds.clear_dispatch_buf.num_groups_y = SHADOW_PAGE_RES / SHADOW_PAGE_CLEAR_GROUP_SIZE;
54 cmds.clear_dispatch_buf.num_groups_z = 0;
55
56 /* Reset TBDR command indirect buffer. */
57 cmds.tile_draw_buf.vertex_len = 0u;
58 cmds.tile_draw_buf.instance_len = 1u;
59 cmds.tile_draw_buf.vertex_first = 0u;
60 cmds.tile_draw_buf.instance_first = 0u;
61}
62
64
65} // namespace eevee::shadow
#define storage(slot, qualifiers)
#define resource_table
#define compute
#define local_size(...)
eevee::shadow::Statistics Statistics
eevee::shadow::TileMaps TileMaps
void defrag(PageAllocator &allocator, Commands &cmds, Statistics &stats)
eevee::shadow::PageAllocator PageAllocator
PipelineCompute page_defrag(defrag)