2017-10-16 17:50:09 +02:00
|
|
|
#include "dxbc_compiler.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2017-11-01 00:01:40 +01:00
|
|
|
DxbcCompiler::DxbcCompiler(
|
2017-11-13 00:22:52 +01:00
|
|
|
const DxbcProgramVersion& version)
|
|
|
|
: m_gen(DxbcCodeGen::create(version)) { }
|
2017-10-16 17:50:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
DxbcCompiler::~DxbcCompiler() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-01 00:01:40 +01:00
|
|
|
void DxbcCompiler::processInstruction(const DxbcInstruction& ins) {
|
2017-11-13 00:22:52 +01:00
|
|
|
const DxbcOpcodeToken token = ins.token();
|
2017-10-22 23:13:29 +02:00
|
|
|
|
2017-11-13 00:22:52 +01: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:
|
2017-11-13 02:07:13 +01:00
|
|
|
return this->dclInterfaceVar(ins);
|
2017-11-13 00:22:52 +01:00
|
|
|
|
|
|
|
case DxbcOpcode::DclTemps:
|
|
|
|
return this->dclTemps(ins);
|
|
|
|
|
|
|
|
default:
|
|
|
|
Logger::err(str::format(
|
|
|
|
"DxbcCompiler::processInstruction: Unhandled opcode: ",
|
|
|
|
token.opcode()));
|
|
|
|
}
|
2017-10-16 17:50:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Rc<DxvkShader> DxbcCompiler::finalize() {
|
2017-11-13 00:22:52 +01:00
|
|
|
return m_gen->finalize();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DxbcCompiler::dclGlobalFlags(const DxbcInstruction& ins) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-13 02:07:13 +01:00
|
|
|
void DxbcCompiler::dclInterfaceVar(const DxbcInstruction& ins) {
|
2017-11-13 00:22:52 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DxbcCompiler::dclTemps(const DxbcInstruction& ins) {
|
|
|
|
m_gen->dclTemps(ins.arg(0));
|
2017-10-16 19:53:17 +02:00
|
|
|
}
|
|
|
|
|
2017-10-16 17:50:09 +02:00
|
|
|
}
|