windows: add opt-in D3D11 shader support#73
Conversation
|
Just tested this PR and so far no change on my setup, windows still open blank and then close a second later with no output. |
|
@squidink7 Could you share:
The most useful comparison would be the same gui example run once normally, then once with |
|
I'm trying to develop a gui program to run on my remote Windows 11 enterprise system at work, so the hardware is a little atypical hence the strange graphics requirements.
If there's any specific examples you'd like me to test and report if they do or don't work please let me know. |
|
Thanks, that helps. Since text_transform works with As there is no console output, could you check the process exit code right after one failing run? If it is something like 3221225477, that would point to an access violation/crash. If you have time, testing border_demo, progress_bars, shadow_demo, gradient_demo, and image_clip with the same command style would also help narrow down which rendering primitive triggers it. |
|
None of the demos you listed work for me, and the return code for all of them is |
|
Thanks, that is a very useful signal.
Given that One last useful comparison, only if you have MSVC available: could you try one failing example with If gcc and msvc both fail the same way, I will treat it as a gui/D3D11 pipeline issue rather than a MinGW-specific one. |
|
Unfortunately I don't have msvc, as this is a work machine (and not at a programming company) I'm unable to install any software outside of my user account which means no Visual Studio :( |
c1731c1 to
7a057fa
Compare
|
@squidink7 Could you please update to the latest version of the PR and try again? The D3D11 custom SGL shader path has been adjusted. |
|
That fixed it for showcase! I haven't yet tested any of the others but I'll update this if anything breaks. |
Summary
Adds opt-in D3D11 support for v-gui’s built-in shader pipelines.
This PR moves the built-in GUI shaders to a generated
v shaderpipeline with OpenGL, Metal, and HLSL/D3D11 output, while keeping D3D11 behind the explicit-d sokol_d3d11flag.It also updates the Windows raster/readback path so default Windows OpenGL does not accidentally use D3D11-only readback, and the D3D11 path uses the proper backend when enabled.
Fix #72
Codex review validation : here
Details
shaders/gui_builtin.glsl.*_shader_desc(gfx.query_backend()).sapp.glue_environment().defaultsfor render-target formats instead of direct enum casting.-d sokol_d3d11readback routing.GUI_CHECK_GENERATED_SHADERS=1and triggers on shader source changes.ShaderAPI.Note: the generated built-in shader header now targets the current Sokol shader set:
glsl410for desktop GLCORE,hlsl4for D3D11, andmetal_macosfor macOS Metal. Runtime customShader.glslremains GLSL 3.3, that path is separate from the generated built-in shaders.Validation
v -no-parallel test .: 72 passed / 1 skipped / 73 totalGUI_CHECK_GENERATED_SHADERS=1 v -no-parallel test _shaders_test.v: passedv -no-parallel test _sokol_formats_test.v _windows_readback_codegen_test.v: passedv -no-parallel test _render_test.v _render_filters_test.v _print_pdf_test.v _print_integration_test.v nativebridge/_readback_abi_test.v: passed-d sokol_d3d11: passedv check-md docs/SHADERS.md docs/WINDOWS.md shaders/README.md: passedgit diff --check: passedWindows Testing Requested
D3D11 is still opt-in in this PR. Before making it the default Windows path, it should be tested on real Windows with
-d sokol_d3d11, especially:examples/showcase.vexamples/gradient_demo.vexamples/shadow_demo.vexamples/blur_demo.vexamples/image_clip.vexamples/svg_demo.vexamples/printing.vexamples/custom_shader.vfallback behavior