-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reject fragment shader output location
s > max_color_attachments
limit
#8316
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
base: trunk
Are you sure you want to change the base?
Reject fragment shader output location
s > max_color_attachments
limit
#8316
Conversation
…t `@builtin(position)` warning
Current CI failures are unrelated, and are resolved with #8317. |
location
s > max_color_attachments
location
s > max_color_attachments
location
s > max_color_attachments
location
s > max_color_attachments
location
s > max_color_attachments
location
s > max_color_attachments
limit
a8a62f6
to
5f9d9bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might also want to impose some limits in naga in cases where large values will result in allocating big arrays for the module or interface info.
let &Varying::Local { location, ref iv } = output else { | ||
continue; | ||
}; | ||
if location >= self.limits.max_color_attachments { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true today that this will always be equal to hal::MAX_COLOR_ATTACHMENTS
(used for the error message), but I don't know if we want to rely on that.
There's also a question whether it is an error for an output that is not consumed by the pipeline to be placed at a location above maxColorAttachments
. The spec describes maxColorAttachments
as a limit on the number of entries in various arrays appearing in descriptors.
| Self::NoEntryPointFound | ||
| Self::MultipleEntryPointsFound => return ErrorType::Validation, | ||
| Self::MultipleEntryPointsFound | ||
| Self::ColorAttachmentLocationExceedsLimit { .. } => return ErrorType::Validation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name bikeshedding: I would prefer ...TooLarge
or ...OutOfBounds
(strings that we already use in error variants) over ExceedsLimit
. (Although I do see we have ExceededLimit...
appearing in one place.)
I also might be inclined to make the name general enough to cover the case that the location lands on a gap between defined color targets (e.g. InvalidColorAttachmentLocation
), although the primary responsibility for checking that seems to be later in create_render_pipeline
(where it presently only generates a log::warn!
), so maybe it's not important.
Found a spec. bug (see gpuweb/gpuweb#5341)! 😀 The WebGPU spec. didn't demand that we ensure that this was so, but it was intended to.
rebaseplz
Testing
TODO
Checklist
CHANGELOG.md
entry.