@@ -3159,27 +3159,24 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
31593159 numComps = 3 ;
31603160 uint32_t argBStart = argAStart + numComps;
31613161
3162- result.value .f32v [0 ] = 0 .0f ;
3163- bool isFloat = (result.type == VarType::Float);
3164- if (isFloat || result.type == VarType::SInt)
3162+ result.value .s64v [0 ] = 0L ;
3163+ for (uint32_t c = 0 ; c < numComps; ++c)
31653164 {
3166- for (uint32_t c = 0 ; c < numComps; ++c)
3167- {
3168- ShaderVariable a;
3169- ShaderVariable b;
3170- RDCASSERT (GetShaderVariable (inst.args [argAStart + c], opCode, dxOpCode, a));
3171- RDCASSERT (GetShaderVariable (inst.args [argBStart + c], opCode, dxOpCode, b));
3172- RDCASSERTEQUAL (result.type , a.type );
3173- RDCASSERTEQUAL (result.type , b.type );
3174- if (isFloat)
3175- result.value .f32v [0 ] += a.value .f32v [0 ] * b.value .f32v [0 ];
3176- else
3177- result.value .s32v [0 ] += a.value .s32v [0 ] * b.value .s32v [0 ];
3178- }
3179- }
3180- else
3181- {
3182- RDCERR (" Unhandled result type %s" , ToStr (result.type ).c_str ());
3165+ ShaderVariable a;
3166+ ShaderVariable b;
3167+ RDCASSERT (GetShaderVariable (inst.args [argAStart + c], opCode, dxOpCode, a));
3168+ RDCASSERT (GetShaderVariable (inst.args [argBStart + c], opCode, dxOpCode, b));
3169+ RDCASSERTEQUAL (a.type , b.type );
3170+ RDCASSERTEQUAL (result.type , a.type );
3171+
3172+ #undef _IMPL
3173+ #define _IMPL (I, S, U ) comp<I>(result, 0 ) += (comp<I>(a, 0 ) * comp<I>(b, 0 ));
3174+ IMPL_FOR_INT_TYPES_FOR_TYPE (_IMPL, result.type );
3175+
3176+ #undef _IMPL
3177+ #define _IMPL (T ) comp<T>(result, 0 ) += (comp<T>(a, 0 ) * comp<T>(b, 0 ));
3178+
3179+ IMPL_FOR_FLOAT_TYPES_FOR_TYPE (_IMPL, result.type );
31833180 }
31843181 break ;
31853182 }
0 commit comments