Skip to content

Commit 8f34eb2

Browse files
jdolanCopilot
andcommitted
Drop DXIL blobs from examples; ship only MSL and SPIR-V
SPIR-V covers Linux, Android, and Windows (via Vulkan). MSL covers macOS and iOS. No need to ship DXIL for the examples. The framework's loadShader/loadComputePipeline still supports DXIL for apps that want it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d58967c commit 8f34eb2

8 files changed

Lines changed: 18 additions & 50 deletions

File tree

Examples/Shaders/Hello.frag.dxil

Whitespace-only changes.

Examples/Shaders/Hello.vert.dxil

Whitespace-only changes.

Examples/Shaders/HelloCompute.comp.dxil

Whitespace-only changes.

Examples/Shaders/HelloCompute.frag.dxil

Whitespace-only changes.

Examples/Shaders/HelloCompute.vert.dxil

Whitespace-only changes.

Examples/Shaders/Makefile.am

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,13 @@ SPIRV_BLOBS = \
2828
HelloCompute.vert.spv \
2929
HelloCompute.frag.spv
3030

31-
DXIL_BLOBS = \
32-
Hello.vert.dxil \
33-
Hello.frag.dxil \
34-
HelloCompute.comp.dxil \
35-
HelloCompute.vert.dxil \
36-
HelloCompute.frag.dxil
37-
38-
EXTRA_DIST = $(HLSL_SOURCES) $(MSL_BLOBS) $(SPIRV_BLOBS) $(DXIL_BLOBS)
31+
EXTRA_DIST = $(HLSL_SOURCES) $(MSL_BLOBS) $(SPIRV_BLOBS)
3932

4033
# For out-of-tree builds, symlink the pre-built blobs into the build directory
4134
# so SDL Resource resolution (SDL_GetBasePath() + "Shaders") finds them.
4235
all-local:
4336
@if [ "x$(srcdir)" != "x$(builddir)" ]; then \
44-
for f in $(MSL_BLOBS) $(SPIRV_BLOBS) $(DXIL_BLOBS); do \
37+
for f in $(MSL_BLOBS) $(SPIRV_BLOBS); do \
4538
test -e "$(builddir)/$$f" || \
4639
$(LN_S) "$(abs_srcdir)/$$f" "$(builddir)/$$f"; \
4740
done; \
@@ -50,11 +43,11 @@ all-local:
5043
# -------------------------------------------------------------------------
5144
# shadercross — regenerate all blobs from HLSL source.
5245
# Requires glslc (from shaderc) for HLSL→SPIR-V and shadercross for
53-
# SPIR-V→MSL. DXIL requires shadercross to be built with DXC support.
46+
# SPIR-V→MSL.
5447
# -------------------------------------------------------------------------
5548

5649
.PHONY: shadercross
57-
shadercross: $(MSL_BLOBS) $(SPIRV_BLOBS) $(DXIL_BLOBS)
50+
shadercross: $(MSL_BLOBS) $(SPIRV_BLOBS)
5851

5952
# Hello — vertex
6053
$(srcdir)/Hello.vert.spv: $(srcdir)/Hello.vert.hlsl
@@ -63,45 +56,30 @@ $(srcdir)/Hello.vert.spv: $(srcdir)/Hello.vert.hlsl
6356
$(srcdir)/Hello.vert.msl: $(srcdir)/Hello.vert.spv
6457
$(SHADERCROSS) $< -s SPIRV -d MSL -t vertex -e vs_main -o $@
6558

66-
$(srcdir)/Hello.vert.dxil: $(srcdir)/Hello.vert.hlsl
67-
$(SHADERCROSS) $< -s HLSL -d DXIL -t vertex -e vs_main -o $@
68-
6959
# Hello — fragment
7060
$(srcdir)/Hello.frag.spv: $(srcdir)/Hello.frag.hlsl
7161
$(GLSLC) -fshader-stage=fragment -x hlsl -fentry-point=fs_main $< -o $@
7262

7363
$(srcdir)/Hello.frag.msl: $(srcdir)/Hello.frag.spv
7464
$(SHADERCROSS) $< -s SPIRV -d MSL -t fragment -e fs_main -o $@
7565

