Skip to content

Commit

Permalink
Apply _metalFeatures and _features overrides to all Simulators: iOS, …
Browse files Browse the repository at this point in the history
…tvOS, visionOS
  • Loading branch information
SRSaunders committed Oct 9, 2024
1 parent 393ce06 commit 4f86cf1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2146,11 +2146,8 @@
if ( mvkOSVersionIsAtLeast(13.0) ) {
_metalFeatures.mslVersionEnum = MTLLanguageVersion2_2;
_metalFeatures.placementHeaps = getMVKConfig().useMTLHeap;
#if MVK_OS_SIMULATOR
_metalFeatures.nativeTextureSwizzle = false;
#else
_metalFeatures.nativeTextureSwizzle = true;
#endif

if (supportsMTLGPUFamily(Apple3)) {
_metalFeatures.native3DCompressedTextures = true;
}
Expand Down Expand Up @@ -2448,9 +2445,10 @@
#endif
}

// iOS and tvOS adjustments necessary when running on the simulator.
// iOS, tvOS and visionOS adjustments necessary when running on the simulator.
#if MVK_OS_SIMULATOR
_metalFeatures.mtlBufferAlignment = 256; // Even on Apple Silicon
_metalFeatures.nativeTextureSwizzle = false;
#endif

// Argument buffers
Expand Down Expand Up @@ -2566,13 +2564,9 @@

_features.dualSrcBlend = true;

#if MVK_OS_SIMULATOR
_features.depthClamp = false;
#else
if (supportsMTLGPUFamily(Apple2)) {
_features.depthClamp = true;
}
#endif

if (supportsMTLGPUFamily(Apple3)) {
_features.tessellationShader = true;
Expand All @@ -2592,6 +2586,11 @@
}
#endif

// iOS, tvOS and visionOS adjustments necessary when running on the simulator.
#if MVK_OS_SIMULATOR
_features.depthClamp = false;
#endif

#if MVK_MACOS
_features.occlusionQueryPrecise = true;
_features.imageCubeArray = true;
Expand Down

0 comments on commit 4f86cf1

Please sign in to comment.