-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize the selection of pixel format in WGL to early exit if found #916
Conversation
Apologies for not responding yet. I'll need to focus on getting the WebGPU backend finally merged, but after that I'll give the PR a whirl. |
Just an additional note: I see a minor issue with the GLX startup in existing code. If ARB_multisample is not supported, this code is not run This does not affect the Windows code as my recent change assigns it to 0 even if the extension does not exist. |
Starting to test this PR now... |
PS: I'm not bothering with GLX fixes too much at the moment, since it will probably be dropped with the alternative EGL initialization in place (first step would be to make EGL the default, and after a while drop GLX completely). |
Btw... I would suggest creating a dedicated branch for each PR on your side in the future :) (makes it a bit easier for me to test those changes on my side, e.g. I already have branch called |
Ok merged! I did a couple of small coding style fixes (also one indentation I missed in the last PR): |
PS: many thanks for the PR! |
OK, I'll try - I am not really up on how I should use github - I just create a fork for each new pull request I do to projects here. FYI: This was all done/found while doing a line by line conversion to Rust of Windows startup code - I don't plan on taking it further, was just a leaning exercise to see how easy it was or what issues I would have. https://github.com/dtrebilco/TestLoad/blob/main/src/sapp.rs |
Basically, if you are on the master branch of your sokol fork, just create a new branch with a somewhat descriptive name:
...or I think the new-fangled method is:
...then implement the change in there and create a pull request from that branch. Then when the pull request gets merged you can delete that branch and sync your fork from the upstream sokol repo: PS:
That works too to avoid problems on your side, but in this case I had an old local branch from your previous PR around and had a name-collision (that's how I usually merge PRs, instead of just pressing the Merge button on the GH side - I only do this for very trivial PRs). It's not a big deal though, I just deleted the old intermediate branch. |
FYI: I'm seeing a pretty serious problem on my old Asus laptop with integrated Intel GPU with this fix (GL programs are stuck at startup with a white screen). I'll try to investigate, but maybe I need to revert this PR. |
The difference between your code and the old code seems to be that the old code returns 28 from Some sort of off-by-one error? |
Ok, the difference between pixel format 27 (which is broken) and format 28 (which works) is the doublebuffer flag. Format 27 has doublebuffer=false (which doesn't work), and format 28 has doublebuffer=true. |
Ah found the issue, the Lines 6825 to 6827 in 4eb208b
...in the old code I'll implement a fix straight in master. |
Ok, fixed in 85d6541 |
Opps - sorry - initially I had that struct initialized in the loop like the old code when testing. |
tbf the original code with the |
Another startup saving on Windows - around ~20ms unless you select a crazy multisampling number that cannot be found.
Also removes a temp buffer allocation.
Same change could be applied to GLX looking at code. (not familiar enough to test myself)