Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ wgpu/resources/*.so
wgpu/resources/*.dylib
wgpu/resources/commit-sha
examples/screenshots/diffs
docs/gallery/
docs/_static/*.whl
docs/sg_execution_times.rst

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
4 changes: 1 addition & 3 deletions examples/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ def create_pipeline_layout(device: wgpu.GPUDevice):
bind_group_entries.append(
wgpu.BindGroupEntry(
binding=0,
resource=wgpu.BufferBinding(
buffer=uniform_buffer, offset=0, size=uniform_buffer.size
),
resource=uniform_buffer,
)
)
bind_group_layout_entries.append(
Expand Down
16 changes: 14 additions & 2 deletions wgpu/backends/wgpu_native/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1722,9 +1722,21 @@ def create_bind_group(
c_entries_list = []
for entry in entries:
check_struct("BindGroupEntry", entry)
# The resource can be a sampler, texture view, or buffer descriptor
# The resource can be a buffer, sampler, texture view, or buffer descriptor
resource = entry["resource"]
if isinstance(resource, GPUSampler):
if isinstance(resource, GPUBuffer):
# H: nextInChain: WGPUChainedStruct *, binding: int, buffer: WGPUBuffer, offset: int, size: int, sampler: WGPUSampler, textureView: WGPUTextureView
c_entry = new_struct(
"WGPUBindGroupEntry",
# not used: nextInChain
binding=int(entry["binding"]),
buffer=resource._internal,
offset=0,
size=resource.size,
sampler=ffi.NULL,
textureView=ffi.NULL,
)
elif isinstance(resource, GPUSampler):
# H: nextInChain: WGPUChainedStruct *, binding: int, buffer: WGPUBuffer, offset: int, size: int, sampler: WGPUSampler, textureView: WGPUTextureView
c_entry = new_struct(
"WGPUBindGroupEntry",
Expand Down
2 changes: 1 addition & 1 deletion wgpu/resources/codegen_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
* Wrote 255 enum mappings and 47 struct-field mappings to wgpu_native/_mappings.py
* Validated 154 C function calls
* Not using 68 C functions
* Validated 96 C structs
* Validated 97 C structs
Loading