Merge pull request #733 from aerofly/master
Avoid MTLDevice minimumLinearTextureAlignmentForPixelFormat failed assertion
This commit is contained in:
commit
055466bec6
@ -1159,6 +1159,10 @@ void MVKPhysicalDevice::initProperties() {
|
|||||||
uint32_t maxStorage = 0, maxUniform = 0;
|
uint32_t maxStorage = 0, maxUniform = 0;
|
||||||
bool singleTexelStorage = true, singleTexelUniform = true;
|
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) {
|
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;
|
NSUInteger alignment;
|
||||||
if ([_mtlDevice respondsToSelector: @selector(minimumTextureBufferAlignmentForPixelFormat:)]) {
|
if ([_mtlDevice respondsToSelector: @selector(minimumTextureBufferAlignmentForPixelFormat:)]) {
|
||||||
alignment = [_mtlDevice minimumTextureBufferAlignmentForPixelFormat: mvkMTLPixelFormatFromVkFormat(vk)];
|
alignment = [_mtlDevice minimumTextureBufferAlignmentForPixelFormat: mvkMTLPixelFormatFromVkFormat(vk)];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user