Files
test2/source/blender/draw/intern/draw_defines.h
Jason Fielder 57a3ab29cc Metal: EEVEE Next: Optimize Virtual shadow maps for Apple Silicon
Optimization of EEVEE Next's Virtual Shadow Maps for TBDRs.
The core of these optimizations lie in eliminating use of
atomic shadow atlas writes and instead utilise tile memory to
perform depth accumulation as a secondary pass once all
geometry updates for a given shadow view have been updated.

This also allows use of fast on-tile depth testing/sorting, reducing
overdraw and redundant fragment operations, while also allowing
for tile indirection calculations to be offloaded into the vertex
shader to increase fragment storage efficiency and throughput.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111283
2023-10-05 19:02:39 +02:00

47 lines
1.5 KiB
C

/* SPDX-FileCopyrightText: 2022 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup draw
*
* List of defines that are shared with the GPUShaderCreateInfos. We do this to avoid
* dragging larger headers into the createInfo pipeline which would cause problems.
*/
#pragma once
/* We target hardware with at least 12 UBO slots (Guaranteed by GL 4.3). */
#define DRW_VIEW_UBO_SLOT 11
#define DRW_VIEW_CULLING_UBO_SLOT 10
#define DRW_OBJ_DATA_INFO_UBO_SLOT 9
#define DRW_OBJ_MAT_UBO_SLOT 8
#define DRW_LAYER_ATTR_UBO_SLOT 7
/* Slots 0-6 are reserved for engine use. */
/* TODO(fclem): Legacy. To be removed once we remove the old DRW. */
#define DRW_OBJ_INFOS_UBO_SLOT 6
/* TODO(fclem): Remove in favor of engine-side clipping UBO. */
#define DRW_CLIPPING_UBO_SLOT 5
/* We target hardware with at least 12 SSBO slots (NOT Guaranteed by GL 4.3). */
#define DRW_RESOURCE_ID_SLOT 11
#define DRW_OBJ_MAT_SLOT 10
#define DRW_OBJ_INFOS_SLOT 9
#define DRW_OBJ_ATTR_SLOT 8
/* Slots 0-7 are reserved for engine use. */
/* Debug SSBOs are not counted in the limit [12 - 15+]. */
#define DRW_DEBUG_PRINT_SLOT 15
#define DRW_DEBUG_DRAW_SLOT 14
#define DRW_COMMAND_GROUP_SIZE 64
#define DRW_FINALIZE_GROUP_SIZE 64
/* Must be multiple of 32. Set to 32 for shader simplicity. */
#define DRW_VISIBILITY_GROUP_SIZE 32
/**
* The maximum of indexable views is dictated by:
* - The UBO limit (16KiB) of the ViewMatrices container.
* - The maximum resource index supported for shaders using multi-view (see DRW_VIEW_SHIFT).
*/
#define DRW_VIEW_MAX 64