Blender V4.5
blender::eevee::HiZBuffer Class Reference

#include <eevee_hizbuffer.hh>

Public Member Functions

 HiZBuffer (Instance &inst, HiZData &data)
 
void set_source (GPUTexture **texture, int layer=-1)
 
void swap_layer ()
 
void set_dirty ()
 
Hierarchical-Z buffer
void sync ()
 
void update ()
 
void debug_draw (View &view, GPUFrameBuffer *view_fb)
 

Public Attributes

struct { 
 
   GPUTexture *   ref_tx_ = nullptr 
 
front 
 
struct { 
 
   GPUTexture *   ref_tx_ = nullptr 
 
back 
 

Detailed Description

Definition at line 27 of file eevee_hizbuffer.hh.

Constructor & Destructor Documentation

◆ HiZBuffer()

blender::eevee::HiZBuffer::HiZBuffer ( Instance & inst,
HiZData & data )
inline

Member Function Documentation

◆ debug_draw()

◆ set_dirty()

void blender::eevee::HiZBuffer::set_dirty ( )
inline

Tag the front buffer for update if needed.

Definition at line 93 of file eevee_hizbuffer.hh.

Referenced by blender::eevee::ForwardPipeline::render(), and swap_layer().

◆ set_source()

void blender::eevee::HiZBuffer::set_source ( GPUTexture ** texture,
int layer = -1 )
inline

Set source texture for the hiz down-sampling. Need to be called once at the start of a pipeline or view. Tag the buffer as dirty.

Definition at line 69 of file eevee_hizbuffer.hh.

References swap_layer(), and texture().

Referenced by blender::eevee::DeferredProbePipeline::render(), blender::eevee::PlanarProbePipeline::render(), and blender::eevee::ShadingView::render().

◆ swap_layer()

void blender::eevee::HiZBuffer::swap_layer ( )
inline

Swap front and back layer. Internally set front layer to be dirty. IMPORTANT: Before the second swap (and the second update) the content of the back hi-z buffer is undefined.

Definition at line 82 of file eevee_hizbuffer.hh.

References back, blender::draw::SwapChain< T, len >::current(), front, blender::draw::SwapChain< T, len >::previous(), set_dirty(), and blender::draw::SwapChain< T, len >::swap().

Referenced by blender::eevee::VolumeModule::draw_compute(), blender::eevee::DeferredLayer::render(), and set_source().

◆ sync()

void blender::eevee::HiZBuffer::sync ( )

Definition at line 16 of file eevee_hizbuffer.cc.

References blender::draw::detail::PassBase< DrawCommandBufType >::barrier(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_image(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_resources(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::math::ceil_to_multiple(), blender::eevee::DEBUG_HIZ_VALIDATION, blender::eevee::Instance::debug_mode, blender::draw::detail::PassBase< DrawCommandBufType >::dispatch(), blender::math::divide_ceil(), blender::draw::detail::PassBase< DrawCommandBufType >::draw_procedural(), DRW_STATE_BLEND_CUSTOM, DRW_STATE_WRITE_COLOR, blender::eevee::Instance::film, front, GPU_BARRIER_TEXTURE_FETCH, GPU_PRIM_TRIS, GPU_R32F, GPU_texture_mipmap_mode(), GPU_TEXTURE_USAGE_SHADER_READ, GPU_TEXTURE_USAGE_SHADER_WRITE, blender::eevee::HIZ_DEBUG, HIZ_GROUP_SIZE, HIZ_MIP_COUNT, blender::eevee::HIZ_UPDATE, blender::eevee::HIZ_UPDATE_LAYER, blender::draw::detail::Pass< DrawCommandBufType >::init(), blender::math::max(), blender::eevee::SphereProbeModule::probe_render_extent(), blender::draw::detail::PassBase< DrawCommandBufType >::push_constant(), blender::eevee::Film::render_extent_get(), blender::draw::detail::PassBase< DrawCommandBufType >::shader_set(), blender::eevee::Instance::shaders, blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant(), blender::eevee::Instance::sphere_probes, blender::draw::detail::PassBase< DrawCommandBufType >::state_set(), blender::eevee::ShaderModule::static_shader_get(), and blender::eevee::HiZData::uv_scale.

Referenced by blender::eevee::Instance::begin_sync().

◆ update()

Member Data Documentation

◆ [struct]

struct { ... } blender::eevee::HiZBuffer::back

◆ [struct]

◆ ref_tx_

GPUTexture* blender::eevee::HiZBuffer::ref_tx_ = nullptr

References to the textures in the swap-chain.

Definition at line 110 of file eevee_hizbuffer.hh.

Referenced by blender::eevee::RayTraceModule::sync().


The documentation for this class was generated from the following files: