1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-07 07:46:19 +01:00
dxvk/src/dxbc/dxbc_compiler.cpp

63 lines
1.4 KiB
C++
Raw Normal View History

#include "dxbc_compiler.h"
namespace dxvk {
DxbcCompiler::DxbcCompiler(
const DxbcProgramVersion& version)
: m_gen(DxbcCodeGen::create(version)) { }
DxbcCompiler::~DxbcCompiler() {
}
void DxbcCompiler::processInstruction(const DxbcInstruction& ins) {
const DxbcOpcodeToken token = ins.token();
2017-10-22 23:13:29 +02:00
switch (token.opcode()) {
case DxbcOpcode::DclGlobalFlags:
return this->dclGlobalFlags(ins);
case DxbcOpcode::DclInput:
case DxbcOpcode::DclInputSiv:
case DxbcOpcode::DclInputSgv:
case DxbcOpcode::DclInputPs:
case DxbcOpcode::DclInputPsSiv:
case DxbcOpcode::DclInputPsSgv:
case DxbcOpcode::DclOutput:
case DxbcOpcode::DclOutputSiv:
case DxbcOpcode::DclOutputSgv:
return this->dclInterfaceVar(ins);
case DxbcOpcode::DclTemps:
return this->dclTemps(ins);
default:
Logger::err(str::format(
"DxbcCompiler::processInstruction: Unhandled opcode: ",
token.opcode()));
}
}
Rc<DxvkShader> DxbcCompiler::finalize() {
return m_gen->finalize();
}
void DxbcCompiler::dclGlobalFlags(const DxbcInstruction& ins) {
}
void DxbcCompiler::dclInterfaceVar(const DxbcInstruction& ins) {
}
void DxbcCompiler::dclTemps(const DxbcInstruction& ins) {
m_gen->dclTemps(ins.arg(0));
}
}