Skip to content

Commit

Permalink
Merge branch 'master' into fix/mip-render-gl
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Oct 26, 2023
2 parents 5657291 + 227df3a commit 630a5a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Updates

#### 26-Oct-2023

- sokol_app.h gl: fix a regression introduced in https://github.com/floooh/sokol/pull/916
which could select the wrong framebuffer pixel format and break rendering
on some GL drivers (in my case: an older Intel GPU).

If you are using the GL backend on Windows, please make sure to upgrade!

#### 23-Oct-2023

- sokol_app.h gl: some further startup optimizations in the WGL code path
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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) (**21-Oct-2023** WebGPU!)
[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**26-Oct-2023** IMPORTANT REGRESSION FIX IN sokol_app.h FOR GL ON WINDOWS!)

[![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)

Expand Down
9 changes: 3 additions & 6 deletions sokol_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -6799,8 +6799,6 @@ _SOKOL_PRIVATE int _sapp_wgl_find_pixel_format(void) {
desired.samples = (_sapp.sample_count > 1) ? _sapp.sample_count : 0;

int pixel_format = 0;
_sapp_gl_fbconfig u;
_sapp_gl_init_fbconfig(&u);

_sapp_gl_fbselect fbselect;
_sapp_gl_init_fbselect(&fbselect);
Expand All @@ -6816,16 +6814,15 @@ _SOKOL_PRIVATE int _sapp_wgl_find_pixel_format(void) {
continue;
}

_sapp_gl_fbconfig u;
_sapp_clear(&u, sizeof(u));
u.red_bits = query_results[result_red_bits_index];
u.green_bits = query_results[result_green_bits_index];
u.blue_bits = query_results[result_blue_bits_index];
u.alpha_bits = query_results[result_alpha_bits_index];
u.depth_bits = query_results[result_depth_bits_index];
u.stencil_bits = query_results[result_stencil_bits_index];
if (query_results[result_double_buffer_index]) {
u.doublebuffer = true;
}

u.doublebuffer = 0 != query_results[result_double_buffer_index];
u.samples = query_results[result_samples_index]; // NOTE: If arb_multisample is not supported - just takes the default 0

// Test if this pixel format is better than the previous one
Expand Down

0 comments on commit 630a5a4

Please sign in to comment.