76-
$(srcdir)/Hello.frag.dxil: $(srcdir)/Hello.frag.hlsl
77-
$(SHADERCROSS) $< -s HLSL -d DXIL -t fragment -e fs_main -o $@
78-
7966
# HelloCompute — compute
8067
$(srcdir)/HelloCompute.comp.spv: $(srcdir)/HelloCompute.comp.hlsl
8168
$(GLSLC) -fshader-stage=compute -x hlsl -fentry-point=cs_main $< -o $@
8269

8370
$(srcdir)/HelloCompute.comp.msl: $(srcdir)/HelloCompute.comp.spv
8471
$(SHADERCROSS) $< -s SPIRV -d MSL -t compute -e cs_main -o $@
8572

86-
$(srcdir)/HelloCompute.comp.dxil: $(srcdir)/HelloCompute.comp.hlsl
87-
$(SHADERCROSS) $< -s HLSL -d DXIL -t compute -e cs_main -o $@
88-
8973
# HelloCompute — vertex
9074
$(srcdir)/HelloCompute.vert.spv: $(srcdir)/HelloCompute.vert.hlsl
9175
$(GLSLC) -fshader-stage=vertex -x hlsl -fentry-point=vs_main $< -o $@
9276

9377
$(srcdir)/HelloCompute.vert.msl: $(srcdir)/HelloCompute.vert.spv
9478
$(SHADERCROSS) $< -s SPIRV -d MSL -t vertex -e vs_main -o $@
9579

96-
$(srcdir)/HelloCompute.vert.dxil: $(srcdir)/HelloCompute.vert.hlsl
97-
$(SHADERCROSS) $< -s HLSL -d DXIL -t vertex -e vs_main -o $@
98-
9980
# HelloCompute — fragment
10081
$(srcdir)/HelloCompute.frag.spv: $(srcdir)/HelloCompute.frag.hlsl
10182
$(GLSLC) -fshader-stage=fragment -x hlsl -fentry-point=fs_main $< -o $@
10283

10384
$(srcdir)/HelloCompute.frag.msl: $(srcdir)/HelloCompute.frag.spv
10485
$(SHADERCROSS) $< -s SPIRV -d MSL -t fragment -e fs_main -o $@
105-
106-
$(srcdir)/HelloCompute.frag.dxil: $(srcdir)/HelloCompute.frag.hlsl
107-
$(SHADERCROSS) $< -s HLSL -d DXIL -t fragment -e fs_main -o $@

ObjectivelyGPU.vs15/ObjectivelyGPU-shadercross.vcxproj

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@
3535
<CustomBuild Include="..\Examples\Shaders\Hello.vert.hlsl">
3636
<Message>Compiling Hello.vert.hlsl</Message>
3737
<Command>
38-
shadercross %(FullPath) -s HLSL -d SPIRV -t vertex -e vs_main -o ..\Examples\Shaders\Hello.vert.spv &amp;&amp;
39-
shadercross %(FullPath) -s HLSL -d MSL -t vertex -e vs_main -o ..\Examples\Shaders\Hello.vert.msl &amp;&amp;
40-
shadercross %(FullPath) -s HLSL -d DXIL -t vertex -e vs_main -o ..\Examples\Shaders\Hello.vert.dxil
38+
shadercross %(FullPath) -s HLSL -d SPIRV -t vertex -e vs_main -o ..\Examples\Shaders\Hello.vert.spv
39+
shadercross %(FullPath) -s HLSL -d MSL -t vertex -e vs_main -o ..\Examples\Shaders\Hello.vert.msl
4140
</Command>
42-
<Outputs>..\Examples\Shaders\Hello.vert.spv;..\Examples\Shaders\Hello.vert.msl;..\Examples\Shaders\Hello.vert.dxil</Outputs>
41+
<Outputs>..\Examples\Shaders\Hello.vert.spv;..\Examples\Shaders\Hello.vert.msl</Outputs>
4342
</CustomBuild>
4443
</ItemGroup>
4544

