From 7b8aa2ec75004ca147fbe23b7d2635304ca20358 Mon Sep 17 00:00:00 2001 From: attilaz Date: Mon, 4 Dec 2023 16:37:39 +0100 Subject: [PATCH] Fixes metal texture/buffer binding issue (#3214) Fixes metal texture/buffer binding when when the same resource is bound to both (vertex and fragment) stages https://github.com/bkaradzic/bgfx/issues/3024 --- src/renderer_mtl.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index c9c6b42fdd..0a7d909e98 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -2049,7 +2049,7 @@ void processArguments( } else { - ps->m_bindingTypes[arg.index-1] = fragmentBit + ps->m_bindingTypes[arg.index-1] |= fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader ; @@ -2067,7 +2067,7 @@ void processArguments( } else { - ps->m_bindingTypes[arg.index] = fragmentBit + ps->m_bindingTypes[arg.index] |= fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader ;