Blender
V5.3
source
blender
draw
engines
eevee
shaders
eevee_shadow_page_clear.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
5
#pragma once
6
7
#include "
eevee_defines.hh
"
8
#include "
eevee_shadow_shared.hh
"
9
10
namespace
eevee::shadow
{
11
12
struct
PageClear
{
13
[[
storage
(2, read)]]
const
ShadowPagesInfoData &
pages_infos_buf
;
14
[[
storage
(6, read)]]
const
uint (&
dst_coord_buf
)[SHADOW_RENDER_MAP_SIZE];
15
[[
image
(
SHADOW_ATLAS_IMG_SLOT
, read_write,
UINT_32
)]]
uimage2DArrayAtomic
shadow_atlas_img
;
16
};
17
23
[[
compute
,
local_size
(SHADOW_PAGE_CLEAR_GROUP_SIZE, SHADOW_PAGE_CLEAR_GROUP_SIZE)]]
24
void
page_clear_comp
([[
resource_table
]]
PageClear
&srt,
25
[[
global_invocation_id
]]
const
uint3
global_id)
26
{
27
/* We clear the destination pixels directly for the atomicMin technique. */
28
uint page_packed = srt.dst_coord_buf[global_id.z];
29
uint3
page_co = shadow_page_unpack(page_packed);
30
page_co.xy = page_co.xy * SHADOW_PAGE_RES + global_id.xy;
31
32
imageStoreFast
(srt.shadow_atlas_img,
int3
(page_co),
uint4
(
floatBitsToUint
(
FLT_MAX
)));
33
}
34
35
PipelineCompute
page_clear
(
page_clear_comp
);
36
37
}
// namespace eevee::shadow
eevee_defines.hh
SHADOW_ATLAS_IMG_SLOT
#define SHADOW_ATLAS_IMG_SLOT
Definition
eevee_defines.hh:269
eevee_shadow_shared.hh
UINT_32
@ UINT_32
Definition
gpu_shader_compat_cxx.hh:234
FLT_MAX
#define FLT_MAX
Definition
gpu_shader_compat_cxx.hh:166
storage
#define storage(slot, qualifiers)
Definition
gpu_shader_cxx_attribute.hh:119
image
#define image(slot, qualifiers, format)
Definition
gpu_shader_cxx_attribute.hh:121
resource_table
#define resource_table
Definition
gpu_shader_cxx_attribute.hh:128
global_invocation_id
#define global_invocation_id
Definition
gpu_shader_cxx_attribute.hh:44
compute
#define compute
Definition
gpu_shader_cxx_attribute.hh:22
local_size
#define local_size(...)
Definition
gpu_shader_cxx_attribute.hh:28
floatBitsToUint
VecBase< uint, D > floatBitsToUint(VecOp< float, D >) RET
uimage2DArrayAtomic
ImageBase< uint, 2, true, true > uimage2DArrayAtomic
Definition
gpu_shader_cxx_image.hh:109
imageStoreFast
#define imageStoreFast
Definition
gpu_shader_cxx_image.hh:48
eevee::shadow
Definition
eevee_shadow_page_allocate.bsl.hh:16
eevee::shadow::page_clear_comp
void page_clear_comp(PageClear &srt, const uint3 global_id)
Definition
eevee_shadow_page_clear.bsl.hh:24
eevee::shadow::page_clear
PipelineCompute page_clear(page_clear_comp)
PipelineCompute
Definition
gpu_shader_compat_cxx.hh:149
eevee::shadow::PageClear
Definition
eevee_shadow_page_clear.bsl.hh:12
eevee::shadow::PageClear::pages_infos_buf
const ShadowPagesInfoData & pages_infos_buf
Definition
eevee_shadow_page_clear.bsl.hh:13
eevee::shadow::PageClear::shadow_atlas_img
uimage2DArrayAtomic shadow_atlas_img
Definition
eevee_shadow_page_clear.bsl.hh:15
eevee::shadow::PageClear::dst_coord_buf
const uint(& dst_coord_buf)[SHADOW_RENDER_MAP_SIZE]
Definition
eevee_shadow_page_clear.bsl.hh:14
int3
Definition
int_vector_types.h:58
uint3
Definition
types_uint3.h:12
uint4
Definition
types_uint4.h:12
Generated on
for Blender by
doxygen
1.18.0