|
Toast Engine
|
Farthest depth pyramid where level k texel t covers pixels t << (k + 1) to ((t + 1) << (k + 1)) - 1. More...
#include <hiz_pyramid.hpp>
Public Member Functions | |
| void | create (const VulkanCore &core, vk::ImageView depth, vk::Extent2D depth_extent) |
| After a wait for idle since an in flight frame may still read the previous pyramid. | |
| void | record (vk::CommandBuffer cmd, vk::Extent2D scene_extent, const glm::mat4 &view_projection) |
Depth in depth_sampled and only its top left scene_extent is reduced. | |
| void | beforeRead (sync::BarrierBatch &barriers) |
| Earlier writes land before a compute shader samples view(). | |
| auto | isReady () const -> bool |
| view() can be bound without it but only a ready pyramid is ever built | |
| auto | view () const -> vk::ImageView |
| Every level in eShaderReadOnlyOptimal once recorded. | |
| auto | sampler () const -> vk::Sampler |
| auto | builtExtent () const -> vk::Extent2D |
| What the last record() covered and saw with zero levels before the first one. | |
| auto | builtLevels () const -> uint32_t |
| auto | builtViewProjection () const -> const glm::mat4 & |
Static Public Member Functions | |
| static auto | levelCount (vk::Extent2D extent) -> uint32_t |
| Levels until the scene extent halves down to one texel. | |
Static Public Attributes | |
| static constexpr uint32_t | k_max_levels = 13 |
| Mirrors hiz_reduce.slang kMaxLevels so level 0 reaches 4096 texels. | |
Farthest depth pyramid where level k texel t covers pixels t << (k + 1) to ((t + 1) << (k + 1)) - 1.