lang: rename signed integer types sN -> iN
Surface rename of the signed integer family: s1..s64 become i1..i64
(u1..u64, usize, isize unchanged). 'string' keeps the s-prefix arm in
name classification; width parsing moves to the i-prefix arm next to
isize.
Internal TypeId tags follow the surface (.s8/.s16/.s32/.s64 ->
.i8/.i16/.i32/.i64), as do mono-key mangle fragments (ptr_i64,
tu_i64_bool) and all display/diagnostic formatting (i{d}).
Migrated in the same sweep: stdlib + examples + issue repros + FFI C
companions (shared symbol names like ffi_id_i64), expected
stdout/stderr/ir snapshots, specs.md, readme.md, CLAUDE.md/AGENTS.md,
implementation_plan.md, docs/, issue writeups. Vendored stb_image and
historical flow state left untouched.
zig build test: 426/426; examples suite: 595/595.
This commit is contained in:
@@ -10,27 +10,27 @@
|
||||
#import "modules/ui/font.sx";
|
||||
|
||||
// Vertex: pos(2) + uv(2) + color(4) + params(4) = 12 floats
|
||||
UI_VERTEX_FLOATS :s64: 12;
|
||||
UI_VERTEX_BYTES :s64: 48;
|
||||
MAX_UI_VERTICES :s64: 16384;
|
||||
UI_VERTEX_FLOATS :i64: 12;
|
||||
UI_VERTEX_BYTES :i64: 48;
|
||||
MAX_UI_VERTICES :i64: 16384;
|
||||
|
||||
UIRenderer :: struct {
|
||||
// GL-side handles. Used when `gpu == null` (every non-iOS target today).
|
||||
vao: u32;
|
||||
vbo: u32;
|
||||
shader: u32;
|
||||
proj_loc: s32;
|
||||
tex_loc: s32;
|
||||
proj_loc: i32;
|
||||
tex_loc: i32;
|
||||
|
||||
// CPU-side vertex scratch buffer — same for both backends.
|
||||
vertices: [*]f32;
|
||||
vertex_count: s64;
|
||||
vertex_count: i64;
|
||||
screen_width: f32;
|
||||
screen_height: f32;
|
||||
dpi_scale: f32;
|
||||
white_texture: u32; // GL name OR TextureHandle (both are u32-shaped)
|
||||
current_texture: u32;
|
||||
draw_calls: s64;
|
||||
draw_calls: i64;
|
||||
|
||||
// GPU protocol backend. When set, the renderer routes shader / buffer /
|
||||
// texture / draw calls through `gpu` instead of raw GL. The chess game
|
||||
@@ -44,8 +44,8 @@ UIRenderer :: struct {
|
||||
// time, not at draw-call submission, so re-using offset 0 across flushes
|
||||
// would let the last writer win and earlier batches would render as
|
||||
// whatever was uploaded last. Reset to 0 in `begin()`.
|
||||
mtl_buf_offset: s64 = 0;
|
||||
mtl_buf_capacity: s64 = 0;
|
||||
mtl_buf_offset: i64 = 0;
|
||||
mtl_buf_capacity: i64 = 0;
|
||||
|
||||
init :: (self: *UIRenderer) {
|
||||
// Allocate vertex scratch (CPU side) — same for both backends.
|
||||
@@ -295,7 +295,7 @@ UIRenderer :: struct {
|
||||
flush :: (self: *UIRenderer) {
|
||||
if self.vertex_count == 0 { return; }
|
||||
|
||||
upload_size : s64 = self.vertex_count * UI_VERTEX_BYTES;
|
||||
upload_size : i64 = self.vertex_count * UI_VERTEX_BYTES;
|
||||
|
||||
if self.gpu != null {
|
||||
// Mirror the GL path: bind current texture before drawing.
|
||||
@@ -315,7 +315,7 @@ UIRenderer :: struct {
|
||||
}
|
||||
byte_off := self.mtl_buf_offset;
|
||||
self.gpu.update_buffer_at(self.mtl_vbuf, xx self.vertices, upload_size, byte_off);
|
||||
vertex_off : s32 = xx (byte_off / UI_VERTEX_BYTES);
|
||||
vertex_off : i32 = xx (byte_off / UI_VERTEX_BYTES);
|
||||
self.gpu.draw_triangles(vertex_off, xx self.vertex_count);
|
||||
// Each batch starts on a vertex boundary so `vertex_off =
|
||||
// byte_off / UI_VERTEX_BYTES` lands on a whole vertex (otherwise
|
||||
@@ -364,7 +364,7 @@ UIRenderer :: struct {
|
||||
raster_size := node.font_size * font.dpi_scale;
|
||||
inv_dpi := font.inv_dpi;
|
||||
|
||||
i : s64 = 0;
|
||||
i : i64 = 0;
|
||||
while i < font.shaped_buf.len {
|
||||
shaped := font.shaped_buf.items[i];
|
||||
cached := font.get_or_rasterize(shaped.glyph_index, raster_size);
|
||||
|
||||
Reference in New Issue
Block a user