Skip to content

Commit b8a29fe

Browse files
committed
Upgrade bgfx
1 parent b58eb1d commit b8a29fe

File tree

330 files changed

+68055
-33305
lines changed

Some content is hidden

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

330 files changed

+68055
-33305
lines changed

.zigversion

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 3 additions & 3 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/d858859d1724fc037129318330f9c5ee5e008a08...master)
45-
- [BImg](https://github.com/bkaradzic/bimg/compare/446b9eb11130821fd11607c2fc94aee80976e56a...master)
46-
- [BGFX](https://github.com/bkaradzic/bgfx/compare/14e0aa5aff65a12df621fbc9466b42d41d01f013...master)
44+
- [BX](https://github.com/bkaradzic/bx//compare/1dc8c4827087c5a6cde221b0978baa15533348fd...master)
45+
- [BImg](https://github.com/bkaradzic/bimg/compare/bf10ffbb3df1f9f12ad7a9105e5e96e11a9c5a0c...master)
46+
- [BGFX](https://github.com/bkaradzic/bgfx/compare/ee2072d02f59ffbd89ef79026474a5e5fa17f206...master)
4747

4848
## Getting started
4949

build.zig

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn build(b: *std.Build) !void {
4646
"-Wno-error=date-time",
4747
};
4848
const cxx_options = common_options ++ [_][]const u8{
49-
"-std=c++17",
49+
"-std=c++20",
5050
};
5151
const c_options = common_options ++ [_][]const u8{};
5252
const mm_options = cxx_options ++ [_][]const u8{};
@@ -500,7 +500,8 @@ pub fn build(b: *std.Build) !void {
500500
"-MP",
501501
"-Wall",
502502
"-Wextra",
503-
"-ffast-math",
503+
// https://github.com/bkaradzic/bgfx/commit/b4dbc129f3b69b0d6a9093f2d579b883396a839f
504+
// "-ffast-math",
504505
"-fomit-frame-pointer",
505506
"-g",
506507
"-m64",
@@ -519,7 +520,8 @@ pub fn build(b: *std.Build) !void {
519520
"-MP",
520521
"-Wall",
521522
"-Wextra",
522-
"-ffast-math",
523+
// https://github.com/bkaradzic/bgfx/commit/b4dbc129f3b69b0d6a9093f2d579b883396a839f
524+
// "-ffast-math",
523525
"-fomit-frame-pointer",
524526
"-g",
525527
"-m64",
@@ -580,6 +582,10 @@ fn bxInclude(b: *std.Build, step: *std.Build.Step.Compile, target: std.Build.Res
580582
step.root_module.addCMacro("__STDC_FORMAT_MACROS", "1");
581583
step.root_module.addCMacro("__STDC_CONSTANT_MACROS", "1");
582584

585+
// if (target.result.os.tag == .windows) {
586+
// step.root_module.addCMacro("BX_CONFIG_EXCEPTION_HANDLING_USE_WINDOWS_SEH", "0");
587+
// }
588+
583589
step.root_module.addCMacro("BX_CONFIG_DEBUG", if (optimize == .Debug) "1" else "0");
584590

585591
switch (target.result.os.tag) {
@@ -820,6 +826,7 @@ const spirv_opt_files = .{
820826
spirv_opt_path ++ "source/opcode.cpp",
821827
spirv_opt_path ++ "source/operand.cpp",
822828
spirv_opt_path ++ "source/to_string.cpp",
829+
spirv_opt_path ++ "source/opt/graph.cpp",
823830
spirv_opt_path ++ "source/opt/aggressive_dead_code_elim_pass.cpp",
824831
spirv_opt_path ++ "source/opt/amd_ext_to_khr.cpp",
825832
spirv_opt_path ++ "source/opt/analyze_live_input_pass.cpp",
@@ -942,6 +949,7 @@ const spirv_opt_files = .{
942949
spirv_opt_path ++ "source/opt/struct_packing_pass.cpp",
943950
spirv_opt_path ++ "source/opt/split_combined_image_sampler_pass.cpp",
944951
spirv_opt_path ++ "source/opt/resolve_binding_conflicts_pass.cpp",
952+
spirv_opt_path ++ "source/opt/canonicalize_ids_pass.cpp",
945953
spirv_opt_path ++ "source/parsed_operand.cpp",
946954
spirv_opt_path ++ "source/print.cpp",
947955
spirv_opt_path ++ "source/reduce/change_operand_reduction_opportunity.cpp",
@@ -1035,4 +1043,5 @@ const spirv_opt_files = .{
10351043
spirv_opt_path ++ "source/val/validate_tensor_layout.cpp",
10361044
spirv_opt_path ++ "source/val/validate_tensor.cpp",
10371045
spirv_opt_path ++ "source/val/validate_invalid_type.cpp",
1046+
spirv_opt_path ++ "source/val/validate_graph.cpp",
10381047
};

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.name = .zbgfx,
33
.fingerprint = 0xc48ed871c4086e4a,
44
.version = "0.5.0",
5-
.minimum_zig_version = "0.15.1",
5+
.minimum_zig_version = "0.15.2",
66
.paths = .{
77
"includes",
88
"libs",

examples/00-minimal/src/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub fn main() anyerror!u8 {
190190
//
191191
// Reset and clear
192192
//
193-
bgfx.reset(@intCast(framebufferSize[0]), @intCast(framebufferSize[1]), reset_flags, bgfx_init.resolution.format);
193+
bgfx.reset(@intCast(framebufferSize[0]), @intCast(framebufferSize[1]), reset_flags, bgfx_init.resolution.formatColor);
194194

195195
// Set view 0 clear state.
196196
bgfx.setViewClear(0, bgfx.ClearFlags_Color | bgfx.ClearFlags_Depth, 0x303030ff, 1.0, 0);
@@ -262,7 +262,7 @@ pub fn main() anyerror!u8 {
262262
@intCast(size[0]),
263263
@intCast(size[1]),
264264
reset_flags,
265-
bgfx_init.resolution.format,
265+
bgfx_init.resolution.formatColor,
266266
);
267267
old_size = size;
268268
old_flags = reset_flags;

examples/01-zgui/src/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub fn main() anyerror!u8 {
100100
//
101101
// Reset and clear
102102
//
103-
bgfx.reset(@intCast(framebufferSize[0]), @intCast(framebufferSize[1]), reset_flags, bgfx_init.resolution.format);
103+
bgfx.reset(@intCast(framebufferSize[0]), @intCast(framebufferSize[1]), reset_flags, bgfx_init.resolution.formatColor);
104104

105105
// Set view 0 clear state.
106106
bgfx.setViewClear(0, bgfx.ClearFlags_Color | bgfx.ClearFlags_Depth, 0x303030ff, 1.0, 0);
@@ -184,7 +184,7 @@ pub fn main() anyerror!u8 {
184184
@intCast(size[0]),
185185
@intCast(size[1]),
186186
reset_flags,
187-
bgfx_init.resolution.format,
187+
bgfx_init.resolution.formatColor,
188188
);
189189
old_size = size;
190190
old_flags = reset_flags;

examples/02-runtime-shaderc/src/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub fn main() anyerror!u8 {
241241
//
242242
// Reset and clear
243243
//
244-
bgfx.reset(@intCast(framebufferSize[0]), @intCast(framebufferSize[1]), reset_flags, bgfx_init.resolution.format);
244+
bgfx.reset(@intCast(framebufferSize[0]), @intCast(framebufferSize[1]), reset_flags, bgfx_init.resolution.formatColor);
245245

246246
// Set view 0 clear state.
247247
bgfx.setViewClear(0, bgfx.ClearFlags_Color | bgfx.ClearFlags_Depth, 0x303030ff, 1.0, 0);
@@ -323,7 +323,7 @@ pub fn main() anyerror!u8 {
323323
@intCast(size[0]),
324324
@intCast(size[1]),
325325
reset_flags,
326-
bgfx_init.resolution.format,
326+
bgfx_init.resolution.formatColor,
327327
);
328328
old_size = size;
329329
old_flags = reset_flags;

examples/03-debugdraw/src/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub fn main() anyerror!u8 {
9696
//
9797
// Reset and clear
9898
//
99-
bgfx.reset(@intCast(framebufferSize[0]), @intCast(framebufferSize[1]), reset_flags, bgfx_init.resolution.format);
99+
bgfx.reset(@intCast(framebufferSize[0]), @intCast(framebufferSize[1]), reset_flags, bgfx_init.resolution.formatColor);
100100

101101
// Set view 0 clear state.
102102
bgfx.setViewClear(0, bgfx.ClearFlags_Color | bgfx.ClearFlags_Depth, 0x303030ff, 1.0, 0);
@@ -178,7 +178,7 @@ pub fn main() anyerror!u8 {
178178
@intCast(size[0]),
179179
@intCast(size[1]),
180180
reset_flags,
181-
bgfx_init.resolution.format,
181+
bgfx_init.resolution.formatColor,
182182
);
183183
old_size = size;
184184
old_flags = reset_flags;

0 commit comments

Comments
 (0)