Skip to content

Commit

Permalink
Minor fix for chapter A first uniform
Browse files Browse the repository at this point in the history
  • Loading branch information
eliemichel committed Oct 13, 2024
1 parent cd8b18b commit 8e18603
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions basic-3d-rendering/shader-uniforms/a-first-uniform.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,19 @@ uniformBuffer = wgpuDeviceCreateBuffer(device, &bufferDesc);
```
````
Then use `Queue::writeBuffer` to upload a value:
Then use `Queue::writeBuffer` to upload a value in the first float of the buffer:
````{tab} With webgpu.hpp
```{lit} C++, Upload uniform values
float currentTime = 1.0f;
queue.writeBuffer(uniformBuffer, 0, &currentTime, 4 * sizeof(float));
queue.writeBuffer(uniformBuffer, 0, &currentTime, sizeof(float));
```
````
````{tab} Vanilla webgpu.h
```{lit} C++, Upload uniform values (for tangle root "Vanilla")
float currentTime = 1.0f;
wgpuQueueWriteBuffer(queue, uniformBuffer, 0, &currentTime, 4 * sizeof(float));
wgpuQueueWriteBuffer(queue, uniformBuffer, 0, &currentTime, sizeof(float));
```
````

Expand Down

0 comments on commit 8e18603

Please sign in to comment.