28 for ([[maybe_unused]]
const int i :
IndexRange(hiz_tx_.size())) {
30 hiz_tx_.current().ensure_mip_views();
39 bool update_mip_0 =
true;
45 pass.specialize_constant(sh,
"update_mip_0", update_mip_0);
47 pass.bind_ssbo(
"finished_tile_counter", atomic_tile_counter_);
49 pass.bind_texture(
"depth_tx", &src_tx_,
with_filter);
50 pass.bind_image(
"out_mip_0", &hiz_mip_ref_[0]);
51 pass.bind_image(
"out_mip_1", &hiz_mip_ref_[1]);
52 pass.bind_image(
"out_mip_2", &hiz_mip_ref_[2]);
53 pass.bind_image(
"out_mip_3", &hiz_mip_ref_[3]);
54 pass.bind_image(
"out_mip_4", &hiz_mip_ref_[4]);
55 pass.bind_image(
"out_mip_5", &hiz_mip_ref_[5]);
56 pass.bind_image(
"out_mip_6", &hiz_mip_ref_[6]);
57 pass.dispatch(
int3(dispatch_size, 1));
64 pass.specialize_constant(sh,
"update_mip_0", update_mip_0);
66 pass.bind_ssbo(
"finished_tile_counter", atomic_tile_counter_);
68 pass.bind_texture(
"depth_layered_tx", &src_tx_,
with_filter);
69 pass.bind_image(
"out_mip_0", &hiz_mip_ref_[0]);
70 pass.bind_image(
"out_mip_1", &hiz_mip_ref_[1]);
71 pass.bind_image(
"out_mip_2", &hiz_mip_ref_[2]);
72 pass.bind_image(
"out_mip_3", &hiz_mip_ref_[3]);
73 pass.bind_image(
"out_mip_4", &hiz_mip_ref_[4]);
74 pass.bind_image(
"out_mip_5", &hiz_mip_ref_[5]);
75 pass.bind_image(
"out_mip_6", &hiz_mip_ref_[6]);
76 pass.push_constant(
"layer_id", &layer_id_);
77 pass.dispatch(
int3(dispatch_size, 1));
82 debug_draw_ps_.
init();
96 src_tx_ = *src_tx_ptr_;
98 hiz_mip_ref_[i] = hiz_tx_.current().mip_view(i);
101 if (layer_id_ == -1) {
115 "Debug Mode: HiZ Validation\n"
116 " - Red: pixel in front of HiZ tile value.\n"
117 " - Blue: No error.");
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
@ GPU_BARRIER_TEXTURE_FETCH
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
void GPU_texture_mipmap_mode(GPUTexture *texture, bool use_mipmap, bool use_filter)
struct GPUShader GPUShader
void submit(PassSimple &pass, View &view)
void bind_resources(U &resources)
void draw_procedural(GPUPrimType primitive, uint instance_len, uint vertex_len, uint vertex_first=-1, ResourceHandle handle={0}, uint custom_id=0)
void state_set(DRWState state, int clip_plane_count=0)
void shader_set(GPUShader *shader)
int2 render_extent_get() const
void debug_draw(View &view, GPUFrameBuffer *view_fb)
struct blender::eevee::HiZBuffer::@195 front
SphereProbeModule sphere_probes
void info_append(const char *msg, Args &&...args)
GPUShader * static_shader_get(eShaderType shader_type)
int probe_render_extent() const
constexpr GPUSamplerState with_filter
VecBase< T, Size > divide_ceil(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
VecBase< T, Size > ceil_to_multiple(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
T max(const T &a, const T &b)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< int32_t, 3 > int3