EEVEE: HiZ Buffer Allocation #117502

Merged
Jeroen Bakker merged 1 commits from Jeroen-Bakker/blender:eevee/fix/117444 into main 2024-01-26 12:06:51 +01:00
3 changed files with 15 additions and 1 deletions

View File

@ -19,7 +19,9 @@ void HiZBuffer::sync()
{
int2 render_extent = inst_.film.render_extent_get();
/* Padding to avoid complexity during down-sampling and screen tracing. */
int2 hiz_extent = math::ceil_to_multiple(render_extent, int2(1u << (HIZ_MIP_COUNT - 1)));
int2 probe_extent = int2(inst_.reflection_probes.probe_render_extent());
int2 hiz_extent = math::ceil_to_multiple(math::max(render_extent, probe_extent),
int2(1u << (HIZ_MIP_COUNT - 1)));
int2 dispatch_size = math::divide_ceil(hiz_extent, int2(HIZ_GROUP_SIZE));
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_SHADER_WRITE;

View File

@ -140,6 +140,11 @@ eLightProbeResolution ReflectionProbeModule::reflection_probe_resolution() const
return LIGHT_PROBE_RESOLUTION_2048;
}
int ReflectionProbeModule::probe_render_extent() const
{
return instance_.scene->eevee.gi_cubemap_resolution / 2;
}
void ReflectionProbeModule::init()
{
if (!is_initialized) {

View File

@ -243,6 +243,13 @@ class ReflectionProbeModule {
return probes_tx_.width();
}
/**
* Get the resolution of a single cubemap side when rendering probes.
*
* The cubemaps are rendered half size of the size of the octahedral texture.
*/
int probe_render_extent() const;
ReflectionProbeAtlasCoordinate world_atlas_coord_get() const;
private: