@@ -870,18 +870,17 @@ static void OnMainThread(Fn&& fn)
870870 return ret;
871871}
872872
873- static GSDevice::DepthFeedbackSupport getDepthFeedback (const GSMTLDevice& dev, bool fbfetch)
873+ static bool getDepthFeedback (const GSMTLDevice& dev, bool fbfetch)
874874{
875875 switch (GSConfig.DepthFeedbackMode )
876876 {
877- case GSDepthFeedbackMode::None: return GSDevice::DepthFeedbackSupport::None;
878- case GSDepthFeedbackMode::Auto: return dev.features .preferred_depth_feedback ;
879- case GSDepthFeedbackMode::DepthAsRT: return GSDevice::DepthFeedbackSupport::DepthAsRT;
877+ case GSDepthFeedbackMode::Auto:
878+ return dev.features .depth_feedback ;
880879 case GSDepthFeedbackMode::Depth:
881- if (!fbfetch)
882- return GSDevice::DepthFeedbackSupport::Depth ;
883- else
884- return GSDevice::DepthFeedbackSupport::DepthAsRT; // Depth + FBFetch not supported
880+ // Depth feedback + FBFetch not supported
881+ return !fbfetch ;
882+ default :
883+ return false ;
885884 }
886885}
887886
@@ -977,7 +976,7 @@ static void OnMainThread(Fn&& fn)
977976 // Init metal stuff
978977 m_fn_constants = MRCTransfer ([MTLFunctionConstantValues new ]);
979978 setFnConstantB (m_fn_constants, m_features.framebuffer_fetch , GSMTLConstantIndex_FRAMEBUFFER_FETCH);
980- setFnConstantI (m_fn_constants, m_features.depth_feedback , GSMTLConstantIndex_DEPTH_FEEDBACK);
979+ setFnConstantB (m_fn_constants, m_features.depth_feedback , GSMTLConstantIndex_DEPTH_FEEDBACK);
981980
982981 m_draw_sync_fence = MRCTransfer ([m_dev.dev newFence ]);
983982 [m_draw_sync_fence setLabel: @" Draw Sync Fence" ];
@@ -1018,7 +1017,7 @@ static void OnMainThread(Fn&& fn)
10181017 const bool depth = i & 2 ;
10191018 const bool stencil = i & 4 ;
10201019 const bool rt1 = i & 8 ;
1021- if (rt1 && m_features.depth_feedback != GSDevice::DepthFeedbackSupport::DepthAsRT )
1020+ if (rt1 && m_features.depth_feedback )
10221021 continue ;
10231022 if (rt1 && !depth)
10241023 continue ;
@@ -1332,6 +1331,7 @@ static void OnMainThread(Fn&& fn)
13321331 desc += " \n Framebuffer Fetch: " + std::string (m_dev.features .framebuffer_fetch ? " Supported" : " Unsupported" );
13331332 desc += " \n Memoryless Textures: " + std::string (m_dev.features .memoryless_textures ? " Supported" : " Unsupported" );
13341333 desc += " \n Primitive ID: " + std::string (m_dev.features .primid ? " Supported" : " Unsupported" );
1334+ desc += " \n Depth Feedback: " + std::string (m_dev.features .depth_feedback ? " Supported" : " Unsupported" );
13351335 desc += " \n Shader Version: " + std::string (to_string (m_dev.features .shader_version ));
13361336 desc += " \n Max Texture Size: " + std::to_string (m_dev.features .max_texsize );
13371337 return desc;
@@ -2380,7 +2380,7 @@ static bool usesStencil(GSHWDrawConfig::DestinationAlphaMode dstalpha)
23802380 }
23812381
23822382 const bool feedback_depth = config.ps .IsFeedbackLoopDepth ();
2383- const bool rt1 = feedback_depth && m_features.depth_feedback == GSDevice::DepthFeedbackSupport::DepthAsRT ;
2383+ const bool rt1 = feedback_depth && ! m_features.depth_feedback ;
23842384 BeginRenderPass (@" RenderHW" , rt, MTLLoadActionLoad , config.ds , MTLLoadActionLoad , stencil, MTLLoadActionLoad , rt1);
23852385 id <MTLRenderCommandEncoder > mtlenc = m_current_render.encoder ;
23862386 FlushDebugEntries (mtlenc);
@@ -2391,8 +2391,7 @@ static bool usesStencil(GSHWDrawConfig::DestinationAlphaMode dstalpha)
23912391 MRESetTexture (rt, GSMTLTextureIndexRenderTarget);
23922392 if (feedback_depth)
23932393 {
2394- bool depth_as_rt = m_features.depth_feedback == GSDevice::DepthFeedbackSupport::DepthAsRT;
2395- GSTexture* tex = depth_as_rt && !m_features.framebuffer_fetch ? m_ds_as_rt : config.ds ;
2394+ GSTexture* tex = !m_features.depth_feedback && !m_features.framebuffer_fetch ? m_ds_as_rt : config.ds ;
23962395 MRESetTexture (tex, GSMTLTextureIndexDepthTarget);
23972396 }
23982397 if (primid_tex)
0 commit comments