Questions tagged [webgpu]

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

Links:

76 questions
1
vote
1 answer

WGPU and Dawn (WebGpu)

I am trying to understand the general concept of wgpu and Dawn. As I understand it, there are two main implementations of the WebGPU standard from Khronos: wgpu from Mozilla and Dawn from Google. Do I understand correctly that: -wgpu: is it a C/Rust…
Lua_beg
  • 31
  • 6
1
vote
1 answer

Binding size '...' is larger than the maximum binding size (134217728)

I want to handle large amount of data on GPU. I write simple test shader, that just make array ements negative. Here it is: @group(0) @binding(0) var sourceArray : array; @group(0) @binding(1) var resultArray…
Nikolai
  • 656
  • 6
  • 19
1
vote
1 answer

Problem with uniform buffer on rust's wgpu only for web target

I made this project as a way to learn rust and graphics programming. The program is based on this great tutorial and currently works as a native desktop application (on Windows atleast). However, my main goal is to create a web app to showcase my…
lobis
  • 145
  • 1
  • 10
1
vote
1 answer

WebGPU WGLSL error occurs following outdated tutorials: "access mode 'write' is not valid for the 'storage' address space"

Note: I've answered my own question here, and am posting so that others in the same situation may benefit. I was following along with various WebGPU tutorials, in particular for compute shaders, these articles in particular:…
ChaseMoskal
  • 7,151
  • 5
  • 37
  • 50
1
vote
4 answers

Is WebGPU something that can actually be tested right now?

I have a hobby project that could use some gpu compute, I figured it would also be a great time to test out the new WebGPU API. So far I tried looking at various WebGPU demos on latest versions of both chrome canary and firefox dev edition, both…
user81993
  • 6,167
  • 6
  • 32
  • 64
1
vote
1 answer

In WebGPU, can you reuse the same render pass in multiple frames?

In WebGPU you can create a render pass by defining its descriptor: const renderPassDesc: GPURenderPassDescriptor = { colorAttachments: [ { view: context.getCurrentTexture().createView(), loadValue: [0.2, 0.3, 0.5, 1], …
damix911
  • 4,165
  • 1
  • 29
  • 44
1
vote
3 answers

WebGPU JsInterop wrapper

I am trying to play around with WebGPU in GWT 2.9.0 using JsInterop and I face some problems trying to map all the WebGPU interfaces to Java. The definitions I refer to are located at https://www.w3.org/TR/webgpu/#idl-index 1) How do I map an…
Samwise
  • 86
  • 6
1
vote
1 answer

why i can not search #enable-unsafe-webgpu in chrome://flags in windows chromeV95

enter image description here In windows chromeV95,i input chrome://flags and search #enable-unsafe-webgpu, and there is no result ?
1
vote
1 answer

How do you ensure background is cleared correctly in WebGPU?

Is there a magic flag I need to set to get correct clearing of the background when rendering with WebGPU? My render works fine except, whatever settings I use, I see the garbage that was last displayed is in the browser window instead of the the…
griffin2000
  • 709
  • 9
  • 26
1
vote
1 answer

Compute Shader Corrupting Vertex Buffer

I'm making a tutorial for computing tangents and bitangents in a WGPU (Vulkan GLSL) compute shader. I'm creating the vertex buffer on the CPU from a .obj I made in blender. Here's the code for the compute shader. #version 450 #define…
sotrh
  • 386
  • 5
  • 13
0
votes
0 answers

How to convert global_invocation_id to clip space coordinates? (To convert depth buffer to world space position)

I am writing a compute shader that runs some function for every pixel in a framebuffer. To simplify this question, I'm using a workgroup size of 1. @compute @workgroup_size(1, 1) fn main(@builtin(global_invocation_id) gid: vec3u) { ...…
Lukas Kalbertodt
  • 79,749
  • 26
  • 255
  • 305
0
votes
1 answer

WGSL: Multiplying a vec4f by a mat4f identity matrix produces different results

I am trying out WebGPU for the first time and have come across a problem. Normally in other rendering frameworks I would multiply a vec4 my a matrix of all 1s and the output would be the same. Here is what I expect with this code: @vertex fn…
Jove
  • 105
  • 4
0
votes
1 answer

Cannot load WebGPU code: WGSL reader error

I'm following this WebGPU tutorial, and I copied the below shader code (shader.wgsl, full file is here): // vertex shader struct Output { @builtin(position) Position : vec4; // <-- error in this line @location(0) vColor :…
Hoff
  • 38,776
  • 17
  • 74
  • 99
0
votes
2 answers

WebGPU. How to SET COLOR PER TRIANGLE, but not per vertex, and USE ONLY VERTEX BUFFER

I am trying to set color per triangle. But it is not working. Only setting color per vertex works! This is what I made: Color Per Triangle