On Fri Sep 29 17:21:01 2023 +0000, Francisco Casas wrote:
That's what second commit does.
Ah, I see, indeed 2/2 makes us write "SV_Target" instead of "color" in the output signature as the native compiler does when passing "-Gec".
Regarding it being invalid, such binary is accepted on windows for
disassembling at least. I don't know if it makes sense for the runtime itself. It's not that important by itself, once such semantics are mapped to correct system values, so we can of course drop it. Right. I also don't think it is important to replicate native's disassembler behavior for these pixel shaders with invalid signatures. But now that I think about it, 1/2 could have the benefit of allowing the vkd3d to run shaders that were compiled wrong by the current and previous versions of vkd3d-shader. Still, I am not sure adding this exception for "retro-compatibility" with a wrong behavior is desired. I would be more for printing a warning encompassing all invalid output semantics rather than just handling "COLOR":
if (version.type == VKD3D_SHADER_TYPE_PIXEL && ascii_strcasecmp(e->semantic_name, "SV_Target")) { WARN("Unexpected output semantic for pixel shader %s.\n", debugstr_a(e->semantic_name)); continue; }
Btw, we should add the checks for invalid output semantics at compilation time at some point.
Right, fixing 2/2 is more important. I'd be happy to drop 1/2 once 2/2 is approved.