Merge pull request #2173 from js6i/fixup-2
Don't set MTLTextureUsageShaderAtomic if the pixel format does not support it.
This commit is contained in:
commit
5d21869b6d
@ -291,7 +291,7 @@ id<MTLTexture> MVKBufferView::getMTLTexture() {
|
|||||||
if ( mvkIsAnyFlagEnabled(_buffer->getUsage(), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) ) {
|
if ( mvkIsAnyFlagEnabled(_buffer->getUsage(), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) ) {
|
||||||
usage |= MTLTextureUsageShaderWrite;
|
usage |= MTLTextureUsageShaderWrite;
|
||||||
#if MVK_XCODE_15
|
#if MVK_XCODE_15
|
||||||
if (getPhysicalDevice()->useNativeTextureAtomics())
|
if (getPhysicalDevice()->useNativeTextureAtomics() && (_mtlPixelFormat == MTLPixelFormatR32Sint || _mtlPixelFormat == MTLPixelFormatR32Uint || _mtlPixelFormat == MTLPixelFormatRG32Uint))
|
||||||
usage |= MTLTextureUsageShaderAtomic;
|
usage |= MTLTextureUsageShaderAtomic;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -729,7 +729,7 @@ MTLTextureUsage MVKPixelFormats::getMTLTextureUsage(VkImageUsageFlags vkImageUsa
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if MVK_XCODE_15
|
#if MVK_XCODE_15
|
||||||
if (supportAtomics) {
|
if (supportAtomics && (mtlFormat == MTLPixelFormatR32Uint || mtlFormat == MTLPixelFormatR32Sint || mtlFormat == MTLPixelFormatRG32Uint)) {
|
||||||
mvkEnableFlags(mtlUsage, MTLTextureUsageShaderAtomic);
|
mvkEnableFlags(mtlUsage, MTLTextureUsageShaderAtomic);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user