18 int2 render_extent = inst_.film.render_extent_get();
19 int2 probe_extent =
int2(inst_.sphere_probes.probe_render_extent());
26 for ([[maybe_unused]]
const int i :
IndexRange(hiz_tx_.size())) {
27 hiz_tx_.current().ensure_2d(
28 gpu::TextureFormat::SFLOAT_32, hiz_extent, usage,
nullptr,
HIZ_MIP_COUNT);
29 hiz_tx_.current().ensure_mip_views();
34 data_.uv_scale =
float2(render_extent) /
float2(hiz_extent);
38 bool update_mip_0 =
true;
46 pass.
bind_ssbo(
"finished_tile_counter", atomic_tile_counter_);
49 pass.
bind_image(
"out_mip_0", &hiz_mip_ref_[0]);
50 pass.
bind_image(
"out_mip_1", &hiz_mip_ref_[1]);
51 pass.
bind_image(
"out_mip_2", &hiz_mip_ref_[2]);
52 pass.
bind_image(
"out_mip_3", &hiz_mip_ref_[3]);
53 pass.
bind_image(
"out_mip_4", &hiz_mip_ref_[4]);
54 pass.
bind_image(
"out_mip_5", &hiz_mip_ref_[5]);
55 pass.
bind_image(
"out_mip_6", &hiz_mip_ref_[6]);
65 pass.
bind_ssbo(
"finished_tile_counter", atomic_tile_counter_);
68 pass.
bind_image(
"out_mip_0", &hiz_mip_ref_[0]);
69 pass.
bind_image(
"out_mip_1", &hiz_mip_ref_[1]);
70 pass.
bind_image(
"out_mip_2", &hiz_mip_ref_[2]);
71 pass.
bind_image(
"out_mip_3", &hiz_mip_ref_[3]);
72 pass.
bind_image(
"out_mip_4", &hiz_mip_ref_[4]);
73 pass.
bind_image(
"out_mip_5", &hiz_mip_ref_[5]);
74 pass.
bind_image(
"out_mip_6", &hiz_mip_ref_[6]);
81 debug_draw_ps_.init();
83 debug_draw_ps_.shader_set(inst_.shaders.static_shader_get(
HIZ_DEBUG));
84 debug_draw_ps_.bind_resources(this->
front);
95 src_tx_ = *src_tx_ptr_;
97 hiz_mip_ref_[
i] = hiz_tx_.current().mip_view(
i);
100 if (layer_id_ == -1) {
101 inst_.manager->submit(hiz_update_ps_);
104 inst_.manager->submit(hiz_update_layer_ps_);
114 "Debug Mode: HiZ Validation\n"
115 " - Red: pixel in front of HiZ tile value.\n"
116 " - Blue: No error.");
117 inst_.hiz_buffer.update();
119 inst_.manager->submit(debug_draw_ps_,
view);
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
@ GPU_BARRIER_TEXTURE_FETCH
void GPU_texture_mipmap_mode(blender::gpu::Texture *texture, bool use_mipmap, bool use_filter)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
void shader_set(gpu::Shader *shader)
void bind_texture(const char *name, gpu::Texture *texture, GPUSamplerState state=sampler_auto)
void specialize_constant(gpu::Shader *shader, const char *name, const float &data)
void bind_image(const char *name, gpu::Texture *image)
void dispatch(int group_len)
void barrier(GPUBarrier type)
void push_constant(const char *name, const float &data)
void bind_ssbo(const char *name, gpu::StorageBuf *buffer)
void debug_draw(View &view, gpu::FrameBuffer *view_fb)
struct blender::eevee::HiZBuffer::@312272073133116306117315271010160007344264367302 front
detail::Pass< command::DrawCommandBuf > PassSimple
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