Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetBindGroupLayout 'raises error' instead of panicing on invalid index #320

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

almarklein
Copy link
Collaborator

Ref discussion in pygfx/wgpu-py#423

We have wgpuRenderPipelineGetBindGroupLayout and wgpuComputePipelineGetBindGroupLayout. End-users calling this code (e.g. people writing code against wgpu-py), may accidentally use an invalid index, which now causes a panic. In order for a wrapper to handle such errors gracefully, they must either know the number of layouts, or the call should not panic but generate an error instead. This PR does the latter (leading to a Python exception in wgpu-py).

Tested with wgpu-py (on the v0.18.1.1 tag).

@almarklein
Copy link
Collaborator Author

almarklein commented Nov 22, 2023

@rajveermalviya if this looks good I'll also add it for the compute pipeline. done

@almarklein almarklein marked this pull request as ready for review November 22, 2023 16:02
Copy link
Collaborator

@rajveermalviya rajveermalviya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rajveermalviya rajveermalviya merged commit 34fd2da into trunk Nov 22, 2023
32 checks passed
@rajveermalviya rajveermalviya deleted the GetBindGroupLayout branch November 22, 2023 16:41
@rajveermalviya
Copy link
Collaborator

Will create a backport to v0.18.1.x later.

rajveermalviya pushed a commit to rajveermalviya/wgpu-native that referenced this pull request Nov 23, 2023
almarklein added a commit that referenced this pull request Nov 23, 2023
#320) (#321)

Co-authored-by: Almar Klein <almar@almarklein.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants