d3d12: Update

This commit is contained in:
vlj 2015-05-20 01:59:24 +02:00 committed by Vincent Lejeune
parent 422a9f1fdc
commit 3f31976080
2 changed files with 22 additions and 0 deletions

View File

@ -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;

View File

@ -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<ParamType> &inputs);