remove useless texture member variables

This commit is contained in:
Samuliak 2025-01-12 18:02:36 +01:00
parent 388bbe2586
commit aec7a182ce
No known key found for this signature in database
5 changed files with 8 additions and 19 deletions

View file

@ -8,7 +8,7 @@
LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM dim, MPTR physAddress, MPTR physMipAddress, Latte::E_GX2SURFFMT format, uint32 width, uint32 height, uint32 depth, uint32 pitch, uint32 mipLevels, uint32 swizzle, LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM dim, MPTR physAddress, MPTR physMipAddress, Latte::E_GX2SURFFMT format, uint32 width, uint32 height, uint32 depth, uint32 pitch, uint32 mipLevels, uint32 swizzle,
Latte::E_HWTILEMODE tileMode, bool isDepth) Latte::E_HWTILEMODE tileMode, bool isDepth)
: LatteTexture(dim, physAddress, physMipAddress, format, width, height, depth, pitch, mipLevels, swizzle, tileMode, isDepth), m_mtlr(mtlRenderer), m_format(format), m_isDepth(isDepth) : LatteTexture(dim, physAddress, physMipAddress, format, width, height, depth, pitch, mipLevels, swizzle, tileMode, isDepth), m_mtlr(mtlRenderer)
{ {
MTL::TextureDescriptor* desc = MTL::TextureDescriptor::alloc()->init(); MTL::TextureDescriptor* desc = MTL::TextureDescriptor::alloc()->init();
desc->setStorageMode(MTL::StorageModePrivate); desc->setStorageMode(MTL::StorageModePrivate);

View file

@ -17,14 +17,6 @@ public:
return m_texture; return m_texture;
} }
Latte::E_GX2SURFFMT GetFormat() const {
return m_format;
}
bool IsDepth() const {
return m_isDepth;
}
void AllocateOnHost() override; void AllocateOnHost() override;
protected: protected:
@ -34,7 +26,4 @@ private:
class MetalRenderer* m_mtlr; class MetalRenderer* m_mtlr;
MTL::Texture* m_texture; MTL::Texture* m_texture;
Latte::E_GX2SURFFMT m_format;
bool m_isDepth;
}; };

View file

@ -19,8 +19,8 @@ void LatteTextureReadbackInfoMtl::StartTransfer()
cemu_assert_debug(m_textureView->firstMip == 0); cemu_assert_debug(m_textureView->firstMip == 0);
cemu_assert_debug(m_textureView->baseTexture->dim != Latte::E_DIM::DIM_3D); cemu_assert_debug(m_textureView->baseTexture->dim != Latte::E_DIM::DIM_3D);
size_t bytesPerRow = GetMtlTextureBytesPerRow(baseTexture->format, baseTexture->IsDepth(), baseTexture->width); size_t bytesPerRow = GetMtlTextureBytesPerRow(baseTexture->format, baseTexture->isDepth, baseTexture->width);
size_t bytesPerImage = GetMtlTextureBytesPerImage(baseTexture->format, baseTexture->IsDepth(), baseTexture->height, bytesPerRow); size_t bytesPerImage = GetMtlTextureBytesPerImage(baseTexture->format, baseTexture->isDepth, baseTexture->height, bytesPerRow);
auto blitCommandEncoder = m_mtlr->GetBlitCommandEncoder(); auto blitCommandEncoder = m_mtlr->GetBlitCommandEncoder();

View file

@ -184,7 +184,7 @@ MTL::Texture* LatteTextureViewMtl::CreateSwizzledView(uint32 gpuSamplerSwizzle)
levelCount = std::min(levelCount, m_baseTexture->maxPossibleMipLevels - baseLevel); levelCount = std::min(levelCount, m_baseTexture->maxPossibleMipLevels - baseLevel);
levelCount = std::max(levelCount, (uint32)1); levelCount = std::max(levelCount, (uint32)1);
auto pixelFormat = GetMtlPixelFormat(format, m_baseTexture->IsDepth()); auto pixelFormat = GetMtlPixelFormat(format, m_baseTexture->isDepth);
MTL::Texture* texture = m_baseTexture->GetTexture()->newTextureView(pixelFormat, textureType, NS::Range::Make(baseLevel, levelCount), NS::Range::Make(baseLayer, layerCount), swizzle); MTL::Texture* texture = m_baseTexture->GetTexture()->newTextureView(pixelFormat, textureType, NS::Range::Make(baseLevel, levelCount), NS::Range::Make(baseLayer, layerCount), swizzle);
return texture; return texture;

View file

@ -351,8 +351,8 @@ void MetalRenderer::HandleScreenshotRequest(LatteTextureView* texView, bool padV
int width, height; int width, height;
texMtl->GetEffectiveSize(width, height, 0); texMtl->GetEffectiveSize(width, height, 0);
uint32 bytesPerRow = GetMtlTextureBytesPerRow(texMtl->format, texMtl->IsDepth(), width); uint32 bytesPerRow = GetMtlTextureBytesPerRow(texMtl->format, texMtl->isDepth, width);
uint32 size = GetMtlTextureBytesPerImage(texMtl->format, texMtl->IsDepth(), height, bytesPerRow); uint32 size = GetMtlTextureBytesPerImage(texMtl->format, texMtl->isDepth, height, bytesPerRow);
// TODO: get a buffer from the memory manager // TODO: get a buffer from the memory manager
MTL::Buffer* buffer = m_device->newBuffer(size, MTL::ResourceStorageModeShared); MTL::Buffer* buffer = m_device->newBuffer(size, MTL::ResourceStorageModeShared);
@ -670,9 +670,9 @@ void MetalRenderer::texture_loadSlice(LatteTexture* hostTexture, sint32 width, s
sliceIndex = 0; sliceIndex = 0;
} }
size_t bytesPerRow = GetMtlTextureBytesPerRow(textureMtl->GetFormat(), textureMtl->IsDepth(), width); size_t bytesPerRow = GetMtlTextureBytesPerRow(textureMtl->format, textureMtl->isDepth, width);
// No need to set bytesPerImage for 3D textures, since we always load just one slice // No need to set bytesPerImage for 3D textures, since we always load just one slice
//size_t bytesPerImage = GetMtlTextureBytesPerImage(textureMtl->GetFormat(), textureMtl->IsDepth(), height, bytesPerRow); //size_t bytesPerImage = GetMtlTextureBytesPerImage(textureMtl->GetFormat(), textureMtl->isDepth, height, bytesPerRow);
//if (m_isAppleGPU) //if (m_isAppleGPU)
//{ //{
// textureMtl->GetTexture()->replaceRegion(MTL::Region(0, 0, offsetZ, width, height, 1), mipIndex, sliceIndex, pixelData, bytesPerRow, 0); // textureMtl->GetTexture()->replaceRegion(MTL::Region(0, 0, offsetZ, width, height, 1), mipIndex, sliceIndex, pixelData, bytesPerRow, 0);