42 lines
973 B
C++
42 lines
973 B
C++
#ifndef SHADER_COMPILER_H
|
|
#define SHADER_COMPILER_H
|
|
|
|
#include "tier1/interface.h"
|
|
#include "tier1/utlvector.h"
|
|
#include "tier1/utlbuffer.h"
|
|
#include "tier2/iappsystem.h"
|
|
#include "materialsystem/shaderinternals.h"
|
|
|
|
struct HostShaderLump_t
|
|
{
|
|
void *m_pAddress;
|
|
uint32_t m_nSize;
|
|
};
|
|
|
|
class CCompiledShader
|
|
{
|
|
public:
|
|
CUtlVector<ShaderObject_t> m_objects = {};
|
|
CUtlVector<HostShaderLump_t> m_lumps = {};
|
|
|
|
~CCompiledShader();
|
|
|
|
uint32_t AllocateLump( uint32_t nSize );
|
|
void *GetLumpPtr( uint32_t nLump );
|
|
uint32_t GetLumpSize( uint32_t nLump );
|
|
ShaderObject_t *AllocateShader();
|
|
|
|
ShaderObject_t *FindShaderObject( EShaderBackend eBackend, EShaderStage eStage );
|
|
};
|
|
|
|
abstract_class IShaderCompiler: public IAppSystem
|
|
{
|
|
public:
|
|
virtual void CompileShader( const char *szInput, CCompiledShader *pShader ) = 0;
|
|
};
|
|
|
|
#define SLANG_SHADER_COMPILER_SPIRV_VULKAN "ShaderCompilerSlangVulkanSpirv"
|
|
#define SLANG_SHADER_COMPILER_CODE_METAL "ShaderCompilerSlangMetalCode"
|
|
|
|
#endif
|