gpu: correct alignment in pointer casts; handle void Context in all callbacks (#233)
* Fixed ErrorCallback.init() alignment * Fixed callbacks alignments * Fixed more of the callback alignment problems * Added checks for void Context in callback
This commit is contained in:
parent
d664c8e55d
commit
169b1e2a42
10 changed files with 29 additions and 24 deletions
|
|
@ -1,3 +1,4 @@
|
|||
const std = @import("std");
|
||||
const PipelineLayout = @import("PipelineLayout.zig");
|
||||
const VertexState = @import("structs.zig").VertexState;
|
||||
const PrimitiveState = @import("structs.zig").PrimitiveState;
|
||||
|
|
@ -81,7 +82,7 @@ pub const CreateCallback = struct {
|
|||
message: [:0]const u8,
|
||||
) void {
|
||||
callback(
|
||||
@ptrCast(Context, @alignCast(@alignOf(Context), type_erased_ctx)),
|
||||
if (Context == void) {} else @ptrCast(Context, @alignCast(std.meta.alignment(Context), type_erased_ctx)),
|
||||
status,
|
||||
pipeline,
|
||||
message,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue