Metal: Always add GPU_TEXTURE_USAGE_ATTACHMENT flag

Texture clearing is done using framebuffer clear.
To avoid adding the flag everywhere we add it as part
of the texture creation process.

This should have no performance impact.
This commit is contained in:
Clément Foucault
2023-05-19 18:45:02 +02:00
parent 8bca0e1075
commit c435d2f856

View File

@@ -178,6 +178,9 @@ bool Texture::init_view(GPUTexture *src_,
void Texture::usage_set(eGPUTextureUsage usage_flags)
{
gpu_image_usage_flags_ = usage_flags;
/* Metal: Texture clearing is done using framebuffer clear. This has no performance impact. */
/* TODO(fclem): Move this to metal backend instead to avoid side effects in other backends. */
gpu_image_usage_flags_ |= GPU_TEXTURE_USAGE_ATTACHMENT;
}
/** \} */