Skip to content

Commit

Permalink
MacOS: Workaround for Metal stride limitation (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tillsunset authored Nov 3, 2022
1 parent a129d22 commit 521f2fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,12 @@ void PipelineCompiler::InitVertexInputState(const LatteContextRegister& latteReg
uint32 bufferStride = (latteRegister.GetRawView()[bufferBaseRegisterIndex + 2] >> 11) & 0xFFFF;

VkVertexInputBindingDescription entry{};
#if BOOST_OS_MACOS
if (bufferStride % 4 != 0) {
forceLog_printf("MoltenVK error: vertex stride was %d, expected multiple of 4", bufferStride);
bufferStride = 0;
}
#endif
entry.stride = bufferStride;
if (!fetchType.has_value() || fetchType == LatteConst::VertexFetchType2::VERTEX_DATA)
entry.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
Expand Down

0 comments on commit 521f2fb

Please sign in to comment.