Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

[DX12] Implementation specific error occured #600

Closed
DasEtwas opened this issue Oct 25, 2020 · 3 comments
Closed

[DX12] Implementation specific error occured #600

DasEtwas opened this issue Oct 25, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@DasEtwas
Copy link
Contributor

Device::create_render_pipeline panics with failed to create graphics pipeline: Failed to create pipeline: Unsupported usage: Implementation specific error occurred

in wgpu-core/src/device/mod.rs:3097:17 using current wgpu master (86757f)

let pipeline_layout = device.create_pipeline_layout(&PipelineLayoutDescriptor {
    label:                Some("color clear shader pipeline layout descriptor"),
    push_constant_ranges: &[],
    bind_group_layouts:   &[],
});
panic >>> let pipeline = device.create_render_pipeline(&RenderPipelineDescriptor {
    label:                     Some("color clear shader render pipeline descriptor"),
    layout:                    Some(&pipeline_layout),
    vertex_stage:              ProgrammableStageDescriptor {
        module:      &device.create_shader_module(ShaderModuleSource::SpirV(Borrowed(...))),
        entry_point: "main",
    },
    fragment_stage:            Some(ProgrammableStageDescriptor {
        module:      &device.create_shader_module(ShaderModuleSource::SpirV(Borrowed(...))),
        entry_point: "main",
    }),
    rasterization_state:       Some(RasterizationStateDescriptor::default()),
    primitive_topology:        PrimitiveTopology::TriangleList,
    color_states:              &[ColorStateDescriptor {
        format:      output_format,
        write_mask:  ColorWrite::ALL,
        color_blend: BlendDescriptor::REPLACE,
        alpha_blend: BlendDescriptor::REPLACE,
    }],
    depth_stencil_state:       None,
    vertex_state:              VertexStateDescriptor {
        index_format:   IndexFormat::Uint32,
        vertex_buffers: &[VertexBufferDescriptor {
            attributes: &[VertexAttributeDescriptor {
                format: VertexFormat::Float2, shader_location: 0, offset: 0
            }],
            stride:     2 * size_of::<f32>() as u64,
            step_mode:  InputStepMode::Vertex,
        }],
    },
    sample_count:              1,
    sample_mask:               !0,
    alpha_to_coverage_enabled: false,
});
stack backtrace:
   0: rust_begin_unwind
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\/library\std\src/panicking.rs:475
   1: std::panicking::begin_panic_fmt
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\/library\std\src/panicking.rs:429
   2: wgpu_core::device::<impl wgpu_core::hub::Global<G>>::device_create_render_pipeline::{{closure}}
             at ~/.cargo\git\checkouts\wgpu-53e70f8674b08dd4\7ac706f\wgpu-core\src\device/mod.rs:3102
   3: core::result::Result<T,E>::map_err
             at ~/.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib/rustlib/src/rust\library\core\src/result.rs:595
   4: wgpu_core::device::<impl wgpu_core::hub::Global<G>>::device_create_render_pipeline
             at ~/.cargo\git\checkouts\wgpu-53e70f8674b08dd4\7ac706f\wgpu-core\src\device/mod.rs:3097
   5: <wgpu::backend::direct::Context as wgpu::Context>::device_create_render_pipeline
             at ~/.cargo\git\checkouts\wgpu-rs-40ea39809c03c5d8\86757f4\src\backend/direct.rs:814
   6: wgpu::Device::create_render_pipeline
             at ~/.cargo\git\checkouts\wgpu-rs-40ea39809c03c5d8\86757f4\src/lib.rs:1498
@grovesNL
Copy link
Collaborator

Thanks for reporting this issue! Does this only happen when using DX12?

Also could you attach the SPIR-V that's used for each shader? Is this code available in a repo we could run to reproduce the issue?

@grovesNL grovesNL added the bug Something isn't working label Oct 25, 2020
@DasEtwas
Copy link
Contributor Author

My fragment shader had an unused input variable without a vertex shader counterpart, which I found out after using VS to debug the exe.
On vulkan, this ran fine and didn't return any validation warnings (on linux, nv proprietary driver) (the unused fragment shader input variable was probably optimized away).

For anyone interested in the error:
D3D12 ERROR: ID3D12Device::CreateGraphicsPipelineState: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (TEXCOORD,0) as input, but it is not provided by the output stage. [ STATE_CREATION ERROR #666: CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]

@grovesNL
Copy link
Collaborator

👍 thanks for the update! This will improve in the future when we're able to fully validate shaders – wgpu will be able to notice this mismatch and fail with a better error message.

kejor pushed a commit to kejor/wgpu-rs that referenced this issue Nov 28, 2020
600: Fix host mapping buffer barriers r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants