Files
funnygame/public/materialsystem/shaderinternals.h
2026-02-28 21:07:44 +02:00

77 lines
1.5 KiB
C

//================= Copyright kotofyt, All rights reserved ==================//
// Purpose: Shader compilers.
//
// We kinda need to store shader contents in blobs so they can be parsed easily
//
// For now we store them like this
// ShaderHeader_t
// ShaderLump_t[m_nNumLump]
// ShaderObject_t[m_nNumShaders]
// ~An actual shader data~
//===========================================================================//
#ifndef SHADER_INTERNALS_H
#define SHADER_INTERNALS_H
#include "stdint.h"
enum EShaderBackend: uint32_t
{
SHADER_BACKEND_SPIRV_VULKAN,
SHADER_BACKEND_CODE_METAL,
};
enum EShaderStage: uint32_t
{
SHADER_STAGE_VERTEX,
SHADER_STAGE_TESSELATION_CONTROL,
SHADER_STAGE_TESSELATION_EVAL,
SHADER_STAGE_GEOMETRY,
SHADER_STAGE_PIXEL,
SHADER_STAGE_COMPUTE,
SHADER_STAGE_RAYGEN,
SHADER_STAGE_ANY_HIT,
SHADER_STAGE_CLOSEST_HIT,
SHADER_STAGE_MISS,
SHADER_STAGE_CALLABLE,
SHADER_STAGE_RAYGEN_SOFTWARE,
SHADER_STAGE_ANY_HIT_SOFTWARE,
SHADER_STAGE_CLOSEST_HIT_SOFTWARE,
SHADER_STAGE_MISS_SOFTWARE,
SHADER_STAGE_CALLABLE_SOFTWARE,
SHADER_STAGE_TASK,
SHADER_STAGE_MESH,
SHADER_STAGE_COMMON_DATA,
SHADER_STAGE_MAX,
SHADER_STAGE_COUNT = SHADER_STAGE_MAX
};
struct ShaderHeader_t
{
char m_cSignature[4];
uint32_t m_nNumLumps;
uint32_t m_nNumShaders;
};
struct ShaderLump_t
{
uint32_t m_nSize;
uint32_t m_nOffset;
};
struct ShaderObject_t
{
EShaderBackend m_eBackend;
EShaderStage m_eStage;
uint32_t m_nMetadataLump;
uint32_t m_nDataLump;
};
#endif