Skip to content

Commit

Permalink
Added missing define and rewrapped into ifdef Metal_IsSupported
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed Apr 25, 2024
1 parent 41bbf55 commit ce9baff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "iOS")
$<$<NOT:$<CONFIG:Debug>>:NDEBUG>
$<$<CONFIG:Debug>:SPDLOG_ACTIVE_LEVEL=0>
$<$<NOT:$<CONFIG:Debug>>:SPDLOG_ACTIVE_LEVEL=1>
__IOS__
)
else()
target_compile_definitions(libultraship PRIVATE
Expand Down
3 changes: 2 additions & 1 deletion src/graphic/Fast3D/gfx_metal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@ static MTL::SamplerAddressMode gfx_cm_to_metal(uint32_t val) {
bool Metal_IsSupported() {
#ifdef __IOS__
return true;
#endif
#else
NS::Array* devices = MTLCopyAllDevices();
NS::UInteger count = devices->count();

devices->release();

return count > 0;
#endif
}

bool Metal_Init(SDL_Renderer* renderer) {
Expand Down

0 comments on commit ce9baff

Please sign in to comment.