diff --git a/driver/draw.c b/driver/draw.c index d265a3e..71fa97c 100644 --- a/driver/draw.c +++ b/driver/draw.c @@ -231,16 +231,20 @@ static uint32_t drawCommon(VkCommandBuffer commandBuffer, int32_t vertexOffset) uint32_t stride = cb->graphicsPipeline->vertexBindingDescriptions[cb->graphicsPipeline->vertexAttributeDescriptions[c].binding].stride; -// if(stride > 0) -// { -// //TODO offset -// uint32_t usedIndices = (cb->vertexBuffers[cb->graphicsPipeline->vertexAttributeDescriptions[c].binding]->boundMem->size - formatByteSize) / stride; + if(stride > 0) + { + uint32_t usedIndices = (cb->vertexBuffers[cb->graphicsPipeline->vertexAttributeDescriptions[c].binding]->boundMem->size + - cb->graphicsPipeline->vertexAttributeDescriptions[c].offset + - vertexOffset * stride + - cb->vertexBufferOffsets[cb->graphicsPipeline->vertexAttributeDescriptions[c].binding] + - cb->vertexBuffers[cb->graphicsPipeline->vertexAttributeDescriptions[c].binding]->boundOffset + - formatByteSize) / stride; -// if(usedIndices < maxIndex) -// { -// maxIndex = usedIndices; -// } -// } + if(usedIndices < maxIndex) + { + maxIndex = usedIndices; + } + } ControlListAddress vertexBuffer = { .handle = cb->vertexBuffers[cb->graphicsPipeline->vertexAttributeDescriptions[c].binding]->boundMem->bo, diff --git a/driver/renderpass.c b/driver/renderpass.c index 8a859a5..d962c42 100644 --- a/driver/renderpass.c +++ b/driver/renderpass.c @@ -167,23 +167,27 @@ void rpi_vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassB } } - cb->binCl.currMarker->flags = flags; - if(rp->subpasses[0].pDepthStencilAttachment) { if(rp->attachments[rp->subpasses[0].pDepthStencilAttachment->attachment].loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) { + flags |= VC4_SUBMIT_CL_USE_CLEAR_COLOR; + cb->binCl.currMarker->clearDepth = (uint32_t)(pRenderPassBegin->pClearValues[rp->subpasses[0].pDepthStencilAttachment->attachment].depthStencil.depth * 0xffffff) & 0xffffff; } if(rp->attachments[rp->subpasses[0].pDepthStencilAttachment->attachment].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) { + flags |= VC4_SUBMIT_CL_USE_CLEAR_COLOR; + cb->binCl.currMarker->clearStencil = pRenderPassBegin->pClearValues[rp->subpasses[0].pDepthStencilAttachment->attachment].depthStencil.stencil & 0xff; } } + cb->binCl.currMarker->flags = flags; + //insert relocs if(writeImage) diff --git a/driver/vkCaps.h b/driver/vkCaps.h index f865b61..b28b30d 100644 --- a/driver/vkCaps.h +++ b/driver/vkCaps.h @@ -582,10 +582,10 @@ static VkPerformanceCounterDescriptionKHR performanceCounterDescriptions[] = static VkPresentModeKHR supportedPresentModes[] = { - VK_PRESENT_MODE_IMMEDIATE_KHR, - VK_PRESENT_MODE_MAILBOX_KHR, + //VK_PRESENT_MODE_IMMEDIATE_KHR, + //VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR, - VK_PRESENT_MODE_FIFO_RELAXED_KHR + //VK_PRESENT_MODE_FIFO_RELAXED_KHR }; #define numSupportedPresentModes (sizeof(supportedPresentModes)/sizeof(VkPresentModeKHR))