Skip to content

DXC compiler fails with custom paths #3433

@daxpedda

Description

@daxpedda

Description
When using a custom path in wgpu::Dx12Compiler::Dxc pipeline creation fails.

When using no custom path, everything works as expected.

I'm still in the process of debugging this and finding out the exact cause, unfortunately I don't have access to a Windows PC right now.

Repro steps
Any example should work, I tried the hello-triangle example, change the Instance creation to:

    let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
        backends: wgpu::Backends::DX12,
        dx12_shader_compiler: wgpu::Dx12Compiler::Dxc {
            dxil_path: Some("shared".into()),
            dxc_path: Some("shared".into()),
        },
    });

Expected vs observed behavior
This will fail with:

2023-01-26T23:08:03.110466Z ERROR wgpu::backend::direct: Shader translation error for stage VERTEX | FRAGMENT | VERTEX_FRAGMENT: invalid argument
2023-01-26T23:08:03.110692Z ERROR wgpu::backend::direct: Please report it to https://github.com/gfx-rs/naga
2023-01-26T23:08:03.111341Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default

Which points to:

if let wgc::pipeline::CreateRenderPipelineError::Internal { stage, ref error } = cause {
log::error!("Shader translation error for stage {:?}: {}", stage, error);
log::error!("Please report it to https://github.com/gfx-rs/naga");
}
self.handle_error(
&device_data.error_sink,
cause,
LABEL,
desc.label,
"Device::create_render_pipeline",
);

Platform
I tried this with wgpu 0.15 and the latest master (b31069f) which didn't change much since the last release.

I did attempt to reproduce this locally with Wine but wasn't able to.
So the only place I could reproduce this is on an actual Windows OS, Windows 10 in my case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions