roleplay/client/shader_src/ui_common.glsl

110 lines
1.7 KiB
Plaintext

struct DrawCommand {
uint vertex_count;
uint instance_count;
uint fist_vertex;
uint first_instance;
};
layout(std430, buffer_reference) buffer DrawCommandList {
DrawCommand d[];
};
struct DispatchCommand {
uint x;
uint y;
uint z;
};
struct Symbol {
2024-10-20 22:39:12 -06:00
float top;
float left;
float width;
float height;
2024-10-22 20:24:34 -06:00
vec2 advance;
};
layout(std430, buffer_reference) buffer SymbolList {
Symbol s[];
};
struct Font {
SymbolList symbols;
uint num_symbols;
uint width;
uint height;
};
layout(std430, buffer_reference) buffer FontList {
Font f[];
};
struct String {
vec2 pos;
vec4 color;
float size;
uint offset;
uint len;
uint font;
uint id;
};
layout(std430, buffer_reference) readonly buffer StringList {
String s[];
};
layout(std430, buffer_reference) readonly buffer CodeList {
uint c[];
};
struct Drawable {
vec2 pos;
vec2 size;
vec4 color;
uint type;
2024-10-24 20:49:59 -06:00
uint var1;
uint var2;
float var3;
float var4;
uint id;
};
layout(std430, buffer_reference) readonly buffer DrawableList {
Drawable d[];
};
2024-10-24 20:49:59 -06:00
layout(std430, buffer_reference) buffer Context {
FontList fonts;
vec2 screen;
vec2 extent;
vec2 scale;
};
layout(std430, buffer_reference) readonly buffer Container {
vec2 offset;
vec2 size;
uint anchor;
2024-10-24 20:49:59 -06:00
Context context;
};
layout(std430, buffer_reference) readonly buffer Layer {
DrawCommand draw;
DispatchCommand dispatch;
uint max_drawables;
uint max_codes;
uint max_strings;
uint num_drawables;
StringList strings;
CodeList codes;
DrawableList drawables;
Container container;
};
2024-10-24 20:49:59 -06:00
layout(std430, push_constant) uniform PushConstant {
Layer layer;
float time;
uint frame;
2024-10-24 20:49:59 -06:00
} pc;