Commit a54a963
Add MonoGame 3.8.5 Content Builder export mode (closes DX12/Vulkan shader gate) (#120)
* Flip MonoGame export to the stable 3.8.5 GA release
3.8.5 shipped stable on nuget.org, replacing the preview line. Removes
the now-dead preview/stable duality (version props, UI selector,
.Native version-gating, the monoGameVersion override) — WindowsDX12
and DesktopVK are now regular, always-available MonoGame targets.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Add MonoGame 3.8.5 Content Builder export mode (closes DX12/Vulkan shader gate)
Opt-in ContentBuildMode.ContentBuilder routes assets and shaders through
MonoGame's new code-first Content Builder (Builder.cs + BuildContent.targets)
instead of raw/ShadowDusk/MGCB, superseding ShaderCompileMode when chosen.
Unlike mgcb.exe it isn't limited to a fixed platform list, so it also closes
the DX12/Vulkan shader gate from issue #52. MonoGame.Content.Builder.Task
stays installed on classic targets for buildTransitive-only libraries
(Apos.Shapes/Gum) that the new pipeline can't see.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Add SM6/Vulkan shader branch to all 16 example .fx files
MonoGame's DX12/Vulkan Content Builder compiles via DXC, which requires
Shader Model 6 (vs_6_0/ps_6_0), rejects the legacy sampler2D/tex2D combo,
and requires SV_Target0 instead of COLOR/COLOR0 for the pixel output.
None of the example shaders had an SM6 branch, so ContentBuilder exports
to MonoGameWindowsDX12/MonoGameDesktopVK failed to compile every shader.
Adds an `#elif defined(SM6) || defined(VULKAN)` branch to each file's
shader-model defines, a matching Texture2D<float4>/SamplerState
declaration for the texture(s), and a fully separate SM6 pixel-shader
entry point (ShadowDusk's OpenGL translator requires the classic
`: COLOR` / `tex2D(...)` entry point to stay literal and unsplit, so the
two shader models get independent function bodies rather than sharing
one via macros or a split signature). The `#if OPENGL` / classic branches
are untouched.
Verified: ShadowDuskCLI /Profile:OpenGL produces byte-identical .mgfx
output before/after for all 16 files; a real `dotnet build` of a
ContentBuildMode.ContentBuilder export targeting MonoGameWindowsDX12
compiles all 16 shaders with zero errors; full XnaFiddle.Tests suite
(337 tests) passes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Bump ShadowDusk to 0.12.0, wire MonoGameDesktopVK shaders via its new Vulkan backend
ShadowDusk 0.12.0 adds a real Vulkan backend that compiles the same plain
.fx source as every other target (no SM6 source rewrite needed, verified
against the pre-SM6-branch form of Grayscale.fx via ShadowDuskCLI and a
real dotnet build). GetShaderExportInfo now wires MonoGameDesktopVK through
ShadowDusk.Compiler/PlatformTarget.Vulkan, closing the DesktopVK half of
issue #52; MonoGameWindowsDX12 is unchanged (still gated, still needs
ContentBuildMode.ContentBuilder for shaders).
Verified the 0.11.0 -> 0.12.0 GL codegen fidelity change (pow/division
strength-reduction) produces byte-identical .mgfx for all 16 bundled
example shaders, so no rendering regression risk there.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Collapse export dialog's two shader/content radio groups into one
"Shader compilation:" and "Content pipeline:" silently overrode each
other and both used the words "Content Pipeline"/"MGCB" for different
things. Replaced with a single "Content strategy:" group (ShadowDusk /
Classic MGCB / MonoGame Content Builder) backed by one UI-only
ContentStrategy enum that maps to ProjectExporter's existing
(ShaderCompileMode, ContentBuildMode) pair. No changes to
ProjectExporter's public API.
* Rework MonoGame export into orthogonal content/shader axes
Splits the 3-way content strategy choice into two independent enums:
ContentBuildMode (Raw/ClassicMgcb/ContentBuilder) for non-shader assets,
and ShaderCompileMode (ShadowDusk/Native, renamed from ContentPipeline)
for .fx compilation. ShadowDusk is now the default shader compiler under
every content strategy, not just Raw - previously Content Builder mode
silently forced shaders through its own native pipeline.
ClassicMgcb becomes a real asset pipeline for the first time: .png/.wav
compile via TextureImporter/WavImporter, with ColorKeyEnabled=False
forced to stop MonoGame's default magenta color-keying from punching
holes in shipped textures.
DX12 was NOT wired into GetShaderExportInfo - checked ShadowDusk's NuGet
feed and PlatformTarget.cs; still 0.12.0 with no DirectX12 backend
(README lists it "Not yet"). CompilesShippedShaders(DX12, ShadowDusk,
ContentBuilder) stays gated until ShadowDusk ships one.
Fixed a bug surfaced by the axis decoupling: a ShadowDusk-mode .fx can
now stay in the head's own Content/ under ContentBuildMode.ContentBuilder,
but the csproj's copy-to-output gate assumed nothing ever did, so the
shader shipped in the zip but never reached the build output.
UI: two independent radio groups replace the single 3-way choice; Raw
shows a fixed "ShadowDusk (fixed)" label since it has no native pipeline.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Fix .slnx startup project and drop redundant "(default)" radio labels
Multi-platform exports listed the shared Common library and Content Builder
console project before any actual game project — Visual Studio picks the
first .slnx entry as the default startup project, so users had to manually
retarget it every time. Platform-head projects now come first.
Also refreshes the two now-stale skill docs (project-export, shaders) and
CLAUDE.md's skill-maintenance policy for the orthogonal content/shader axes
rework, and removes "(default)" from radio labels that snuck back in.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent b1d95bb commit a54a963
26 files changed
Lines changed: 1553 additions & 179 deletions
File tree
- .claude/skills
- project-export
- shaders
- XnaFiddle.BlazorGL
- Examples
- Pages
- XnaFiddle.Core
- XnaFiddle.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
10 | 23 | | |
11 | 24 | | |
12 | 25 | | |
13 | 26 | | |
14 | 27 | | |
| 28 | + | |
15 | 29 | | |
16 | 30 | | |
17 | 31 | | |
| |||
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
35 | 72 | | |
36 | 73 | | |
37 | 74 | | |
| |||
47 | 84 | | |
48 | 85 | | |
49 | 86 | | |
| 87 | + | |
50 | 88 | | |
51 | 89 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
| 26 | + | |
16 | 27 | | |
17 | 28 | | |
18 | 29 | | |
| |||
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
31 | 61 | | |
32 | 62 | | |
33 | 63 | | |
| |||
39 | 69 | | |
40 | 70 | | |
41 | 71 | | |
| 72 | + | |
42 | 73 | | |
43 | 74 | | |
44 | 75 | | |
| |||
0 commit comments