diff --git a/rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.cpp b/rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.cpp index 7afbf4bab5..be52bab93a 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.cpp @@ -51,6 +51,27 @@ std::string D3D12VertexProgramDecompiler::getFunction(enum class FUNCTION f) } } +std::string D3D12VertexProgramDecompiler::compareFunction(COMPARE f, const std::string &Op0, const std::string &Op1) +{ + switch (f) + { + default: + abort(); + case COMPARE::FUNCTION_SEQ: + return "(" + Op0 + " == " + Op1 + ".xxxx"; + case COMPARE::FUNCTION_SGE: + return "(" + Op0 + " >= " + Op1 + ").xxxx"; + case COMPARE::FUNCTION_SGT: + return "(" + Op0 + " > " + Op1 + ").xxxx"; + case COMPARE::FUNCTION_SLE: + return "(" + Op0 + " <= " + Op1 + ").xxxx"; + case COMPARE::FUNCTION_SLT: + return "(" + Op0 + " < " + Op1 + ").xxxx"; + case COMPARE::FUNCTION_SNE: + return "(" + Op0 + " != " + Op1 + ").xxxx"; + } +} + void D3D12VertexProgramDecompiler::insertHeader(std::stringstream &OS) { OS << "cbuffer SCALE_OFFSET : register(b0)" << std::endl; diff --git a/rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.h b/rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.h index 0c5fcdce52..d61642c18b 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.h +++ b/rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.h @@ -9,6 +9,7 @@ struct D3D12VertexProgramDecompiler : public VertexProgramDecompiler protected: virtual std::string getFloatTypeName(size_t elementCount) override; virtual std::string getFunction(enum class FUNCTION) override; + virtual std::string compareFunction(enum class COMPARE, const std::string &, const std::string &) override; virtual void insertHeader(std::stringstream &OS); virtual void insertInputs(std::stringstream &OS, const std::vector &inputs);