Skip to content

Commit 70b27dc

Browse files
OndraVovesOndra Voves
authored andcommitted
BREAKING: Upgrade BGFX. (#16)
Reviewed-on: https://codeberg.org/cyberegoorg/zbgfx/pulls/16
1 parent e18ebd4 commit 70b27dc

64 files changed

Lines changed: 4277 additions & 1541 deletions

Some content is hidden

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

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ Minimal is `0.16.0`. But you know try your version and believe.
3838

3939
## Bgfx version
4040

41-
- [BX](https://github.com/bkaradzic/bx/compare/98ad3bec2a7ee1a5cbabdcabc25252572dcb1d88...master)
41+
See `build.zig.zon` for pinned commits.
42+
43+
- [BX](https://github.com/bkaradzic/bx/compare/f86bece7967be1b8a7fd39262cdc8ce99d123c3b...master)
4244
- [BImg](https://github.com/bkaradzic/bimg/compare/ddbeeae05779f84f97694553eb41605a60f86f0a...master)
43-
- [BGFX](https://github.com/bkaradzic/bgfx/compare/a5a3d30421c38c369b5946fa174f7a14b1a60bf9...master)
45+
- [BGFX](https://github.com/bkaradzic/bgfx/compare/9499caafb06706715da78a7436a85de00ffc2497...master)
46+
47+
### Upgrade BGFX by your self.
48+
- Uncomment deps in `build.zig.zon`.
49+
- Change commit ref and hash for deps you need.
50+
- `zig build -Dwith_sync sync`.
51+
- `zig build`.
4452

4553
## Useful tools
4654
- [bgfx_shader_analyzer](https://github.com/r0ckHopper/bgfx_shader_analyzer) - LSP for bgfx shaders.
@@ -97,7 +105,7 @@ zig build
97105
Minimal setup with GLFW for window and input.
98106

99107
```sh
100-
examples/zig-out/bin/minimal-glfw
108+
zig-out/bin/minimal-glfw
101109
```
102110

103111
| Key | Description |
@@ -110,7 +118,7 @@ examples/zig-out/bin/minimal-glfw
110118
Basic usage of shaders compiled in build and embed to zig module.
111119

112120
```sh
113-
examples/zig-out/bin/shader-embed
121+
zig-out/bin/shader-embed
114122
```
115123

116124
| Key | Description |
@@ -124,7 +132,7 @@ Basic usage of shader compile in runtime.
124132
Try edit shaders in `zig-out/bin/shaders` and hit `r` to recompile.
125133

126134
```sh
127-
examples/zig-out/bin/shader-runtime
135+
zig-out/bin/shader-runtime
128136
```
129137

130138
| Key | Description |
@@ -138,7 +146,7 @@ examples/zig-out/bin/shader-runtime
138146
Minimal setup for zgui/ImGui.
139147

140148
```sh
141-
examples/zig-out/bin/zgui
149+
zig-out/bin/zgui
142150
```
143151

144152
| Key | Description |
@@ -151,7 +159,7 @@ examples/zig-out/bin/zgui
151159
DebugDraw api usage example.
152160

153161
```sh
154-
examples/zig-out/bin/debugdraw
162+
zig-out/bin/debugdraw
155163
```
156164

157165
| Key | Description |

build.zig.zon

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
22
.name = .zbgfx,
33
.fingerprint = 0xc48ed871c4086e4a,
4-
.version = "0.14.0",
4+
.version = "0.15.0",
55
.minimum_zig_version = "0.16.0",
66
.paths = .{
77
"includes",
@@ -14,8 +14,8 @@
1414

1515
.dependencies = .{
1616
// .bx = .{
17-
// .url = "https://github.com/bkaradzic/bx/archive/98ad3bec2a7ee1a5cbabdcabc25252572dcb1d88.tar.gz",
18-
// .hash = "N-V-__8AAIZUWgCX9dGi9E57zYjzwzNp0hfgNihQ4bieAMyx",
17+
// .url = "https://github.com/bkaradzic/bx/archive/f86bece7967be1b8a7fd39262cdc8ce99d123c3b.tar.gz",
18+
// .hash = "N-V-__8AAMFVWgAIG204nVWEtrzyahuF3KdTycRdE-TIxjJr",
1919
// .lazy = true,
2020
// },
2121
// .bimg = .{
@@ -24,8 +24,8 @@
2424
// .lazy = true,
2525
// },
2626
// .bgfx = .{
27-
// .url = "https://github.com/bkaradzic/bgfx/archive/a5a3d30421c38c369b5946fa174f7a14b1a60bf9.tar.gz",
28-
// .hash = "N-V-__8AAI7JJw_vBinp7q5ju2t0OBAQQQqYBSHaDJ0Ra0PS",
27+
// .url = "https://github.com/bkaradzic/bgfx/archive/9499caafb06706715da78a7436a85de00ffc2497.tar.gz",
28+
// .hash = "N-V-__8AAPE_LA9QcsPPaG88MC5MN9MzufvrqcEMCGn-k53M",
2929
// .lazy = true,
3030
// },
3131
},

examples/debugdraw/src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn main() anyerror!u8 {
191191
// Preapare view
192192
//
193193
bgfx.setViewTransform(0, &zm.matToArr(viewMtx), &zm.matToArr(projMtx));
194-
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]));
194+
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]), 0, 1);
195195
bgfx.touch(0);
196196
bgfx.dbgTextClear(0, false);
197197

examples/minimal-glfw/src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ pub fn main() anyerror!u8 {
256256
// Preapare view
257257
//
258258
bgfx.setViewTransform(0, &zm.matToArr(viewMtx), &zm.matToArr(projMtx));
259-
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]));
259+
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]), 0, 1);
260260
bgfx.touch(0);
261261
bgfx.dbgTextClear(0, false);
262262

