diff --git a/renderdoc/driver/shaders/dxil/dxil_debug.cpp b/renderdoc/driver/shaders/dxil/dxil_debug.cpp index fa07c366c..c08102e9b 100644 --- a/renderdoc/driver/shaders/dxil/dxil_debug.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_debug.cpp @@ -2561,6 +2561,10 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper, case Operation::Add: case Operation::Sub: case Operation::Mul: + case Operation::UDiv: + case Operation::SDiv: + case Operation::URem: + case Operation::SRem: { RDCASSERTEQUAL(inst.args[0]->type->type, Type::TypeKind::Scalar); RDCASSERTEQUAL(inst.args[0]->type->scalarType, Type::Int); @@ -2594,6 +2598,34 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper, IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type); } + else if(opCode == Operation::UDiv) + { +#undef _IMPL +#define _IMPL(I, S, U) comp(result, c) = comp(a, c) / comp(b, c) + + IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type); + } + else if(opCode == Operation::SDiv) + { +#undef _IMPL +#define _IMPL(I, S, U) comp(result, c) = comp(a, c) / comp(b, c) + + IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type); + } + else if(opCode == Operation::URem) + { +#undef _IMPL +#define _IMPL(I, S, U) comp(result, c) = comp(a, c) % comp(b, c) + + IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type); + } + else if(opCode == Operation::SRem) + { +#undef _IMPL +#define _IMPL(I, S, U) comp(result, c) = comp(a, c) % comp(b, c) + + IMPL_FOR_INT_TYPES_FOR_TYPE(_IMPL, a.type); + } else { RDCERR("Unhandled opCode %s", ToStr(opCode).c_str()); @@ -3017,10 +3049,6 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper, case Operation::PtrToI: case Operation::IToPtr: case Operation::AddrSpaceCast: - case Operation::UDiv: - case Operation::SDiv: - case Operation::URem: - case Operation::SRem: case Operation::ExtractElement: case Operation::InsertElement: case Operation::ShuffleVector: diff --git a/renderdoc/driver/shaders/dxil/dxil_reflect.cpp b/renderdoc/driver/shaders/dxil/dxil_reflect.cpp index c2c354dce..fc8394f4c 100644 --- a/renderdoc/driver/shaders/dxil/dxil_reflect.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_reflect.cpp @@ -1773,10 +1773,6 @@ rdcstr Program::GetDebugStatus() case Operation::PtrToI: case Operation::IToPtr: case Operation::AddrSpaceCast: - case Operation::UDiv: - case Operation::SDiv: - case Operation::URem: - case Operation::SRem: case Operation::ExtractElement: case Operation::InsertElement: case Operation::ShuffleVector: