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,70 @@
//================= 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_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