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

Bind group / pipeline deduplication does not take into account RenderBundles #2865

Closed
shoebe opened this issue Jul 10, 2022 · 1 comment · Fixed by #2867
Closed

Bind group / pipeline deduplication does not take into account RenderBundles #2865

shoebe opened this issue Jul 10, 2022 · 1 comment · Fixed by #2867

Comments

@shoebe
Copy link
Contributor

shoebe commented Jul 10, 2022

Description
#2623 introduced not pushing a pipeline/bind group set command if it was already set
Render bundles reset the pipeline and bind groups after being executed though, and this isn't taken into account by this check

Repro steps
Edited the hello-triangle example:
https://github.com/shoebe/wgpu/tree/115ee0fa8cc8b03fd61fc015827afc30f84821ca/wgpu/examples/deduplication-bug
In short:

render_pass.set_pipeline(&pipeline); // 1
render_pass.execute_bundles(bundles);
render_pass.set_pipeline(&pipeline); // This pipeline will not be set because it was set before the bundle execution
render_pass.draw(0..3, 0..1);
drop(render_pass);
self.queue.submit(std::iter::once(encoder.finish())); // crash here: 'render pipeline must be set'
// if line 1 is commented out, no crash

Extra materials
Crash log:

[2022-07-10T17:30:11Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 1, Vulkan)>`
    In a draw command, indexed:false indirect:false
    render pipeline must be set

', wgpu/src/backend/direct.rs:2391:5

Possible fix
See https://github.com/shoebe/wgpu/commit/54c330aa275ffed712a2dee6bf567c733f151886

@cwfitzgerald
Copy link
Member

Good catch - that fix looks great, please PR it!

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 a pull request may close this issue.

2 participants