vkCreateRenderPass() return VK_ERROR_FORMAT_NOT_SUPPORTED if format not supported.
This commit is contained in:
parent
0bc3be3707
commit
e2ce1a6329
@ -28,6 +28,7 @@ Released TBD
|
|||||||
- Fix crash in `vkDestroyPipelineLayout()`.
|
- Fix crash in `vkDestroyPipelineLayout()`.
|
||||||
- `vkCmdBlitImage()` support format component swizzling.
|
- `vkCmdBlitImage()` support format component swizzling.
|
||||||
- `vkCmdClearImage()` set error if attempt made to clear 1D image, and fix validation of depth attachment formats.
|
- `vkCmdClearImage()` set error if attempt made to clear 1D image, and fix validation of depth attachment formats.
|
||||||
|
- `vkCreateRenderPass()` return `VK_ERROR_FORMAT_NOT_SUPPORTED` if format not supported.
|
||||||
- Remove error logging on `VK_TIMEOUT` of `VkSemaphore` and `VkFence`.
|
- Remove error logging on `VK_TIMEOUT` of `VkSemaphore` and `VkFence`.
|
||||||
- Consolidate the various linkable objects into a `MVKLinkableMixin` template base class.
|
- Consolidate the various linkable objects into a `MVKLinkableMixin` template base class.
|
||||||
- Use `MVKVector` whenever possible in MoltenVK, especially within render loop.
|
- Use `MVKVector` whenever possible in MoltenVK, especially within render loop.
|
||||||
|
@ -134,6 +134,8 @@ public:
|
|||||||
const VkAttachmentDescription* pCreateInfo);
|
const VkAttachmentDescription* pCreateInfo);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
VkAttachmentDescription validate(const VkAttachmentDescription* pCreateInfo);
|
||||||
|
|
||||||
VkAttachmentDescription _info;
|
VkAttachmentDescription _info;
|
||||||
MVKRenderPass* _renderPass;
|
MVKRenderPass* _renderPass;
|
||||||
uint32_t _attachmentIndex;
|
uint32_t _attachmentIndex;
|
||||||
|
@ -321,9 +321,19 @@ MVKRenderPassAttachment::MVKRenderPassAttachment(MVKRenderPass* renderPass,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_info = *pCreateInfo;
|
_info = validate(pCreateInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate and potentially modify the create info
|
||||||
|
VkAttachmentDescription MVKRenderPassAttachment::validate(const VkAttachmentDescription* pCreateInfo) {
|
||||||
|
VkAttachmentDescription info = *pCreateInfo;
|
||||||
|
|
||||||
|
if ( !_renderPass->getMTLPixelFormatFromVkFormat(info.format) ) {
|
||||||
|
_renderPass->setConfigurationResult(reportError(VK_ERROR_FORMAT_NOT_SUPPORTED, "vkCreateRenderPass(): Attachment format %s is not supported on this device.", mvkVkFormatName(info.format)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark MVKRenderPass
|
#pragma mark MVKRenderPass
|
||||||
|
@ -580,7 +580,7 @@ MTLPixelFormat mvkMTLPixelFormatFromVkFormatInObj(VkFormat vkFormat, MVKBaseObje
|
|||||||
string errMsg;
|
string errMsg;
|
||||||
errMsg += "VkFormat ";
|
errMsg += "VkFormat ";
|
||||||
errMsg += (fmtDesc.vkName) ? fmtDesc.vkName : to_string(fmtDesc.vk);
|
errMsg += (fmtDesc.vkName) ? fmtDesc.vkName : to_string(fmtDesc.vk);
|
||||||
errMsg += " is not supported on this platform.";
|
errMsg += " is not supported on this device.";
|
||||||
|
|
||||||
if (fmtDesc.isSupportedOrSubstitutable()) {
|
if (fmtDesc.isSupportedOrSubstitutable()) {
|
||||||
mtlPixFmt = fmtDesc.mtlSubstitute;
|
mtlPixFmt = fmtDesc.mtlSubstitute;
|
||||||
@ -702,7 +702,7 @@ MTLVertexFormat mvkMTLVertexFormatFromVkFormatInObj(VkFormat vkFormat, MVKBaseOb
|
|||||||
string errMsg;
|
string errMsg;
|
||||||
errMsg += "VkFormat ";
|
errMsg += "VkFormat ";
|
||||||
errMsg += (fmtDesc.vkName) ? fmtDesc.vkName : to_string(fmtDesc.vk);
|
errMsg += (fmtDesc.vkName) ? fmtDesc.vkName : to_string(fmtDesc.vk);
|
||||||
errMsg += " is not supported for vertex buffers on this platform.";
|
errMsg += " is not supported for vertex buffers on this device.";
|
||||||
|
|
||||||
if (fmtDesc.vertexIsSupportedOrSubstitutable()) {
|
if (fmtDesc.vertexIsSupportedOrSubstitutable()) {
|
||||||
mtlVtxFmt = fmtDesc.mtlVertexFormatSubstitute;
|
mtlVtxFmt = fmtDesc.mtlVertexFormatSubstitute;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user