working on rendering

This commit is contained in:
2025-12-23 15:03:44 +02:00
parent 5a71b3023a
commit 3b4e2eea32
65 changed files with 1971 additions and 190 deletions

View File

@@ -0,0 +1,41 @@
#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