1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00
OpenDX/src/dxso/dxso_module.h
Joshie 54ed8f0bb0 [d3d9] Implement Direct3D9 Frontend (#1275)
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Co-authored-by: Robin Kertels <robin.kertels@gmail.com>
Co-authored-by: pchome <pchome@users.noreply.github.com>
Co-authored-by: Christopher Egert <cme3000@gmail.com>
Co-authored-by: Derek Lesho <dereklesho52@Gmail.com>
Co-authored-by: Luis Cáceres <lacaceres97@gmail.com>
Co-authored-by: Nelson Chen <crazysim@gmail.com>
Co-authored-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Co-authored-by: Riesi <riesi@opentrash.com>
Co-authored-by: gbMichelle <gbmichelle.dev@gmail.com>
2019-12-16 04:28:01 +01:00

85 lines
1.8 KiB
C++

#pragma once
#include "dxso_reader.h"
#include "dxso_code.h"
#include "dxso_header.h"
#include "dxso_ctab.h"
#include "dxso_isgn.h"
#include "dxso_analysis.h"
#include "../d3d9/d3d9_constant_layout.h"
#include "../d3d9/d3d9_shader_permutations.h"
#include <vector>
namespace dxvk {
class DxsoCompiler;
class DxsoCode;
struct DxsoModuleInfo;
/**
* \brief DXSO shader module, a d3d9 shader object.
*/
class DxsoModule {
public:
DxsoModule(DxsoReader& reader);
const DxsoProgramInfo& info() {
return m_header.info();
}
DxsoAnalysisInfo analyze();
/**
* \brief Compiles DXSO shader to SPIR-V module
*
* \param [in] moduleInfo DXSO module info
* \param [in] fileName File name, will be added to
* the compiled SPIR-V for debugging purposes.
* \returns The compiled shader object
*/
DxsoPermutations compile(
const DxsoModuleInfo& moduleInfo,
const std::string& fileName,
const DxsoAnalysisInfo& analysis,
const D3D9ConstantLayout& layout);
const DxsoIsgn& isgn() {
return m_isgn;
}
const DxsoShaderMetaInfo& meta() { return m_meta; }
const DxsoDefinedConstants& constants() { return m_constants; }
uint32_t usedSamplers() { return m_usedSamplers; }
uint32_t usedRTs() { return m_usedRTs; }
private:
void runCompiler(
DxsoCompiler& compiler,
DxsoCodeIter iter) const;
void runAnalyzer(
DxsoAnalyzer& analyzer,
DxsoCodeIter iter) const;
DxsoHeader m_header;
DxsoCode m_code;
DxsoIsgn m_isgn;
uint32_t m_usedSamplers;
uint32_t m_usedRTs;
DxsoShaderMetaInfo m_meta;
DxsoDefinedConstants m_constants;
};
}