diff --git a/src/core/gpu.h b/src/core/gpu.h index bc2b35a1a..fb9a555b5 100644 --- a/src/core/gpu.h +++ b/src/core/gpu.h @@ -52,8 +52,7 @@ enum { GPU_TEXTURE_RENDER = (1 << 1), GPU_TEXTURE_STORAGE = (1 << 2), GPU_TEXTURE_COPY_SRC = (1 << 3), - GPU_TEXTURE_COPY_DST = (1 << 4), - GPU_TEXTURE_TRANSIENT = (1 << 5) + GPU_TEXTURE_COPY_DST = (1 << 4) }; typedef enum { diff --git a/src/core/gpu_vk.c b/src/core/gpu_vk.c index 5a5d60879..f2797325e 100644 --- a/src/core/gpu_vk.c +++ b/src/core/gpu_vk.c @@ -485,7 +485,7 @@ bool gpu_texture_init(gpu_texture* texture, gpu_texture_info* info) { ((info->usage & GPU_TEXTURE_STORAGE) ? VK_IMAGE_USAGE_STORAGE_BIT : 0) | ((info->usage & GPU_TEXTURE_COPY_SRC) ? VK_IMAGE_USAGE_TRANSFER_SRC_BIT : 0) | ((info->usage & GPU_TEXTURE_COPY_DST) ? VK_IMAGE_USAGE_TRANSFER_DST_BIT : 0) | - ((info->usage & GPU_TEXTURE_TRANSIENT) ? VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT : 0) | + ((info->usage == GPU_TEXTURE_RENDER) ? VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT : 0) | (info->upload.levelCount > 0 ? VK_IMAGE_USAGE_TRANSFER_DST_BIT : 0) | (info->upload.generateMipmaps ? VK_IMAGE_USAGE_TRANSFER_SRC_BIT : 0) }; @@ -512,7 +512,7 @@ bool gpu_texture_init(gpu_texture* texture, gpu_texture_info* info) { nickname(texture->handle, VK_OBJECT_TYPE_IMAGE, info->label); gpu_memory_type memoryType; - bool transient = info->usage & GPU_TEXTURE_TRANSIENT; + bool transient = info->usage == GPU_TEXTURE_RENDER; switch (info->format) { case GPU_FORMAT_D16: memoryType = transient ? GPU_MEMORY_TEXTURE_LAZY_D16 : GPU_MEMORY_TEXTURE_D16; break; diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index c28f9873a..23ce4f44b 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -2104,8 +2104,7 @@ Texture* lovrTextureCreate(const TextureInfo* info) { ((info->usage & TEXTURE_SAMPLE) ? GPU_TEXTURE_SAMPLE : 0) | ((info->usage & TEXTURE_RENDER) ? GPU_TEXTURE_RENDER : 0) | ((info->usage & TEXTURE_STORAGE) ? GPU_TEXTURE_STORAGE : 0) | - (transfer ? GPU_TEXTURE_COPY_SRC | GPU_TEXTURE_COPY_DST : 0) | - ((info->usage == TEXTURE_RENDER) ? GPU_TEXTURE_TRANSIENT : 0), + (transfer ? GPU_TEXTURE_COPY_SRC | GPU_TEXTURE_COPY_DST : 0), .srgb = srgb, .handle = info->handle, .label = info->label, @@ -7543,7 +7542,7 @@ static gpu_texture* getScratchTexture(Canvas* canvas, TextureFormat format, bool .size = { canvas->width, canvas->height, canvas->views }, .mipmaps = 1, .samples = canvas->samples, - .usage = GPU_TEXTURE_RENDER | GPU_TEXTURE_TRANSIENT + .usage = GPU_TEXTURE_RENDER }; lovrAssert(gpu_texture_init(scratch->texture, &info), "Failed to create scratch texture");