mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2025-01-19 11:52:16 +01:00
don't need to memcpy the whole buf
This commit is contained in:
parent
b18f960c38
commit
1f7196f5b8
@ -627,8 +627,8 @@ VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearAttachments)(
|
|||||||
oldPipeline = cmdBuf->graphicsPipeline;
|
oldPipeline = cmdBuf->graphicsPipeline;
|
||||||
memcpy(oldVertexBufferOffsets, cmdBuf->vertexBufferOffsets, sizeof(oldVertexBufferOffsets));
|
memcpy(oldVertexBufferOffsets, cmdBuf->vertexBufferOffsets, sizeof(oldVertexBufferOffsets));
|
||||||
memcpy(oldVertexBuffers, cmdBuf->vertexBuffers, sizeof(oldVertexBuffers));
|
memcpy(oldVertexBuffers, cmdBuf->vertexBuffers, sizeof(oldVertexBuffers));
|
||||||
memcpy(oldPushConstantBufferVertex, cmdBuf->pushConstantBufferVertex, sizeof(oldPushConstantBufferVertex));
|
memcpy(oldPushConstantBufferVertex, cmdBuf->pushConstantBufferVertex, sizeof(uint32_t) * 10);
|
||||||
memcpy(oldPushConstantBufferPixel, cmdBuf->pushConstantBufferPixel, sizeof(oldPushConstantBufferPixel));
|
memcpy(oldPushConstantBufferPixel, cmdBuf->pushConstantBufferPixel, sizeof(uint32_t) * 10);
|
||||||
|
|
||||||
for(uint32_t c = 0; c < attachmentCount; ++c)
|
for(uint32_t c = 0; c < attachmentCount; ++c)
|
||||||
{
|
{
|
||||||
@ -667,6 +667,7 @@ VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearAttachments)(
|
|||||||
dsci.front.passOp = VK_STENCIL_OP_REPLACE;
|
dsci.front.passOp = VK_STENCIL_OP_REPLACE;
|
||||||
dsci.back = dsci.front;
|
dsci.back = dsci.front;
|
||||||
|
|
||||||
|
//TODO cache pipeline, don't create it each occasion
|
||||||
createClearPipeline(device, &dsci, clearColor ? device->emulClearShaderModule : device->emulClearNoColorShaderModule, device->emulClearDsl, &blitPipelineLayout, cmdBuf->currRenderPass, &blitPipeline);
|
createClearPipeline(device, &dsci, clearColor ? device->emulClearShaderModule : device->emulClearNoColorShaderModule, device->emulClearDsl, &blitPipelineLayout, cmdBuf->currRenderPass, &blitPipeline);
|
||||||
|
|
||||||
RPIFUNC(vkCmdBindPipeline)(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline);
|
RPIFUNC(vkCmdBindPipeline)(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline);
|
||||||
@ -726,8 +727,8 @@ VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearAttachments)(
|
|||||||
cmdBuf->graphicsPipeline = oldPipeline;
|
cmdBuf->graphicsPipeline = oldPipeline;
|
||||||
memcpy(cmdBuf->vertexBufferOffsets, oldVertexBufferOffsets, sizeof(oldVertexBufferOffsets));
|
memcpy(cmdBuf->vertexBufferOffsets, oldVertexBufferOffsets, sizeof(oldVertexBufferOffsets));
|
||||||
memcpy(cmdBuf->vertexBuffers, oldVertexBuffers, sizeof(oldVertexBuffers));
|
memcpy(cmdBuf->vertexBuffers, oldVertexBuffers, sizeof(oldVertexBuffers));
|
||||||
memcpy(cmdBuf->pushConstantBufferVertex, oldPushConstantBufferVertex, sizeof(oldPushConstantBufferVertex));
|
memcpy(cmdBuf->pushConstantBufferVertex, oldPushConstantBufferVertex, sizeof(uint32_t) * 10);
|
||||||
memcpy(cmdBuf->pushConstantBufferPixel, oldPushConstantBufferPixel, sizeof(oldPushConstantBufferPixel));
|
memcpy(cmdBuf->pushConstantBufferPixel, oldPushConstantBufferPixel, sizeof(uint32_t) * 10);
|
||||||
|
|
||||||
PROFILEEND(RPIFUNC(vkCmdClearAttachments));
|
PROFILEEND(RPIFUNC(vkCmdClearAttachments));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user