gpu: internalize ShaderModule types

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-29 23:58:52 -07:00 committed by Stephen Gutekanst
parent b0776270d3
commit 23fb836ce8
3 changed files with 20 additions and 21 deletions

View file

@ -3,6 +3,22 @@ const CompilationInfoCallback = @import("callbacks.zig").CompilationInfoCallback
const Impl = @import("interface.zig").Impl;
pub const ShaderModule = opaque {
pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
};
pub const SPIRVDescriptor = extern struct {
chain: ChainedStruct,
code_size: u32,
code: [*]const u32,
};
pub const WGSLDescriptor = extern struct {
chain: ChainedStruct,
source: [*:0]const u8,
};
pub inline fn getCompilationInfo(shader_module: *ShaderModule, callback: CompilationInfoCallback, userdata: *anyopaque) void {
Impl.shaderModuleGetCompilationInfo(shader_module, callback, userdata);
}
@ -19,19 +35,3 @@ pub const ShaderModule = opaque {
Impl.shaderModuleRelease(shader_module);
}
};
pub const ShaderModuleDescriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
};
pub const ShaderModuleSPIRVDescriptor = extern struct {
chain: ChainedStruct,
code_size: u32,
code: [*]const u32,
};
pub const ShaderModuleWGSLDescriptor = extern struct {
chain: ChainedStruct,
source: [*:0]const u8,
};