WGSL: THREE WAYS TO DECLARE PURE VALUES


Introduction

The WebGPU Shading Language (or WGSL) has four ways to declare named values: var, const, override, and let.

A var declares a variable: a name for storage holding a value. For this post we’ll forget about memory for now — see what I did there? — and talk about the others.

So what’s up with the other three?

Giving names to pure values

Each of const, override, or let gives a name to a value like a number, vector, array, or structure.

IS THIS THING ON?

Hello world!

Recently I wondered aloud whether I should write a blog. I also wondered if I should call it “Bog standard”.

I made a poll to ask, over on Mastodon. Unfortunately, the poll only had a binary answer. (What a noob.) So in the end I don’t know how folks felt about either one of my questions, specifically.

One response was “DO IT” (Thanks, Neil!) I took that to mean I should get on with it, finally, no matter what I called it.