summaryrefslogtreecommitdiff
path: root/src/vector
diff options
context:
space:
mode:
Diffstat (limited to 'src/vector')
-rw-r--r--src/vector/Gpu.zig12
-rw-r--r--src/vector/root.zig4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/vector/Gpu.zig b/src/vector/Gpu.zig
index a557537..5853145 100644
--- a/src/vector/Gpu.zig
+++ b/src/vector/Gpu.zig
@@ -19,8 +19,8 @@ const shaders = @import("vector_shaders");
pub const samples = 8;
-const vertex: abi.gpu.Shader = .{ .spirv = shaders.path_vert, .uniform_buffers = 1 };
-const stencil_only: abi.gpu.Shader = .{ .spirv = shaders.stencil_frag };
+const vertex: abi.gpu.Shader = .{ .code = shaders.path_vert, .uniform_buffers = 1 };
+const stencil_only: abi.gpu.Shader = .{ .code = shaders.stencil_frag };
const pipelines = [_]abi.gpu.Pipeline{
// 0: nonzero winding.
@@ -42,7 +42,7 @@ const pipelines = [_]abi.gpu.Pipeline{
// 2: cover.
abi.gpu.pipeline(layouts.Vertex, .{
.vertex = vertex,
- .fragment = .{ .spirv = shaders.cover_frag, .uniform_buffers = 1 },
+ .fragment = .{ .code = shaders.cover_frag, .uniform_buffers = 1 },
.stencil = .{
.front = .{ .compare = .not_equal, .pass = .zero },
.back = .{ .compare = .not_equal, .pass = .zero },
@@ -116,8 +116,8 @@ fn block(paint: *const Paint, alpha: f32) layouts.Paint {
const m = paint.to_gradient;
var out: layouts.Paint = .{
.color = paint.color,
- .row0 = .{ m.a, m.c, m.e, @floatFromInt(@intFromEnum(paint.kind)) },
- .row1 = .{ m.b, m.d, m.f, @floatFromInt(@intFromEnum(paint.spread)) },
+ .row0 = .{ m.a, m.c, m.e, @floatFromInt(@backingInt(paint.kind)) },
+ .row1 = .{ m.b, m.d, m.f, @floatFromInt(@backingInt(paint.spread)) },
.points = .{ paint.p0[0], paint.p0[1], paint.p1[0], paint.p1[1] },
.extra = .{ paint.radius, alpha, 0, 0 },
.offsets = @splat(@splat(0)),
@@ -157,7 +157,7 @@ pub fn pass(g: *const Gpu) abi.gpu.Pass {
test "a fill is a stencil fan and a covering quad with its paint" {
var arena: std.heap.ArenaAllocator = .init(std.testing.allocator);
defer arena.deinit();
- var g: Gpu = .{ .width = 100, .height = 50, .image = @enumFromInt(1) };
+ var g: Gpu = .{ .width = 100, .height = 50, .image = @fromBackingInt(@intCast(1)) };
g.begin(arena.allocator(), .{ 0, 0, 0, 1 });
var p: Polygons = .init(arena.allocator());
try p.points.appendSlice(arena.allocator(), &.{ .{ 10, 10 }, .{ 40, 10 }, .{ 40, 30 }, .{ 10, 30 } });
diff --git a/src/vector/root.zig b/src/vector/root.zig
index 7556948..0414286 100644
--- a/src/vector/root.zig
+++ b/src/vector/root.zig
@@ -69,12 +69,12 @@ pub fn Renderer(comptime backend: Backend) type {
return r.target.height;
}
- /// Starts a picture. `f.arena` holds what the GPU pass needs until
+ /// Starts a picture. `f.scratch` holds what the GPU pass needs until
/// the frame is consumed.
pub fn begin(r: *Self, f: anytype, clear: Drawing.Color) void {
switch (backend) {
.cpu => r.target.clear(clear),
- .gpu => r.target.begin(f.arena, clear),
+ .gpu => r.target.begin(f.scratch, clear),
}
}