examples/shader-embed/src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ pub fn main(init: std.process.Init) anyerror!u8 {
272272
// Preapare view
273273
//
274274
bgfx.setViewTransform(0, &zm.matToArr(viewMtx), &zm.matToArr(projMtx));
275-
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]));
275+
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]), 0, 1);
276276
bgfx.touch(0);
277277
bgfx.dbgTextClear(0, false);
278278

examples/shader-runtime/src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pub fn main(init: std.process.Init) anyerror!u8 {
342342
// Preapare view
343343
//
344344
bgfx.setViewTransform(0, &zm.matToArr(viewMtx), &zm.matToArr(projMtx));
345-
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]));
345+
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]), 0, 1);
346346
bgfx.touch(0);
347347
bgfx.dbgTextClear(0, false);
348348

examples/zgui/src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ pub fn main(init: std.process.Init) anyerror!u8 {
185185
old_flags = reset_flags;
186186
}
187187

188-
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]));
188+
bgfx.setViewRect(0, 0, 0, @intCast(size[0]), @intCast(size[1]), 0, 1);
189189
bgfx.touch(0);
190190
bgfx.dbgTextClear(0, false);
191191

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
// Copyright (c) 2018 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_

libs/bgfx/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,12 @@ mobile platforms.
724724

725725
![Harbi2 screenshot](https://h2mb.b-cdn.net/image.webp)
726726

727+
## METAL GEAR SOLID 4: Guns of the Patriots
728+
729+
https://store.steampowered.com/app/2492670/METAL_GEAR_SOLID_4_Guns_of_the_Patriots__Master_Collection_Version/ 2026 remaster of the 2008 action-adventure stealth video game.
730+
731+
<img width="1800" height="1013" alt="mgs4_cover" src="https://github.com/user-attachments/assets/cea9ec8a-f71b-4bf9-b826-0be898ca8658" />
732+
727733
[License (BSD 2-clause)](https://bkaradzic.github.io/bgfx/license.html)
728734
-----------------------------------------------------------------------
729735

0 commit comments

Comments
 (0)