Metal: Re-enable loadstore config for EEVEE Next framebuffer

A previous PR resolved the loadstore config setup on bind, so
we can now re-enable load-store config with clearing of the
header texture via render pass.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121610
This commit is contained in:
Jason Fielder
2024-05-09 11:27:37 +02:00
committed by Clément Foucault
parent b42e973320
commit e97e06ea2c

View File

@@ -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()