Module: wine Branch: master Commit: 11fb78d9bde296fbd1731ab2e0c857c3874583e1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=11fb78d9bde296fbd1731ab2e0...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Mar 9 10:37:05 2017 +0100
wined3d: Don't read modifiers for opcodes with "read_opcode_func" set (AFL).
Otherwise "len" would be inconsistent with "p". This assumes opcodes with "read_opcode_func" either don't have modifiers or handle them themselves.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/shader_sm4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 8986d35..ef68754 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -1570,10 +1570,6 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi p = *ptr; *ptr += len;
- previous_token = opcode_token; - while (previous_token & WINED3D_SM4_INSTRUCTION_MODIFIER) - shader_sm4_read_instruction_modifier(previous_token = *p++, ins); - if (opcode_info->read_opcode_func) { opcode_info->read_opcode_func(ins, opcode, opcode_token, p, len, priv); @@ -1582,6 +1578,10 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi { enum wined3d_shader_dst_modifier instruction_dst_modifier = WINED3DSPDM_NONE;
+ previous_token = opcode_token; + while (previous_token & WINED3D_SM4_INSTRUCTION_MODIFIER && p != *ptr) + shader_sm4_read_instruction_modifier(previous_token = *p++, ins); + ins->flags = (opcode_token & WINED3D_SM4_INSTRUCTION_FLAGS_MASK) >> WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT;
if (ins->flags & WINED3D_SM4_INSTRUCTION_FLAG_SATURATE)