RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.48k stars 253 forks source link

macOS: Fix compile failure when configuring metal argument buffers with MoltenVK >= 1.2.10 #919

Closed SRSaunders closed 3 months ago

SRSaunders commented 3 months ago

This is a macOS-only fix.

In MoltenVK >= 1.2.10, the useMetalArgumentBuffers private configuration parameter has changed from an enum to a boolean. This causes a compile failure with a mismatched type. This PR does the following:

  1. Removes reference to the missing enum type and values, and instead uses a decltype() cast from an int to provide compatibility between old and new SDK (MoltenVK) versions.
  2. Updates the cmake-xcode-debug.sh script to define MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=1(On) for compatibility between old and new SDK (MoltenVK) versions.
  3. Adds CVAR_NEW tag to r_mvk* cvar declarations.