Skip to content

Commit 9460514

Browse files
authored
Update SPIRV, SPIRV-Cross, and SPIRV-Reflect (dotnet#2542)
1 parent c87fc66 commit 9460514

File tree

74 files changed

+2419
-1264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2419
-1264
lines changed

.github/workflows/spirv-cross.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ jobs:
3636
echo running extras
3737
${{ matrix.env.extras }}
3838
- name: Install Zig
39-
uses: goto-bus-stop/setup-zig@v2
40-
- name: Setup .NET 6.0 and .NET 7.0
39+
uses: mlugg/setup-zig@v2
40+
with:
41+
version: 0.15.2
42+
- name: Setup .NET
4143
uses: actions/setup-dotnet@v1
4244
with:
4345
dotnet-version: |
4446
6.0.201
4547
7.0.*
48+
8.0.*
4649
- name: Build SPIRV-Cross
4750
run: ${{ matrix.env.nuke_invoke }} SPIRVCross
4851
env:

.github/workflows/spirv-reflect.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ jobs:
3636
echo running extras
3737
${{ matrix.env.extras }}
3838
- name: Install Zig
39-
uses: goto-bus-stop/setup-zig@v2
40-
- name: Setup .NET 6.0 and .NET 7.0
39+
uses: mlugg/setup-zig@v2
40+
with:
41+
version: 0.15.2
42+
- name: Setup .NET
4143
uses: actions/setup-dotnet@v1
4244
with:
4345
dotnet-version: |
4446
6.0.201
4547
7.0.*
48+
8.0.*
4649
- name: Build SPIRV-Reflect
4750
run: ${{ matrix.env.nuke_invoke }} SPIRVReflect
4851
env:

Silk.NET.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Vulkan.Extensions.
624624
EndProject
625625
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Vulkan.Extensions.OHOS", "src\Vulkan\Extensions\Silk.NET.Vulkan.Extensions.OHOS\Silk.NET.Vulkan.Extensions.OHOS.csproj", "{4F35A32B-3EF0-4B0F-8784-01B9CCA5BC4D}"
626626
EndProject
627+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpirvTest", "src\Lab\Experiments\SpirvTest\SpirvTest.csproj", "{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}"
628+
EndProject
627629
Global
628630
GlobalSection(SolutionConfigurationPlatforms) = preSolution
629631
Debug|Any CPU = Debug|Any CPU
@@ -3825,6 +3827,18 @@ Global
38253827
{4F35A32B-3EF0-4B0F-8784-01B9CCA5BC4D}.Release|x64.Build.0 = Release|Any CPU
38263828
{4F35A32B-3EF0-4B0F-8784-01B9CCA5BC4D}.Release|x86.ActiveCfg = Release|Any CPU
38273829
{4F35A32B-3EF0-4B0F-8784-01B9CCA5BC4D}.Release|x86.Build.0 = Release|Any CPU
3830+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3831+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
3832+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Debug|x64.ActiveCfg = Debug|Any CPU
3833+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Debug|x64.Build.0 = Debug|Any CPU
3834+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Debug|x86.ActiveCfg = Debug|Any CPU
3835+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Debug|x86.Build.0 = Debug|Any CPU
3836+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
3837+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Release|Any CPU.Build.0 = Release|Any CPU
3838+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Release|x64.ActiveCfg = Release|Any CPU
3839+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Release|x64.Build.0 = Release|Any CPU
3840+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Release|x86.ActiveCfg = Release|Any CPU
3841+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7}.Release|x86.Build.0 = Release|Any CPU
38283842
EndGlobalSection
38293843
GlobalSection(SolutionProperties) = preSolution
38303844
HideSolutionNode = FALSE
@@ -4129,6 +4143,7 @@ Global
41294143
{9338EAE3-2ADA-4E34-9965-43521D24FFA0} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
41304144
{B8D369E0-424C-4C99-9A81-7E8552B0C225} = {49BC383A-D7E6-4013-93C7-371479B984CC}
41314145
{4F35A32B-3EF0-4B0F-8784-01B9CCA5BC4D} = {49BC383A-D7E6-4013-93C7-371479B984CC}
4146+
{DB1EAED4-699B-4254-A832-A8FFC15F6CC7} = {39B598E9-44BA-4A61-A1BB-7C543734DBA6}
41324147
EndGlobalSection
41334148
GlobalSection(ExtensibilityGlobals) = postSolution
41344149
SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D}

