Renderer: Implement and fix front face (winding order) between Vulkan / OpenGL

This commit is contained in:
Jérôme Leclercq
2021-05-28 22:58:14 +02:00
parent 299585a7de
commit ff505e9019
15 changed files with 71 additions and 30 deletions

View File

@@ -24,6 +24,7 @@ namespace Nz
inline VkFormat ToVulkan(ComponentType componentType);
inline VkCullModeFlagBits ToVulkan(FaceSide faceSide);
inline VkPolygonMode ToVulkan(FaceFilling faceFilling);
inline VkFrontFace ToVulkan(FrontFace frontFace);
inline VkAccessFlagBits ToVulkan(MemoryAccess memoryAccess);
inline VkAccessFlags ToVulkan(MemoryAccessFlags memoryAccessFlags);
inline VkPipelineStageFlagBits ToVulkan(PipelineStage pipelineStage);

View File

@@ -153,7 +153,19 @@ namespace Nz
NazaraError("Unhandled FaceFilling 0x" + NumberToString(UnderlyingCast(faceFilling), 16));
return VK_POLYGON_MODE_FILL;
}
inline VkFrontFace ToVulkan(FrontFace frontFace)
{
switch (frontFace)
{
case FrontFace::Clockwise: return VK_FRONT_FACE_CLOCKWISE;
case FrontFace::CounterClockwise: return VK_FRONT_FACE_COUNTER_CLOCKWISE;
}
NazaraError("Unhandled FrontFace 0x" + NumberToString(UnderlyingCast(frontFace), 16));
return {};
}
inline VkAccessFlagBits ToVulkan(MemoryAccess memoryAccess)
{
switch (memoryAccess)