mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-29 12:34:17 +01:00
fix: incorrect texture usages
This commit is contained in:
parent
1750715791
commit
b8021b642d
@ -65,7 +65,7 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM
|
||||
}
|
||||
else if (textureType == MTL::TextureTypeCube)
|
||||
{
|
||||
// Do notjing
|
||||
// Do nothing
|
||||
}
|
||||
else if (textureType == MTL::TextureTypeCubeArray)
|
||||
{
|
||||
@ -81,13 +81,10 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM
|
||||
|
||||
MTL::TextureUsage usage = MTL::TextureUsageShaderRead | MTL::TextureUsagePixelFormatView;
|
||||
if (!Latte::IsCompressedFormat(format))
|
||||
{
|
||||
usage |= MTL::TextureUsageRenderTarget;
|
||||
}
|
||||
desc->setUsage(usage);
|
||||
|
||||
m_texture = mtlRenderer->GetDevice()->newTexture(desc);
|
||||
|
||||
desc->release();
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "Cafe/HW/Latte/Renderer/Metal/MetalCommon.h"
|
||||
#include "Cafe/HW/Latte/Renderer/Metal/MetalLayerHandle.h"
|
||||
#include "Cafe/HW/Latte/Renderer/Renderer.h"
|
||||
#include "HW/Latte/Renderer/Metal/MetalAttachmentsInfo.h"
|
||||
#include "config/CemuConfig.h"
|
||||
|
||||
#define IMGUI_IMPL_METAL_CPP
|
||||
@ -70,6 +69,7 @@ MetalRenderer::MetalRenderer()
|
||||
MTL::TextureDescriptor* textureDescriptor = MTL::TextureDescriptor::alloc()->init();
|
||||
textureDescriptor->setTextureType(MTL::TextureType1D);
|
||||
textureDescriptor->setWidth(1);
|
||||
textureDescriptor->setUsage(MTL::TextureUsageShaderRead);
|
||||
m_nullTexture1D = m_device->newTexture(textureDescriptor);
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
m_nullTexture1D->setLabel(GetLabel("Null texture 1D", m_nullTexture1D));
|
||||
@ -77,6 +77,7 @@ MetalRenderer::MetalRenderer()
|
||||
|
||||
textureDescriptor->setTextureType(MTL::TextureType2D);
|
||||
textureDescriptor->setHeight(1);
|
||||
textureDescriptor->setUsage(MTL::TextureUsageShaderRead | MTL::TextureUsageRenderTarget);
|
||||
m_nullTexture2D = m_device->newTexture(textureDescriptor);
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
m_nullTexture2D->setLabel(GetLabel("Null texture 2D", m_nullTexture2D));
|
||||
|
Loading…
Reference in New Issue
Block a user