Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined format when using dynamic rendering with depth/stencil attachment. #2342

Open
jeroenbakker-atmind opened this issue Sep 18, 2024 · 1 comment

Comments

@jeroenbakker-atmind
Copy link
Contributor

jeroenbakker-atmind commented Sep 18, 2024

It seems like when using a D32_SFLOAT_S8_UINT as depth attachment it gets VK_FORMAT_UNDEFINED and fails to create a valid render pass.

MVKAttachmentDescription::MVKAttachmentDescription(MVKRenderPass* renderPass,
												   const VkRenderingAttachmentInfo* pAttInfo,
												   bool isResolveAttachment) {

sets _info.format to VK_FORMAT_UNDEFINED The MTLPixelFormat is MTLPixelFormatX32_Stencil8. I expected the vkFormat to be filled by MVKPixelFormats::buildVkFormatMaps But it isn't as there is only a one to one mapping from Vulkan to Metal and Depth32Float_Stencil8 is already mapping.

It then prints errors in MVKAttachmentDescription::linkToSubpasses as no format is known. The render pass configuration error is set to VK_ERROR_FORMAT_NOT_SUPPORTED. This might lead to not any further commands for this rendering context.

Expectation
I would expect that the MTLPixelFormatX32_Stencil8 would have a valid vkFormat assigned.
When attaching a depth/stencil image I would not expect MTLPixelFormatX32_Stencil8 to be used but MTLPixelFormatDepth32Float_Stencil8 as we are writing to the image.

Reproducable
This was detected when running Blender using MoltenVK. The UI draws, but solid view doesn't draw at all.
Note that there is temporarily no working Blender on MoltenVK I hope to patch it later this week.

@jeroenbakker-atmind
Copy link
Contributor Author

If you need any information, please ask. It is quite easy to reproduce with Blender, although it is quite complex example. I could spent some time to narrow it down to the least amount of steps to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants