Skip to content

Commit

Permalink
Merge pull request #733 from aerofly/master
Browse files Browse the repository at this point in the history
Avoid MTLDevice minimumLinearTextureAlignmentForPixelFormat failed assertion
  • Loading branch information
billhollings authored Sep 8, 2019
2 parents 73ac6b6 + 5a02641 commit 055466b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,10 @@
uint32_t maxStorage = 0, maxUniform = 0;
bool singleTexelStorage = true, singleTexelUniform = true;
mvkEnumerateSupportedFormats({0, 0, VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT}, true, [&](VkFormat vk) {
// MTLDevice minimumLinearTextureAlignmentForPixelFormat with MTLPixelFormatInvalid will cause as a failed assertion on iOS 13.x and iPad OS 13.x
if ( vk == VK_FORMAT_UNDEFINED )
return false;

NSUInteger alignment;
if ([_mtlDevice respondsToSelector: @selector(minimumTextureBufferAlignmentForPixelFormat:)]) {
alignment = [_mtlDevice minimumTextureBufferAlignmentForPixelFormat: mvkMTLPixelFormatFromVkFormat(vk)];
Expand Down

0 comments on commit 055466b

Please sign in to comment.