1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2025-01-30 22:52:14 +01:00

various fixes

This commit is contained in:
yours3lf 2020-04-29 20:17:55 +01:00
parent 8813599202
commit 643c80444c
3 changed files with 22 additions and 14 deletions

View File

@ -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,

View File

@ -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)

View File

@ -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))