diff --git a/tests/test_set_constant.py b/tests/test_set_constant.py index e187ae89..3044d279 100644 --- a/tests/test_set_constant.py +++ b/tests/test_set_constant.py @@ -18,7 +18,7 @@ using stage-separated push constants correctly. The source code assumes the topology is POINT-LIST, so that each call to vertexMain -corresponds with one call to fragmentMain. +corresponds with one call to fragmentMain. """ COUNT = 10 @@ -34,7 +34,7 @@ values1: array, // VERTEX constants values2: array, // FRAGMENT constants } - var push_constants: PushConstants; + var push_constants: PushConstants; struct VertexOutput { @location(0) index: u32, @@ -99,7 +99,6 @@ def run_test(device): vertex_call_buffer = device.create_buffer(size=COUNT * 4, usage="STORAGE|COPY_SRC") bind_group = device.create_bind_group( - label=f"Bind Group for Faces", layout=pipeline.get_bind_group_layout(0), entries=[ {"binding": 0, "resource": {"buffer": vertex_call_buffer}}, diff --git a/wgpu/_classes.py b/wgpu/_classes.py index 2e6ad5b1..232cd623 100644 --- a/wgpu/_classes.py +++ b/wgpu/_classes.py @@ -718,7 +718,7 @@ def create_pipeline_layout( *, label="", bind_group_layouts: "List[GPUBindGroupLayout]", - push_constant_layouts: "List[GPUPushConstantRange]" = [], + push_constant_layouts: "List[Dict]" = [], ): """Create a `GPUPipelineLayout` object, which can be used in `create_render_pipeline()` or `create_compute_pipeline()`. diff --git a/wgpu/backends/wgpu_native/_api.py b/wgpu/backends/wgpu_native/_api.py index 9702aaa8..e5b5f90a 100644 --- a/wgpu/backends/wgpu_native/_api.py +++ b/wgpu/backends/wgpu_native/_api.py @@ -811,13 +811,15 @@ def _request_device( # This is important, because zero does NOT mean default, and a limit of zero # for a specific limit may break a lot of applications. required_limits = required_limits or {} - for key, value in self.limits.items(): - c_key = to_camel_case(key) - new_value = required_limits.get(key, value) - if hasattr(c_limits, c_key): - setattr(c_limits, c_key, new_value) - else: - setattr(c_limits_extras, c_key, new_value) + for limit in (c_limits, c_limits_extras): + for key in dir(limit): + snake_key = to_snake_case(key) + # Use the value in required_limits if it exists.fl + try: + value = required_limits[snake_key] + except KeyError: + value = self.limits[snake_key] + setattr(limit, key, value) # ---- Set queue descriptor @@ -1310,7 +1312,7 @@ def create_pipeline_layout( *, label="", bind_group_layouts: "List[GPUBindGroupLayout]", - push_constant_layouts: "List[GPUPushConstantRange]" = [], + push_constant_layouts: "List[Dict]" = [], ): bind_group_layouts_ids = [x._internal for x in bind_group_layouts]