From cc7aa3a49a0485f50d061eebc74c91d057e511cf Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 18 Mar 2022 22:54:27 -0700 Subject: [PATCH] gpu: remove needless Limits conversion Signed-off-by: Stephen Gutekanst --- gpu/src/NativeInstance.zig | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/gpu/src/NativeInstance.zig b/gpu/src/NativeInstance.zig index 9facd1fe..41852af8 100644 --- a/gpu/src/NativeInstance.zig +++ b/gpu/src/NativeInstance.zig @@ -266,7 +266,7 @@ const adapter_vtable = Adapter.VTable{ const required_limits = if (descriptor.required_limits) |l| c.WGPURequiredLimits{ .nextInChain = null, - .limits = convertLimits(l), + .limits = @bitCast(c.WGPULimits, l), } else null; 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 { return .{ .ptr = queue.?, @@ -2212,7 +2180,6 @@ test { _ = adapter_vtable; _ = wrapDevice; _ = device_vtable; - _ = convertLimits; _ = wrapQueue; _ = wrapShaderModule; _ = wrapSwapChain;