mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
[vulkan] Use only one global staging buffer
I think I did two as a bit of a ring buffer, but the new ring buffer system used inside a staging buffer makes it less necessary. Also, the staging buffer is now a fair bit bigger (4M is probably not really enough)
This commit is contained in:
parent
92afe9f265
commit
904a91c0b7
2 changed files with 4 additions and 7 deletions
|
@ -68,7 +68,7 @@ typedef struct vulkan_ctx_s {
|
|||
VkCommandBuffer cmdbuffer;
|
||||
VkFence fence; // for ctx->cmdbuffer only
|
||||
vulkan_renderpass_t renderpass;
|
||||
struct qfv_stagebuf_s *staging[2];
|
||||
struct qfv_stagebuf_s *staging;
|
||||
VkPipeline pipeline;
|
||||
size_t curFrame;
|
||||
vulkan_framebufferset_t framebuffers;
|
||||
|
|
|
@ -174,8 +174,7 @@ Vulkan_Shutdown_Common (vulkan_ctx_t *ctx)
|
|||
if (ctx->swapchain) {
|
||||
QFV_DestroySwapchain (ctx->swapchain);
|
||||
}
|
||||
QFV_DestroyStagingBuffer (ctx->staging[0]);
|
||||
QFV_DestroyStagingBuffer (ctx->staging[1]);
|
||||
QFV_DestroyStagingBuffer (ctx->staging);
|
||||
Vulkan_DestroyMatrices (ctx);
|
||||
ctx->instance->funcs->vkDestroySurfaceKHR (ctx->instance->instance,
|
||||
ctx->surface, 0);
|
||||
|
@ -203,10 +202,8 @@ Vulkan_CreateDevice (vulkan_ctx_t *ctx)
|
|||
void
|
||||
Vulkan_CreateStagingBuffers (vulkan_ctx_t *ctx)
|
||||
{
|
||||
ctx->staging[0] = QFV_CreateStagingBuffer (ctx->device, 1024*1024, 1,
|
||||
ctx->cmdpool);
|
||||
ctx->staging[1] = QFV_CreateStagingBuffer (ctx->device, 1024*1024, 1,
|
||||
ctx->cmdpool);
|
||||
ctx->staging = QFV_CreateStagingBuffer (ctx->device, 4*1024*1024, 1,
|
||||
ctx->cmdpool);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue