windows: add opt-in D3D11 shader support#7
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8aac93cb78
ℹ️ 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".
8aac93c to
c1731c1
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
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.
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