I found an interesting bug with the MetalRednerer.mm @ 3149-3165
I ported an Vulcan Instancing example and whatever I did the instance vertex attributes were not properly updating. After digging in The-Forge code, I found out that even though I'm not using any tessellation and my vertex attribute is set to VERTEX_ATTRIB_RATE_INSTANCE, the if/else (MetalRednerer.mm @ 3158) is never executed.
For the fix, it's obvious the else is skipped since we enter the @available section on Mac10.12 or iOS10, so I have extracted the latter if/else into a function to avoid duplication of code, since it has to be checked in either case. Here the proposed solution:
I found an interesting bug with the MetalRednerer.mm @ 3149-3165 I ported an Vulcan Instancing example and whatever I did the instance vertex attributes were not properly updating. After digging in The-Forge code, I found out that even though I'm not using any tessellation and my vertex attribute is set to VERTEX_ATTRIB_RATE_INSTANCE, the if/else (MetalRednerer.mm @ 3158) is never executed.
For the fix, it's obvious the else is skipped since we enter the @available section on Mac10.12 or iOS10, so I have extracted the latter if/else into a function to avoid duplication of code, since it has to be checked in either case. Here the proposed solution:
// Extracted function
// Changed code in void addGraphicsPipelineImpl(Renderer pRenderer, const GraphicsPipelineDesc pDesc, Pipeline** ppPipeline)