2017-10-16 17:50:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
2017-11-01 00:01:40 +01:00
|
|
|
#include "dxbc_chunk_isgn.h"
|
2017-10-16 17:50:09 +02:00
|
|
|
#include "dxbc_chunk_shex.h"
|
2017-10-29 02:35:16 +02:00
|
|
|
#include "dxbc_names.h"
|
2017-11-01 00:01:40 +01:00
|
|
|
#include "dxbc_type.h"
|
2017-10-18 10:36:47 +02:00
|
|
|
|
2017-10-26 15:40:39 +02:00
|
|
|
#include "../spirv/spirv_module.h"
|
2017-10-16 17:50:09 +02:00
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief DXBC to SPIR-V compiler
|
|
|
|
*/
|
|
|
|
class DxbcCompiler {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2017-11-01 00:01:40 +01:00
|
|
|
DxbcCompiler(
|
2017-11-07 15:10:38 +01:00
|
|
|
DxbcProgramVersion version);
|
2017-10-16 17:50:09 +02:00
|
|
|
~DxbcCompiler();
|
|
|
|
|
2017-10-21 17:58:58 +02:00
|
|
|
DxbcCompiler (DxbcCompiler&&) = delete;
|
|
|
|
DxbcCompiler& operator = (DxbcCompiler&&) = delete;
|
|
|
|
|
2017-10-16 17:50:09 +02:00
|
|
|
/**
|
|
|
|
* \brief Processes a single instruction
|
2017-10-21 17:58:58 +02:00
|
|
|
*
|
2017-10-16 17:50:09 +02:00
|
|
|
* \param [in] ins The instruction
|
2017-10-21 17:58:58 +02:00
|
|
|
* \returns \c true on success
|
2017-10-16 17:50:09 +02:00
|
|
|
*/
|
2017-11-01 00:01:40 +01:00
|
|
|
void processInstruction(
|
2017-11-07 15:10:38 +01:00
|
|
|
const DxbcInstruction& ins);
|
2017-10-16 17:50:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \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;
|
2017-10-26 15:40:39 +02:00
|
|
|
SpirvModule m_module;
|
2017-10-16 19:53:17 +02:00
|
|
|
|
2017-10-16 17:50:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|