build/cache/spirv-cross.json.gz

390 Bytes
Binary file not shown.

build/cache/spirv-reflect.json.gz

0 Bytes
Binary file not shown.

build/cache/spirv.json.gz

0 Bytes
Binary file not shown.

build/nuke/Native/SPIRVCross.cs

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
using static Nuke.Common.Tools.Git.GitTasks;
2626
using static Nuke.Common.Tools.GitHub.GitHubTasks;
2727

28-
partial class Build {
28+
partial class Build
29+
{
2930
AbsolutePath SPIRVCrossPath => RootDirectory / "build" / "submodules" / "SPIRV-Cross";
3031

3132
//This is the build script for the SPIRV-Reflect shared library
@@ -34,62 +35,64 @@ partial class Build {
3435
3536
pub fn build(b: *std.Build) void {
3637
const target = b.standardTargetOptions(.{});
37-
const mode = b.standardOptimizeOption(.{});
38+
const optimize = b.standardOptimizeOption(.{});
3839
39-
const shared_lib_options: std.Build.SharedLibraryOptions = .{
40-
.name = ""spirv-cross"",
40+
const lib_mod = b.createModule(.{
4141
.target = target,
42-
.optimize = mode,
43-
};
42+
.optimize = optimize,
43+
.link_libc = true,
44+
.link_libcpp = true,
45+
});
4446
45-
const lib: *std.Build.Step.Compile = b.addSharedLibrary(shared_lib_options);
46-
lib.linkLibC();
47-
lib.linkLibCpp();
47+
const lib = b.addLibrary(.{
48+
.name = ""spirv-cross"",
49+
.root_module = lib_mod,
50+
.use_llvm = true,
51+
.linkage = .dynamic,
52+
});
4853
4954
const flags = &.{ ""-std=c++11"", ""-fPIC"" };
5055
5156
//Enable the GLSL, HLSL, MSL, CPP, and Reflect C APIs
52-
lib.defineCMacro(""SPIRV_CROSS_C_API_GLSL"", ""1"");
53-
lib.defineCMacro(""SPIRV_CROSS_C_API_HLSL"", ""1"");
54-
lib.defineCMacro(""SPIRV_CROSS_C_API_MSL"", ""1"");
55-
lib.defineCMacro(""SPIRV_CROSS_C_API_CPP"", ""1"");
56-
lib.defineCMacro(""SPIRV_CROSS_C_API_REFLECT"", ""1"");
57+
lib_mod.addCMacro(""SPIRV_CROSS_C_API_GLSL"", ""1"");
58+
lib_mod.addCMacro(""SPIRV_CROSS_C_API_HLSL"", ""1"");
59+
lib_mod.addCMacro(""SPIRV_CROSS_C_API_MSL"", ""1"");
60+
lib_mod.addCMacro(""SPIRV_CROSS_C_API_CPP"", ""1"");
61+
lib_mod.addCMacro(""SPIRV_CROSS_C_API_REFLECT"", ""1"");
5762
5863
//Export the C API symbols
59-
lib.defineCMacro(""SPVC_EXPORT_SYMBOLS"", ""1"");
64+
lib_mod.addCMacro(""SPVC_EXPORT_SYMBOLS"", ""1"");
6065
6166
//On windows, we need to specify `__declspec(dllexport)` ourselves
6267
//else SPIRV-Cross thinks this is a GNU toolchain and uses the wrong attribute in this case
6368
if (target.result.os.tag == .windows) {
64-
lib.defineCMacro(""SPVC_PUBLIC_API"", ""__declspec(dllexport)"");
69+
lib_mod.addCMacro(""SPVC_PUBLIC_API"", ""__declspec(dllexport)"");
6570
}
6671
6772
//If we arent in debug, defined NDEBUG and strip symbols
68-
if (mode != .Debug) {
69-
lib.defineCMacro(""NDEBUG"", ""1"");
73+
if (optimize != .Debug) {
74+
lib_mod.addCMacro(""NDEBUG"", ""1"");
7075
71-
lib.root_module.strip = true;
76+
lib_mod.strip = true;
7277
}
7378
74-
lib.addCSourceFiles(.{
75-
.files = &.{
76-
""spirv_cross.cpp"",
77-
""spirv_cfg.cpp"",
78-
""spirv_cpp.cpp"",
79-
""spirv_cross_c.cpp"",
80-
""spirv_cross_parsed_ir.cpp"",
81-
""spirv_cross_util.cpp"",
82-
""spirv_glsl.cpp"",
83-
""spirv_hlsl.cpp"",
84-
""spirv_msl.cpp"",
85-
""spirv_parser.cpp"",
86-
""spirv_reflect.cpp"",
87-
},
88-
.flags = flags
89-
});
79+
lib_mod.addCSourceFiles(.{ .files = &.{
80+
""spirv_cross.cpp"",
81+
""spirv_cfg.cpp"",
82+
""spirv_cpp.cpp"",
83+
""spirv_cross_c.cpp"",
84+
""spirv_cross_parsed_ir.cpp"",
85+
""spirv_cross_util.cpp"",
86+
""spirv_glsl.cpp"",
87+
""spirv_hlsl.cpp"",
88+
""spirv_msl.cpp"",
89+
""spirv_parser.cpp"",
90+
""spirv_reflect.cpp"",
91+
}, .flags = flags });
9092
9193
b.installArtifact(lib);
92-
}";
94+
}
95+
";
9396

9497
Target SPIRVCross => CommonTarget
9598
(

build/nuke/Native/SPIRVReflect.cs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
using static Nuke.Common.Tools.Git.GitTasks;
2626
using static Nuke.Common.Tools.GitHub.GitHubTasks;
2727

28-
partial class Build {
28+
partial class Build
29+
{
2930
AbsolutePath SPIRVReflectPath => RootDirectory / "build" / "submodules" / "SPIRV-Reflect";
3031

3132
//This is the build script for the SPIRV-Reflect shared library
@@ -36,21 +37,29 @@ pub fn build(b: *std.Build) void {
3637
const target = b.standardTargetOptions(.{});
3738
const optimize = b.standardOptimizeOption(.{});
3839
39-
const shared_lib_options: std.Build.SharedLibraryOptions = .{
40-
.name = ""spirv-reflect"",
40+
const lib_mod = b.createModule(.{
4141
.target = target,
4242
.optimize = optimize,
43-
};
44-
45-
const lib: *std.Build.Step.Compile = b.addSharedLibrary(shared_lib_options);
46-
lib.linkLibC();
47-
48-
if(optimize != .Debug)
49-
lib.root_module.strip = true;
43+
.link_libc = true,
44+
});
5045
51-
lib.addCSourceFiles(.{ .files = &.{""spirv_reflect.c""}, .flags = &.{ ""-std=c99"", ""-fPIC"" } });
46+
const lib = b.addLibrary(.{
47+
.name = ""spirv-reflect"",
48+
.root_module = lib_mod,
49+
.use_llvm = true,
50+
.linkage = .dynamic,
51+
});
52+
53+
if (optimize != .Debug)
54+
lib_mod.strip = true;
55+
56+
lib_mod.addCSourceFiles(.{
57+
.files = &.{""spirv_reflect.c""},
58+
.flags = &.{ ""-std=c99"", ""-fPIC"" },
59+
});
5260
b.installArtifact(lib);
53-
}";
61+
}
62+
";
5463

5564
Target SPIRVReflect => CommonTarget
5665
(

build/submodules/SPIRV-Cross

Submodule SPIRV-Cross updated 258 files

0 commit comments

Comments
 (0)