Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrimitiveTopology::PointList does not render on WebGL #3179

Closed
Oberdiah opened this issue Nov 5, 2022 · 0 comments · Fixed by #3440
Closed

PrimitiveTopology::PointList does not render on WebGL #3179

Oberdiah opened this issue Nov 5, 2022 · 0 comments · Fixed by #3440
Labels
api: gles Issues with GLES or WebGL type: bug Something isn't working

Comments

@Oberdiah
Copy link

Oberdiah commented Nov 5, 2022

Description
Any draw commands using PrimitiveTopology::Pointlist do not render anything when using the WebGL backend. All other backends I've tested render as expected.

Repro steps
hello-triangle/shader.wgsl (So you can see the triangle points)

@vertex
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4<f32> {
    let x = f32(i32(in_vertex_index) - 1);
    let y = f32(i32(in_vertex_index & 1u) * 2 - 1);
-   return vec4<f32>(x, y, 0.0, 1.0);
+   return vec4<f32>(x * 0.9, y * 0.9, 0.0, 1.0);
}

hello-triangle/main.rs

             entry_point: "fs_main",
             targets: &[Some(swapchain_format.into())],
         }),
-        primitive: wgpu::PrimitiveState::default(),
+        primitive: wgpu::PrimitiveState {
+            topology: wgpu::PrimitiveTopology::PointList,
+            ..wgpu::PrimitiveState::default()
+        },
         depth_stencil: None,
         multisample: wgpu::MultisampleState::default(),
         multiview: None,

Then running cargo run-wasm --example hello-triangle --features webgl

Expected vs observed behavior
Expected behaviour:
Three pixel-sized red dots on screen.
This can also be seen working by running the above code with cargo run --example hello-triangle
Observed behaviour:
No dots are rendered

Platform
Windows 10, wgpu 0.14.0, tested on both Firefox and Chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: gles Issues with GLES or WebGL type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants