Skip to content

Commit

Permalink
Less views
Browse files Browse the repository at this point in the history
  • Loading branch information
etang-cw committed Nov 7, 2023
1 parent bb914fa commit b07d288
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MoltenVK/MoltenVK/GPUObjects/MVKImage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@
lock_guard<mutex> lock(_image->_lock);
mtlTex = _mtlTextureViews[mtlPixFmt];
if ( !mtlTex ) {
mtlTex = [baseTexture newTextureViewWithPixelFormat: mtlPixFmt]; // retained
if ([baseTexture pixelFormat] == mtlPixFmt)
mtlTex = [baseTexture retain];
else
mtlTex = [baseTexture newTextureViewWithPixelFormat: mtlPixFmt]; // retained
_mtlTextureViews[mtlPixFmt] = mtlTex;
}
}
Expand Down

0 comments on commit b07d288

Please sign in to comment.