2017-10-16 17:50:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
2017-10-17 13:02:57 +02:00
|
|
|
#include "dxbc_capability.h"
|
2017-10-16 17:50:09 +02:00
|
|
|
#include "dxbc_chunk_shex.h"
|
2017-10-17 13:02:57 +02:00
|
|
|
#include "dxbc_entrypoint.h"
|
|
|
|
#include "dxbc_typeinfo.h"
|
2017-10-16 17:50:09 +02:00
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief DXBC to SPIR-V compiler
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class DxbcCompiler {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DxbcCompiler(DxbcProgramVersion version);
|
|
|
|
~DxbcCompiler();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Processes a single instruction
|
|
|
|
* \param [in] ins The instruction
|
|
|
|
*/
|
|
|
|
void processInstruction(DxbcInstruction ins);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Creates actual shader object
|
|
|
|
*
|
|
|
|
* Combines all information gatherd during the
|
|
|
|
* shader compilation into one shader object.
|
|
|
|
*/
|
|
|
|
Rc<DxvkShader> finalize();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2017-10-16 19:53:17 +02:00
|
|
|
DxbcProgramVersion m_version;
|
|
|
|
DxvkSpirvIdCounter m_counter;
|
|
|
|
|
2017-10-17 13:02:57 +02:00
|
|
|
DxbcCapabilities m_spvCapabilities;
|
|
|
|
DxbcEntryPoint m_spvEntryPoints;
|
|
|
|
DxbcTypeInfo m_spvTypeInfo;
|
|
|
|
DxvkSpirvCodeBuffer m_spvCode;
|
2017-10-16 19:53:17 +02:00
|
|
|
|
2017-10-17 13:02:57 +02:00
|
|
|
uint32_t m_entryPointId = 0;
|
2017-10-16 19:53:17 +02:00
|
|
|
|
2017-10-16 17:50:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|