Permalink
Browse files

Merge pull request #10061 from unknownbrackets/vulkan-minor

Fix softgpu in Vulkan
  • Loading branch information...
hrydgard committed Nov 6, 2017
2 parents de459e6 + 4a08410 commit 392adde1a032137e08ec5f83d11489778398a586
Showing with 6 additions and 4 deletions.
  1. +0 −1 UI/EmuScreen.cpp
  2. +4 −1 ext/native/thin3d/VulkanQueueRunner.cpp
  3. +2 −2 ext/native/thin3d/thin3d_vulkan.cpp
View
@@ -965,7 +965,6 @@ void EmuScreen::preRender() {
bool useBufferedRendering = g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
if ((!useBufferedRendering && !g_Config.bSoftwareRendering) || Core_IsStepping()) {
// We need to clear here already so that drawing during the frame is done on a clean slate.
DrawContext *draw = screenManager()->getDrawContext();
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, 0xFF000000 });
Viewport viewport;
@@ -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;
@@ -559,6 +559,9 @@ void VulkanQueueRunner::PerformBindFramebufferAsRenderTarget(const VKRStep &step
}
} else {
renderPass = GetBackbufferRenderPass();
assert(step.render.color == VKRRenderPassAction::CLEAR || step.render.color == VKRRenderPassAction::DONT_CARE);
assert(step.render.depthStencil == VKRRenderPassAction::CLEAR || step.render.depthStencil == VKRRenderPassAction::DONT_CARE);
Uint8x4ToFloat4(clearVal[0].color.float32, step.render.clearColor);
numClearVals = 2; // We don't bother with a depth buffer here.
clearVal[1].depthStencil.depth = 0.0f;
clearVal[1].depthStencil.stencil = 0;
@@ -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 392adde

Please sign in to comment.