Skip to content

Commit c98e173

Browse files
committed
- Upgrade bgfx and bx.
- Cleanup
1 parent f66f29b commit c98e173

File tree

140 files changed

+24893
-17317
lines changed

Some content is hidden

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

140 files changed

+24893
-17317
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Install Zig
4949
uses: mlugg/setup-zig@v2
5050
- name: Lint
51-
run: zig fmt --check .
51+
run: zig fmt --check . --exclude libs/
5252

5353
build-examples:
5454
needs: ["validation"]
@@ -58,7 +58,7 @@ jobs:
5858
os:
5959
# FIXME: Problem with x11 in CI (latest ubuntu). But it works on linux
6060
#- linux-large
61-
- macos-13-large
61+
- macos-15-large
6262
- windows-large
6363

6464
runs-on: ${{matrix.os}}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ Minimal is `0.15.1`. But you know try your version and believe.
4141

4242
## Bgfx version
4343

44-
- [BX](https://github.com/bkaradzic/bx//compare/1dc8c4827087c5a6cde221b0978baa15533348fd...master)
44+
- [BX](https://github.com/bkaradzic/bx//compare/5dc415ee2e9935089b21186518436681c2d03b47...master)
4545
- [BImg](https://github.com/bkaradzic/bimg/compare/bf10ffbb3df1f9f12ad7a9105e5e96e11a9c5a0c...master)
46-
- [BGFX](https://github.com/bkaradzic/bgfx/compare/ee2072d02f59ffbd89ef79026474a5e5fa17f206...master)
46+
- [BGFX](https://github.com/bkaradzic/bgfx/compare/8a60697cfdfe6181b87ea0c49dff58e43448f712...master)
4747

4848
## Getting started
4949

build.zig

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const std = @import("std");
2-
const zbgfx = @import("src/zbgfx.zig");
32

4-
pub const build_shader = zbgfx.build;
3+
pub const build_step = @import("src/build_step.zig");
54

65
pub fn build(b: *std.Build) !void {
76
const target = b.standardTargetOptions(.{});
@@ -207,9 +206,31 @@ pub fn build(b: *std.Build) !void {
207206
});
208207
}
209208

210-
const zbgfx_module = b.addModule("zbgfx", .{
211-
.root_source_file = b.path("src/zbgfx.zig"),
212-
});
209+
const zbgfx_module = b.addModule(
210+
"zbgfx",
211+
.{
212+
.root_source_file = b.path("src/zbgfx.zig"),
213+
.imports = &.{
214+
.{
215+
.name = "bgfx",
216+
.module = b.createModule(.{ .root_source_file = b.path("libs/bgfx/bindings/zig/bgfx.zig") }),
217+
},
218+
219+
// .{
220+
// .name = "embed_bgfx_shader_sh",
221+
// .module = b.createModule(.{ .root_source_file = b.path("libs/bgfx/src/bgfx_shader.sh") }),
222+
// },
223+
// .{
224+
// .name = "embed_bgfx_compute_sh",
225+
// .module = b.createModule(.{ .root_source_file = b.path("libs/bgfx/src/bgfx_compute.sh") }),
226+
// },
227+
// .{
228+
// .name = "embed_shaderlib_sh",
229+
// .module = b.createModule(.{ .root_source_file = b.path("libs/bgfx/examples/common/shaderlib.sh") }),
230+
// },
231+
},
232+
},
233+
);
213234
_ = zbgfx_module; // autofix
214235

215236
//
@@ -274,7 +295,7 @@ pub fn build(b: *std.Build) !void {
274295
// Imgui .bin.h shader embeding step.
275296
//
276297
const shader_includes = b.path("shaders");
277-
const fs_imgui_image_bin_h = try zbgfx.build.compileBasicBinH(
298+
const fs_imgui_image_bin_h = try build_step.compileBasicBinH(
278299
b,
279300
target,
280301
shaderc,
@@ -291,7 +312,7 @@ pub fn build(b: *std.Build) !void {
291312
);
292313

293314
//
294-
const fs_ocornut_imgui_bin_h = try zbgfx.build.compileBasicBinH(
315+
const fs_ocornut_imgui_bin_h = try build_step.compileBasicBinH(
295316
b,
296317
target,
297318
shaderc,
@@ -307,7 +328,7 @@ pub fn build(b: *std.Build) !void {
307328
},
308329
);
309330

310-
const vs_imgui_image_bin_h = try zbgfx.build.compileBasicBinH(
331+
const vs_imgui_image_bin_h = try build_step.compileBasicBinH(
311332
b,
312333
target,
313334
shaderc,
@@ -323,7 +344,7 @@ pub fn build(b: *std.Build) !void {
323344
},
324345
);
325346

326-
const vs_ocornut_imgui_bin_h = try zbgfx.build.compileBasicBinH(
347+
const vs_ocornut_imgui_bin_h = try build_step.compileBasicBinH(
327348
b,
328349
target,
329350
shaderc,
@@ -839,6 +860,23 @@ const spirv_opt_files = .{
839860
spirv_opt_path ++ "source/opcode.cpp",
840861
spirv_opt_path ++ "source/operand.cpp",
841862
spirv_opt_path ++ "source/to_string.cpp",
863+
spirv_opt_path ++ "source/software_version.cpp",
864+
spirv_opt_path ++ "source/spirv_endian.cpp",
865+
spirv_opt_path ++ "source/spirv_optimizer_options.cpp",
866+
spirv_opt_path ++ "source/spirv_reducer_options.cpp",
867+
spirv_opt_path ++ "source/spirv_target_env.cpp",
868+
spirv_opt_path ++ "source/spirv_validator_options.cpp",
869+
spirv_opt_path ++ "source/table.cpp",
870+
spirv_opt_path ++ "source/table2.cpp",
871+
spirv_opt_path ++ "source/text.cpp",
872+
spirv_opt_path ++ "source/text_handler.cpp",
873+
spirv_opt_path ++ "source/parsed_operand.cpp",
874+
spirv_opt_path ++ "source/print.cpp",
875+
876+
spirv_opt_path ++ "source/util/bit_vector.cpp",
877+
spirv_opt_path ++ "source/util/parse_number.cpp",
878+
spirv_opt_path ++ "source/util/string_utils.cpp",
879+
842880
spirv_opt_path ++ "source/opt/graph.cpp",
843881
spirv_opt_path ++ "source/opt/aggressive_dead_code_elim_pass.cpp",
844882
spirv_opt_path ++ "source/opt/amd_ext_to_khr.cpp",
@@ -963,8 +1001,7 @@ const spirv_opt_files = .{
9631001
spirv_opt_path ++ "source/opt/split_combined_image_sampler_pass.cpp",
9641002
spirv_opt_path ++ "source/opt/resolve_binding_conflicts_pass.cpp",
9651003
spirv_opt_path ++ "source/opt/canonicalize_ids_pass.cpp",
966-
spirv_opt_path ++ "source/parsed_operand.cpp",
967-
spirv_opt_path ++ "source/print.cpp",
1004+
9681005
spirv_opt_path ++ "source/reduce/change_operand_reduction_opportunity.cpp",
9691006
spirv_opt_path ++ "source/reduce/change_operand_to_undef_reduction_opportunity.cpp",
9701007
spirv_opt_path ++ "source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp",
@@ -996,19 +1033,7 @@ const spirv_opt_files = .{
9961033
spirv_opt_path ++ "source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp",
9971034
spirv_opt_path ++ "source/reduce/structured_loop_to_selection_reduction_opportunity.cpp",
9981035
spirv_opt_path ++ "source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp",
999-
spirv_opt_path ++ "source/software_version.cpp",
1000-
spirv_opt_path ++ "source/spirv_endian.cpp",
1001-
spirv_opt_path ++ "source/spirv_optimizer_options.cpp",
1002-
spirv_opt_path ++ "source/spirv_reducer_options.cpp",
1003-
spirv_opt_path ++ "source/spirv_target_env.cpp",
1004-
spirv_opt_path ++ "source/spirv_validator_options.cpp",
1005-
spirv_opt_path ++ "source/table.cpp",
1006-
spirv_opt_path ++ "source/table2.cpp",
1007-
spirv_opt_path ++ "source/text.cpp",
1008-
spirv_opt_path ++ "source/text_handler.cpp",
1009-
spirv_opt_path ++ "source/util/bit_vector.cpp",
1010-
spirv_opt_path ++ "source/util/parse_number.cpp",
1011-
spirv_opt_path ++ "source/util/string_utils.cpp",
1036+
10121037
spirv_opt_path ++ "source/val/basic_block.cpp",
10131038
spirv_opt_path ++ "source/val/construct.cpp",
10141039
spirv_opt_path ++ "source/val/function.cpp",
@@ -1057,4 +1082,5 @@ const spirv_opt_files = .{
10571082
spirv_opt_path ++ "source/val/validate_tensor.cpp",
10581083
spirv_opt_path ++ "source/val/validate_invalid_type.cpp",
10591084
spirv_opt_path ++ "source/val/validate_graph.cpp",
1085+
spirv_opt_path ++ "source/val/validate_logical_pointers.cpp",
10601086
};

examples/00-minimal/build_sample.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn build(
4646
const combine_bin_zig = zbgfx_dep.artifact("combine_bin_zig");
4747
const shader_includes = zbgfx_dep.path("shaders");
4848

49-
const fs_cubes_zig = try zbgfx.build_shader.compileBasicBinZig(
49+
const fs_cubes_zig = try zbgfx.build_step.compileBasicBinZig(
5050
b,
5151
target,
5252
shaderc,
@@ -62,7 +62,7 @@ pub fn build(
6262
.includes = &.{shader_includes},
6363
},
6464
);
65-
const vs_cubes_zig = try zbgfx.build_shader.compileBasicBinZig(
65+
const vs_cubes_zig = try zbgfx.build_step.compileBasicBinZig(
6666
b,
6767
target,
6868
shaderc,

libs/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_in
4242
static const char* const E_SPV_EXT_shader_tile_image = "SPV_EXT_shader_tile_image";
4343
static const char* const E_SPV_EXT_mesh_shader = "SPV_EXT_mesh_shader";
4444
static const char* const E_SPV_EXT_float8 = "SPV_EXT_float8";
45+
static const char* const E_SPV_EXT_shader_64bit_indexing = "SPV_EXT_shader_64bit_indexing";
46+
static const char* const E_SPV_EXT_shader_invocation_reorder = "SPV_EXT_shader_invocation_reorder";
4547

4648
#endif // #ifndef GLSLextEXT_H

0 commit comments

Comments
 (0)