gpu: add TODOs for slice helper candidates

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-16 10:46:44 -07:00
parent e13b3078a5
commit f366244a9a
10 changed files with 20 additions and 2 deletions

View file

@ -48,6 +48,7 @@ pub const BindGroup = opaque {
next_in_chain: ?*const ChainedStruct = null, next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
layout: *BindGroupLayout, layout: *BindGroupLayout,
// TODO: slice helper
entry_count: u32 = 0, entry_count: u32 = 0,
entries: ?[*]const Entry = null, entries: ?[*]const Entry = null,
}; };

View file

@ -92,6 +92,7 @@ pub const BindGroupLayout = opaque {
pub const Descriptor = extern struct { pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null, next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
// TODO: slice helper
entry_count: u32 = 0, entry_count: u32 = 0,
entries: ?[*]const Entry = null, entries: ?[*]const Entry = null,
}; };

View file

@ -31,7 +31,6 @@ pub const ComputePassEncoder = opaque {
Impl.computePassEncoderPushDebugGroup(compute_pass_encoder, group_label); Impl.computePassEncoderPushDebugGroup(compute_pass_encoder, group_label);
} }
/// Default `dynamic_offset_count`: 0
/// Default `dynamic_offsets`: null /// Default `dynamic_offsets`: null
pub inline fn setBindGroup(compute_pass_encoder: *ComputePassEncoder, group_index: u32, group: *BindGroup, dynamic_offsets: ?[]const u32) void { pub inline fn setBindGroup(compute_pass_encoder: *ComputePassEncoder, group_index: u32, group: *BindGroup, dynamic_offsets: ?[]const u32) void {
Impl.computePassEncoderSetBindGroup( Impl.computePassEncoderSetBindGroup(

View file

@ -17,6 +17,7 @@ pub const EncoderInternalUsageDescriptor = extern struct {
/// TODO: Can be chained in gpu.Instance.Descriptor /// TODO: Can be chained in gpu.Instance.Descriptor
pub const InstanceDescriptor = extern struct { pub const InstanceDescriptor = extern struct {
chain: ChainedStruct, chain: ChainedStruct,
// TODO: slice helper
additional_runtime_search_paths_count: u32 = 0, additional_runtime_search_paths_count: u32 = 0,
additional_runtime_search_paths: ?[*]const u8 = null, additional_runtime_search_paths: ?[*]const u8 = null,
}; };
@ -30,8 +31,10 @@ pub const TextureInternalUsageDescriptor = extern struct {
/// TODO: Can be chained in gpu.Device.Descriptor /// TODO: Can be chained in gpu.Device.Descriptor
pub const TogglesDeviceDescriptor = extern struct { pub const TogglesDeviceDescriptor = extern struct {
chain: ChainedStruct, chain: ChainedStruct,
// TODO: slice helper
force_enabled_toggles_count: u32 = 0, force_enabled_toggles_count: u32 = 0,
force_enabled_toggles: ?[*]const u8 = null, force_enabled_toggles: ?[*]const u8 = null,
// TODO: slice helper
force_disabled_toggles_count: u32 = 0, force_disabled_toggles_count: u32 = 0,
force_disabled_toggles: ?[*]const u8 = null, force_disabled_toggles: ?[*]const u8 = null,
}; };

View file

@ -44,6 +44,7 @@ pub const Device = opaque {
pub const Descriptor = extern struct { pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null, next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
// TODO: slice helper
required_features_count: u32 = 0, required_features_count: u32 = 0,
required_features: ?[*]const FeatureName = null, required_features: ?[*]const FeatureName = null,
required_limits: ?*const RequiredLimits = null, required_limits: ?*const RequiredLimits = null,

View file

@ -6,6 +6,7 @@ pub const PipelineLayout = opaque {
pub const Descriptor = extern struct { pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null, next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
// TODO: slice helper
bind_group_layout_count: u32 = 0, bind_group_layout_count: u32 = 0,
bind_group_layouts: ?[*]const *BindGroupLayout = null, bind_group_layouts: ?[*]const *BindGroupLayout = null,
}; };

View file

@ -9,6 +9,7 @@ pub const QuerySet = opaque {
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
type: QueryType, type: QueryType,
count: u32, count: u32,
// TODO: slice helper
pipeline_statistics: ?[*]const PipelineStatisticName = null, pipeline_statistics: ?[*]const PipelineStatisticName = null,
pipeline_statistics_count: u32 = 0, pipeline_statistics_count: u32 = 0,
}; };

View file

@ -11,6 +11,7 @@ pub const RenderBundleEncoder = opaque {
pub const Descriptor = extern struct { pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null, next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
// TODO: slice helper
color_formats_count: u32 = 0, color_formats_count: u32 = 0,
color_formats: ?[*]const Texture.Format = null, color_formats: ?[*]const Texture.Format = null,
depth_stencil_format: Texture.Format = .undef, depth_stencil_format: Texture.Format = .undef,
@ -58,7 +59,6 @@ pub const RenderBundleEncoder = opaque {
Impl.renderBundleEncoderPushDebugGroup(render_bundle_encoder, group_label); Impl.renderBundleEncoderPushDebugGroup(render_bundle_encoder, group_label);
} }
/// Default `dynamic_offsets_count`: 0
/// Default `dynamic_offsets`: `null` /// Default `dynamic_offsets`: `null`
pub inline fn setBindGroup(render_bundle_encoder: *RenderBundleEncoder, group_index: u32, group: *BindGroup, dynamic_offsets: ?[]const u32) void { pub inline fn setBindGroup(render_bundle_encoder: *RenderBundleEncoder, group_index: u32, group: *BindGroup, dynamic_offsets: ?[]const u32) void {
Impl.renderBundleEncoderSetBindGroup( Impl.renderBundleEncoderSetBindGroup(

View file

@ -182,6 +182,7 @@ pub const Texture = opaque {
format: Format, format: Format,
mip_level_count: u32 = 1, mip_level_count: u32 = 1,
sample_count: u32 = 1, sample_count: u32 = 1,
// TODO: slice helper
view_format_count: u32 = 0, view_format_count: u32 = 0,
view_formats: ?[*]const Format = null, view_formats: ?[*]const Format = null,
}; };

View file

@ -57,6 +57,7 @@ pub const RequestAdapterOptions = extern struct {
pub const ComputePassDescriptor = extern struct { pub const ComputePassDescriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null, next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
// TODO: slice helper
timestamp_write_count: u32 = 0, timestamp_write_count: u32 = 0,
timestamp_writes: ?[*]const ComputePassTimestampWrite = null, timestamp_writes: ?[*]const ComputePassTimestampWrite = null,
}; };
@ -64,10 +65,12 @@ pub const ComputePassDescriptor = extern struct {
pub const RenderPassDescriptor = extern struct { pub const RenderPassDescriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null, next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
// TODO: slice helper
color_attachment_count: u32 = 0, color_attachment_count: u32 = 0,
color_attachments: ?[*]const RenderPassColorAttachment = null, color_attachments: ?[*]const RenderPassColorAttachment = null,
depth_stencil_attachment: ?*const RenderPassDepthStencilAttachment = null, depth_stencil_attachment: ?*const RenderPassDepthStencilAttachment = null,
occlusion_query_set: ?*QuerySet = null, occlusion_query_set: ?*QuerySet = null,
// TODO: slice helper
timestamp_write_count: u32 = 0, timestamp_write_count: u32 = 0,
timestamp_writes: ?[*]const RenderPassTimestampWrite = null, timestamp_writes: ?[*]const RenderPassTimestampWrite = null,
}; };
@ -583,6 +586,7 @@ pub const BlendState = extern struct {
pub const CompilationInfo = extern struct { pub const CompilationInfo = extern struct {
next_in_chain: ?*const ChainedStruct = null, next_in_chain: ?*const ChainedStruct = null,
// TODO: slice helper
message_count: u32, message_count: u32,
messages: ?[*]const CompilationMessage = null, messages: ?[*]const CompilationMessage = null,
}; };
@ -619,6 +623,7 @@ 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,
// TODO: slice helper
constant_count: u32 = 0, constant_count: u32 = 0,
constants: ?[*]const ConstantEntry = null, constants: ?[*]const ConstantEntry = null,
}; };
@ -651,6 +656,7 @@ pub const SupportedLimits = extern struct {
pub const VertexBufferLayout = extern struct { pub const VertexBufferLayout = extern struct {
array_stride: u64, array_stride: u64,
step_mode: VertexStepMode = .vertex, step_mode: VertexStepMode = .vertex,
// TODO: slice helper
attribute_count: u32, attribute_count: u32,
attributes: ?[*]const VertexAttribute = null, attributes: ?[*]const VertexAttribute = null,
}; };
@ -666,8 +672,10 @@ 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,
// TODO: slice helper
constant_count: u32 = 0, constant_count: u32 = 0,
constants: ?[*]const ConstantEntry = null, constants: ?[*]const ConstantEntry = null,
// TODO: slice helper
buffer_count: u32 = 0, buffer_count: u32 = 0,
buffers: ?[*]const VertexBufferLayout = null, buffers: ?[*]const VertexBufferLayout = null,
}; };
@ -676,8 +684,10 @@ 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,
// TODO: slice helper
constant_count: u32 = 0, constant_count: u32 = 0,
constants: ?[*]const ConstantEntry = null, constants: ?[*]const ConstantEntry = null,
// TODO: slice helper
target_count: u32, target_count: u32,
targets: ?[*]const ColorTargetState = null, targets: ?[*]const ColorTargetState = null,
}; };