fix(texture): only emit MSAA resolve attachment when sample_count > 1 - #1052
Merged
Conversation
`render_target_ex` was calling `new_render_pass_mrt` with `resolve_img: Some(...)` whenever `params.sample_count != 0`. Because `RenderTargetParams::default().sample_count == 1`, that branch fired for plain `render_target(w, h)` calls too — generating a resolve attachment for what is conceptually a single-sample target. This was masked on backends that accept a no-op resolve, but the Metal backend rightly rejects it: the multisample-resolve store action requires the color attachment's texture sampleCount to be > 1. Gate the resolve allocation on `sample_count > 1` so plain `render_target()` produces a single-attachment pass on every backend.
benface
force-pushed
the
fix-msaa-resolve-guard
branch
from
June 13, 2026 15:05
5b7a330 to
f6c8f04
Compare
Owner
|
Thanks for PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
render_target_exwas callingnew_render_pass_mrtwithresolve_img: Some(...)wheneverparams.sample_count != 0. BecauseRenderTargetParams::default().sample_count == 1, that branch fires for plainrender_target(w, h)calls too — generating a multisample-resolve attachment for what is conceptually a single-sample target.This was masked on backends that accept a no-op resolve, but the Metal backend rightly rejects it: the multisample-resolve store action requires the color attachment's texture sampleCount to be > 1. With miniquad's Metal
new_render_pass_mrtresolve_imgpath now wired (not-fl3/miniquad#638), Metal validation fires on the firstrender_target()of any macroquad app:Gate the resolve allocation on
sample_count > 1so plainrender_target()produces a single-attachment pass on every backend.