power_play/src/pp/pp_vis/pp_vis_shaders.cgh
2025-12-31 15:52:52 -06:00

69 lines
1.3 KiB
Plaintext

////////////////////////////////////////////////////////////
//~ Constant types
G_DeclConstant(G_StructuredBufferRef, V_ShaderConst_Params, 0);
Enum(V_SelectionMode)
{
V_SelectionMode_None,
V_SelectionMode_Tile,
};
Struct(V_DParams)
{
Vec2 target_size;
G_Texture2DRef target_ro;
G_RWTexture2DRef target_rw;
Xform world_to_draw_xf;
Xform draw_to_world_xf;
V_SelectionMode selection_mode;
S_TileKind equipped_tile;
b32 has_mouse_focus;
b32 has_keyboard_focus;
Vec2 ui_cursor;
Vec2 draw_cursor;
Vec2 world_cursor;
Rng2 ui_selection;
Rng2 draw_selection;
Rng2 world_selection;
Vec2 camera_pos;
f32 camera_zoom;
f32 world_size;
G_Texture2DRef tiles;
G_StructuredBufferRef quads;
G_StructuredBufferRef shape_verts;
};
////////////////////////////////////////////////////////////
//~ Backdrop shader types
#define V_BackdropCSThreadSizeFromTexSize(tex_size) VEC3I32((tex_size.x + 7) / 8, (tex_size.y + 7) / 8, 1)
////////////////////////////////////////////////////////////
//~ Quad shader types
Enum(V_DQuadFlag)
{
V_DQuadFlag_None = 0,
V_DQuadFlag_DrawGrid = (1 << 0),
};
Struct(V_DQuad)
{
V_DQuadFlag flags;
};
////////////////////////////////////////////////////////////
//~ Shape shader types
Struct(V_DVert)
{
Vec2 pos;
Vec4 color_lin;
};