48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
////////////////////////////////////////////////////////////
|
|
//~ State types
|
|
|
|
Struct(G_Ctx)
|
|
{
|
|
// Common shared resources
|
|
G_IndexBufferDesc quad_indices;
|
|
G_SamplerStateRef basic_sampler;
|
|
G_Texture3DRef basic_noise;
|
|
};
|
|
|
|
Struct(G_ThreadLocalCtx)
|
|
{
|
|
G_ArenaHandle gpu_perm;
|
|
};
|
|
|
|
extern G_Ctx G;
|
|
extern ThreadLocal G_ThreadLocalCtx G_tl;
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Bootstrap
|
|
|
|
void G_BootstrapCommon(void);
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Utils
|
|
|
|
//- Arena
|
|
|
|
G_ArenaHandle G_PermArena(void);
|
|
|
|
//- Push resource from cpu
|
|
|
|
G_ResourceHandle G_PushBufferFromCpuCopy_(G_ArenaHandle gpu_arena, G_CommandListHandle cl, String src, G_BufferDesc desc);
|
|
#define G_PushBufferFromCpuCopy(_arena, _cl, _src, ...) \
|
|
G_PushBufferFromCpuCopy_((_arena), (_cl), (_src), (G_BufferDesc) { .size = (_src).len, __VA_ARGS__ })
|
|
|
|
//- Viewport / scissor
|
|
|
|
Rng3 G_ViewportFromTexture(G_ResourceHandle texture);
|
|
Rng2 G_ScissorFromTexture(G_ResourceHandle texture);
|
|
|
|
//- Shared resources
|
|
|
|
G_IndexBufferDesc G_QuadIndices(void);
|
|
G_SamplerStateRef G_BasicSampler(void);
|
|
G_Texture3DRef G_BasicNoiseTexture(void);
|