reorder fields in glsl vertex struct to be less wasteful
This commit is contained in:
parent
5754fc1ad2
commit
91780b12c7
|
@ -50,10 +50,8 @@ mg_gles_surface* mg_gles_canvas_get_surface(mg_gles_canvas_backend* canvas)
|
||||||
typedef struct debug_vertex
|
typedef struct debug_vertex
|
||||||
{
|
{
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
u8 align0[8];
|
|
||||||
vec4 cubic;
|
|
||||||
vec2 uv;
|
vec2 uv;
|
||||||
u8 align1[8];
|
vec4 cubic;
|
||||||
vec4 color;
|
vec4 color;
|
||||||
vec4 clip;
|
vec4 clip;
|
||||||
int zIndex;
|
int zIndex;
|
||||||
|
@ -73,9 +71,9 @@ enum {
|
||||||
LAYOUT_INT_ALIGN = 4,
|
LAYOUT_INT_ALIGN = 4,
|
||||||
|
|
||||||
LAYOUT_POS_OFFSET = 0,
|
LAYOUT_POS_OFFSET = 0,
|
||||||
LAYOUT_CUBIC_OFFSET = LayoutNext(POS, VEC2, VEC4),
|
LAYOUT_UV_OFFSET = LayoutNext(POS, VEC2, VEC2),
|
||||||
LAYOUT_UV_OFFSET = LayoutNext(CUBIC, VEC4, VEC2),
|
LAYOUT_CUBIC_OFFSET = LayoutNext(UV, VEC2, VEC4),
|
||||||
LAYOUT_COLOR_OFFSET = LayoutNext(UV, VEC2, VEC4),
|
LAYOUT_COLOR_OFFSET = LayoutNext(CUBIC, VEC4, VEC4),
|
||||||
LAYOUT_CLIP_OFFSET = LayoutNext(COLOR, VEC4, VEC4),
|
LAYOUT_CLIP_OFFSET = LayoutNext(COLOR, VEC4, VEC4),
|
||||||
LAYOUT_ZINDEX_OFFSET = LayoutNext(CLIP, VEC4, INT),
|
LAYOUT_ZINDEX_OFFSET = LayoutNext(CLIP, VEC4, INT),
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ layout(std430) buffer;
|
||||||
|
|
||||||
struct vertex {
|
struct vertex {
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
vec4 cubic;
|
|
||||||
vec2 uv;
|
vec2 uv;
|
||||||
|
vec4 cubic;
|
||||||
vec4 color;
|
vec4 color;
|
||||||
vec4 clip;
|
vec4 clip;
|
||||||
int zIndex;
|
int zIndex;
|
||||||
|
|
|
@ -6,8 +6,8 @@ layout(std430) buffer;
|
||||||
|
|
||||||
struct vertex {
|
struct vertex {
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
vec4 cubic;
|
|
||||||
vec2 uv;
|
vec2 uv;
|
||||||
|
vec4 cubic;
|
||||||
vec4 color;
|
vec4 color;
|
||||||
vec4 clip;
|
vec4 clip;
|
||||||
int zIndex;
|
int zIndex;
|
||||||
|
|
|
@ -6,8 +6,8 @@ layout(std430) buffer;
|
||||||
|
|
||||||
struct vertex {
|
struct vertex {
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
vec4 cubic;
|
|
||||||
vec2 uv;
|
vec2 uv;
|
||||||
|
vec4 cubic;
|
||||||
vec4 color;
|
vec4 color;
|
||||||
vec4 clip;
|
vec4 clip;
|
||||||
int zIndex;
|
int zIndex;
|
||||||
|
|
Loading…
Reference in New Issue