sokol: add opt-in Windows D3D11 support#27654
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae02dc8fa2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Why not make d3d default on Windows? If it'll be used at all, may as well be the default... unless this is a temp measure so it can be tested for a while, first. |
|
@JalonSolov Yes, exactly. This is intentional as a safety step. I prefer keeping OpenGL as the Windows default for now, while D3D11 gets tested by users on real Windows setups. ^^ |
ae02dc8 to
219cc04
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 219cc04d8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Thanks! this works great for gg examples, however it doesn't seem to work for the gui library, which as far as I am aware uses gg/sokol behind the scenes. That may be a separate issue however it was exhibiting similar problems where a blank window would open but then close immediately after with nothing logged to the console. |
|
Thanks for the feedback! This PR does not cover that part yet. The base @squidink7 Could you open a separate issue in This is also why I prefer keeping D3D11 opt-in for now instead of making it the default immediately, it helps expose this kind of collateral issue without breaking existing Windows users. |
|
Done! vlang/gui#72 |
Summary
Adds opt-in Windows D3D11 support for sokol.
Windows keeps OpenGL as the default backend. D3D11 is enabled explicitly with:
v -d sokol_d3d11 examples/gg/minimal.v
This wires D3D11 backend selection, sapp device/swapchain glue, gg through sokol, and backend-aware screenshot readback while preserving the existing public screenshot API.
Fix #27652
Validation
Passed locally:
Windows smoke CI passed with MSVC and GCC:
Windows Manual Testing
CI validates compile/link only. Please test on real Windows:
Please confirm rendering, input, resize, clean close, and screenshot PNG/PPM correctness.
Note: D3D11 screenshot/readback is implemented for normal Windows builds, but
-sharedlive -d sokol_d3d11screenshot/readback is not supported yet and should be handled in a separate follow-up.