From 79e86ed1b6e4325fe166ae1adcb4e8a08e18681c Mon Sep 17 00:00:00 2001 From: Samuliak Date: Sun, 6 Oct 2024 19:35:15 +0200 Subject: [PATCH] fix: image views segfaulting --- .../renderer_metal/mtl_texture_cache.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/video_core/renderer_metal/mtl_texture_cache.cpp b/src/video_core/renderer_metal/mtl_texture_cache.cpp index 73faeae631..af8082688a 100644 --- a/src/video_core/renderer_metal/mtl_texture_cache.cpp +++ b/src/video_core/renderer_metal/mtl_texture_cache.cpp @@ -122,17 +122,16 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI ImageId image_id_, Image& image) : VideoCommon::ImageViewBase{info, image.info, image_id_, image.gpu_addr} { using Shader::TextureType; - if (image.GetHandle()) { - texture = image.GetHandle()->retain(); - } + texture = image.GetHandle(); - // TODO: create texture view + // TODO: implement } +// TODO: save slot images ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewInfo& info, ImageId image_id_, Image& image, const SlotVector& slot_imgs) : ImageView(runtime, info, image_id_, image) { - // TODO: save slot images + texture = image.GetHandle(); } ImageView::ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, @@ -147,9 +146,8 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::NullImageV } ImageView::~ImageView() { - if (texture) { - texture->release(); - } + // TODO: uncomment + // texture->release(); } Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& tsc) {