Permalink
Browse files

Vulkan: Fix non-16 bit indexed drawing.

Only really affects softgpu, since games are rewritten to 16 bit.
  • Loading branch information...
unknownbrackets committed Nov 6, 2017
1 parent 9dfc9ff commit 4a08410d7d5d24b0d66d095f2b1770b065f581cd
Showing with 3 additions and 3 deletions.
  1. +1 −1 ext/native/thin3d/VulkanQueueRunner.cpp
  2. +2 −2 ext/native/thin3d/thin3d_vulkan.cpp
@@ -380,7 +380,7 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c
case VKRRenderCommand::DRAW_INDEXED:
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, c.drawIndexed.pipelineLayout, 0, 1, &c.drawIndexed.ds, c.drawIndexed.numUboOffsets, c.drawIndexed.uboOffsets);
vkCmdBindIndexBuffer(cmd, c.drawIndexed.ibuffer, c.drawIndexed.ioffset, VK_INDEX_TYPE_UINT16);
vkCmdBindIndexBuffer(cmd, c.drawIndexed.ibuffer, c.drawIndexed.ioffset, c.drawIndexed.indexType);
vkCmdBindVertexBuffers(cmd, 0, 1, &c.drawIndexed.vbuffer, &c.drawIndexed.voffset);
vkCmdDrawIndexed(cmd, c.drawIndexed.count, c.drawIndexed.instances, 0, 0, 0);
break;
@@ -1118,8 +1118,8 @@ void VKContext::Draw(int vertexCount, int offset) {
}
void VKContext::DrawIndexed(int vertexCount, int offset) {
VKBuffer *ibuf = static_cast<VKBuffer *>(curIBuffer_);
VKBuffer *vbuf = static_cast<VKBuffer *>(curVBuffers_[0]);
VKBuffer *ibuf = curIBuffer_;
VKBuffer *vbuf = curVBuffers_[0];
VkBuffer vulkanVbuf, vulkanIbuf, vulkanUBObuf;
uint32_t ubo_offset = (uint32_t)curPipeline_->PushUBO(push_, vulkan_, &vulkanUBObuf);

0 comments on commit 4a08410

Please sign in to comment.