gpu: remove needless Limits conversion
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
f79c77af99
commit
cc7aa3a49a
1 changed files with 1 additions and 34 deletions
|
|
@ -266,7 +266,7 @@ const adapter_vtable = Adapter.VTable{
|
||||||
|
|
||||||
const required_limits = if (descriptor.required_limits) |l| c.WGPURequiredLimits{
|
const required_limits = if (descriptor.required_limits) |l| c.WGPURequiredLimits{
|
||||||
.nextInChain = null,
|
.nextInChain = null,
|
||||||
.limits = convertLimits(l),
|
.limits = @bitCast(c.WGPULimits, l),
|
||||||
} else null;
|
} else null;
|
||||||
|
|
||||||
const desc = c.WGPUDeviceDescriptor{
|
const desc = c.WGPUDeviceDescriptor{
|
||||||
|
|
@ -845,38 +845,6 @@ inline fn convertRenderPipelineDescriptor(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: maybe make Limits an extern struct that can be cast?
|
|
||||||
fn convertLimits(l: Limits) c.WGPULimits {
|
|
||||||
return .{
|
|
||||||
.maxTextureDimension1D = l.max_texture_dimension_1d,
|
|
||||||
.maxTextureDimension2D = l.max_texture_dimension_2d,
|
|
||||||
.maxTextureDimension3D = l.max_texture_dimension_3d,
|
|
||||||
.maxTextureArrayLayers = l.max_texture_array_layers,
|
|
||||||
.maxBindGroups = l.max_bind_groups,
|
|
||||||
.maxDynamicUniformBuffersPerPipelineLayout = l.max_dynamic_uniform_buffers_per_pipeline_layout,
|
|
||||||
.maxDynamicStorageBuffersPerPipelineLayout = l.max_dynamic_storage_buffers_per_pipeline_layout,
|
|
||||||
.maxSampledTexturesPerShaderStage = l.max_sampled_textures_per_shader_stage,
|
|
||||||
.maxSamplersPerShaderStage = l.max_samplers_per_shader_stage,
|
|
||||||
.maxStorageBuffersPerShaderStage = l.max_storage_buffers_per_shader_stage,
|
|
||||||
.maxStorageTexturesPerShaderStage = l.max_storage_textures_per_shader_stage,
|
|
||||||
.maxUniformBuffersPerShaderStage = l.max_uniform_buffers_per_shader_stage,
|
|
||||||
.maxUniformBufferBindingSize = l.max_uniform_buffer_binding_size,
|
|
||||||
.maxStorageBufferBindingSize = l.max_storage_buffer_binding_size,
|
|
||||||
.minUniformBufferOffsetAlignment = l.min_uniform_buffer_offset_alignment,
|
|
||||||
.minStorageBufferOffsetAlignment = l.min_storage_buffer_offset_alignment,
|
|
||||||
.maxVertexBuffers = l.max_vertex_buffers,
|
|
||||||
.maxVertexAttributes = l.max_vertex_attributes,
|
|
||||||
.maxVertexBufferArrayStride = l.max_vertex_buffer_array_stride,
|
|
||||||
.maxInterStageShaderComponents = l.max_inter_stage_shader_components,
|
|
||||||
.maxComputeWorkgroupStorageSize = l.max_compute_workgroup_storage_size,
|
|
||||||
.maxComputeInvocationsPerWorkgroup = l.max_compute_invocations_per_workgroup,
|
|
||||||
.maxComputeWorkgroupSizeX = l.max_compute_workgroup_size_x,
|
|
||||||
.maxComputeWorkgroupSizeY = l.max_compute_workgroup_size_y,
|
|
||||||
.maxComputeWorkgroupSizeZ = l.max_compute_workgroup_size_z,
|
|
||||||
.maxComputeWorkgroupsPerDimension = l.max_compute_workgroups_per_dimension,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
fn wrapQueue(queue: c.WGPUQueue) Queue {
|
fn wrapQueue(queue: c.WGPUQueue) Queue {
|
||||||
return .{
|
return .{
|
||||||
.ptr = queue.?,
|
.ptr = queue.?,
|
||||||
|
|
@ -2212,7 +2180,6 @@ test {
|
||||||
_ = adapter_vtable;
|
_ = adapter_vtable;
|
||||||
_ = wrapDevice;
|
_ = wrapDevice;
|
||||||
_ = device_vtable;
|
_ = device_vtable;
|
||||||
_ = convertLimits;
|
|
||||||
_ = wrapQueue;
|
_ = wrapQueue;
|
||||||
_ = wrapShaderModule;
|
_ = wrapShaderModule;
|
||||||
_ = wrapSwapChain;
|
_ = wrapSwapChain;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue