Guide for using gfx-rs's wgpu library.
Go to file
Ebrahim Byagowi 3555c713cb Use shaderc instead the deprecated glsl-to-spirv
I was getting lots of these errors,

glsl-to-spirv-0.1.7/glslang/hlsl/../glslang/MachineIndependent/../Public/../Include/../Include/Common.h:99:
.../registry/src/github.com-1ecc6299db9ec823/glsl-to-spirv-0.1.7/glslang/hlsl/../glslang/MachineIndependent/../Public/../Include/PoolAlloc.h:314:54: error: 'operator=' is a private member of 'glslang::TPoolAllocator'
    void setAllocator(TPoolAllocator* a) { allocator = *a; }
                                           ~~~~~~~~~ ^ ~~
.../registry/src/github.com-1ecc6299db9ec823/glsl-to-spirv-0.1.7/glslang/hlsl/../glslang/MachineIndependent/../Public/../Include/PoolAlloc.h:244:21: note: declared private here
    TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator
                    ^

And had to replace the apparently now deprecated glsl-to-spirv with shaderc-rs in order to
see the tutorial and thought would be useful for others also.
2020-05-27 00:05:41 +04:30
code Use shaderc instead the deprecated glsl-to-spirv 2020-05-27 00:05:41 +04:30
docs Use shaderc instead the deprecated glsl-to-spirv 2020-05-27 00:05:41 +04:30
.gitignore finished gif showcase 2020-03-29 19:51:50 -06:00
Cargo.lock Use shaderc instead the deprecated glsl-to-spirv 2020-05-27 00:05:41 +04:30
Cargo.toml started gifs showcase 2020-03-18 14:19:06 -06:00
deploy.sh fixing deploy.sh 2020-04-17 21:28:41 -06:00
FEATURES.md tutorial4-buffer 2019-10-25 01:57:14 -06:00
package-lock.json finished lighting rewrite 2020-04-17 21:23:19 -06:00
package.json finished lighting rewrite 2020-04-17 21:23:19 -06:00
run-all.sh updated winit to 0.20 2020-01-11 15:55:08 -07:00

Introduction

What is wgpu?

Wgpu is a Rust implementation of the WebGPU API spec. WebGPU is a specification published by the GPU for the Web Community Group. It aims to allow web code access to GPU functions in a safe and reliable manner. It does this by mimicking the Vulkan API, and translating that down to whatever API the host hardware is using (ie. DirectX, Metal, Vulkan).

Wgpu is still in development, so some of this doc is subject to change.

Why Rust?

Wgpu actually has C bindings to allow you to write C/C++ code with it, as well as use other languages that interface with C. That being said, wgpu is written in Rust, and it has some convient Rust Bindings that don't have to jump through any hoops. On top of that, I've been enjoying writing in Rust.

You should be fairly familiar with Rust before using this tutorial as I won't go into much detail on Rust syntax. If you're not super comfortable with Rust you can review the Rust tutorial. You should also be familiar about Cargo.

I'm using this project as a way to learn wgpu myself, so I might miss some important details, or explain things wrong. I'm always open to constructive feedback. That being said, let's get started!