mirror of
https://github.com/rt64/rt64.git
synced 2025-01-01 03:38:09 +00:00
Update texture usage flags
This commit is contained in:
parent
b855e7dd69
commit
2c27f9e1c5
@ -527,19 +527,8 @@ namespace RT64 {
|
|||||||
descriptor.mipmapLevelCount = desc.mipLevels;
|
descriptor.mipmapLevelCount = desc.mipLevels;
|
||||||
descriptor.arrayLength = 1;
|
descriptor.arrayLength = 1;
|
||||||
descriptor.sampleCount = desc.multisampling.sampleCount;
|
descriptor.sampleCount = desc.multisampling.sampleCount;
|
||||||
// TODO: Usage flags
|
descriptor.usage |= (desc.flags & (RenderTextureFlag::RENDER_TARGET | RenderTextureFlag::DEPTH_TARGET)) ? MTLTextureUsageRenderTarget : MTLTextureUsageUnknown;
|
||||||
if (desc.flags & RenderTextureFlag::RENDER_TARGET) {
|
descriptor.usage |= (desc.flags & (RenderTextureFlag::UNORDERED_ACCESS)) ? MTLTextureUsageShaderWrite : MTLTextureUsageUnknown;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pool != nullptr) {
|
if (pool != nullptr) {
|
||||||
this->mtlTexture = [pool->heap newTextureWithDescriptor: descriptor];
|
this->mtlTexture = [pool->heap newTextureWithDescriptor: descriptor];
|
||||||
|
Loading…
Reference in New Issue
Block a user