diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-08-15 19:08:34 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-08-15 19:36:19 +0300 |
commit | b43b62191cde60fee65f8ff1ad108b271f42295d (patch) | |
tree | c1262b5422c33f8fc21adbc4613c9fa22bc95528 /source/blender/draw/engines/eevee_next/eevee_light.cc | |
parent | 3195a381200eb98e6add8b0504f701318186946d (diff) |
EEVEE-Next: HiZ Buffer: New implementation
This new implementation does all downsampling in a single compute shader
dispatch, removing a lot of complexity from the previous recursive
downsampling.
This is heavilly inspired by the Single-Pass-Downsampler from GPUOpen:
https://github.com/GPUOpen-Effects/FidelityFX-SPD
However I do not implement all the optimization bits as they require
vulkan (GL_KHR_shader_subgroup) and is not as versatile (it is only
for HiZ).
Timers inside renderdoc report ~0.4ms of saving on a 2048*1024 render for
the whole downsampling. Note that the previous implementation only
processed 6 mips where the new one processes 8 mips.
```
EEVEE ~1.0ms
EEVEE-Next ~0.6ms
```
Padding has been bumped to be of 128px for processing 8 mips.
A new debug option has been added (debug value 2) to validate the HiZ.
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_light.cc')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_light.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_light.cc b/source/blender/draw/engines/eevee_next/eevee_light.cc index dbbf481f3f4..5392816124b 100644 --- a/source/blender/draw/engines/eevee_next/eevee_light.cc +++ b/source/blender/draw/engines/eevee_next/eevee_light.cc @@ -452,9 +452,11 @@ void LightModule::debug_pass_sync() return; } - debug_draw_ps_ = DRW_pass_create("LightCulling.Debug", DRW_STATE_WRITE_COLOR); + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_CUSTOM; + debug_draw_ps_ = DRW_pass_create("LightCulling.Debug", state); GPUShader *sh = inst_.shaders.static_shader_get(LIGHT_CULLING_DEBUG); DRWShadingGroup *grp = DRW_shgroup_create(sh, debug_draw_ps_); + inst_.hiz_buffer.bind_resources(grp); DRW_shgroup_storage_block_ref(grp, "light_buf", &culling_light_buf_); DRW_shgroup_storage_block_ref(grp, "light_cull_buf", &culling_data_buf_); DRW_shgroup_storage_block_ref(grp, "light_zbin_buf", &culling_zbin_buf_); @@ -490,6 +492,8 @@ void LightModule::debug_draw(GPUFrameBuffer *view_fb) if (debug_draw_ps_ == nullptr) { return; } + inst_.info = "Debug Mode: Light Culling Validation"; + inst_.hiz_buffer.update(); GPU_framebuffer_bind(view_fb); DRW_draw_pass(debug_draw_ps_); } |