Open Bug 1870208 Opened 9 months ago Updated 1 month ago

WebGPU Fundamentals' triangle examples don't render

Categories

(Core :: Graphics: WebGPU, defect, P3)

defect

Tracking

()

People

(Reporter: ErichDonGubler, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs, )

Details

STR

  1. Open the Drawing triangles to textures section of the eponymous first page of WebGPU Fundamentals' tutorial.

  2. Scroll to the end of the section where a split code editor and runner display the triangle shader. Observe that errors appear in the right-hand size, where the rendered image would be, of the form:

    ❌WebGPU GPUValidationError: Error matching ShaderStages(VERTEX) shader requirements against the pipeline, caused by: Shader module is invalid
    ❌WebGPU GPUValidationError: In a set_pipeline command, caused by: Render pipeline Id(16,1,d3d12) is invalid
    ❌WebGPU GPUValidationError: Command encoder is invalid
    

:jimb tells me that this is gfx-rs/wgpu#4337.

Summary: WebGPU Fundamentals' triangle example doesn't render → WebGPU Fundamentals' first triangle example doesn't render
Summary: WebGPU Fundamentals' first triangle example doesn't render → WebGPU Fundamentals' triangle examples don't render

Workaround: In each of the offending examples I've noticed, there's a bit of shader code that looks like this:

  let pos = array(
    vec2f( 0.0,  0.5),  // top center
    vec2f(-0.5, -0.5),  // bottom left
    vec2f( 0.5, -0.5)   // bottom right
  );

If you change let to var:

-let pos = array(
+var pos = array(

…then the shader compiles, and the remainder of the WebGPU code seems to Just Work™.

Depends on: 1913424
You need to log in before you can comment on or make changes to this bug.