roleplay/client/shader_src/ui_common.glsl

110 lines
1.6 KiB
GLSL

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 {
float top;
float left;
float width;
float height;
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;
uint var1;
uint var2;
float var3;
float var4;
uint id;
};
layout(std430, buffer_reference) readonly buffer DrawableList {
Drawable d[];
};
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;
Context context;
};
layout(std430, buffer_reference) readonly buffer Layer {
StringList strings;
CodeList codes;
DrawableList drawables;
DrawCommand draw;
DispatchCommand dispatch;
uint max_drawables;
uint max_codes;
uint max_strings;
uint num_drawables;
Container container;
};
layout(std430, push_constant) uniform PushConstant {
Layer layer;
float time;
} pc;