diff --git a/source/blender/draw/engines/eevee_next/eevee_gbuffer.hh b/source/blender/draw/engines/eevee_next/eevee_gbuffer.hh index eca996b1124..afef6fbeaec 100644 --- a/source/blender/draw/engines/eevee_next/eevee_gbuffer.hh +++ b/source/blender/draw/engines/eevee_next/eevee_gbuffer.hh @@ -156,35 +156,27 @@ struct GBuffer { void bind(Framebuffer &gbuffer_fb) { if (/* FIXME(fclem): Vulkan doesn't implement load / store config yet. */ - GPU_backend_get_type() == GPU_BACKEND_VULKAN || - /* FIXME(fclem): Metal has bug in backend. */ - GPU_backend_get_type() == GPU_BACKEND_METAL) + GPU_backend_get_type() == GPU_BACKEND_VULKAN) { header_tx.clear(uint4(0)); } - if (GPU_backend_get_type() == GPU_BACKEND_METAL) { - /* TODO(fclem): Load/store action is broken on Metal. */ + if (!GPU_stencil_export_support()) { + /* Clearing custom load-store frame-buffers is invalid, + * clear the stencil as a regular frame-buffer first. */ GPU_framebuffer_bind(gbuffer_fb); + GPU_framebuffer_clear_stencil(gbuffer_fb, 0x0u); } - else { - if (!GPU_stencil_export_support()) { - /* Clearing custom load-store frame-buffers is invalid, - * clear the stencil as a regular frame-buffer first. */ - GPU_framebuffer_bind(gbuffer_fb); - GPU_framebuffer_clear_stencil(gbuffer_fb, 0x0u); - } - GPU_framebuffer_bind_ex( - gbuffer_fb, - { - {GPU_LOADACTION_LOAD, GPU_STOREACTION_STORE}, /* Depth */ - {GPU_LOADACTION_LOAD, GPU_STOREACTION_STORE}, /* Combined */ - {GPU_LOADACTION_CLEAR, GPU_STOREACTION_STORE, {0}}, /* GBuf Header */ - {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_STORE}, /* GBuf Normal */ - {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_STORE}, /* GBuf Closure */ - {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_STORE}, /* GBuf Closure 2*/ - }); - } + GPU_framebuffer_bind_ex( + gbuffer_fb, + { + {GPU_LOADACTION_LOAD, GPU_STOREACTION_STORE}, /* Depth */ + {GPU_LOADACTION_LOAD, GPU_STOREACTION_STORE}, /* Combined */ + {GPU_LOADACTION_CLEAR, GPU_STOREACTION_STORE, {0}}, /* GBuf Header */ + {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_STORE}, /* GBuf Normal */ + {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_STORE}, /* GBuf Closure */ + {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_STORE}, /* GBuf Closure 2*/ + }); } void release()