On Fri Sep 29 16:09:25 2023 +0000, Francisco Casas wrote:
Ok, took me a while to find out the implications of this. So, this for loop has the purpose of initializing sm4->output_map[] when reading dxbc-tpf binaries. And this array is used to translate, for pixel shaders, references to the output registers (VKD3DSPR_OUTPUT) to the VKD3DSPR_COLOROUT registers, using the semantic_index as offset, in map_register(). So, if we find a say, "COLOR2" semantic in the output signature of a SM4 pixel shader binary we would be correctly mapping the arbitrary output register to VKD3DSPR_COLOROUT2 after reading the shader. I am not sure this change is necessary. My understanding is that the "COLOR" semantic is invalid as a ps_4_0 output semantic, except when compatibility mode is used, and in this case it is written as "SV_Target", so no dxbc-tpf **pixel shader** binary should have "COLOR" as a semantic on its output signature.
That's what second commit does. 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.