gpu: convert *opaque -> opaque for ShaderModule
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
397f2eb1c9
commit
2c1a8240c5
7 changed files with 21 additions and 21 deletions
|
|
@ -97,11 +97,11 @@ pub const Device = opaque {
|
||||||
Impl.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata);
|
Impl.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn createSampler(device: *Device, descriptor: ?*const SamplerDescriptor) Sampler {
|
pub inline fn createSampler(device: *Device, descriptor: ?*const SamplerDescriptor) *Sampler {
|
||||||
return Impl.deviceCreateSampler(device, descriptor);
|
return Impl.deviceCreateSampler(device, descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn createShaderModule(device: *Device, descriptor: *const ShaderModuleDescriptor) ShaderModule {
|
pub inline fn createShaderModule(device: *Device, descriptor: *const ShaderModuleDescriptor) *ShaderModule {
|
||||||
return Impl.deviceCreateShaderModule(device, descriptor);
|
return Impl.deviceCreateShaderModule(device, descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
const ChainedStruct = @import("types.zig").ChainedStruct;
|
const ChainedStruct = @import("types.zig").ChainedStruct;
|
||||||
const Impl = @import("interface.zig").Impl;
|
const Impl = @import("interface.zig").Impl;
|
||||||
|
|
||||||
pub const RenderBundle = *opaque {
|
pub const RenderBundle = opaque {
|
||||||
pub inline fn reference(render_bundle: *RenderBundle) void {
|
pub inline fn reference(render_bundle: *RenderBundle) void {
|
||||||
Impl.renderBundleReference(render_bundle);
|
Impl.renderBundleReference(render_bundle);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ const Color = @import("types.zig").Color;
|
||||||
const IndexFormat = @import("types.zig").IndexFormat;
|
const IndexFormat = @import("types.zig").IndexFormat;
|
||||||
const Impl = @import("interface.zig").Impl;
|
const Impl = @import("interface.zig").Impl;
|
||||||
|
|
||||||
pub const RenderPassEncoder = *opaque {
|
pub const RenderPassEncoder = opaque {
|
||||||
pub inline fn beginOcclusionQuery(render_pass_encoder: *RenderPassEncoder, query_index: u32) void {
|
pub inline fn beginOcclusionQuery(render_pass_encoder: *RenderPassEncoder, query_index: u32) void {
|
||||||
Impl.renderPassEncoderBeginOcclusionQuery(render_pass_encoder, query_index);
|
Impl.renderPassEncoderBeginOcclusionQuery(render_pass_encoder, query_index);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ const PipelineLayout = @import("pipeline_layout.zig").PipelineLayout;
|
||||||
const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout;
|
const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout;
|
||||||
const Impl = @import("interface.zig").Impl;
|
const Impl = @import("interface.zig").Impl;
|
||||||
|
|
||||||
pub const RenderPipeline = *opaque {
|
pub const RenderPipeline = opaque {
|
||||||
pub inline fn getBindGroupLayout(render_pipeline: *RenderPipeline, group_index: u32) *BindGroupLayout {
|
pub inline fn getBindGroupLayout(render_pipeline: *RenderPipeline, group_index: u32) *BindGroupLayout {
|
||||||
return Impl.renderPipelineGetBindGroupLayout(render_pipeline, group_index);
|
return Impl.renderPipelineGetBindGroupLayout(render_pipeline, group_index);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,16 @@ const FilterMode = @import("types.zig").FilterMode;
|
||||||
const CompareFunction = @import("types.zig").CompareFunction;
|
const CompareFunction = @import("types.zig").CompareFunction;
|
||||||
const Impl = @import("interface.zig").Impl;
|
const Impl = @import("interface.zig").Impl;
|
||||||
|
|
||||||
pub const Sampler = *opaque {
|
pub const Sampler = opaque {
|
||||||
pub inline fn setLabel(sampler: Sampler, label: [*:0]const u8) void {
|
pub inline fn setLabel(sampler: *Sampler, label: [*:0]const u8) void {
|
||||||
Impl.samplerSetLabel(sampler, label);
|
Impl.samplerSetLabel(sampler, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn reference(sampler: Sampler) void {
|
pub inline fn reference(sampler: *Sampler) void {
|
||||||
Impl.samplerReference(sampler);
|
Impl.samplerReference(sampler);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn release(sampler: Sampler) void {
|
pub inline fn release(sampler: *Sampler) void {
|
||||||
Impl.samplerRelease(sampler);
|
Impl.samplerRelease(sampler);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -32,15 +32,15 @@ pub const SamplerBindingType = enum(u32) {
|
||||||
|
|
||||||
pub const SamplerBindingLayout = extern struct {
|
pub const SamplerBindingLayout = extern struct {
|
||||||
next_in_chain: ?*const ChainedStruct = null,
|
next_in_chain: ?*const ChainedStruct = null,
|
||||||
type: SamplerBindingType = .undef,
|
type: *SamplerBindingType = .undef,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const SamplerDescriptor = extern struct {
|
pub const SamplerDescriptor = extern struct {
|
||||||
next_in_chain: ?*const ChainedStruct = null,
|
next_in_chain: ?*const ChainedStruct = null,
|
||||||
label: ?[*:0]const u8 = null,
|
label: ?[*:0]const u8 = null,
|
||||||
address_mode_u: SamplerAddressMode = .clamp_to_edge,
|
address_mode_u: *SamplerAddressMode = .clamp_to_edge,
|
||||||
address_mode_v: SamplerAddressMode = .clamp_to_edge,
|
address_mode_v: *SamplerAddressMode = .clamp_to_edge,
|
||||||
address_mode_w: SamplerAddressMode = .clamp_to_edge,
|
address_mode_w: *SamplerAddressMode = .clamp_to_edge,
|
||||||
mag_filter: FilterMode = .nearest,
|
mag_filter: FilterMode = .nearest,
|
||||||
min_filter: FilterMode = .nearest,
|
min_filter: FilterMode = .nearest,
|
||||||
mipmap_filter: FilterMode = .nearest,
|
mipmap_filter: FilterMode = .nearest,
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,20 @@ const ChainedStruct = @import("types.zig").ChainedStruct;
|
||||||
const CompilationInfoCallback = @import("types.zig").CompilationInfoCallback;
|
const CompilationInfoCallback = @import("types.zig").CompilationInfoCallback;
|
||||||
const Impl = @import("interface.zig").Impl;
|
const Impl = @import("interface.zig").Impl;
|
||||||
|
|
||||||
pub const ShaderModule = *opaque {
|
pub const ShaderModule = opaque {
|
||||||
pub inline fn getCompilationInfo(shader_module: ShaderModule, callback: CompilationInfoCallback, userdata: *anyopaque) void {
|
pub inline fn getCompilationInfo(shader_module: *ShaderModule, callback: CompilationInfoCallback, userdata: *anyopaque) void {
|
||||||
Impl.shaderModuleGetCompilationInfo(shader_module, callback, userdata);
|
Impl.shaderModuleGetCompilationInfo(shader_module, callback, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn setLabel(shader_module: ShaderModule, label: [*:0]const u8) void {
|
pub inline fn setLabel(shader_module: *ShaderModule, label: [*:0]const u8) void {
|
||||||
Impl.shaderModuleSetLabel(shader_module, label);
|
Impl.shaderModuleSetLabel(shader_module, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn reference(shader_module: ShaderModule) void {
|
pub inline fn reference(shader_module: *ShaderModule) void {
|
||||||
Impl.shaderModuleReference(shader_module);
|
Impl.shaderModuleReference(shader_module);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn release(shader_module: ShaderModule) void {
|
pub inline fn release(shader_module: *ShaderModule) void {
|
||||||
Impl.shaderModuleRelease(shader_module);
|
Impl.shaderModuleRelease(shader_module);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -581,7 +581,7 @@ pub const ImageCopyTexture = extern struct {
|
||||||
|
|
||||||
pub const ProgrammableStageDescriptor = extern struct {
|
pub const ProgrammableStageDescriptor = extern struct {
|
||||||
next_in_chain: ?*const ChainedStruct = null,
|
next_in_chain: ?*const ChainedStruct = null,
|
||||||
module: ShaderModule,
|
module: *ShaderModule,
|
||||||
entry_point: [*:0]const u8,
|
entry_point: [*:0]const u8,
|
||||||
constant_count: u32 = 0,
|
constant_count: u32 = 0,
|
||||||
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
|
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
|
||||||
|
|
@ -630,7 +630,7 @@ pub const ColorTargetState = extern struct {
|
||||||
|
|
||||||
pub const VertexState = extern struct {
|
pub const VertexState = extern struct {
|
||||||
next_in_chain: ?*const ChainedStruct = null,
|
next_in_chain: ?*const ChainedStruct = null,
|
||||||
module: ShaderModule,
|
module: *ShaderModule,
|
||||||
entry_point: [*:0]const u8,
|
entry_point: [*:0]const u8,
|
||||||
constant_count: u32 = 0,
|
constant_count: u32 = 0,
|
||||||
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
|
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
|
||||||
|
|
@ -642,7 +642,7 @@ pub const VertexState = extern struct {
|
||||||
|
|
||||||
pub const FragmentState = extern struct {
|
pub const FragmentState = extern struct {
|
||||||
next_in_chain: ?*const ChainedStruct = null,
|
next_in_chain: ?*const ChainedStruct = null,
|
||||||
module: ShaderModule,
|
module: *ShaderModule,
|
||||||
entry_point: [*:0]const u8,
|
entry_point: [*:0]const u8,
|
||||||
constant_count: u32 = 0,
|
constant_count: u32 = 0,
|
||||||
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
|
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue