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,
} {
return switch (@typeInfo(@TypeOf(data))) {
.Array => |ary| .{
.size = @sizeOf(ary.child) * ary.len,
.Array => .{
.size = @sizeOf(@TypeOf(data)),
.ptr = &data,
},
.Pointer => |ptr| switch (ptr.size) {