@@ -50,9 +49,8 @@
5049
<Command>
5150
shadercross %(FullPath) -s HLSL -d SPIRV -t fragment -e fs_main -o ..\Examples\Shaders\Hello.frag.spv
5251
shadercross %(FullPath) -s HLSL -d MSL -t fragment -e fs_main -o ..\Examples\Shaders\Hello.frag.msl
53-
shadercross %(FullPath) -s HLSL -d DXIL -t fragment -e fs_main -o ..\Examples\Shaders\Hello.frag.dxil
5452
</Command>
55-
<Outputs>..\Examples\Shaders\Hello.frag.spv;..\Examples\Shaders\Hello.frag.msl;..\Examples\Shaders\Hello.frag.dxil</Outputs>
53+
<Outputs>..\Examples\Shaders\Hello.frag.spv;..\Examples\Shaders\Hello.frag.msl</Outputs>
5654
</CustomBuild>
5755
</ItemGroup>
5856

@@ -61,11 +59,10 @@
6159
<CustomBuild Include="..\Examples\Shaders\HelloCompute.comp.hlsl">
6260
<Message>Compiling HelloCompute.comp.hlsl</Message>
6361
<Command>
64-
shadercross %(FullPath) -s HLSL -d SPIRV -t compute -e cs_main -o ..\Examples\Shaders\HelloCompute.comp.spv &amp;&amp;
65-
shadercross %(FullPath) -s HLSL -d MSL -t compute -e cs_main -o ..\Examples\Shaders\HelloCompute.comp.msl &amp;&amp;
66-
shadercross %(FullPath) -s HLSL -d DXIL -t compute -e cs_main -o ..\Examples\Shaders\HelloCompute.comp.dxil
62+
shadercross %(FullPath) -s HLSL -d SPIRV -t compute -e cs_main -o ..\Examples\Shaders\HelloCompute.comp.spv
63+
shadercross %(FullPath) -s HLSL -d MSL -t compute -e cs_main -o ..\Examples\Shaders\HelloCompute.comp.msl
6764
</Command>
68-
<Outputs>..\Examples\Shaders\HelloCompute.comp.spv;..\Examples\Shaders\HelloCompute.comp.msl;..\Examples\Shaders\HelloCompute.comp.dxil</Outputs>
65+
<Outputs>..\Examples\Shaders\HelloCompute.comp.spv;..\Examples\Shaders\HelloCompute.comp.msl</Outputs>
6966
</CustomBuild>
7067
</ItemGroup>
7168

@@ -74,11 +71,10 @@
7471
<CustomBuild Include="..\Examples\Shaders\HelloCompute.vert.hlsl">
7572
<Message>Compiling HelloCompute.vert.hlsl</Message>
7673
<Command>
77-
shadercross %(FullPath) -s HLSL -d SPIRV -t vertex -e vs_main -o ..\Examples\Shaders\HelloCompute.vert.spv &amp;&amp;
78-
shadercross %(FullPath) -s HLSL -d MSL -t vertex -e vs_main -o ..\Examples\Shaders\HelloCompute.vert.msl &amp;&amp;
79-
shadercross %(FullPath) -s HLSL -d DXIL -t vertex -e vs_main -o ..\Examples\Shaders\HelloCompute.vert.dxil
74+
shadercross %(FullPath) -s HLSL -d SPIRV -t vertex -e vs_main -o ..\Examples\Shaders\HelloCompute.vert.spv
75+
shadercross %(FullPath) -s HLSL -d MSL -t vertex -e vs_main -o ..\Examples\Shaders\HelloCompute.vert.msl
8076
</Command>
81-
<Outputs>..\Examples\Shaders\HelloCompute.vert.spv;..\Examples\Shaders\HelloCompute.vert.msl;..\Examples\Shaders\HelloCompute.vert.dxil</Outputs>
77+
<Outputs>..\Examples\Shaders\HelloCompute.vert.spv;..\Examples\Shaders\HelloCompute.vert.msl</Outputs>
8278
</CustomBuild>
8379
</ItemGroup>
8480

