From f9167e9e8d74a11812e9d1096dc2e9fa4b2709be Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Sat, 23 Aug 2025 14:44:58 +0200 Subject: update readme and changelog (https://github.com/floooh/sokol/pull/1287) --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b14be7a9..356aea2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,45 @@ ## Updates +### 23-Aug-2025 + +The sokol_gfx.h '**resource view update**'. This is a breaking update which +changes the resource-binding- and and pass-attachments-model from directly +binding image- and buffer-objects to resource view objects. + +In a nutshell: + +- a new object type `sg_view` with associated functions has been added: view objects + 'specialize' an image or buffer resource for the different + ways a shader + accesses image or buffer data (texture sampling vs storage-load/store vs rendering into color- or depth-stencil-buffers) +- in turn, the object type `sg_attachments` and associated functions has ben removed +- `sg_bindings` now takes a single array of `sg_view` objects to define + texture-, storage-buffer- and storage-image bindings for the next drawcall +- storage-image-bindings are no longer pass-attachments but 'regular' bindings + (like texture- and storage-buffer-bindings) +- pre-baked pass attachment combinations are no longer a thing, instead + `sg_pass.attachments` is now a transient nested struct like `sg_bindings` + which defines the pass attachments as arrays of `sg_view` objects +- storage-buffer-bindings can now have an offset (with the restriction that + offsets can't be dynamic, but are baked into a view object, and the offset + must have a 256-byte alignment) + +When using `sokol-shdc`, note that you need to update sokol-shdc and recompile +your shaders. You may get new 'bindslot collision errors' which you need to +resolve by updating the `layout(binding=N)` attributes for textures, storage-buffers +and storage-images. + +For many more details and code examples see the [accompanying blog post](https://floooh.github.io/2025/08/17/sokol-gfx-view-update.html). + +Also check out the updated inline-documentation sections that deal with offscreen- +rendering and resource-binding in the sokol_gfx.h header, and finally +check out the updated examples (each example has a link to the C and GLSL source code): + +- WebGL2: https://floooh.github.io/sokol-html5/ +- WebGPU (required for storage buffer and compute samples): https://floooh.github.io/sokol-webgpu/ + +The main PR (with links to all related tickets and PRs): https://github.com/floooh/sokol/pull/1287 + ### 15-Aug-2025 The sokol_gfx.h WebGPU backend has been fixed for the latest breaking changes in diff --git a/README.md b/README.md index ae956374..096a8578 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # Sokol -[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**29-Jun-2025** sokol_imgui.h: updated for Dear ImGui 1.92.0 (some breaking changes!) +[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**23-Aug-2025**: the big breaking 'resource view update') [![Build](/../../actions/workflows/main.yml/badge.svg)](/../../actions/workflows/main.yml) [![Bindings](/../../actions/workflows/gen_bindings.yml/badge.svg)](/../../actions/workflows/gen_bindings.yml) [![build](https://github.com/floooh/sokol-zig/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-zig/actions/workflows/main.yml) [![build](https://github.com/floooh/sokol-nim/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-nim/actions/workflows/main.yml) [![Odin](https://github.com/floooh/sokol-odin/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-odin/actions/workflows/main.yml)[![Rust](https://github.com/floooh/sokol-rust/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-rust/actions/workflows/main.yml)[![Dlang](https://github.com/kassane/sokol-d/actions/workflows/build.yml/badge.svg)](https://github.com/kassane/sokol-d/actions/workflows/build.yml)[![C3](https://github.com/floooh/sokol-c3/actions/workflows/build.yml/badge.svg)](https://github.com/floooh/sokol-c3/actions/workflows/build.yml) -- cgit v1.2.3