render target discards and block allocation
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d568810fa0
commit
8e04b0d1c9
|
@ -587,6 +587,7 @@ typedef struct Refresh_ColorAttachmentInfo
|
||||||
Refresh_Vec4 clearColor; /* Can be ignored by RenderPass */
|
Refresh_Vec4 clearColor; /* Can be ignored by RenderPass */
|
||||||
Refresh_LoadOp loadOp;
|
Refresh_LoadOp loadOp;
|
||||||
Refresh_StoreOp storeOp;
|
Refresh_StoreOp storeOp;
|
||||||
|
uint8_t safeDiscard; /* ignored if loadOp is LOAD */
|
||||||
} Refresh_ColorAttachmentInfo;
|
} Refresh_ColorAttachmentInfo;
|
||||||
|
|
||||||
typedef struct Refresh_DepthStencilAttachmentInfo
|
typedef struct Refresh_DepthStencilAttachmentInfo
|
||||||
|
@ -600,6 +601,7 @@ typedef struct Refresh_DepthStencilAttachmentInfo
|
||||||
Refresh_StoreOp storeOp;
|
Refresh_StoreOp storeOp;
|
||||||
Refresh_LoadOp stencilLoadOp;
|
Refresh_LoadOp stencilLoadOp;
|
||||||
Refresh_StoreOp stencilStoreOp;
|
Refresh_StoreOp stencilStoreOp;
|
||||||
|
uint8_t safeDiscard; /* ignored if either loadOp or stencilLoadOp is LOAD*/
|
||||||
} Refresh_DepthStencilAttachmentInfo;
|
} Refresh_DepthStencilAttachmentInfo;
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
|
|
|
@ -2846,7 +2846,6 @@ static uint8_t VULKAN_INTERNAL_BindResourceMemory(
|
||||||
static uint8_t VULKAN_INTERNAL_BindMemoryForImage(
|
static uint8_t VULKAN_INTERNAL_BindMemoryForImage(
|
||||||
VulkanRenderer* renderer,
|
VulkanRenderer* renderer,
|
||||||
VkImage image,
|
VkImage image,
|
||||||
uint8_t isRenderTarget,
|
|
||||||
VulkanMemoryUsedRegion** usedRegion
|
VulkanMemoryUsedRegion** usedRegion
|
||||||
) {
|
) {
|
||||||
uint8_t bindResult = 0;
|
uint8_t bindResult = 0;
|
||||||
|
@ -2872,7 +2871,7 @@ static uint8_t VULKAN_INTERNAL_BindMemoryForImage(
|
||||||
renderer,
|
renderer,
|
||||||
memoryTypeIndex,
|
memoryTypeIndex,
|
||||||
&memoryRequirements,
|
&memoryRequirements,
|
||||||
isRenderTarget,
|
0,
|
||||||
memoryRequirements.memoryRequirements.size,
|
memoryRequirements.memoryRequirements.size,
|
||||||
VK_NULL_HANDLE,
|
VK_NULL_HANDLE,
|
||||||
image,
|
image,
|
||||||
|
@ -2895,11 +2894,6 @@ static uint8_t VULKAN_INTERNAL_BindMemoryForImage(
|
||||||
memoryTypeIndex = 0;
|
memoryTypeIndex = 0;
|
||||||
requiredMemoryPropertyFlags = 0;
|
requiredMemoryPropertyFlags = 0;
|
||||||
|
|
||||||
if (isRenderTarget)
|
|
||||||
{
|
|
||||||
Refresh_LogWarn("RenderTarget is allocated in host memory, pre-allocate your targets!");
|
|
||||||
}
|
|
||||||
|
|
||||||
Refresh_LogWarn("Out of device-local memory, allocating textures on host-local memory!");
|
Refresh_LogWarn("Out of device-local memory, allocating textures on host-local memory!");
|
||||||
|
|
||||||
while (VULKAN_INTERNAL_FindImageMemoryRequirements(
|
while (VULKAN_INTERNAL_FindImageMemoryRequirements(
|
||||||
|
@ -2913,7 +2907,7 @@ static uint8_t VULKAN_INTERNAL_BindMemoryForImage(
|
||||||
renderer,
|
renderer,
|
||||||
memoryTypeIndex,
|
memoryTypeIndex,
|
||||||
&memoryRequirements,
|
&memoryRequirements,
|
||||||
isRenderTarget,
|
0,
|
||||||
memoryRequirements.memoryRequirements.size,
|
memoryRequirements.memoryRequirements.size,
|
||||||
VK_NULL_HANDLE,
|
VK_NULL_HANDLE,
|
||||||
image,
|
image,
|
||||||
|
@ -5448,7 +5442,6 @@ static VulkanTexture* VULKAN_INTERNAL_CreateTexture(
|
||||||
bindResult = VULKAN_INTERNAL_BindMemoryForImage(
|
bindResult = VULKAN_INTERNAL_BindMemoryForImage(
|
||||||
renderer,
|
renderer,
|
||||||
texture->image,
|
texture->image,
|
||||||
isRenderTarget,
|
|
||||||
&texture->usedRegion
|
&texture->usedRegion
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -5601,6 +5594,53 @@ static VulkanTextureHandle* VULKAN_INTERNAL_CreateTextureHandle(
|
||||||
return textureHandle;
|
return textureHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void VULKAN_INTERNAL_DiscardActiveTexture(
|
||||||
|
VulkanRenderer *renderer,
|
||||||
|
VulkanTextureContainer *textureContainer
|
||||||
|
) {
|
||||||
|
VulkanTextureHandle *textureHandle;
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
/* If a previously-discarded buffer is available, we can use that. */
|
||||||
|
for (i = 0; i < textureContainer->textureCount; i += 1)
|
||||||
|
{
|
||||||
|
textureHandle = textureContainer->textureHandles[i];
|
||||||
|
if (SDL_AtomicGet(&textureHandle->vulkanTexture->referenceCount) == 0)
|
||||||
|
{
|
||||||
|
textureContainer->activeTextureHandle = textureHandle;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* No texture handle is available, generate a new one. */
|
||||||
|
textureContainer->activeTextureHandle = VULKAN_INTERNAL_CreateTextureHandle(
|
||||||
|
renderer,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->dimensions.width,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->dimensions.height,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->depth,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->isCube,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->levelCount,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->sampleCount,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->format,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->aspectFlags,
|
||||||
|
textureContainer->activeTextureHandle->vulkanTexture->usageFlags,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
EXPAND_ARRAY_IF_NEEDED(
|
||||||
|
textureContainer->textureHandles,
|
||||||
|
VulkanTextureHandle*,
|
||||||
|
textureContainer->textureCount + 1,
|
||||||
|
textureContainer->textureCapacity,
|
||||||
|
textureContainer->textureCapacity * 2
|
||||||
|
);
|
||||||
|
|
||||||
|
textureContainer->textureHandles[
|
||||||
|
textureContainer->textureCount
|
||||||
|
] = textureContainer->activeTextureHandle;
|
||||||
|
textureContainer->textureCount += 1;
|
||||||
|
}
|
||||||
|
|
||||||
static void VULKAN_INTERNAL_CreateRenderTarget(
|
static void VULKAN_INTERNAL_CreateRenderTarget(
|
||||||
VulkanRenderer *renderer,
|
VulkanRenderer *renderer,
|
||||||
VulkanTexture *texture,
|
VulkanTexture *texture,
|
||||||
|
@ -7773,6 +7813,7 @@ static void VULKAN_BeginRenderPass(
|
||||||
VkRenderPass renderPass;
|
VkRenderPass renderPass;
|
||||||
VulkanFramebuffer *framebuffer;
|
VulkanFramebuffer *framebuffer;
|
||||||
|
|
||||||
|
VulkanTextureContainer *textureContainer;
|
||||||
VulkanTexture *texture;
|
VulkanTexture *texture;
|
||||||
VulkanTexture *msaaTexture = NULL;
|
VulkanTexture *msaaTexture = NULL;
|
||||||
uint32_t w, h;
|
uint32_t w, h;
|
||||||
|
@ -7787,14 +7828,29 @@ static void VULKAN_BeginRenderPass(
|
||||||
uint32_t framebufferWidth = UINT32_MAX;
|
uint32_t framebufferWidth = UINT32_MAX;
|
||||||
uint32_t framebufferHeight = UINT32_MAX;
|
uint32_t framebufferHeight = UINT32_MAX;
|
||||||
|
|
||||||
/* The framebuffer cannot be larger than the smallest attachment. */
|
|
||||||
|
|
||||||
for (i = 0; i < colorAttachmentCount; i += 1)
|
for (i = 0; i < colorAttachmentCount; i += 1)
|
||||||
{
|
{
|
||||||
texture = ((VulkanTextureContainer*) colorAttachmentInfos[i].texture)->activeTextureHandle->vulkanTexture;
|
textureContainer = (VulkanTextureContainer*) colorAttachmentInfos[i].texture;
|
||||||
|
|
||||||
|
if (
|
||||||
|
colorAttachmentInfos[i].safeDiscard &&
|
||||||
|
colorAttachmentInfos[i].loadOp != REFRESH_LOADOP_LOAD &&
|
||||||
|
textureContainer->canBeDiscarded &&
|
||||||
|
SDL_AtomicGet(&textureContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0
|
||||||
|
) {
|
||||||
|
VULKAN_INTERNAL_DiscardActiveTexture(
|
||||||
|
renderer,
|
||||||
|
textureContainer
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
texture = textureContainer->activeTextureHandle->vulkanTexture;
|
||||||
|
|
||||||
w = texture->dimensions.width >> colorAttachmentInfos[i].level;
|
w = texture->dimensions.width >> colorAttachmentInfos[i].level;
|
||||||
h = texture->dimensions.height >> colorAttachmentInfos[i].level;
|
h = texture->dimensions.height >> colorAttachmentInfos[i].level;
|
||||||
|
|
||||||
|
/* The framebuffer cannot be larger than the smallest attachment. */
|
||||||
|
|
||||||
if (w < framebufferWidth)
|
if (w < framebufferWidth)
|
||||||
{
|
{
|
||||||
framebufferWidth = w;
|
framebufferWidth = w;
|
||||||
|
@ -7814,10 +7870,28 @@ static void VULKAN_BeginRenderPass(
|
||||||
|
|
||||||
if (depthStencilAttachmentInfo != NULL)
|
if (depthStencilAttachmentInfo != NULL)
|
||||||
{
|
{
|
||||||
texture = ((VulkanTextureContainer*) depthStencilAttachmentInfo->texture)->activeTextureHandle->vulkanTexture;
|
textureContainer = (VulkanTextureContainer*) depthStencilAttachmentInfo->texture;
|
||||||
|
|
||||||
|
if (
|
||||||
|
depthStencilAttachmentInfo->safeDiscard &&
|
||||||
|
depthStencilAttachmentInfo->loadOp != REFRESH_LOADOP_LOAD &&
|
||||||
|
depthStencilAttachmentInfo->stencilLoadOp != REFRESH_LOADOP_LOAD &&
|
||||||
|
textureContainer->canBeDiscarded &&
|
||||||
|
SDL_AtomicGet(&textureContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0
|
||||||
|
) {
|
||||||
|
VULKAN_INTERNAL_DiscardActiveTexture(
|
||||||
|
renderer,
|
||||||
|
textureContainer
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
texture = textureContainer->activeTextureHandle->vulkanTexture;
|
||||||
|
|
||||||
w = texture->dimensions.width >> depthStencilAttachmentInfo->level;
|
w = texture->dimensions.width >> depthStencilAttachmentInfo->level;
|
||||||
h = texture->dimensions.height >> depthStencilAttachmentInfo->level;
|
h = texture->dimensions.height >> depthStencilAttachmentInfo->level;
|
||||||
|
|
||||||
|
/* The framebuffer cannot be larger than the smallest attachment. */
|
||||||
|
|
||||||
if (w < framebufferWidth)
|
if (w < framebufferWidth)
|
||||||
{
|
{
|
||||||
framebufferWidth = w;
|
framebufferWidth = w;
|
||||||
|
@ -8493,53 +8567,6 @@ static void VULKAN_INTERNAL_DiscardActiveBuffer(
|
||||||
bufferContainer->bufferCount += 1;
|
bufferContainer->bufferCount += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void VULKAN_INTERNAL_DiscardActiveTexture(
|
|
||||||
VulkanRenderer *renderer,
|
|
||||||
VulkanTextureContainer *textureContainer
|
|
||||||
) {
|
|
||||||
VulkanTextureHandle *textureHandle;
|
|
||||||
uint32_t i;
|
|
||||||
|
|
||||||
/* If a previously-discarded buffer is available, we can use that. */
|
|
||||||
for (i = 0; i < textureContainer->textureCount; i += 1)
|
|
||||||
{
|
|
||||||
textureHandle = textureContainer->textureHandles[i];
|
|
||||||
if (SDL_AtomicGet(&textureHandle->vulkanTexture->referenceCount) == 0)
|
|
||||||
{
|
|
||||||
textureContainer->activeTextureHandle = textureHandle;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* No texture handle is available, generate a new one. */
|
|
||||||
textureContainer->activeTextureHandle = VULKAN_INTERNAL_CreateTextureHandle(
|
|
||||||
renderer,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->dimensions.width,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->dimensions.height,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->depth,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->isCube,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->levelCount,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->sampleCount,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->format,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->aspectFlags,
|
|
||||||
textureContainer->activeTextureHandle->vulkanTexture->usageFlags,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
EXPAND_ARRAY_IF_NEEDED(
|
|
||||||
textureContainer->textureHandles,
|
|
||||||
VulkanTextureHandle*,
|
|
||||||
textureContainer->textureCount + 1,
|
|
||||||
textureContainer->textureCapacity,
|
|
||||||
textureContainer->textureCapacity * 2
|
|
||||||
);
|
|
||||||
|
|
||||||
textureContainer->textureHandles[
|
|
||||||
textureContainer->textureCount
|
|
||||||
] = textureContainer->activeTextureHandle;
|
|
||||||
textureContainer->textureCount += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void VULKAN_SetTransferData(
|
static void VULKAN_SetTransferData(
|
||||||
Refresh_Renderer *driverData,
|
Refresh_Renderer *driverData,
|
||||||
void* data,
|
void* data,
|
||||||
|
@ -8550,8 +8577,10 @@ static void VULKAN_SetTransferData(
|
||||||
VulkanRenderer *renderer = (VulkanRenderer*) driverData;
|
VulkanRenderer *renderer = (VulkanRenderer*) driverData;
|
||||||
VulkanBufferContainer *transferBufferContainer = (VulkanBufferContainer*) transferBuffer;
|
VulkanBufferContainer *transferBufferContainer = (VulkanBufferContainer*) transferBuffer;
|
||||||
|
|
||||||
if (option == REFRESH_TRANSFEROPTIONS_SAFEDISCARD && SDL_AtomicGet(&transferBufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_TRANSFEROPTIONS_SAFEDISCARD &&
|
||||||
|
SDL_AtomicGet(&transferBufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveBuffer(
|
VULKAN_INTERNAL_DiscardActiveBuffer(
|
||||||
renderer,
|
renderer,
|
||||||
transferBufferContainer
|
transferBufferContainer
|
||||||
|
@ -8617,8 +8646,11 @@ static void VULKAN_UploadToTexture(
|
||||||
VulkanTextureContainer *vulkanTextureContainer = (VulkanTextureContainer*) textureSlice->texture;
|
VulkanTextureContainer *vulkanTextureContainer = (VulkanTextureContainer*) textureSlice->texture;
|
||||||
VkBufferImageCopy imageCopy;
|
VkBufferImageCopy imageCopy;
|
||||||
|
|
||||||
if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && vulkanTextureContainer->canBeDiscarded && SDL_AtomicGet(&vulkanTextureContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_COPYOPTIONS_SAFEDISCARD &&
|
||||||
|
vulkanTextureContainer->canBeDiscarded &&
|
||||||
|
SDL_AtomicGet(&vulkanTextureContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveTexture(
|
VULKAN_INTERNAL_DiscardActiveTexture(
|
||||||
renderer,
|
renderer,
|
||||||
vulkanTextureContainer
|
vulkanTextureContainer
|
||||||
|
@ -8688,8 +8720,10 @@ static void VULKAN_UploadToBuffer(
|
||||||
VulkanBufferContainer *gpuBufferContainer = (VulkanBufferContainer*) gpuBuffer;
|
VulkanBufferContainer *gpuBufferContainer = (VulkanBufferContainer*) gpuBuffer;
|
||||||
VkBufferCopy bufferCopy;
|
VkBufferCopy bufferCopy;
|
||||||
|
|
||||||
if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && SDL_AtomicGet(&gpuBufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_COPYOPTIONS_SAFEDISCARD &&
|
||||||
|
SDL_AtomicGet(&gpuBufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveBuffer(
|
VULKAN_INTERNAL_DiscardActiveBuffer(
|
||||||
renderer,
|
renderer,
|
||||||
gpuBufferContainer
|
gpuBufferContainer
|
||||||
|
@ -8741,8 +8775,10 @@ static void VULKAN_DownloadFromTexture(
|
||||||
VulkanBufferContainer *transferBufferContainer = (VulkanBufferContainer*) transferBuffer;
|
VulkanBufferContainer *transferBufferContainer = (VulkanBufferContainer*) transferBuffer;
|
||||||
VkBufferImageCopy imageCopy;
|
VkBufferImageCopy imageCopy;
|
||||||
|
|
||||||
if (option == REFRESH_TRANSFEROPTIONS_SAFEDISCARD && SDL_AtomicGet(&transferBufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_TRANSFEROPTIONS_SAFEDISCARD &&
|
||||||
|
SDL_AtomicGet(&transferBufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveBuffer(
|
VULKAN_INTERNAL_DiscardActiveBuffer(
|
||||||
renderer,
|
renderer,
|
||||||
transferBufferContainer
|
transferBufferContainer
|
||||||
|
@ -8812,8 +8848,10 @@ static void VULKAN_DownloadFromBuffer(
|
||||||
VulkanBufferContainer *transferBufferContainer = (VulkanBufferContainer*) transferBuffer;
|
VulkanBufferContainer *transferBufferContainer = (VulkanBufferContainer*) transferBuffer;
|
||||||
VkBufferCopy bufferCopy;
|
VkBufferCopy bufferCopy;
|
||||||
|
|
||||||
if (option == REFRESH_TRANSFEROPTIONS_SAFEDISCARD && SDL_AtomicGet(&transferBufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_TRANSFEROPTIONS_SAFEDISCARD &&
|
||||||
|
SDL_AtomicGet(&transferBufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveBuffer(
|
VULKAN_INTERNAL_DiscardActiveBuffer(
|
||||||
renderer,
|
renderer,
|
||||||
transferBufferContainer
|
transferBufferContainer
|
||||||
|
@ -8864,8 +8902,11 @@ static void VULKAN_CopyTextureToTexture(
|
||||||
VulkanTextureContainer *dstContainer = (VulkanTextureContainer*) destination->texture;
|
VulkanTextureContainer *dstContainer = (VulkanTextureContainer*) destination->texture;
|
||||||
VkImageCopy imageCopy;
|
VkImageCopy imageCopy;
|
||||||
|
|
||||||
if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && dstContainer->canBeDiscarded && SDL_AtomicGet(&dstContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_COPYOPTIONS_SAFEDISCARD &&
|
||||||
|
dstContainer->canBeDiscarded &&
|
||||||
|
SDL_AtomicGet(&dstContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveTexture(
|
VULKAN_INTERNAL_DiscardActiveTexture(
|
||||||
renderer,
|
renderer,
|
||||||
dstContainer
|
dstContainer
|
||||||
|
@ -8948,8 +8989,10 @@ static void VULKAN_CopyTextureToBuffer(
|
||||||
VulkanBufferContainer *bufferContainer = (VulkanBufferContainer*) gpuBuffer;
|
VulkanBufferContainer *bufferContainer = (VulkanBufferContainer*) gpuBuffer;
|
||||||
VkBufferImageCopy imageCopy;
|
VkBufferImageCopy imageCopy;
|
||||||
|
|
||||||
if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && SDL_AtomicGet(&bufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_COPYOPTIONS_SAFEDISCARD &&
|
||||||
|
SDL_AtomicGet(&bufferContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveBuffer(
|
VULKAN_INTERNAL_DiscardActiveBuffer(
|
||||||
renderer,
|
renderer,
|
||||||
bufferContainer
|
bufferContainer
|
||||||
|
@ -9020,8 +9063,10 @@ static void VULKAN_CopyBufferToTexture(
|
||||||
VulkanTextureContainer *textureContainer = (VulkanTextureContainer*) textureSlice->texture;
|
VulkanTextureContainer *textureContainer = (VulkanTextureContainer*) textureSlice->texture;
|
||||||
VkBufferImageCopy imageCopy;
|
VkBufferImageCopy imageCopy;
|
||||||
|
|
||||||
if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && textureContainer->canBeDiscarded && SDL_AtomicGet(&textureContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_COPYOPTIONS_SAFEDISCARD &&
|
||||||
|
textureContainer->canBeDiscarded && SDL_AtomicGet(&textureContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveTexture(
|
VULKAN_INTERNAL_DiscardActiveTexture(
|
||||||
renderer,
|
renderer,
|
||||||
textureContainer
|
textureContainer
|
||||||
|
@ -9092,8 +9137,10 @@ static void VULKAN_CopyBufferToBuffer(
|
||||||
VulkanBufferContainer *dstContainer = (VulkanBufferContainer*) destination;
|
VulkanBufferContainer *dstContainer = (VulkanBufferContainer*) destination;
|
||||||
VkBufferCopy bufferCopy;
|
VkBufferCopy bufferCopy;
|
||||||
|
|
||||||
if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && SDL_AtomicGet(&dstContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0)
|
if (
|
||||||
{
|
option == REFRESH_COPYOPTIONS_SAFEDISCARD &&
|
||||||
|
SDL_AtomicGet(&dstContainer->activeBufferHandle->vulkanBuffer->referenceCount) > 0
|
||||||
|
) {
|
||||||
VULKAN_INTERNAL_DiscardActiveBuffer(
|
VULKAN_INTERNAL_DiscardActiveBuffer(
|
||||||
renderer,
|
renderer,
|
||||||
dstContainer
|
dstContainer
|
||||||
|
|
Loading…
Reference in New Issue