this code compiled in earlier versions of zig but no longer does
pub fn shaderCodeComptime(comptime bytes: []const u8) []align(@alignOf(u32)) const u8 {
comptime var array: [@divExact(bytes.len, @sizeOf(u32))]u32 = undefined;
const byte_ptr: [*]align(@alignOf(u32)) u8 = @ptrCast(&array);
@memcpy(byte_ptr[0..bytes.len], bytes);
return byte_ptr[0..bytes.len];
}
src/util.zig:7:20: error: runtime value contains reference to comptime var
return byte_ptr[0..bytes.len];
~~~~~~~~^~~~~~~~~~~~~~
is this a bug i should report or is there a migration path for this.
i guess there is probably a better approach to do this type of thing and open to those ideas but i do want to know how to do this form of buffer fill at comptime -> into runtime constant