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

SubpassDescriptionBuilder::resolve_attachments Must null Out the Pointer if Slice Length is 0 #508

Closed
cwfitzgerald opened this issue Dec 6, 2021 · 2 comments

Comments

@cwfitzgerald
Copy link

cwfitzgerald commented Dec 6, 2021

Currently the builder for the resolve attachments just takes the pointer of the slice of the resolve attachments. Unfortunately the spec requires this be a true null if there are no resolve attachments.

pResolveAttachments is NULL or a pointer to an array of colorAttachmentCount VkAttachmentReference structures defining the resolve attachments for this subpass and their layouts.

Which means the generated code should look something like:

    pub fn resolve_attachments(mut self, resolve_attachments: &'a [AttachmentReference]) -> Self {
        self.inner.color_attachment_count = resolve_attachments.len() as _;
		if self.inner.color_attachment_count != 0 {
        	self.inner.p_resolve_attachments = resolve_attachments.as_ptr();
		} else {
			self.inner.p_resolve_attachments = 0 as _;
        }
        self
    }

Unfortunately it is just this slice that needs that qualification added.

This has caused a real driver issue on mobile drivers.

@cwfitzgerald
Copy link
Author

cwfitzgerald commented Dec 6, 2021

Not an ash bug, misread the spec. This is a driver bug, and per precedent, will be worked around a layer above ash.

@MarijnS95
Copy link
Collaborator

Related: #445

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

No branches or pull requests

2 participants