Skip to content

Minor fixes to custom_shader example#3319

Open
mfreeborn wants to merge 3 commits intoiced-rs:masterfrom
mfreeborn:vertically-align-custom-shader-controls
Open

Minor fixes to custom_shader example#3319
mfreeborn wants to merge 3 commits intoiced-rs:masterfrom
mfreeborn:vertically-align-custom-shader-controls

Conversation

@mfreeborn
Copy link
Copy Markdown
Contributor

@mfreeborn mfreeborn commented Apr 27, 2026

A handful of minor changes and fixes.

  1. Vertically align the controls with their labels
  2. Correctly use rads when defining the camera's field of view, rather than degrees (which does happen to work fine, but is not what is intended. The original code looks to be taken from the learn WGPU tutorial, which uses cgmath, rather than glam, which, in turn, uses Rad and Deg types.)
  3. The dynamically resizable Buffer never does updates its own size value upon ::resize(). It looks like we can instead rely on the underlying raw buffer's ::size() when determining whether the raw buffer should be recreated. The pre-existing behaviour recreates the raw buffer every frame, because size is initialised to hold just one cube, and thus the condition to create a new buffer is basically always met.

@mfreeborn mfreeborn changed the title Vertically align controls with their labels Minor fixes to custom_shader example Apr 29, 2026
The `resize` method only ever checks the size upon creation. Remove the redundantly stored `size` parameter and instead use the actual size of the raw buffer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant