Major reorg
This commit is contained in:
@@ -23,10 +23,10 @@ layout(set = 1, binding = 0) uniform Uniforms {
|
||||
};
|
||||
|
||||
// ---------- SDF primitive storage buffer ----------
|
||||
// Mirrors the CPU-side Base_2D_Primitive in pipeline_2d_base.odin. Named with the
|
||||
// pipeline prefix so a project-wide grep on the type name matches both the GLSL
|
||||
// Mirrors the CPU-side Core_2D_Primitive in core_2d.odin. Named with the
|
||||
// subsystem prefix so a project-wide grep on the type name matches both the GLSL
|
||||
// declaration and the Odin declaration.
|
||||
struct Base_2D_Primitive {
|
||||
struct Core_2D_Primitive {
|
||||
vec4 bounds; // 0-15
|
||||
uint color; // 16-19
|
||||
uint flags; // 20-23
|
||||
@@ -38,8 +38,8 @@ struct Base_2D_Primitive {
|
||||
uvec4 effects; // 80-95: gradient/outline parameters (read when .Gradient/.Outline)
|
||||
};
|
||||
|
||||
layout(std430, set = 0, binding = 0) readonly buffer Base_2D_Primitives {
|
||||
Base_2D_Primitive primitives[];
|
||||
layout(std430, set = 0, binding = 0) readonly buffer Core_2D_Primitives {
|
||||
Core_2D_Primitive primitives[];
|
||||
};
|
||||
|
||||
// ---------- Entry point ----------
|
||||
@@ -57,7 +57,7 @@ void main() {
|
||||
gl_Position = projection * vec4(v_position * dpi_scale, 0.0, 1.0);
|
||||
} else {
|
||||
// ---- Mode 1: SDF instanced quads ----
|
||||
Base_2D_Primitive p = primitives[gl_InstanceIndex];
|
||||
Core_2D_Primitive p = primitives[gl_InstanceIndex];
|
||||
|
||||
vec2 corner = v_position; // unit quad corners: (0,0)-(1,1)
|
||||
vec2 world_pos = mix(p.bounds.xy, p.bounds.zw, corner);
|
||||
|
||||
Reference in New Issue
Block a user