opengl: for an array, size is just the size of the type

This commit is contained in:
Mitchell Hashimoto
2022-04-04 13:10:46 -07:00
parent b4fdfcc264
commit d1a24ce89c

View File

@ -73,8 +73,8 @@ pub const Binding = struct {
ptr: *const anyopaque, ptr: *const anyopaque,
} { } {
return switch (@typeInfo(@TypeOf(data))) { return switch (@typeInfo(@TypeOf(data))) {
.Array => |ary| .{ .Array => .{
.size = @sizeOf(ary.child) * ary.len, .size = @sizeOf(@TypeOf(data)),
.ptr = &data, .ptr = &data,
}, },
.Pointer => |ptr| switch (ptr.size) { .Pointer => |ptr| switch (ptr.size) {