gpu: enable void callback contexts
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
1717c684de
commit
79d27b82be
9 changed files with 46 additions and 48 deletions
|
|
@ -57,9 +57,9 @@ pub const CreateCallback = struct {
|
|||
|
||||
pub fn init(
|
||||
comptime Context: type,
|
||||
ctx: *Context,
|
||||
ctx: Context,
|
||||
comptime callback: fn (
|
||||
ctx: *Context,
|
||||
ctx: Context,
|
||||
status: CreateStatus,
|
||||
pipeline: ComputePipeline,
|
||||
message: [:0]const u8,
|
||||
|
|
@ -73,7 +73,7 @@ pub const CreateCallback = struct {
|
|||
message: [:0]const u8,
|
||||
) void {
|
||||
callback(
|
||||
@ptrCast(*Context, @alignCast(@alignOf(*Context), type_erased_ctx)),
|
||||
@ptrCast(Context, @alignCast(@alignOf(Context), type_erased_ctx)),
|
||||
status,
|
||||
pipeline,
|
||||
message,
|
||||
|
|
@ -82,7 +82,7 @@ pub const CreateCallback = struct {
|
|||
}).erased;
|
||||
|
||||
return .{
|
||||
.type_erased_ctx = ctx,
|
||||
.type_erased_ctx = if (Context == void) undefined else ctx,
|
||||
.type_erased_callback = erased,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue