Skip to content

Setting a pipeline-overridable shader constant to f64::INFINITY results in a crash on certain platforms #6082

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

Closed
polina4096 opened this issue Aug 6, 2024 · 4 comments

Comments

@polina4096
Copy link

Description
When setting a pipeline-overridable shader constant to f64::INFINITY, code fails with an error on certain platforms in various configurations. I've only been able to catch this on Windows as of now.

Repro steps

device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
  label: None,
  layout: Some(&pipeline_layout),
  vertex: wgpu::VertexState {
    module: &shader,
    entry_point: "vs_main",
    buffers: &[],
    compilation_options: wgpu::PipelineCompilationOptions {
      constants: &HashMap::new().tap_mut(|x| {
        x.insert(String::from("1000"), f64::INFINITY);
      }),
      ..Default::default()
    },
  },
  /* ... */
}

Expected vs observed behavior
This results in a crash with a message saying to report the issue. Not really sure which is the best way to handle this case otherwise, but at least it should not behave like that.

Extra materials
Screenshot 2024-08-06 at 05 07 51

Platform
Windows 11
wgpu = "22.1.0"

@teoxoy
Copy link
Member

teoxoy commented Aug 6, 2024

This is expected, as the validation error is saying, NaNs and Infinities are not supported.

There is this issue that tracks support for those though: #5128.

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in WebGPU for Firefox Aug 6, 2024
@polina4096
Copy link
Author

I'm not sure the message to report it is expected.

@Wumpf
Copy link
Member

Wumpf commented Aug 6, 2024

@teoxoy the "please report this" bit in the log there is strange & confusing indeed. Do we have that tracked somewhere?

@teoxoy
Copy link
Member

teoxoy commented Aug 9, 2024

Ah yes, that's not intended. I'll open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants