Questions tagged [webgpu]

API that exposes GPU capabilities to web browsers. Use this tag with questions on programming against WebGPU.

Links:

76 questions
0
votes
0 answers

WebGPU and white screen in different browsers

I installed chrome canery on my tablet to use webgpu with three.js. This also worked for some time after I activated webgpu in chrome://flags. Recently, however, I only get a white picture. So I looked for other browser. Google dev, it worked then,…
Spiri
  • 331
  • 2
  • 9
0
votes
1 answer

How do I flip and switch my axes in WebGPU?

Currently my axes --for some reason-- are X and Y defining the ground plane and -Z as up. I want to have X and Z as the ground plane and +Y as up. To illustrate what I'm saying, here's the normal scene: Brazil with a translation of [1, 0,…
tlckpl
  • 59
  • 1
  • 8
0
votes
2 answers

How to time profile/see when tasks are complete in wgpu (targeting web)?

Basically title. There are support for timestamp queries, but that requires specific device feature support (my laptop for example does not support it when targeting web). There is also the function Queue::onSubmittedWorkDone(callback) that throws…
Pap113
  • 37
  • 1
  • 7
0
votes
1 answer

Can I render a point-list over an area larger than the point itself?

I am rendering what is effectively a fancy point cloud. Each point is to occupy multiple pixels on the screen (depending on the depth) and has a bunch of data required for shading. With primitive.topology = 'point-list' I can have each point draw…
Jatentaki
  • 11,804
  • 4
  • 41
  • 37
0
votes
1 answer

How do I make a continuous animation loop with wasm +winit?

I have the following rust code which work when I create a native window: event_loop.run(move |event, _, control_flow| { control_flow.set_poll(); match event { Event::WindowEvent { event:…
Pap113
  • 37
  • 1
  • 7
0
votes
1 answer

Why do we have to manually write synchronization commands in Vulkan?

C++ has a proposal that named std::execution, in this proposal, we don't have to write synchronization manually and it's zero cost abstraction. I'm new to Vulkan. After some study, I find Vulkan has many complex synchronization commands which is…
macomphy
  • 413
  • 1
  • 9
0
votes
0 answers

How to update pixel Image data using WebGPU in HTML5 canvas as 2d image?

I'm trying to convert my code from WebGL to WebGPU. In WebGL, I'm using below code to update pixel Image data to update in canvas. .... var texture = webglCtx.createTexture(); webglCtx.bindTexture(webglCtx.TEXTURE_2D, texture); …
Joe
  • 365
  • 2
  • 9
  • 24
0
votes
0 answers

Web GPU Call Stack Limit - Have to Expand function manually

Using the newest chrome 113 and the web gpu function, after updating drivers, testing on different computers, I have determined that this is the error, and I cannot understand why wgsl would fail here. Speculation: there's some call stack limit im…
Ben Hagel
  • 441
  • 4
  • 9
  • 22
0
votes
1 answer

deno bundle - Property 'gpu' does not exist on type 'Navigator' [TS2339]

In Deno 1.8, unstable/experimental support for WebGPU was added. With WebGPU landing in Chrome Stable 113, I decided it was about time I start my foray into graphics programming. I do understand that no other browser has this feature enabled by…
goddtriffin
  • 75
  • 1
  • 5
0
votes
0 answers

WebGPU Firefox shows no triangle

In Chrome Dev 113, the code below displays a triangle. However, in Firefox Nightly 116, only the background color is shown. This happens for me both on Linux and Android—haven't tested on Windows or macOS. I know that WebGPU is still in development,…
0
votes
1 answer

Draw a rectangle using WebGPU

I'm new to WebGPU and the 3D rendering world. What I am trying to do is to draw a rectangle in Typescript and wgsl. I understand that a mesh is a set of vertices. A mesh of 3 vertices draws a triangle. Doesn't a mesh of 4 vertices draws a…
0
votes
1 answer

WebGPU. How to draw the Triangle Strip with different color for each Triangle?

The first triangle must be RED, the second triangle must be GREEN. But both are GREEN ((( How to set different colors for each sub-triangle in 'triangle-strip' primitive topology ? My final goal is: Creating new triangles with new colors at mouse…
Teamur
  • 67
  • 1
  • 4
0
votes
1 answer

How to write to a uniform buffer using mapAsync with WebGPU

I have a uniform buffer that is created like this: const temp = new Float32Array([0, 0, 0, 0, 0, 0, 0, 0]); const positionBuffer = device.createBuffer({ size: temp.byteLength, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_SRC, …
luek baja
  • 1,475
  • 8
  • 20
0
votes
1 answer

WebGPU: Vertex range requires a larger buffer than the bound buffer size

I am simply trying to send an array of vertex positions to the vertex shader. Here is a snippet of my JS code: const vertices = new Float32Array([0, 0.5, 0, 1, -0.5, -0.5, 0, 2, 0.5, -0.5, 0, 1]); const vertexBuffer = device.createBuffer({ //…
luek baja
  • 1,475
  • 8
  • 20
0
votes
1 answer

WebGPU Rust and Javascript communication

I incorporate WebGPU+Rust in the following way (index.html)
alagris
  • 1,838
  • 16
  • 31