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

fix(ext/webgpu): Allow depthClearValue to be undefined when depthLoadOp is not "clear" #23850

Merged
merged 1 commit into from
May 20, 2024

Conversation

chirsz-ever
Copy link
Contributor

The current implemention would panic at op_webgpu_command_encoder_begin_render_pass with legal JavaScript code, because GpuRenderPassDepthStencilAttachment require depth_clear_value to always appear.

The current WebGPU specification says1

(depthClearValue is) Ignored if depthLoadOp is not "clear"

The modification is tiny and easy to understand. Should I open a issue and/or add a unit test?

Footnotes

  1. https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdepthstencilattachment-depthclearvalue

@chirsz-ever
Copy link
Contributor Author

@crowlKats Could you please review this PR?

@crowlKats
Copy link
Member

@chirsz-ever looks good, though a simple unit test would be nice

@chirsz-ever
Copy link
Contributor Author

A new unit test added in "tests/unit/webgpu_test.ts".

…oadOp` is not "clear"

Add a new unit test in "tests/unit/webgpu_test.ts".
Copy link
Member

@crowlKats crowlKats left a comment

Choose a reason for hiding this comment

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

LGTM

@crowlKats crowlKats merged commit 529356c into denoland:main May 20, 2024
17 checks passed
bartlomieju pushed a commit that referenced this pull request May 21, 2024
bartlomieju pushed a commit that referenced this pull request May 21, 2024
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.

None yet

2 participants