rspirv icon indicating copy to clipboard operation
rspirv copied to clipboard

ImageFormat::Rgb10a2ui uses inconsistent casing.

Open XAMPPRocky opened this issue 3 years ago • 4 comments

Notice how ImageFormat::Rgb10A2 and ImageFormat::Rgb10a2ui have a differently cased A, in Rust the casing starts at the beginning of each word. The former is correct and Rgb10a2ui should be Rgb10A2ui .

XAMPPRocky avatar Apr 22 '21 10:04 XAMPPRocky

It doesn't help that the casing is wrong in the SPIR-V grammar JSON:

https://github.com/KhronosGroup/SPIRV-Headers/blob/dafead1765f6c1a5f9f8a76387dcb2abe4e54acd/include/spirv/unified1/spirv.core.grammar.json#L9015

https://github.com/KhronosGroup/SPIRV-Headers/blob/dafead1765f6c1a5f9f8a76387dcb2abe4e54acd/include/spirv/unified1/spirv.core.grammar.json#L9130

MarijnS95 avatar Apr 22 '21 10:04 MarijnS95

By the way, shouldn't the U in Ui be capitalized as well?

MarijnS95 avatar Apr 22 '21 10:04 MarijnS95

By the way, shouldn't the U in Ui be capitalized as well?

Good question, I don't think so based on how these formats are cased in GLSL, you can see it's specified as rgb10_a2 and rgb10_a2ui, which to me would imply that you're supposed to treat a2 and a2ui as whole words.

https://www.khronos.org/opengl/wiki/Image_Load_Store

XAMPPRocky avatar Apr 22 '21 10:04 XAMPPRocky

Hmm, complicated. @XAMPPRocky are we looking at this from a Rust naming conventions or GLSL/SPIR-V naming perspective? That link implies the entire thing to be lowercase while the autogenerator here seems to take the grammar name verbatim.

MarijnS95 avatar Apr 22 '21 10:04 MarijnS95