1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-13 16:08:50 +01:00
dxvk/src/dxbc/dxbc_compiler.h

106 lines
2.4 KiB
C
Raw Normal View History

#pragma once
#include "./gen/dxbc_gen_common.h"
namespace dxvk {
/**
* \brief DXBC compiler
*
* Interprets DXBC instructions and generates
* SPIR-V code for the appropriate shader type.
*/
class DxbcCompiler {
public:
DxbcCompiler(
const DxbcProgramVersion& version,
const Rc<DxbcIsgn>& isgn,
const Rc<DxbcIsgn>& osgn);
~DxbcCompiler();
void processInstruction(
const DxbcInstruction& ins);
Rc<DxvkShader> finalize();
private:
Rc<DxbcCodeGen> m_gen;
void dclGlobalFlags(
const DxbcInstruction& ins);
2017-12-08 17:08:26 +01:00
void dclConstantBuffer(
const DxbcInstruction& ins);
2017-12-10 03:39:35 +01:00
void dclSampler(
const DxbcInstruction& ins);
void dclInterfaceVar(
const DxbcInstruction& ins);
void dclTemps(
const DxbcInstruction& ins);
void opAdd(
const DxbcInstruction& ins);
void opMul(
const DxbcInstruction& ins);
2017-12-08 17:08:26 +01:00
void opDpx(
const DxbcInstruction& ins,
uint32_t n);
void opMov(
const DxbcInstruction& ins);
void opRet(
const DxbcInstruction& ins);
2017-12-08 17:08:26 +01:00
DxbcValue getDynamicIndexValue(
const DxbcOperandIndex& index);
DxbcComponentMask getDstOperandMask(
const DxbcOperand& operand);
DxbcPointer getTempOperandPtr(
const DxbcOperand& operand);
DxbcPointer getInterfaceOperandPtr(
const DxbcOperand& operand);
2017-12-08 17:08:26 +01:00
DxbcPointer getConstantBufferPtr(
const DxbcOperand& operand);
DxbcPointer getOperandPtr(
const DxbcOperand& operand);
DxbcValue selectOperandComponents(
const DxbcOperandToken& opToken,
const DxbcValue& opValue,
DxbcComponentMask dstMask);
DxbcValue applyOperandModifiers(
DxbcValue value,
DxbcOperandModifiers modifiers);
DxbcValue applyResultModifiers(
DxbcValue value,
DxbcOpcodeControl control);
DxbcValue loadOperand(
const DxbcOperand& operand,
DxbcComponentMask dstMask,
DxbcScalarType dstType);
void storeOperand(
const DxbcOperand& operand,
DxbcValue value,
DxbcComponentMask mask);
};
}