Skip to content

Commit 65016f4

Browse files
committed
Remove atomic usage for RG32Uint.
1 parent 5ad3ee5 commit 65016f4

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

MoltenVK/MoltenVK/GPUObjects/MVKBuffer.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
if ( mvkIsAnyFlagEnabled(_buffer->getUsage(), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) ) {
297297
usage |= MTLTextureUsageShaderWrite;
298298
#if MVK_XCODE_15
299-
if (getMetalFeatures().nativeTextureAtomics && (_mtlPixelFormat == MTLPixelFormatR32Sint || _mtlPixelFormat == MTLPixelFormatR32Uint || _mtlPixelFormat == MTLPixelFormatRG32Uint))
299+
if (getMetalFeatures().nativeTextureAtomics && (_mtlPixelFormat == MTLPixelFormatR32Sint || _mtlPixelFormat == MTLPixelFormatR32Uint))
300300
usage |= MTLTextureUsageShaderAtomic;
301301
#endif
302302
}

MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.mm

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@
748748
}
749749

750750
#if MVK_XCODE_15
751-
if (supportAtomics && (mtlFormat == MTLPixelFormatR32Uint || mtlFormat == MTLPixelFormatR32Sint || mtlFormat == MTLPixelFormatRG32Uint)) {
751+
if (supportAtomics && (mtlFormat == MTLPixelFormatR32Uint || mtlFormat == MTLPixelFormatR32Sint)) {
752752
mvkEnableFlags(mtlUsage, MTLTextureUsageShaderAtomic);
753753
}
754754
#endif
@@ -1497,7 +1497,6 @@
14971497
// Modifies the format capability tables based on the capabilities of the specific MTLDevice
14981498
void MVKPixelFormats::modifyMTLFormatCapabilities(const MVKMTLDeviceCapabilities& gpuCaps) {
14991499

1500-
bool noVulkanSupport = false; // Indicated supported in Metal but not Vulkan or SPIR-V.
15011500
bool notMac = gpuCaps.isAppleGPU && !gpuCaps.supportsMac1;
15021501
bool iosOnly1 = notMac && !gpuCaps.supportsApple2;
15031502
bool iosOnly2 = notMac && !gpuCaps.supportsApple3;
@@ -1538,12 +1537,6 @@
15381537
setMTLPixFmtCapsIf( iosOnly6, RG32Uint, RWC );
15391538
setMTLPixFmtCapsIf( iosOnly6, RG32Sint, RWC );
15401539

1541-
// Metal supports reading both R&G into as one 64-bit atomic operation, but Vulkan and SPIR-V do not.
1542-
// Including this here so we remember to update this if support is added to Vulkan in the future.
1543-
bool atomic64 = noVulkanSupport && (gpuCaps.supportsApple9 || (gpuCaps.supportsApple8 && gpuCaps.supportsMac2));
1544-
enableMTLPixFmtCapsIf( atomic64, RG32Uint, Atomic );
1545-
enableMTLPixFmtCapsIf( atomic64, RG32Sint, Atomic );
1546-
15471540
setMTLPixFmtCapsIf( iosOnly8, RG32Float, RWCMB );
15481541
setMTLPixFmtCapsIf( iosOnly6, RG32Float, RWCB );
15491542

0 commit comments

Comments
 (0)