Skip to content

Commit

Permalink
DXIL Debugger support for DXOp::LegacyF32ToF16, DXOp::LegacyF16ToF32
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorro666 committed Nov 20, 2024
1 parent cb3bc8b commit 2a4c88f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
24 changes: 22 additions & 2 deletions renderdoc/driver/shaders/dxil/dxil_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2653,6 +2653,28 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
}
break;
}
case DXOp::LegacyF32ToF16:
{
RDCASSERTEQUAL(inst.args[1]->type->type, Type::TypeKind::Scalar);
RDCASSERTEQUAL(inst.args[1]->type->scalarType, Type::Float);
RDCASSERTEQUAL(retType->type, Type::TypeKind::Scalar);
RDCASSERTEQUAL(retType->scalarType, Type::Int);
ShaderVariable arg;
RDCASSERT(GetShaderVariable(inst.args[1], opCode, dxOpCode, arg));
result.value.u16v[0] = ConvertToHalf(arg.value.f32v[0]);
break;
}
case DXOp::LegacyF16ToF32:
{
RDCASSERTEQUAL(inst.args[1]->type->type, Type::TypeKind::Scalar);
RDCASSERTEQUAL(inst.args[1]->type->scalarType, Type::Int);
RDCASSERTEQUAL(retType->type, Type::TypeKind::Scalar);
RDCASSERTEQUAL(retType->scalarType, Type::Float);
ShaderVariable arg;
RDCASSERT(GetShaderVariable(inst.args[1], opCode, dxOpCode, arg));
result.value.f32v[0] = ConvertFromHalf(arg.value.u16v[0]);
break;
}
case DXOp::TempRegLoad:
case DXOp::TempRegStore:
case DXOp::MinPrecXRegLoad:
Expand Down Expand Up @@ -2711,8 +2733,6 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
case DXOp::BitcastF32toI32:
case DXOp::BitcastI64toF64:
case DXOp::BitcastF64toI64:
case DXOp::LegacyF32ToF16:
case DXOp::LegacyF16ToF32:
case DXOp::LegacyDoubleToFloat:
case DXOp::LegacyDoubleToSInt32:
case DXOp::LegacyDoubleToUInt32:
Expand Down
2 changes: 0 additions & 2 deletions renderdoc/driver/shaders/dxil/dxil_reflect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1853,8 +1853,6 @@ rdcstr Program::GetDebugStatus()
case DXOp::BitcastF32toI32:
case DXOp::BitcastI64toF64:
case DXOp::BitcastF64toI64:
case DXOp::LegacyF32ToF16:
case DXOp::LegacyF16ToF32:
case DXOp::LegacyDoubleToFloat:
case DXOp::LegacyDoubleToSInt32:
case DXOp::LegacyDoubleToUInt32:
Expand Down

0 comments on commit 2a4c88f

Please sign in to comment.