@@ -87,11 +83,10 @@
8783
<CustomBuild Include="..\Examples\Shaders\HelloCompute.frag.hlsl">
8884
<Message>Compiling HelloCompute.frag.hlsl</Message>
8985
<Command>
90-
shadercross %(FullPath) -s HLSL -d SPIRV -t fragment -e fs_main -o ..\Examples\Shaders\HelloCompute.frag.spv &amp;&amp;
91-
shadercross %(FullPath) -s HLSL -d MSL -t fragment -e fs_main -o ..\Examples\Shaders\HelloCompute.frag.msl &amp;&amp;
92-
shadercross %(FullPath) -s HLSL -d DXIL -t fragment -e fs_main -o ..\Examples\Shaders\HelloCompute.frag.dxil
86+
shadercross %(FullPath) -s HLSL -d SPIRV -t fragment -e fs_main -o ..\Examples\Shaders\HelloCompute.frag.spv
87+
shadercross %(FullPath) -s HLSL -d MSL -t fragment -e fs_main -o ..\Examples\Shaders\HelloCompute.frag.msl
9388
</Command>
94-
<Outputs>..\Examples\Shaders\HelloCompute.frag.spv;..\Examples\Shaders\HelloCompute.frag.msl;..\Examples\Shaders\HelloCompute.frag.dxil</Outputs>
89+
<Outputs>..\Examples\Shaders\HelloCompute.frag.spv;..\Examples\Shaders\HelloCompute.frag.msl</Outputs>
9590
</CustomBuild>
9691
</ItemGroup>
9792

ObjectivelyGPU.xcodeproj/project.pbxproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,23 +489,18 @@
489489
outputPaths = (
490490
"$(SRCROOT)/Examples/Shaders/Hello.vert.msl",
491491
"$(SRCROOT)/Examples/Shaders/Hello.vert.spv",
492-
"$(SRCROOT)/Examples/Shaders/Hello.vert.dxil",
493492
"$(SRCROOT)/Examples/Shaders/Hello.frag.msl",
494493
"$(SRCROOT)/Examples/Shaders/Hello.frag.spv",
495-
"$(SRCROOT)/Examples/Shaders/Hello.frag.dxil",
496494
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.msl",
497495
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.spv",
498-
"$(SRCROOT)/Examples/Shaders/HelloCompute.comp.dxil",
499496
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.msl",
500497
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.spv",
501-
"$(SRCROOT)/Examples/Shaders/HelloCompute.vert.dxil",
502498
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.msl",
503499
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.spv",
504-
"$(SRCROOT)/Examples/Shaders/HelloCompute.frag.dxil",
505500
);
506501
runOnlyForDeploymentPostprocessing = 0;
507502
shellPath = /bin/sh;
508-
shellScript = "set -e\nSHADERS=\"$SRCROOT/Examples/Shaders\"\ncompile() {\n local name=$1 stage=$2 ep=$3\n glslc -fshader-stage=$stage -x hlsl -fentry-point=$ep \"$SHADERS/${name}.hlsl\" -o \"$SHADERS/${name}.spv\"\n shadercross \"$SHADERS/${name}.spv\" -s SPIRV -d MSL -t $stage -e $ep -o \"$SHADERS/${name}.msl\"\n shadercross \"$SHADERS/${name}.hlsl\" -s HLSL -d DXIL -t $stage -e $ep -o \"$SHADERS/${name}.dxil\"\n}\ncompile Hello.vert vertex vs_main\ncompile Hello.frag fragment fs_main\ncompile HelloCompute.comp compute cs_main\ncompile HelloCompute.vert vertex vs_main\ncompile HelloCompute.frag fragment fs_main\n";
503+
shellScript = "set -e\nSHADERS=\"$SRCROOT/Examples/Shaders\"\ncompile() {\n local name=$1 stage=$2 ep=$3\n glslc -fshader-stage=$stage -x hlsl -fentry-point=$ep \"$SHADERS/${name}.hlsl\" -o \"$SHADERS/${name}.spv\"\n shadercross \"$SHADERS/${name}.spv\" -s SPIRV -d MSL -t $stage -e $ep -o \"$SHADERS/${name}.msl\"\n}\ncompile Hello.vert vertex vs_main\ncompile Hello.frag fragment fs_main\ncompile HelloCompute.comp compute cs_main\ncompile HelloCompute.vert vertex vs_main\ncompile HelloCompute.frag fragment fs_main\n";
509504
showEnvVarsInLog = 0;
510505
};
511506
/* End PBXShellScriptBuildPhase section */

0 commit comments

Comments
 (0)