Skip to content

Commit

Permalink
Call IGL method to flush Metal texture cache
Browse files Browse the repository at this point in the history
Summary: This diff updates two places were accessing the texture cache held in an IGL Metal PlatformDevice and attempting to flush it without checking if it is null first. The update is to call the existing method on the PlatformDevice that does the same thing but includes the null check.

Reviewed By: syeh1

Differential Revision: D49151276

fbshipit-source-id: b12a846d7cc917affc8ff06b4e39629437b5b12f
  • Loading branch information
Eric Griffith authored and facebook-github-bot committed Sep 11, 2023
1 parent b1a0189 commit 2e8846a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/igl/metal/PlatformDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class PlatformDevice final : public IPlatformDevice {
/// @return An accurate pixel format that is suitable for rendering or invalid if failed.
TextureFormat getNativeDrawableTextureFormat(CALayer* nativeDrawable, Result* outResult);

void flushNativeTextureCache();
void flushNativeTextureCache() const;

CVMetalTextureCacheRef getTextureCache();

Expand Down
2 changes: 1 addition & 1 deletion src/igl/metal/PlatformDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
return textureCache_;
}

void PlatformDevice::flushNativeTextureCache() {
void PlatformDevice::flushNativeTextureCache() const {
#if (!TARGET_OS_SIMULATOR || __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000)
if (textureCache_) {
CVMetalTextureCacheFlush(textureCache_, 0);
Expand Down

0 comments on commit 2e8846a

Please sign in to comment.