Skip to content

sokol: support D3D11 sharedlive readback#27673

Closed
GGRei wants to merge 3 commits into
vlang:masterfrom
GGRei:d3d11-sharedlive-default-part2
Closed

sokol: support D3D11 sharedlive readback#27673
GGRei wants to merge 3 commits into
vlang:masterfrom
GGRei:d3d11-sharedlive-default-part2

Conversation

@GGRei

@GGRei GGRei commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR completes the D3D11 screenshot/readback path for Windows sharedlive builds.

It adds the missing host/DLL glue needed by Sokol app state in live shared libraries, so sapp.screenshot_window() can compile and link correctly with -sharedlive -d sokol_d3d11.

It also fixes the Windows GCC/Clang generated-C language reset so MinGW sharedlive import archives are not parsed as C input.

D3D11 remains opt-in for now through -d sokol_d3d11; OpenGL remains the default Windows path until the D3D11 path has had more real user testing.

Details

  • Add V-private wrappers for sapp_get_environment() and sapp_get_swapchain() across the sharedlive boundary.
  • Implement D3D11 readback through the exported swapchain path instead of raw Sokol app state.
  • Forward relevant sokol_* defines into live shared rebuilds.
  • Add -x none after generated C input for Windows GCC/Clang command lines.
  • Add regression coverage for D3D11 readback tokens, sharedlive Sokol implementation reuse, live define forwarding, and MinGW import-archive ordering.

Validation

  • ./v fmt -verify ...
  • git diff --check
  • VJOBS=1 ./v test vlib/v/live vlib/sokol/gfx
  • VJOBS=1 ./v test vlib/v/builder
  • Windows smoke:
    • MSVC sharedlive D3D11 screenshot compile/link
    • GCC sharedlive D3D11 screenshot compile/link

@GGRei
GGRei marked this pull request as ready for review July 6, 2026 13:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 660cf7fdaf

ℹ️ 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".

Comment thread vlib/v/gen/c/live.v Outdated
@GGRei

GGRei commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 160a8420ab

ℹ️ 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".

@medvednikov medvednikov closed this Jul 6, 2026
@medvednikov medvednikov reopened this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants