From 2d3febac0e075802476cf0f877c4ddd3f6a20605 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 14 Oct 2022 09:19:58 -0700 Subject: [PATCH] fix invalid ptrcast --- src/opengl/Program.zig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/opengl/Program.zig b/src/opengl/Program.zig index cfaf025c4..7ac6d243f 100644 --- a/src/opengl/Program.zig +++ b/src/opengl/Program.zig @@ -72,8 +72,15 @@ pub inline fn use(p: Program) !Binding { } /// Requires the program is currently in use. -pub inline fn setUniform(p: Program, n: [:0]const u8, value: anytype) !void { - const loc = c.glGetUniformLocation(p.id, n); +pub inline fn setUniform( + p: Program, + n: [:0]const u8, + value: anytype, +) !void { + const loc = c.glGetUniformLocation( + p.id, + @ptrCast([*c]const u8, n.ptr), + ); if (loc < 0) { return error.UniformNameInvalid; }