From 2c27f9e1c5e77c6cf3eb9fb1fae0f95317cac0d8 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Sun, 10 Nov 2024 22:19:15 +0100 Subject: [PATCH] Update texture usage flags --- src/metal/rt64_metal.mm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/metal/rt64_metal.mm b/src/metal/rt64_metal.mm index 13e701e..4e829f4 100755 --- a/src/metal/rt64_metal.mm +++ b/src/metal/rt64_metal.mm @@ -527,19 +527,8 @@ namespace RT64 { descriptor.mipmapLevelCount = desc.mipLevels; descriptor.arrayLength = 1; descriptor.sampleCount = desc.multisampling.sampleCount; - // TODO: Usage flags - if (desc.flags & RenderTextureFlag::RENDER_TARGET) { - descriptor.usage |= MTLTextureUsageRenderTarget; - } - if (desc.flags & RenderTextureFlag::DEPTH_TARGET) { - descriptor.usage |= MTLTextureUsageRenderTarget; - } - if (desc.flags & RenderTextureFlag::STORAGE) { - descriptor.usage |= MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite; - } - if (desc.flags & RenderTextureFlag::UNORDERED_ACCESS) { - descriptor.usage |= MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite; - } + descriptor.usage |= (desc.flags & (RenderTextureFlag::RENDER_TARGET | RenderTextureFlag::DEPTH_TARGET)) ? MTLTextureUsageRenderTarget : MTLTextureUsageUnknown; + descriptor.usage |= (desc.flags & (RenderTextureFlag::UNORDERED_ACCESS)) ? MTLTextureUsageShaderWrite : MTLTextureUsageUnknown; if (pool != nullptr) { this->mtlTexture = [pool->heap newTextureWithDescriptor: descriptor];