From 477ea95905b9b39c244776a63a28a876444c3235 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 21 Feb 2022 12:07:16 -0500 Subject: [PATCH] Fix metal not getting drawable correctly --- engine/gfx/metal/src/gfx_metal.cpp | 5 ++--- engine/platform/include/platform.hpp | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/engine/gfx/metal/src/gfx_metal.cpp b/engine/gfx/metal/src/gfx_metal.cpp index aad92ed..7a08491 100755 --- a/engine/gfx/metal/src/gfx_metal.cpp +++ b/engine/gfx/metal/src/gfx_metal.cpp @@ -81,7 +81,7 @@ MTL::SamplerAddressMode toSamplingMode(SamplingMode mode) { } #if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) -MTL::SamplerBorderColor toBorderColor(GFXBorderColor color) { +inline MTL::SamplerBorderColor toBorderColor(GFXBorderColor color) { switch(color) { case GFXBorderColor::OpaqueWhite: return MTL::SamplerBorderColorOpaqueWhite; @@ -720,8 +720,7 @@ void GFXMetal::submit(GFXCommandBuffer* command_buffer, const platform::window_p CA::MetalDrawable* drawable = nullptr; if(native != nullptr) { - auto next_drawable = (metal_next_image*)platform::get_next_image(window); - drawable = next_drawable->next_drawable; + drawable = (metal_next_image)platform::get_next_image(window); } MTL::CommandBuffer* commandBuffer = command_queue->commandBuffer(); diff --git a/engine/platform/include/platform.hpp b/engine/platform/include/platform.hpp index a531992..67ef680 100755 --- a/engine/platform/include/platform.hpp +++ b/engine/platform/include/platform.hpp @@ -111,9 +111,7 @@ struct metal_surface { MTL::PixelFormat format; }; -struct metal_next_image { - CA::MetalDrawable* next_drawable; -}; +using metal_next_image = CA::MetalDrawable*; #endif namespace platform {