Support runtime config via runtime environment variables

and enable sync queue submits as default.

MVKConfiguration values can be set via runtime environment variables
or compile time build settings.
Enable GPU switching control via MVKConfiguration::switchSystemGPU
and MVK_CONFIG_SWITCH_SYSTEM_GPU env var & build setting.
Enable MVKConfiguration::synchronousQueueSubmits by default.
Set MVKConfiguration::performanceTracking via
MVK_CONFIG_PERFORMANCE_TRACKING env var & build setting.
Set MVKConfiguration::performanceLoggingFrameCount via
MVK_CONFIG_PERFORMANCE_LOGGING_FRAME_COUNT env var & build setting.
Add mvkGetEnvVar(), mvkGetEnvVarInt64() & mvkGetEnvVarBool() functions.
Add MVK_SET_FROM_ENV_OR_BUILD_BOOL(), MVK_SET_FROM_ENV_OR_BUILD_INT32()
& MVK_SET_FROM_ENV_OR_BUILD_INT64() macros.
Rename MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_POOL macro
to MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE.
This commit is contained in:
Bill Hollings 2019-01-09 16:59:04 -05:00
parent d13e5d487c
commit bdf540d25a
6 changed files with 232 additions and 80 deletions

View File

@ -65,11 +65,14 @@ extern "C" {
* To be active, some configuration settings must be set before a VkDevice is created.
* See the description of the individual configuration structure members for more information.
*
* The initial value of several of these settings is deterined when MolttenVK is compiled by the
* presence of a DEBUG build setting, By default the DEBUG build setting is present when MoltenVK
* is compiled in Debug mode, and not present when compiled in Release mode. The initial values
* of the other settings are determined by other build settings when MoltenVK is compiled.
* See the description of the individual configuration structure members for more information.
* The initial value of each of the configuration settings is established at runtime by a
* corresponding environment variable, or if the environment variable is not set, by a
* corresponding build setting at the time MoltenVK is compiled. The environment variable
* and build setting for each configuration setting share the same name.
*
* For example, the initial value of the shaderConversionFlipVertexY configuration setting
* is set by the MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y at runtime, or by the
* MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y build setting when MoltenVK is compiled.
*
* This structure may be extended as new features are added to MoltenVK. If you are linking to
* an implementation of MoltenVK that was compiled from a different VK_MVK_MOLTENVK_SPEC_VERSION
@ -84,10 +87,14 @@ extern "C" {
typedef struct {
/**
* If enabled, debugging capabilities will be enabled, including logging shader code
* during runtime shader conversion.
* If enabled, debugging capabilities will be enabled, including logging
* shader code during runtime shader conversion.
*
* Initial value is true in the presence of the DEBUG build setting, and false otherwise.
* The initial value or this parameter is set by the
* MVK_DEBUG
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter is false if MoltenVK was
* built in Release mode, and true if MoltenVK was built in Debug mode.
*/
VkBool32 debugMode;
@ -97,9 +104,10 @@ typedef struct {
* An alternate way to reverse the Y-axis is to employ a negative Y-axis value on
* the viewport, in which case this parameter can be disabled.
*
* Initial value is set by the MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y build setting
* when MoltenVK is compiled. By default the MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y
* build setting is set to true.
* The initial value or this parameter is set by the
* MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to true.
*/
VkBool32 shaderConversionFlipVertexY;
@ -109,10 +117,13 @@ typedef struct {
* will be dispatched to a GCD dispatch_queue whose priority is determined by
* VkDeviceQueueCreateInfo::pQueuePriorities during vkCreateDevice().
*
* Initial value is set by the MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS build setting when MoltenVK
* is compiled. By default the MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS build setting is set to false,
* and command processing will be handled on a prioritizable queue thread. Changing the value of
* this parameter must be done before creating a VkDevice, for the change to take effect.
* Changing the value of this parameter must be done before creating a VkDevice,
* for the change to take effect.
*
* The initial value or this parameter is set by the
* MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to true.
*/
VkBool32 synchronousQueueSubmits;
@ -146,8 +157,10 @@ typedef struct {
* command buffers do not support the concept of being reset after being filled. Depending on when
* and how often you do this, it may cause unexpected visual artifacts and unnecessary GPU load.
*
* Initial value is set by the MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS build setting when MoltenVK
* is compiled. By default the MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS build setting is set to false.
* The initial value or this parameter is set by the
* MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to false.
*/
VkBool32 prefillMetalCommandBuffers;
@ -159,10 +172,13 @@ typedef struct {
* is required per command buffer queue submission, which may be significantly less than the
* number of Vulkan command buffers.
*
* Initial value is set by the MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_POOL build setting
* when MoltenVK is compiled. By default the MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_POOL
* build setting is set to 64. Changing the value of this parameter must be done before creating
* a VkDevice, for the change to take effect.
* Changing the value of this parameter must be done before creating a VkDevice,
* for the change to take effect.
*
* The initial value or this parameter is set by the
* MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to 64.
*/
uint32_t maxActiveMetalCommandBuffersPerQueue;
@ -174,9 +190,10 @@ typedef struct {
* within a renderpass. If disabled, one MTLBuffer will be shared by all query pools,
* which improves performance, but limits the total device queries to 8192.
*
* Initial value is set by the MVK_CONFIG_SUPPORT_LARGE_QUERY_POOLS build setting
* when MoltenVK is compiled. By default the MVK_CONFIG_SUPPORT_LARGE_QUERY_POOLS
* build setting is set to true.
* The initial value or this parameter is set by the
* MVK_CONFIG_SUPPORT_LARGE_QUERY_POOLS
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to true.
*/
VkBool32 supportLargeQueryPools;
@ -184,8 +201,10 @@ typedef struct {
* If enabled, each surface presentation is scheduled using a command buffer. Enabling this
* setting may improve rendering frame synchronization, but may result in reduced frame rates.
*
* Initial value is set by the MVK_CONFIG_PRESENT_WITH_COMMAND_BUFFER build setting when MoltenVK
* is compiled. By default the MVK_CONFIG_PRESENT_WITH_COMMAND_BUFFER build setting is set to true.
* The initial value or this parameter is set by the
* MVK_CONFIG_PRESENT_WITH_COMMAND_BUFFER
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to true.
*/
VkBool32 presentWithCommandBuffer;
@ -197,9 +216,10 @@ typedef struct {
* multiples of display pixels (eg- macOS Retina, and typical of graphics apps and games),
* but may cause aliasing effects when using non-integer display scaling.
*
* Initial value is set by the MVK_CONFIG_SWAPCHAIN_MAG_FILTER_USE_NEAREST build setting
* when MoltenVK is compiled. By default the MVK_CONFIG_SWAPCHAIN_MAG_FILTER_USE_NEAREST
* build setting is set to true.
* The initial value or this parameter is set by the
* MVK_CONFIG_SWAPCHAIN_MAG_FILTER_USE_NEAREST
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to true.
*/
VkBool32 swapchainMagFilterUseNearest;
@ -209,8 +229,10 @@ typedef struct {
* within the Metal compiler can stall the thread for up to 30 seconds. Setting this value
* limits that delay to a specified amount of time, allowing shader compilations to fail fast.
*
* Initial value is set by the MVK_CONFIG_METAL_COMPILE_TIMEOUT build setting when MoltenVK
* is compiled. By default the MVK_CONFIG_METAL_COMPILE_TIMEOUT build setting is infinite.
* The initial value or this parameter is set by the
* MVK_CONFIG_METAL_COMPILE_TIMEOUT
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to infinite.
*/
uint64_t metalCompileTimeout;
@ -219,7 +241,10 @@ typedef struct {
* retrieved via the vkGetSwapchainPerformanceMVK() function, and various performance statistics
* are tracked, logged, and can be retrieved via the vkGetPerformanceStatisticsMVK() function.
*
* Initial value is true in the presence of the DEBUG build setting, and false otherwise.
* The initial value or this parameter is set by the
* MVK_CONFIG_PERFORMANCE_TRACKING
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to false.
*/
VkBool32 performanceTracking;
@ -227,7 +252,10 @@ typedef struct {
* If non-zero, performance statistics will be periodically logged to the console, on a repeating
* cycle of this many frames per swapchain. The performanceTracking capability must also be enabled.
*
* Initial value is 300 in the presence of the DEBUG build setting, and zero otherwise.
* The initial value or this parameter is set by the
* MVK_CONFIG_PERFORMANCE_LOGGING_FRAME_COUNT
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to zero.
*/
uint32_t performanceLoggingFrameCount;
@ -235,8 +263,10 @@ typedef struct {
* If enabled, a MoltenVK logo watermark will be rendered on top of the scene.
* This can be enabled for publicity during demos.
*
* Initial value is set by the MVK_CONFIG_DISPLAY_WATERMARK build setting when MoltenVK
* is compiled. By default the MVK_CONFIG_DISPLAY_WATERMARK build setting is set to false.
* The initial value or this parameter is set by the
* MVK_CONFIG_DISPLAY_WATERMARK
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to false.
*/
VkBool32 displayWatermark;
@ -257,11 +287,46 @@ typedef struct {
* as having specialized graphics OR compute OR transfer functionality, to make it easier for some
* apps to select a queue family with the appropriate requirements.
*
* Initial value is set by the MVK_CONFIG_SPECIALIZED_QUEUE_FAMILIES build setting when MoltenVK
* is compiled. By default the MVK_CONFIG_SPECIALIZED_QUEUE_FAMILIES build setting is set to false.
* The initial value or this parameter is set by the
* MVK_CONFIG_SPECIALIZED_QUEUE_FAMILIES
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to false.
*/
VkBool32 specializedQueueFamilies;
/**
* If enabled, when the app creates a VkDevice from a VkPhysicalDevice (GPU) that is neither
* headless nor low-power, and is different than the GPU used by the windowing system, the
* windowing system will be forced to switch to use the GPU selected by the Vulkan app.
* When the Vulkan app is ended, the windowing system will automatically switch back to
* using the previous GPU, depending on the usage requirements of other running apps.
*
* If disabled, the Vulkan app will render using its selected GPU, and if the windowing
* system uses a different GPU, the windowing system compositor will automatically copy
* framebuffer content from the app GPU to the windowing system GPU.
*
* The value of this parmeter has no effect on systems with a single GPU, or when the
* Vulkan app creates a VkDevice from a low-power or headless VkPhysicalDevice (GPU).
*
* Switching the windowing system GPU to match the Vulkan app GPU maximizes app performance,
* because it avoids the windowing system compositor from having to copy framebuffer content
* between GPUs on each rendered frame. However, doing so forces the entire system to
* potentially switch to using a GPU that may consume more power while the app is running.
*
* Some Vulkan apps may want to render using a high-power GPU, but leave it up to the
* system window compositor to determine how best to blend content with the windowing
* system, and as a result, may want to disable this parameter.
*
* Changing the value of this parameter must be done before creating a VkDevice,
* for the change to take effect.
*
* The initial value or this parameter is set by the
* MVK_CONFIG_SWITCH_SYSTEM_GPU
* runtime environment variable or MoltenVK compile-time build setting.
* If neither is set, the value of this parameter defaults to true.
*/
VkBool32 switchSystemGPU;
} MVKConfiguration;
/**

View File

@ -581,6 +581,7 @@ protected:
MVKResource* addResource(MVKResource* rez);
MVKResource* removeResource(MVKResource* rez);
void initPerformanceTracking();
void initPhysicalDevice(MVKPhysicalDevice* physicalDevice);
void initQueues(const VkDeviceCreateInfo* pCreateInfo);
const char* getActivityPerformanceDescription(MVKPerformanceTracker& shaderCompilationEvent);
uint64_t getPerformanceTimestampImpl();

View File

@ -1789,27 +1789,7 @@ uint32_t MVKDevice::expandVisibilityResultMTLBuffer(uint32_t queryCount) {
MVKDevice::MVKDevice(MVKPhysicalDevice* physicalDevice, const VkDeviceCreateInfo* pCreateInfo) {
initPerformanceTracking();
#if MVK_MACOS
//on mac OS, the wrong GPU will drive the screen (graphics switching will not occur)
//unless we call this specific MTLCreateSystemDefaultDevice method to create the metal device
id<MTLDevice> device = physicalDevice->getMTLDevice();
if (!device.headless && !device.lowPower) {
id<MTLDevice> sysDefaultDevice = MTLCreateSystemDefaultDevice();
//lets be 100% sure this is the device the user asked for
if (sysDefaultDevice.registryID == device.registryID) {
physicalDevice->replaceMTLDevice(sysDefaultDevice);
}
}
#endif
_physicalDevice = physicalDevice;
_pMVKConfig = _physicalDevice->_mvkInstance->getMoltenVKConfiguration();
_pFeatures = &_physicalDevice->_features;
_pMetalFeatures = _physicalDevice->getMetalFeatures();
_pProperties = &_physicalDevice->_properties;
_pMemoryProperties = &_physicalDevice->_memoryProperties;
initPhysicalDevice(physicalDevice);
_globalVisibilityResultMTLBuffer = nil;
_globalVisibilityQueryCount = 0;
@ -1849,6 +1829,30 @@ void MVKDevice::initPerformanceTracking() {
_performanceStatistics.queue.mtlQueueAccess = initPerf;
}
void MVKDevice::initPhysicalDevice(MVKPhysicalDevice* physicalDevice) {
_physicalDevice = physicalDevice;
_pMVKConfig = _physicalDevice->_mvkInstance->getMoltenVKConfiguration();
_pFeatures = &_physicalDevice->_features;
_pMetalFeatures = _physicalDevice->getMetalFeatures();
_pProperties = &_physicalDevice->_properties;
_pMemoryProperties = &_physicalDevice->_memoryProperties;
#if MVK_MACOS
// If we have selected a high-power GPU and want to force the window system
// to use it, force the window system to use a high-power GPU by calling the
// MTLCreateSystemDefaultDevice function, and if that GPU is the same as the
// selected GPU, update the MTLDevice instance used by the MVKPhysicalDevice.
id<MTLDevice> mtlDevice = _physicalDevice->getMTLDevice();
if (_pMVKConfig->switchSystemGPU && !(mtlDevice.lowPower || mtlDevice.headless) ) {
id<MTLDevice> sysMTLDevice = MTLCreateSystemDefaultDevice();
if (sysMTLDevice.registryID == mtlDevice.registryID) {
_physicalDevice->replaceMTLDevice(sysMTLDevice);
}
}
#endif
}
// Create the command queues
void MVKDevice::initQueues(const VkDeviceCreateInfo* pCreateInfo) {
uint32_t qrCnt = pCreateInfo->queueCreateInfoCount;

View File

@ -22,6 +22,7 @@
#include "MVKFoundation.h"
#include "MVKEnvironment.h"
#include "MVKSurface.h"
#include "MVKOSExtensions.h"
using namespace std;
@ -351,19 +352,20 @@ void MVKInstance::logVersions() {
// Init config.
void MVKInstance::initConfig() {
_mvkConfig.debugMode = MVK_DEBUG;
_mvkConfig.shaderConversionFlipVertexY = MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y;
_mvkConfig.synchronousQueueSubmits = MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS;
_mvkConfig.prefillMetalCommandBuffers = MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS;
_mvkConfig.maxActiveMetalCommandBuffersPerQueue = MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_POOL;
_mvkConfig.supportLargeQueryPools = MVK_CONFIG_SUPPORT_LARGE_QUERY_POOLS;
_mvkConfig.presentWithCommandBuffer = MVK_CONFIG_PRESENT_WITH_COMMAND_BUFFER;
_mvkConfig.swapchainMagFilterUseNearest = MVK_CONFIG_SWAPCHAIN_MAG_FILTER_USE_NEAREST;
_mvkConfig.metalCompileTimeout = MVK_CONFIG_METAL_COMPILE_TIMEOUT;
_mvkConfig.performanceTracking = MVK_DEBUG;
_mvkConfig.performanceLoggingFrameCount = MVK_DEBUG ? 300 : 0;
_mvkConfig.displayWatermark = MVK_CONFIG_DISPLAY_WATERMARK;
_mvkConfig.specializedQueueFamilies = MVK_CONFIG_SPECIALIZED_QUEUE_FAMILIES;
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.debugMode, MVK_DEBUG);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.shaderConversionFlipVertexY, MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.synchronousQueueSubmits, MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.prefillMetalCommandBuffers, MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS);
MVK_SET_FROM_ENV_OR_BUILD_INT32(_mvkConfig.maxActiveMetalCommandBuffersPerQueue, MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.supportLargeQueryPools, MVK_CONFIG_SUPPORT_LARGE_QUERY_POOLS);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.presentWithCommandBuffer, MVK_CONFIG_PRESENT_WITH_COMMAND_BUFFER);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.swapchainMagFilterUseNearest, MVK_CONFIG_SWAPCHAIN_MAG_FILTER_USE_NEAREST);
MVK_SET_FROM_ENV_OR_BUILD_INT64(_mvkConfig.metalCompileTimeout, MVK_CONFIG_METAL_COMPILE_TIMEOUT);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.performanceTracking, MVK_CONFIG_PERFORMANCE_TRACKING);
MVK_SET_FROM_ENV_OR_BUILD_INT32(_mvkConfig.performanceLoggingFrameCount, MVK_CONFIG_PERFORMANCE_LOGGING_FRAME_COUNT);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.displayWatermark, MVK_CONFIG_DISPLAY_WATERMARK);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.specializedQueueFamilies, MVK_CONFIG_SPECIALIZED_QUEUE_FAMILIES);
MVK_SET_FROM_ENV_OR_BUILD_BOOL( _mvkConfig.switchSystemGPU, MVK_CONFIG_SWITCH_SYSTEM_GPU);
}
VkResult MVKInstance::verifyLayers(uint32_t count, const char* const* names) {

View File

@ -19,6 +19,8 @@
#pragma once
#include "mvk_vulkan.h"
#include "MVKFoundation.h"
#include <string>
#import <Metal/Metal.h>
@ -67,6 +69,69 @@ inline void mvkDispatchToMainAndWait(dispatch_block_t block) {
}
#pragma mark -
#pragma mark Process environment
/**
* Returns the value of the environment variable at the given name,
* or an empty string if no environment variable with that name exists.
*
* If pWasFound is not null, it's value is set to true if the environment
* variable exists, or false if not.
*/
inline std::string mvkGetEnvVar(std::string varName, bool* pWasFound = nullptr) {
NSDictionary* env = [[NSProcessInfo processInfo] environment];
NSString* envStr = env[@(varName.c_str())];
if (pWasFound) { *pWasFound = envStr != nil; }
return envStr ? envStr.UTF8String : "";
}
/**
* Returns the value of the environment variable at the given name,
* or zero if no environment variable with that name exists.
*
* If pWasFound is not null, it's value is set to true if the environment
* variable exists, or false if not.
*/
inline int64_t mvkGetEnvVarInt64(std::string varName, bool* pWasFound = nullptr) {
return strtoll(mvkGetEnvVar(varName, pWasFound).c_str(), NULL, 0);
}
/**
* Returns the value of the environment variable at the given name,
* or false if no environment variable with that name exists.
*
* If pWasFound is not null, it's value is set to true if the environment
* variable exists, or false if not.
*/
inline bool mvkGetEnvVarBool(std::string varName, bool* pWasFound = nullptr) {
return mvkGetEnvVarInt64(varName, pWasFound) != 0;
}
#define MVK_SET_FROM_ENV_OR_BUILD_BOOL(cfgVal, EV) \
do { \
bool wasFound = false; \
bool ev = mvkGetEnvVarBool(#EV, &wasFound); \
cfgVal = wasFound ? ev : EV; \
} while(false)
#define MVK_SET_FROM_ENV_OR_BUILD_INT64(cfgVal, EV) \
do { \
bool wasFound = false; \
int64_t ev = mvkGetEnvVarInt64(#EV, &wasFound); \
cfgVal = wasFound ? ev : EV; \
} while(false)
#define MVK_SET_FROM_ENV_OR_BUILD_INT32(cfgVal, EV) \
do { \
bool wasFound = false; \
int64_t ev = mvkGetEnvVarInt64(#EV, &wasFound); \
int64_t val = wasFound ? ev : EV; \
cfgVal = (int32_t)mvkClamp(val, (int64_t)INT32_MIN, (int64_t)INT32_MAX); \
} while(false)
#pragma mark -
#pragma mark MTLDevice

View File

@ -44,9 +44,9 @@
# define MVK_CONFIG_SHADER_CONVERSION_FLIP_VERTEX_Y 1
#endif
/** Process command queue submissions on the same thread on which the submission call was made. Disabled by default. */
/** Process command queue submissions on the same thread on which the submission call was made. Enable by default. */
#ifndef MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS
# define MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS 0
# define MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS 1
#endif
/** Fill a Metal command buffers when each Vulkan command buffer is filled. */
@ -58,8 +58,8 @@
* The maximum number of Metal command buffers that can be concurrently
* active per Vulkan queue. Default is Metal's default value of 64.
*/
#ifndef MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_POOL
# define MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_POOL 64
#ifndef MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE
# define MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE 64
#endif
/** Support more than 8192 occlusion queries per buffer. Enabled by default. */
@ -77,21 +77,36 @@
# define MVK_CONFIG_SWAPCHAIN_MAG_FILTER_USE_NEAREST 1
#endif
/** Display the MoltenVK logo watermark. Disabled by default. */
#ifndef MVK_CONFIG_DISPLAY_WATERMARK
# define MVK_CONFIG_DISPLAY_WATERMARK 0
#endif
/** The maximum amount of time, in nanoseconds, to wait for a Metal library. Default is infinite. */
#ifndef MVK_CONFIG_METAL_COMPILE_TIMEOUT
# define MVK_CONFIG_METAL_COMPILE_TIMEOUT INT64_MAX
#endif
/** Track performance. Disabled by default. */
#ifndef MVK_CONFIG_PERFORMANCE_TRACKING
# define MVK_CONFIG_PERFORMANCE_TRACKING 0
#endif
/** Log performance once every this number of frames. Default is zero (never). */
#ifndef MVK_CONFIG_PERFORMANCE_LOGGING_FRAME_COUNT
# define MVK_CONFIG_PERFORMANCE_LOGGING_FRAME_COUNT 0
#endif
/** Display the MoltenVK logo watermark. Disabled by default. */
#ifndef MVK_CONFIG_DISPLAY_WATERMARK
# define MVK_CONFIG_DISPLAY_WATERMARK 0
#endif
/** Advertise specialized queue families. Disabled by default. */
#ifndef MVK_CONFIG_SPECIALIZED_QUEUE_FAMILIES
# define MVK_CONFIG_SPECIALIZED_QUEUE_FAMILIES 0
#endif
/** If the Vulkan app selects a high-power GPU, force the system to use it. Enabled by default. */
#ifndef MVK_CONFIG_SWITCH_SYSTEM_GPU
# define MVK_CONFIG_SWITCH_SYSTEM_GPU 1
#endif
/**
* IOSurfaces are supported on macOS, and on iOS starting with iOS 11.