On 14 January 2016 at 12:39, Józef Kucia jkucia@codeweavers.com wrote:
+#define WINED3D_SM4_OPCODESPECIFICCONTROL_SHIFT 11 +#define WINED3D_SM4_OPCODESPECIFICCONTROL_MASK (0x3u << WINED3D_SM4_OPCODESPECIFICCONTROL_SHIFT)
I guess the naming derives from shader_sm1.c, but I think I'd prefer something like WINED3D_SM4_INSTRUCTION_FLAGS_MASK. The shader_sm1.c naming for the various masks and shifts is inconsistent in general, I'd like to clean it up to be more like shader_sm4.c at some point.
I suspect the mask is actually at least 0xfu (because of WINED3D_SM4_RESOURCE_TYPE_MASK), but we'll find out as soon as we run into an instruction that uses the extra bits.
ins->handler_idx = opcode_info->handler_idx;
- ins->flags = 0;
- ins->flags = (opcode_token & WINED3D_SM4_OPCODESPECIFICCONTROL_MASK) >> WINED3D_SM4_OPCODESPECIFICCONTROL_SHIFT;
I think it would be better to do this inside the last else-block of the function. It probably doesn't hurt to have nonsense in the flags field for DCL opcodes, but I think it's best avoided.