Confusing error, "Format Bgra8UnormSrgb can't be multisampled", needs better wording #4288
Labels
area: validation
Issues related to validation, diagnostics, and error handling
type: enhancement
New feature or request
I've been experimenting with MSAA multisampling for the first time.
It appears that, by default, WGPU (and also WebGPU) only support x4 multisampling for the Bgra8UnormSrgb texture format. I believe this because guaranteed_format_features says so:
This is all good so far; no complaints so far.
My complaint is that when I tried to use x8 multisampling I get the error "Format Bgra8UnormSrgb can't be multisampled" which is misleading. The statement is simply false, Bgra8UnormSrgb can be multisampled. The error message makes a simple statement that is false.
Fortunately, I chose to start by using x4 multisampling, so I got the multisampling to work without encountering this error. If I had encountered this error earlier I would have been very confused and would have probably started refactoring my code to use a different texture format.
I propose changing the wording of this error to something like "Format Bgra8UnormSrgb could not be multisampled". A more open-ended error message like this makes it clear that something else, besides the texture format, might be to blame for the multisampling failure. This would be a trivial change, simply changing one string to another.
If we want to go further, the error could say something like "Format Bgra8UnormSrgb does not support x8 multisampling". This would require more than changing just a couple of strings though.
I intend to investigate these changes myself, although anyone else is welcome to as well, no worries. I'm happy for any input or suggestions.
The text was updated successfully, but these errors were encountered: