Skip to content

Precompile shaders and share rendering between WinForms and native Win32 - #42

Merged
atcarter714 merged 6 commits into
mainfrom
iteration/shaders-native-host
Nov 22, 2026
Merged

atcarter714 merged 6 commits into
mainfrom
iteration/shaders-native-host

Conversation

@atcarter714

@atcarter714 atcarter714 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

The old shader task could report success without compiling, and desktop frame management was tied to WinForms. Framework now builds and embeds its skinning shaders and shares frame submission/presentation between WinForms and a native Win32 host.

  • Replace the incomplete DXC task with pinned compiler invocation, transitive include-aware incremental compilation, diagnostics, debug PDBs, dependency manifests, clean support, and a consumable DXSharp.Tools.Builds package.
  • Add owned precompiled shader bytecode, graphics/compute pipeline overloads and typed compiler options, including filesystem includes. Preserve the existing runtime compilation APIs.
  • Extract FrameRenderer and implement a native HWND host with DPI, resize, input, message pumping, callback lifetime management and orderly GPU drain. Stop WinForms ticks before teardown; cover queued close dispatch.
  • Add CharacterLab.Native, sharing the existing scene/camera source and precompiled shaders, without Windows Forms or a runtime DXC dependency.
  • Add native-host and shader JIT/NativeAOT fixtures, both-host package runs, cold-cache shader-build qualification, and windowing/DPI/keyboard namespace coverage.

Validation: all six qualification jobs passed on head f0105e49671deafb2ed49c558eefca05a2f3b31a. The prospective merge tree is 7968769916b490a26147c94cde0be49e41130d4c. Windows Debug/Release and Windows/Linux .NET 10/11 JIT/NativeAOT pass. All 14 samples build from isolated packages on both runtimes; both CharacterLab hosts present nine package frames. Native resize/close/exception teardown and precompiled shader pipeline checks pass. Shader package tests cover two entry points, paths with spaces, unchanged builds, define/transitive-include changes, diagnostics, deleted includes, PDBs/manifests and clean. Windows graphics evidence uses WARP; no new hardware performance claim.

This remains Preview 4 development; no package publication. WPF/WinUI adapters, richer compiler services and the remaining native API families are continuation work.

@atcarter714
atcarter714 marked this pull request as ready for review November 22, 2026 03:50
@atcarter714
atcarter714 merged commit ccabe4d into main Nov 22, 2026
6 checks passed
atcarter714 added a commit that referenced this pull request Nov 22, 2026
Restore the exact qualified source tree aa2cd4f from #42 and #43. All six fresh qualification jobs passed in run 45079290538. Continue Preview 4 development with preserved history and package versions.
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.

1 participant