Skip to content

Commit

Permalink
Revisit compressed texture support in sokol_gfx.h (#569)
Browse files Browse the repository at this point in the history
- tighter validation checks on texture creation:
    - content data validation now also happens in ```sg_make_image()``` (previously only in ```sg_update_image()```)
    - validate that compressed textures are immutable
    - separate "no data" validation checks for immutable vs dynamic/stream textures
    - provided data size for creating or updating textures must match the expected surface sizez exactly
- fix PVRTC row and surface pitch computation according to the GL PVRTC extension spec
- better adhere to Metal documentation for the ```MTLTexture.replaceRegion``` parameters (when bytesPerImage is expected to be zero or not)
  • Loading branch information
floooh authored Oct 8, 2021
1 parent f84a68a commit 66a9c88
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 58 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## Updates

- **08-Oct-2021**: texture compression support in sokol_gfx.h has been revisited:
- tighter validation checks on texture creation:
- content data validation now also happens in ```sg_make_image()``` (previously only in ```sg_update_image()```)
- validate that compressed textures are immutable
- separate "no data" validation checks for immutable vs dynamic/stream textures
- provided data size for creating or updating textures must match the expected surface sizez exactly
- fix PVRTC row and surface pitch computation according to the GL PVRTC extension spec
- better adhere to Metal documentation for the ```MTLTexture.replaceRegion``` parameters (when bytesPerImage is expected to be zero or not)

- **02-Sep-2021**: some minor non-breaking additions:
- sokol_app.h: new events FOCUSED and UNFOCUSED to indicate that the
window has gained or lost the focused state (Win32: WM_SETFOCUS/WM_KILLFOCUS,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Simple
[STB-style](https://github.com/nothings/stb/blob/master/docs/stb_howto.txt)
cross-platform libraries for C and C++, written in C.

[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**02-Sep-2021** sokol_app.h: new FOCUSED/UNFOCUSED event and better keycode handling in the Emscripten backend)
[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**08-Oct-2021** revisited and cleaned up texture compression support in sokol_gfx.h)

## Examples and Related Projects

Expand Down
Loading

0 comments on commit 66a9c88

Please sign in to comment.