Skip to content

RenderPass.setPushConstant broken on Dx12 #6558

@fyellin

Description

@fyellin

set_push_constant seems to be broken on Dx12. I have a small test that runs fine on GL, Vulkan, and Metal, but breaks on Dx12.

The test is simple. My push constants are an array of sixteen i32s, (the squares from 0 to 255). In either the vertex shader or the fragment shader I copy the constants to a buffer. I then read the contents of the buffer and compare with the values that were originally pushed.

assert_eq(result, expected_result);

Panic: assertion `left == right` failed
      left: [0, 16, 64, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
     right: [0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225]

It seems strange that I'm seeing every fourth constant. And I'm only seeing this on Dx12.

bug_report.zip contains a single file bug_report.rs, which is a wgpu test.

bug_report.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: naga back-endOutputs of naga shader conversionexternal: fxc issueIssues with the FXC HLSL compilerlang: HLSLD3D Shading LanguagenagaShader Translatortype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions