@@ -4,7 +4,6 @@ AUTOMAKE_OPTIONS = nostdinc
44# Normal builds never invoke shadercross. Run 'make shadercross' after
55# editing a .hlsl file to regenerate the platform blobs.
66
7- GLSLC = glslc
87SHADERCROSS = shadercross
98
109HLSL_SOURCES = \
@@ -28,58 +27,59 @@ SPIRV_BLOBS = \
2827 HelloCompute.vert.spv \
2928 HelloCompute.frag.spv
3029
31- EXTRA_DIST = $(HLSL_SOURCES ) $(MSL_BLOBS ) $(SPIRV_BLOBS )
30+ DXIL_BLOBS =
31+
32+ EXTRA_DIST = $(HLSL_SOURCES ) $(MSL_BLOBS ) $(SPIRV_BLOBS ) $(DXIL_BLOBS )
3233
3334# For out-of-tree builds, symlink the pre-built blobs into the build directory
3435# so SDL Resource resolution (SDL_GetBasePath() + "Shaders") finds them.
3536all-local :
3637 @if [ " x$( srcdir) " != " x$( builddir) " ]; then \
37- for f in $( MSL_BLOBS) $( SPIRV_BLOBS) ; do \
38+ for f in $( MSL_BLOBS) $( SPIRV_BLOBS) $( DXIL_BLOBS ) ; do \
3839 test -e " $( builddir) /$$ f" || \
3940 $(LN_S ) " $( abs_srcdir) /$$ f" " $( builddir) /$$ f" ; \
4041 done ; \
4142 fi
4243
4344# -------------------------------------------------------------------------
4445# shadercross — regenerate all blobs from HLSL source.
45- # Requires glslc (from shaderc) for HLSL→SPIR-V and shadercross for
46- # SPIR-V→MSL.
46+ # Requires shadercross (from SDL_shadercross) for HLSL→SPIR-V and HLSL→MSL.
4747# -------------------------------------------------------------------------
4848
4949.PHONY : shadercross
5050shadercross : $(MSL_BLOBS ) $(SPIRV_BLOBS )
5151
5252# Hello — vertex
5353$(srcdir ) /Hello.vert.spv : $(srcdir ) /Hello.vert.hlsl
54- $(GLSLC ) -fshader-stage=vertex -x hlsl -fentry-point=vs_main $< -o $@
54+ $(SHADERCROSS ) $< -s HLSL -d SPIRV -t vertex -e vs_main -o $@
5555
56- $(srcdir ) /Hello.vert.msl : $(srcdir ) /Hello.vert.spv
57- $(SHADERCROSS ) $< -s SPIRV -d MSL -t vertex -e vs_main -o $@
56+ $(srcdir ) /Hello.vert.msl : $(srcdir ) /Hello.vert.hlsl
57+ $(SHADERCROSS ) $< -s HLSL -d MSL -t vertex -e vs_main -o $@
5858
5959# Hello — fragment
6060$(srcdir ) /Hello.frag.spv : $(srcdir ) /Hello.frag.hlsl
61- $(GLSLC ) -fshader-stage=fragment -x hlsl -fentry-point=fs_main $< -o $@
61+ $(SHADERCROSS ) $< -s HLSL -d SPIRV -t fragment -e fs_main -o $@
6262
63- $(srcdir ) /Hello.frag.msl : $(srcdir ) /Hello.frag.spv
64- $(SHADERCROSS ) $< -s SPIRV -d MSL -t fragment -e fs_main -o $@
63+ $(srcdir ) /Hello.frag.msl : $(srcdir ) /Hello.frag.hlsl
64+ $(SHADERCROSS ) $< -s HLSL -d MSL -t fragment -e fs_main -o $@
6565
6666# HelloCompute — compute
6767$(srcdir ) /HelloCompute.comp.spv : $(srcdir ) /HelloCompute.comp.hlsl
68- $(GLSLC ) -fshader-stage=compute -x hlsl -fentry-point=cs_main $< -o $@
68+ $(SHADERCROSS ) $< -s HLSL -d SPIRV -t compute -e cs_main -o $@
6969
70- $(srcdir ) /HelloCompute.comp.msl : $(srcdir ) /HelloCompute.comp.spv
71- $(SHADERCROSS ) $< -s SPIRV -d MSL -t compute -e cs_main -o $@
70+ $(srcdir ) /HelloCompute.comp.msl : $(srcdir ) /HelloCompute.comp.hlsl
71+ $(SHADERCROSS ) $< -s HLSL -d MSL -t compute -e cs_main -o $@
7272
7373# HelloCompute — vertex
7474$(srcdir ) /HelloCompute.vert.spv : $(srcdir ) /HelloCompute.vert.hlsl
75- $(GLSLC ) -fshader-stage=vertex -x hlsl -fentry-point=vs_main $< -o $@
75+ $(SHADERCROSS ) $< -s HLSL -d SPIRV -t vertex -e vs_main -o $@
7676
77- $(srcdir ) /HelloCompute.vert.msl : $(srcdir ) /HelloCompute.vert.spv
78- $(SHADERCROSS ) $< -s SPIRV -d MSL -t vertex -e vs_main -o $@
77+ $(srcdir ) /HelloCompute.vert.msl : $(srcdir ) /HelloCompute.vert.hlsl
78+ $(SHADERCROSS ) $< -s HLSL -d MSL -t vertex -e vs_main -o $@
7979
8080# HelloCompute — fragment
8181$(srcdir ) /HelloCompute.frag.spv : $(srcdir ) /HelloCompute.frag.hlsl
82- $(GLSLC ) -fshader-stage=fragment -x hlsl -fentry-point=fs_main $< -o $@
82+ $(SHADERCROSS ) $< -s HLSL -d SPIRV -t fragment -e fs_main -o $@
8383
84- $(srcdir ) /HelloCompute.frag.msl : $(srcdir ) /HelloCompute.frag.spv
85- $(SHADERCROSS ) $< -s SPIRV -d MSL -t fragment -e fs_main -o $@
84+ $(srcdir ) /HelloCompute.frag.msl : $(srcdir ) /HelloCompute.frag.hlsl
85+ $(SHADERCROSS ) $< -s HLSL -d MSL -t fragment -e fs_main -o $@
0 commit comments