Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

Commit 5ed9830

Browse files
authored
Add linux arm64 support (#1)
* Add linux arm64 support * Update spriv-cross and glslang * Update glslang.patch * Add missing header
1 parent 266921f commit 5ed9830

28 files changed

Lines changed: 850 additions & 335 deletions

.github/workflows/build.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
'.github/workflows/dist.yml'
77

88
jobs:
9-
win64:
9+
win-x64:
1010
runs-on: windows-latest
1111
steps:
1212
- uses: actions/checkout@v6
@@ -19,9 +19,9 @@ jobs:
1919
uses: actions/upload-artifact@v6
2020
with:
2121
path: ./build/src/Release/axslcc.exe
22-
name: axslcc-win64
23-
linux:
24-
runs-on: debian-11 # self-hosted on org simdsoft, @halx99 personal machine
22+
name: axslcc-win-x64
23+
linux-x64:
24+
runs-on: ubuntu-22.04
2525
steps:
2626
- uses: actions/checkout@v6
2727
- name: build
@@ -33,7 +33,21 @@ jobs:
3333
uses: actions/upload-artifact@v6
3434
with:
3535
path: ./build/src/axslcc
36-
name: axslcc-linux
36+
name: axslcc-linux-x64
37+
linux-arm64:
38+
runs-on: ubuntu-22.04-arm
39+
steps:
40+
- uses: actions/checkout@v6
41+
- name: build
42+
shell: pwsh
43+
run: |
44+
cmake -B build -DCMAKE_BUILD_TYPE=Release
45+
cmake --build build --config Release --target axslcc
46+
- name: Upload
47+
uses: actions/upload-artifact@v6
48+
with:
49+
path: ./build/src/axslcc
50+
name: axslcc-linux-arm64
3751
osx-arm64:
3852
runs-on: macos-latest
3953
steps:

.github/workflows/dist.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,27 @@ jobs:
5757
- name: Create packages
5858
if: ${{ steps.check_ver.outputs.release_ver != '' }}
5959
run: |
60-
curl -L https://github.com/simdsoft/1kiss/releases/download/devtools/d3dcompiler_47.dll -o ./axslcc-win64/d3dcompiler_47.dll
61-
ls -l ./axslcc-win64
60+
curl -L https://github.com/simdsoft/1kiss/releases/download/devtools/d3dcompiler_47.dll -o ./axslcc-win-x64/d3dcompiler_47.dll
61+
ls -l ./axslcc-win-x64
6262
mkdir -p pkg_dir
6363
prefix=axslcc-${{ steps.check_ver.outputs.release_ver }}
64-
ls -l axslcc-linux
64+
ls -l axslcc-linux-x64
65+
ls -l axslcc-linux-arm64
6566
ls -l axslcc-osx-x64
6667
ls -l axslcc-osx-arm64
67-
sudo chmod u+x ./axslcc-linux/axslcc
68+
sudo chmod u+x ./axslcc-linux-x64/axslcc
69+
sudo chmod u+x ./axslcc-linux-arm64/axslcc
6870
sudo chmod u+x ./axslcc-osx-x64/axslcc
6971
sudo chmod u+x ./axslcc-osx-arm64/axslcc
70-
ls -l axslcc-linux
72+
ls -l axslcc-linux-x64
73+
ls -l axslcc-linux-arm64
7174
ls -l axslcc-osx-x64
7275
ls -l axslcc-osx-arm64
73-
tar -czvf ./pkg_dir/$prefix-linux.tar.gz -C ./axslcc-linux axslcc
76+
tar -czvf ./pkg_dir/$prefix-linux-x64.tar.gz -C ./axslcc-linux-x64 axslcc
77+
tar -czvf ./pkg_dir/$prefix-linux-arm64.tar.gz -C ./axslcc-linux-arm64 axslcc
7478
tar -czvf ./pkg_dir/$prefix-osx-x64.tar.gz -C ./axslcc-osx-x64 axslcc
7579
tar -czvf ./pkg_dir/$prefix-osx-arm64.tar.gz -C ./axslcc-osx-arm64 axslcc
76-
sh -c "cd ./axslcc-win64; zip ../pkg_dir/$prefix-win64.zip axslcc.exe d3dcompiler_47.dll"
80+
sh -c "cd ./axslcc-win-x64; zip ../pkg_dir/$prefix-win-x64.zip axslcc.exe d3dcompiler_47.dll"
7781
- name: Publish to github release page
7882
if: ${{ steps.check_ver.outputs.release_ver != '' }}
7983
uses: softprops/action-gh-release@v2

3rdparty/spirv-cross/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ set(spirv-cross-util-sources
255255
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.hpp)
256256

257257
set(spirv-cross-abi-major 0)
258-
set(spirv-cross-abi-minor 67)
258+
set(spirv-cross-abi-minor 68)
259259
set(spirv-cross-abi-patch 0)
260260
set(SPIRV_CROSS_VERSION ${spirv-cross-abi-major}.${spirv-cross-abi-minor}.${spirv-cross-abi-patch})
261261

@@ -551,6 +551,14 @@ if (SPIRV_CROSS_CLI)
551551
target_link_libraries(spirv-cross-typed-id-test spirv-cross-core)
552552
set_target_properties(spirv-cross-typed-id-test PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
553553

554+
add_executable(spirv-cross-debug-lines-test tests-other/debug-lines.cpp)
555+
target_link_libraries(spirv-cross-debug-lines-test spirv-cross-core)
556+
set_target_properties(spirv-cross-debug-lines-test PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
557+
558+
add_executable(spirv-cross-debug-info-test tests-other/debug-info.cpp)
559+
target_link_libraries(spirv-cross-debug-info-test spirv-cross-core)
560+
set_target_properties(spirv-cross-debug-info-test PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
561+
554562
if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
555563
target_compile_options(spirv-cross-c-api-test PRIVATE -std=c89 -Wall -Wextra)
556564
endif()
@@ -573,6 +581,10 @@ if (SPIRV_CROSS_CLI)
573581
COMMAND $<TARGET_FILE:spirv-cross-msl-ycbcr-conversion-test> ${CMAKE_CURRENT_SOURCE_DIR}/tests-other/msl_ycbcr_conversion_test_2.spv)
574582
add_test(NAME spirv-cross-typed-id-test
575583
COMMAND $<TARGET_FILE:spirv-cross-typed-id-test>)
584+
add_test(NAME spirv-cross-debug-lines-test
585+
COMMAND $<TARGET_FILE:spirv-cross-debug-lines-test> ${CMAKE_CURRENT_SOURCE_DIR}/tests-other/debug-lines.spv)
586+
add_test(NAME spirv-cross-debug-info-test
587+
COMMAND $<TARGET_FILE:spirv-cross-debug-info-test> ${CMAKE_CURRENT_SOURCE_DIR}/tests-other/debug-info.spv)
576588
add_test(NAME spirv-cross-test
577589
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --parallel
578590
${spirv-cross-externals}
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
// Copyright (c) 2018-2024 The Khronos Group Inc.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and/or associated documentation files (the "Materials"),
5+
// to deal in the Materials without restriction, including without limitation
6+
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
7+
// and/or sell copies of the Materials, and to permit persons to whom the
8+
// Materials are furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Materials.
12+
//
13+
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
14+
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
15+
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
16+
//
17+
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20+
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+
// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
23+
// IN THE MATERIALS.
24+
25+
#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
26+
#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
27+
28+
#ifdef __cplusplus
29+
extern "C" {
30+
#endif
31+
32+
enum {
33+
NonSemanticShaderDebugInfo100Version = 100,
34+
NonSemanticShaderDebugInfo100Version_BitWidthPadding = 0x7fffffff
35+
};
36+
enum {
37+
NonSemanticShaderDebugInfo100Revision = 6,
38+
NonSemanticShaderDebugInfo100Revision_BitWidthPadding = 0x7fffffff
39+
};
40+
41+
enum NonSemanticShaderDebugInfo100Instructions {
42+
NonSemanticShaderDebugInfo100DebugInfoNone = 0,
43+
NonSemanticShaderDebugInfo100DebugCompilationUnit = 1,
44+
NonSemanticShaderDebugInfo100DebugTypeBasic = 2,
45+
NonSemanticShaderDebugInfo100DebugTypePointer = 3,
46+
NonSemanticShaderDebugInfo100DebugTypeQualifier = 4,
47+
NonSemanticShaderDebugInfo100DebugTypeArray = 5,
48+
NonSemanticShaderDebugInfo100DebugTypeVector = 6,
49+
NonSemanticShaderDebugInfo100DebugTypedef = 7,
50+
NonSemanticShaderDebugInfo100DebugTypeFunction = 8,
51+
NonSemanticShaderDebugInfo100DebugTypeEnum = 9,
52+
NonSemanticShaderDebugInfo100DebugTypeComposite = 10,
53+
NonSemanticShaderDebugInfo100DebugTypeMember = 11,
54+
NonSemanticShaderDebugInfo100DebugTypeInheritance = 12,
55+
NonSemanticShaderDebugInfo100DebugTypePtrToMember = 13,
56+
NonSemanticShaderDebugInfo100DebugTypeTemplate = 14,
57+
NonSemanticShaderDebugInfo100DebugTypeTemplateParameter = 15,
58+
NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter = 16,
59+
NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack = 17,
60+
NonSemanticShaderDebugInfo100DebugGlobalVariable = 18,
61+
NonSemanticShaderDebugInfo100DebugFunctionDeclaration = 19,
62+
NonSemanticShaderDebugInfo100DebugFunction = 20,
63+
NonSemanticShaderDebugInfo100DebugLexicalBlock = 21,
64+
NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator = 22,
65+
NonSemanticShaderDebugInfo100DebugScope = 23,
66+
NonSemanticShaderDebugInfo100DebugNoScope = 24,
67+
NonSemanticShaderDebugInfo100DebugInlinedAt = 25,
68+
NonSemanticShaderDebugInfo100DebugLocalVariable = 26,
69+
NonSemanticShaderDebugInfo100DebugInlinedVariable = 27,
70+
NonSemanticShaderDebugInfo100DebugDeclare = 28,
71+
NonSemanticShaderDebugInfo100DebugValue = 29,
72+
NonSemanticShaderDebugInfo100DebugOperation = 30,
73+
NonSemanticShaderDebugInfo100DebugExpression = 31,
74+
NonSemanticShaderDebugInfo100DebugMacroDef = 32,
75+
NonSemanticShaderDebugInfo100DebugMacroUndef = 33,
76+
NonSemanticShaderDebugInfo100DebugImportedEntity = 34,
77+
NonSemanticShaderDebugInfo100DebugSource = 35,
78+
NonSemanticShaderDebugInfo100DebugFunctionDefinition = 101,
79+
NonSemanticShaderDebugInfo100DebugSourceContinued = 102,
80+
NonSemanticShaderDebugInfo100DebugLine = 103,
81+
NonSemanticShaderDebugInfo100DebugNoLine = 104,
82+
NonSemanticShaderDebugInfo100DebugBuildIdentifier = 105,
83+
NonSemanticShaderDebugInfo100DebugStoragePath = 106,
84+
NonSemanticShaderDebugInfo100DebugEntryPoint = 107,
85+
NonSemanticShaderDebugInfo100DebugTypeMatrix = 108,
86+
NonSemanticShaderDebugInfo100InstructionsMax = 0x7fffffff
87+
};
88+
89+
90+
enum NonSemanticShaderDebugInfo100DebugInfoFlags {
91+
NonSemanticShaderDebugInfo100None = 0x0000,
92+
NonSemanticShaderDebugInfo100FlagIsProtected = 0x01,
93+
NonSemanticShaderDebugInfo100FlagIsPrivate = 0x02,
94+
NonSemanticShaderDebugInfo100FlagIsPublic = 0x03,
95+
NonSemanticShaderDebugInfo100FlagIsLocal = 0x04,
96+
NonSemanticShaderDebugInfo100FlagIsDefinition = 0x08,
97+
NonSemanticShaderDebugInfo100FlagFwdDecl = 0x10,
98+
NonSemanticShaderDebugInfo100FlagArtificial = 0x20,
99+
NonSemanticShaderDebugInfo100FlagExplicit = 0x40,
100+
NonSemanticShaderDebugInfo100FlagPrototyped = 0x80,
101+
NonSemanticShaderDebugInfo100FlagObjectPointer = 0x100,
102+
NonSemanticShaderDebugInfo100FlagStaticMember = 0x200,
103+
NonSemanticShaderDebugInfo100FlagIndirectVariable = 0x400,
104+
NonSemanticShaderDebugInfo100FlagLValueReference = 0x800,
105+
NonSemanticShaderDebugInfo100FlagRValueReference = 0x1000,
106+
NonSemanticShaderDebugInfo100FlagIsOptimized = 0x2000,
107+
NonSemanticShaderDebugInfo100FlagIsEnumClass = 0x4000,
108+
NonSemanticShaderDebugInfo100FlagTypePassByValue = 0x8000,
109+
NonSemanticShaderDebugInfo100FlagTypePassByReference = 0x10000,
110+
NonSemanticShaderDebugInfo100FlagUnknownPhysicalLayout = 0x20000,
111+
NonSemanticShaderDebugInfo100DebugInfoFlagsMax = 0x7fffffff
112+
};
113+
114+
enum NonSemanticShaderDebugInfo100BuildIdentifierFlags {
115+
NonSemanticShaderDebugInfo100IdentifierPossibleDuplicates = 0x01,
116+
NonSemanticShaderDebugInfo100BuildIdentifierFlagsMax = 0x7fffffff
117+
};
118+
119+
enum NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncoding {
120+
NonSemanticShaderDebugInfo100Unspecified = 0,
121+
NonSemanticShaderDebugInfo100Address = 1,
122+
NonSemanticShaderDebugInfo100Boolean = 2,
123+
NonSemanticShaderDebugInfo100Float = 3,
124+
NonSemanticShaderDebugInfo100Signed = 4,
125+
NonSemanticShaderDebugInfo100SignedChar = 5,
126+
NonSemanticShaderDebugInfo100Unsigned = 6,
127+
NonSemanticShaderDebugInfo100UnsignedChar = 7,
128+
NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff
129+
};
130+
131+
enum NonSemanticShaderDebugInfo100DebugCompositeType {
132+
NonSemanticShaderDebugInfo100Class = 0,
133+
NonSemanticShaderDebugInfo100Structure = 1,
134+
NonSemanticShaderDebugInfo100Union = 2,
135+
NonSemanticShaderDebugInfo100DebugCompositeTypeMax = 0x7fffffff
136+
};
137+
138+
enum NonSemanticShaderDebugInfo100DebugTypeQualifier {
139+
NonSemanticShaderDebugInfo100ConstType = 0,
140+
NonSemanticShaderDebugInfo100VolatileType = 1,
141+
NonSemanticShaderDebugInfo100RestrictType = 2,
142+
NonSemanticShaderDebugInfo100AtomicType = 3,
143+
NonSemanticShaderDebugInfo100DebugTypeQualifierMax = 0x7fffffff
144+
};
145+
146+
enum NonSemanticShaderDebugInfo100DebugOperation {
147+
NonSemanticShaderDebugInfo100Deref = 0,
148+
NonSemanticShaderDebugInfo100Plus = 1,
149+
NonSemanticShaderDebugInfo100Minus = 2,
150+
NonSemanticShaderDebugInfo100PlusUconst = 3,
151+
NonSemanticShaderDebugInfo100BitPiece = 4,
152+
NonSemanticShaderDebugInfo100Swap = 5,
153+
NonSemanticShaderDebugInfo100Xderef = 6,
154+
NonSemanticShaderDebugInfo100StackValue = 7,
155+
NonSemanticShaderDebugInfo100Constu = 8,
156+
NonSemanticShaderDebugInfo100Fragment = 9,
157+
NonSemanticShaderDebugInfo100DebugOperationMax = 0x7fffffff
158+
};
159+
160+
enum NonSemanticShaderDebugInfo100DebugImportedEntity {
161+
NonSemanticShaderDebugInfo100ImportedModule = 0,
162+
NonSemanticShaderDebugInfo100ImportedDeclaration = 1,
163+
NonSemanticShaderDebugInfo100DebugImportedEntityMax = 0x7fffffff
164+
};
165+
166+
167+
#ifdef __cplusplus
168+
}
169+
#endif
170+
171+
#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_

3rdparty/spirv-cross/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ struct CLIArguments
744744
bool hlsl_enable_16bit_types = false;
745745
bool hlsl_flatten_matrix_vertex_input_semantics = false;
746746
bool hlsl_preserve_structured_buffers = false;
747+
bool hlsl_user_semantic = false;
747748
HLSLBindingFlags hlsl_binding_flags = 0;
748749
bool vulkan_semantics = false;
749750
bool flatten_multidimensional_arrays = false;
@@ -852,6 +853,7 @@ static void print_help_hlsl()
852853
"\t[--hlsl-enable-16bit-types]:\n\t\tEnables native use of half/int16_t/uint16_t and ByteAddressBuffer interaction with these types. Requires SM 6.2.\n"
853854
"\t[--hlsl-flatten-matrix-vertex-input-semantics]:\n\t\tEmits matrix vertex inputs with input semantics as if they were independent vectors, e.g. TEXCOORD{2,3,4} rather than matrix form TEXCOORD2_{0,1,2}.\n"
854855
"\t[--hlsl-preserve-structured-buffers]:\n\t\tEmit SturucturedBuffer<T> rather than ByteAddressBuffer. Requires UserTypeGOOGLE to be emitted. Intended for DXC roundtrips.\n"
856+
"\t[--hlsl-user-semantic]:\n\t\tUses UserSemantic decoration to generate vertex input and output semantics.\n"
855857
);
856858
// clang-format on
857859
}
@@ -1471,6 +1473,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
14711473
hlsl_opts.enable_16bit_types = args.hlsl_enable_16bit_types;
14721474
hlsl_opts.flatten_matrix_vertex_input_semantics = args.hlsl_flatten_matrix_vertex_input_semantics;
14731475
hlsl_opts.preserve_structured_buffers = args.hlsl_preserve_structured_buffers;
1476+
hlsl_opts.user_semantic = args.hlsl_user_semantic;
14741477
hlsl->set_hlsl_options(hlsl_opts);
14751478
hlsl->set_resource_binding_flags(args.hlsl_binding_flags);
14761479
if (args.hlsl_base_vertex_index_explicit_binding)
@@ -1673,6 +1676,7 @@ static int main_inner(int argc, char *argv[])
16731676
cbs.add("--hlsl-flatten-matrix-vertex-input-semantics",
16741677
[&args](CLIParser &) { args.hlsl_flatten_matrix_vertex_input_semantics = true; });
16751678
cbs.add("--hlsl-preserve-structured-buffers", [&args](CLIParser &) { args.hlsl_preserve_structured_buffers = true; });
1679+
cbs.add("--hlsl-user-semantic", [&args](CLIParser &) { args.hlsl_user_semantic = true; });
16761680
cbs.add("--vulkan-semantics", [&args](CLIParser &) { args.vulkan_semantics = true; });
16771681
cbs.add("-V", [&args](CLIParser &) { args.vulkan_semantics = true; });
16781682
cbs.add("--flatten-multidimensional-arrays", [&args](CLIParser &) { args.flatten_multidimensional_arrays = true; });

3rdparty/spirv-cross/spirv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ typedef enum SpvDecoration_ {
645645
SpvDecorationConditionalINTEL = 6247,
646646
SpvDecorationCacheControlLoadINTEL = 6442,
647647
SpvDecorationCacheControlStoreINTEL = 6443,
648-
SpvDecorationSamplerSlot = 7000, // axslcc spec
648+
SpvDecorationSamplerSlot = 7000, // axslcc spec
649649
SpvDecorationMax = 0x7fffffff,
650650
} SpvDecoration;
651651

@@ -3694,7 +3694,7 @@ inline const char* SpvDecorationToString(SpvDecoration value) {
36943694
case SpvDecorationIndex: return "Index";
36953695
case SpvDecorationBinding: return "Binding";
36963696
case SpvDecorationDescriptorSet: return "DescriptorSet";
3697-
case SpvDecorationSamplerSlot: return "SamplerSlot"; // axslcc spec
3697+
case SpvDecorationSamplerSlot: return "SamplerSlot"; // axslcc spec
36983698
case SpvDecorationOffset: return "Offset";
36993699
case SpvDecorationXfbBuffer: return "XfbBuffer";
37003700
case SpvDecorationXfbStride: return "XfbStride";

3rdparty/spirv-cross/spirv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ enum Decoration {
641641
DecorationConditionalINTEL = 6247,
642642
DecorationCacheControlLoadINTEL = 6442,
643643
DecorationCacheControlStoreINTEL = 6443,
644-
DecorationSamplerSlot = 7000, // axslcc spec
644+
DecorationSamplerSlot = 7000, // axslcc spec
645645
DecorationMax = 0x7fffffff,
646646
};
647647

0 commit comments

Comments
 (0)