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

Fix Metal API violation when using VK_KHR_swapchain_mutable_format. #2465

Merged
merged 2 commits into from
Mar 14, 2025

Conversation

stripe2933
Copy link
Contributor

Texture view creation is not allowed from framebufferOnly textures. The flag should be disabled if texture view will be created from it.

Related: #2261

Texture view creation is not allowed from framebufferOnly textures.
@CLAassistant
Copy link

CLAassistant commented Mar 13, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks for submitting this.

I've made a suggestion for streamlining the logic.

@stripe2933
Copy link
Contributor Author

One thing I'm concerned about is setting framebufferOnly to false may disable the optimization. I'm not familiar with Metal, and I'm wondering is there a Metal specific way to treat the color attachment's format different from CAMetalLayer's format, without creating an alias texture for it.

Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now. Thanks.

One thing I'm concerned about is setting framebufferOnly to false may disable the optimization.

Yes. This will definitely affect performance, as the Apple docs make clear. I guess mutable format is included in the "you may not sample, read from, or write" restrictions that leave Metal unable to use an optimized layout if the render target texture.

I'm not familiar with Metal, and I'm wondering is there a Metal specific way to treat the color attachment's format different from CAMetalLayer's format, without creating an alias texture for it.

AFAIK, the framebufferOnly flag is the Metal specific way of optimizing, and we have to live with its restrictions. I'd be happy to be proven wrong on this.

@billhollings billhollings merged commit f604a18 into KhronosGroup:main Mar 14, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants