mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix primitive topology. Crashfix.
This commit is contained in:
parent
9e34d7d625
commit
7eeba080c7
3 changed files with 17 additions and 12 deletions
|
@ -52,16 +52,6 @@ enum {
|
|||
DRAW_BINDING_DYNUBO_BONE = 4,
|
||||
};
|
||||
|
||||
const VkPrimitiveTopology prim[8] = {
|
||||
VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
|
||||
VK_PRIMITIVE_TOPOLOGY_LINE_LIST,
|
||||
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP,
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP,
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN,
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, // Vulkan doesn't do quads. We could do strips with restart-index though. We could also do RECT primitives in the geometry shader.
|
||||
};
|
||||
|
||||
enum {
|
||||
TRANSFORMED_VERTEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * sizeof(TransformedVertex)
|
||||
};
|
||||
|
|
|
@ -88,6 +88,17 @@ static const VkStencilOp stencilOps[] = {
|
|||
VK_STENCIL_OP_KEEP, // reserved
|
||||
};
|
||||
|
||||
const VkPrimitiveTopology primToVulkan[8] = {
|
||||
VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
|
||||
VK_PRIMITIVE_TOPOLOGY_LINE_LIST,
|
||||
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP,
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP,
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN,
|
||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, // Vulkan doesn't do quads. We could do strips with restart-index though. We could also do RECT primitives in the geometry shader.
|
||||
};
|
||||
|
||||
|
||||
bool ApplyShaderBlending() {
|
||||
return false;
|
||||
}
|
||||
|
@ -249,6 +260,8 @@ void ConvertStateToVulkanKey(FramebufferManagerVulkan &fbManager, int prim, Vulk
|
|||
}
|
||||
}
|
||||
|
||||
key.topology = primToVulkan[prim];
|
||||
|
||||
VkViewport &vp = dynState.viewport;
|
||||
vp.x = vpAndScissor.viewportX;
|
||||
vp.y = vpAndScissor.viewportY;
|
||||
|
|
|
@ -563,8 +563,10 @@ public:
|
|||
private:
|
||||
void Destroy() {
|
||||
ILOG("texture destroyed: %p", this);
|
||||
vkTex_->Destroy(vulkan_);
|
||||
delete vkTex_;
|
||||
if (vkTex_) {
|
||||
vkTex_->Destroy(vulkan_);
|
||||
delete vkTex_;
|
||||
}
|
||||
}
|
||||
|
||||
VulkanContext *vulkan_;
|
||||
|
|
Loading…
Add table
Reference in a new issue