Merge pull request #1142 from MarnixKuijs/master
Device fallback and fixed typo
This commit is contained in:
commit
c593983ae0
@ -1346,7 +1346,7 @@ VkResult MVKCmdClearImage<N>::setContent(MVKCommandBuffer* cmdBuff,
|
||||
|
||||
// Validate
|
||||
MVKMTLFmtCaps mtlFmtCaps = cmdBuff->getPixelFormats()->getCapabilities(_image->getMTLPixelFormat(planeIndex));
|
||||
bool isDestUnwritableLinear = MVK_MACOS && !cmdBuff->getDevice()->_pMetalFeatures->renderLinearTextures && _dstImage->getIsLinear();
|
||||
bool isDestUnwritableLinear = MVK_MACOS && !cmdBuff->getDevice()->_pMetalFeatures->renderLinearTextures && _image->getIsLinear();
|
||||
uint32_t reqCap = isDS ? kMVKMTLFmtCapsDSAtt : (isDestUnwritableLinear ? kMVKMTLFmtCapsWrite : kMVKMTLFmtCapsColorAtt);
|
||||
if (!mvkAreAllFlagsEnabled(mtlFmtCaps, reqCap)) {
|
||||
return cmdBuff->reportError(VK_ERROR_FEATURE_NOT_PRESENT, "vkCmdClear%sImage(): Format %s cannot be cleared on this device.", (isDS ? "DepthStencil" : "Color"), cmdBuff->getPixelFormats()->getName(_image->getVkFormat()));
|
||||
|
@ -1425,7 +1425,7 @@ void MVKPixelFormats::modifyMTLFormatCapabilities() {
|
||||
#endif
|
||||
#if MVK_MACOS
|
||||
NSArray<id<MTLDevice>>* mtlDevices = MTLCopyAllDevices(); // temp retained
|
||||
id<MTLDevice> mtlDevice = [mtlDevices[0] retain]; // temp retained
|
||||
id<MTLDevice> mtlDevice = [mtlDevices count] > 0 ? [mtlDevices[0] retain] : MTLCreateSystemDefaultDevice(); // temp retained
|
||||
[mtlDevices release]; // temp release
|
||||
#endif
|
||||
modifyMTLFormatCapabilities(mtlDevice);
|
||||
|
Loading…
x
Reference in New Issue
Block a user