From 08dbc9bd8d9a489b0660f74ae11604f7dfb96d4f Mon Sep 17 00:00:00 2001 From: Samuliak Date: Sat, 5 Oct 2024 14:11:58 +0200 Subject: [PATCH] prevent buffer view from crashing --- src/video_core/renderer_metal/mtl_buffer_cache.cpp | 2 +- src/video_core/renderer_metal/mtl_buffer_cache.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_core/renderer_metal/mtl_buffer_cache.cpp b/src/video_core/renderer_metal/mtl_buffer_cache.cpp index 4b2a051829..61e72f2ef2 100644 --- a/src/video_core/renderer_metal/mtl_buffer_cache.cpp +++ b/src/video_core/renderer_metal/mtl_buffer_cache.cpp @@ -27,7 +27,7 @@ BufferView::BufferView(MTL::Buffer* buffer_, size_t offset_, size_t size_, : buffer{buffer_->retain()}, offset{offset_}, size{size_}, format{format_} {} BufferView::~BufferView() { - buffer->release(); + // buffer->release(); } Buffer::Buffer(BufferCacheRuntime& runtime, VideoCommon::NullBufferParams null_params) diff --git a/src/video_core/renderer_metal/mtl_buffer_cache.h b/src/video_core/renderer_metal/mtl_buffer_cache.h index 1037863ae3..77a9fc37f6 100644 --- a/src/video_core/renderer_metal/mtl_buffer_cache.h +++ b/src/video_core/renderer_metal/mtl_buffer_cache.h @@ -22,7 +22,7 @@ struct BufferView { VideoCore::Surface::PixelFormat format_ = VideoCore::Surface::PixelFormat::Invalid); ~BufferView(); - MTL::Buffer* buffer = nil; + MTL::Buffer* buffer = nullptr; size_t offset{}; size_t size{}; VideoCore::Surface::PixelFormat format{};