Browse Source

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
attilaz 2 years ago
parent
commit
7b8aa2ec75
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/renderer_mtl.mm

+ 2 - 2
src/renderer_mtl.mm

@@ -2049,7 +2049,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa
 								}
 								else
 								{
-									ps->m_bindingTypes[arg.index-1] = fragmentBit
+									ps->m_bindingTypes[arg.index-1] |= fragmentBit
 										? PipelineStateMtl::BindToFragmentShader
 										: PipelineStateMtl::BindToVertexShader
 										;
@@ -2067,7 +2067,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa
 							}
 							else
 							{
-								ps->m_bindingTypes[arg.index] = fragmentBit
+								ps->m_bindingTypes[arg.index] |= fragmentBit
 									? PipelineStateMtl::BindToFragmentShader
 									: PipelineStateMtl::BindToVertexShader
 									;