On Wed Apr 12 22:29:06 2023 +0000, Francisco Casas wrote:
Well, "you used an output semantic in an array variable; that can't work" (or more specifically, that the semantic is used within a struct within an array) isn't the only way that makes the first location the same as the second location. It can also happen that two input semantics use the same struct, like in the following vertex shader:
struct apple { float2 f : SEMANTIC; }; void main(out apple a, out apple b) { a.f = float2(1, 2); b.f = float2(3, 4); }
which... I better add as a test. Would it be a good compromise to make the hlsl_note slightly different when both locations coincide, but keeping it generic? I am thinking on something like: "This struct field appears more than once in the input/output parameters."
Hmm, I hadn't thought of that. Being maximally descriptive is probably going to be hard...
And it's probably a rare mistake to make anyway, I can't imagine any sane programmer would embed semantics in an array or use the same struct multiple times anyway. So maybe we can just leave it at v3...