WebGPU Fundamentals' triangle examples don't render
Categories
(Core :: Graphics: WebGPU, defect, P3)
Tracking
()
People
(Reporter: ErichDonGubler, Assigned: ErichDonGubler)
References
(Blocks 2 open bugs, )
Details
STR
-
Open the
Drawing triangles to texturessection of the eponymous first page ofWebGPU Fundamentals' tutorial. -
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
| Assignee | ||
Comment 1•2 years ago
|
||
:jimb tells me that this is gfx-rs/wgpu#4337.
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
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™.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
I now get:
Uncaptured WebGPU error: Internal error in ShaderStages(VERTEX) shader: Metal: program_source:44:12: error: no viable conversion from returned value of type 'OurVertexShaderOutput' to function return type 'vsOutput'
return vsOutput { _tmp.position, _tmp.texcoord };
^~~~~~~~
program_source:25:8: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'OurVertexShaderOutput' to 'const vsOutput &' for 1st argument
struct vsOutput {
^
program_source:25:8: note: candidate c
| Assignee | ||
Comment 4•2 years ago
|
||
:jrmuizel: I have a fix at wgpu#6438, which is being tracked by bug 1926305.
| Assignee | ||
Comment 5•2 years ago
|
||
This should now work fully; validated myself that all examples at https://webgpufundamentals.org/webgpu/lessons/webgpu-fundamentals.html#drawing-triangles-to-textures work now. 🥳
| Assignee | ||
Updated•2 years ago
|
Description
•