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…
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…
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…
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:…
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…
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],
…
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…
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…
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…
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) { ...…
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…
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 :…