Compare commits

...

65 Commits

Author SHA1 Message Date
dependabot[bot]
bd755d6c91 build(deps): bump the submodules group with 2 updates
Bumps the submodules group with 2 updates: [bgfx](https://github.com/bkaradzic/bgfx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `14e0aa5` to `23baae9`
- [Commits](14e0aa5aff...23baae9e00)

Updates `bimg` from `446b9eb` to `3af74f3`
- [Commits](446b9eb111...3af74f3fe1)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-version: 23baae9e0010ee03edd8904fc7e176c76f4f8e2c
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-version: 3af74f3fe1a36c1ce17d2443c352eb8dbb3a5bd4
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-03 19:21:05 -04:00
dependabot[bot]
e8a92ffbbe build(deps): bump the submodules group with 2 updates
Bumps the submodules group with 2 updates: [bgfx](https://github.com/bkaradzic/bgfx) and [bx](https://github.com/bkaradzic/bx).


Updates `bgfx` from `4109e14` to `14e0aa5`
- [Commits](4109e14b43...14e0aa5aff)

Updates `bx` from `5a20afe` to `d858859`
- [Commits](5a20afef84...d858859d17)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-version: 14e0aa5aff65a12df621fbc9466b42d41d01f013
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-version: d858859d1724fc037129318330f9c5ee5e008a08
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-03 07:10:16 -04:00
alemuntoni
657dd62551 bump submodules and add new sources to spirv-opt.cmake 2025-05-29 14:57:33 -04:00
Jason Millard
36a0d1d8d0 actions: bump actions. fixes upload-artifact@v3 failures 2025-02-27 17:03:45 -05:00
dependabot[bot]
cf79284dad build(deps): bump the submodules group across 1 directory with 3 updates
Bumps the submodules group with 3 updates in the / directory: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `7b3e1eb` to `de56398`
- [Commits](7b3e1ebf62...de56398919)

Updates `bx` from `c723ec4` to `01c99dd`
- [Commits](c723ec4054...01c99ddd09)

Updates `bimg` from `b713092` to `c5c7b6e`
- [Commits](b7130927db...c5c7b6e187)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-26 19:54:40 -05:00
Jason Millard
06144dcb9b add validate_tensor_layout.cpp to spirv-opt cmake 2025-01-02 11:16:00 -05:00
dependabot[bot]
3b5115516c build(deps): bump the submodules group across 1 directory with 3 updates
Bumps the submodules group with 3 updates in the / directory: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `cc789e8` to `7b3e1eb`
- [Commits](cc789e83a6...7b3e1ebf62)

Updates `bx` from `2cebc55` to `c723ec4`
- [Commits](2cebc558eb...c723ec4054)

Updates `bimg` from `0d1c78e` to `b713092`
- [Commits](0d1c78e779...b7130927db)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-02 11:16:00 -05:00
Aaron Ishibashi
ef0ed485c5 Fix broken shader platform checks, add checks for iOS, Android, Orbis (#254)
* Fix broken shader platform checks, add checks for iOS, Android, Orbis, remove NaCl

* Fix formatting issue

Co-authored-by: Sandy <1013356+bwrsandman@users.noreply.github.com>

* Update cmake/bgfxToolUtils.cmake formatting

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Sandy <1013356+bwrsandman@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-17 11:59:45 -05:00
Sandy
2c33050257 ci: Update deprecated upload-artifact 2024-11-13 19:57:16 -05:00
Vincent Lee
b12eb2882a Fix bgfx_compile_shaders section of README.md 2024-11-07 08:10:32 -05:00
Andrew Feng
1139067c7d Improve shader profile extension to be more compatible with bgfx (#247)
* remove profile extension incompatible with those listed under examples/runtime/shaders; fix incorrect parameter names; enforce consistent syntax when appending to CLI.

* remove dx9

* add separate profile extension for paths vs profile extension
2024-11-05 12:41:12 -05:00
Matt Tytel
b135fa3d77 Fixing wayland cmake definitions and linkage. 2024-11-05 10:24:53 -05:00
dependabot[bot]
9af6a48ce0 build(deps): bump the submodules group with 3 updates (#252) 2024-11-05 14:56:44 +00:00
dependabot[bot]
f531516396 build(deps): bump the submodules group across 1 directory with 2 updates
Bumps the submodules group with 2 updates in the / directory: [bgfx](https://github.com/bkaradzic/bgfx) and [bx](https://github.com/bkaradzic/bx).


Updates `bgfx` from `409fbc5` to `7e5bb54`
- [Commits](409fbc5d14...7e5bb54a3e)

Updates `bx` from `3d53a4a` to `296dfb2`
- [Commits](3d53a4abaa...296dfb202b)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-02 14:21:33 -04:00
Boyu
94184872a8 Fix incorrect adding .h in bgfx_compile_shaders (#245) 2024-09-10 19:10:48 -04:00
dependabot[bot]
4ceffda6de build(deps): bump the submodules group across 1 directory with 3 updates
Bumps the submodules group with 3 updates in the / directory: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `af12904` to `409fbc5`
- [Commits](af12904d8c...409fbc5d14)

Updates `bx` from `e7ede51` to `3d53a4a`
- [Commits](e7ede513dc...3d53a4abaa)

Updates `bimg` from `2afa64c` to `aaf9125`
- [Commits](2afa64c14c...aaf9125234)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-03 10:36:09 -04:00
Sandy
8defeece11 Update compile shaders example 2024-07-20 19:46:27 -04:00
Sandy Carter
5b8c8b9057 Cleanup pssl comment 2024-07-20 19:34:50 -04:00
Sandy Carter
de5f4544ef Change the output path of generated shaders
The paths now for output shaders is the same of the shader file inside of
a directory for the profile.
2024-07-20 19:34:50 -04:00
Sandy Carter
85b9f3cf5f Make bgfx_compile_shaders more generic
Allow compiling as header or as binaries
2024-07-20 19:34:50 -04:00
Sandy
79e4993ca5 Update cmake/bgfx/bgfx.cmake
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-09 09:41:37 -04:00
Sandy Carter
0211a63b99 Add option to use wayland on linux, enabled by default 2024-07-09 09:41:37 -04:00
dependabot[bot]
1156dcc725 build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `d1feabe` to `af12904`
- [Commits](d1feabe319...af12904d8c)

Updates `bx` from `24527ea` to `e7ede51`
- [Commits](24527eabfd...e7ede513dc)

Updates `bimg` from `59f188a` to `2afa64c`
- [Commits](59f188a6ad...2afa64c14c)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 09:24:15 -04:00
exdal
c2b7416a58 Merge pull request #233 from bwrsandman/preprocessor
bx: Add /Zc:preprocessor
2024-06-16 13:51:25 +03:00
Sandy Carter
c0ce1388cc bx: Add /Zc:preprocessor 2024-06-15 19:34:35 -04:00
dependabot[bot]
19cb98d40b build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `57d8a08` to `00fa5ad`
- [Commits](57d8a0838b...00fa5ad179)

Updates `bx` from `34ba9c7` to `d171a0f`
- [Commits](34ba9c7a5c...d171a0f264)

Updates `bimg` from `e9fa0ce` to `98a40e8`
- [Commits](e9fa0ceff2...98a40e8533)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 14:36:24 -04:00
Sandy Carter
701d84c222 tools: Add an option to insert search paths for tools 2024-05-19 16:13:58 -04:00
Sandy Carter
5940bb7cf8 tools: Rely on CMAKE_PROGRAM_PATH for finding tools 2024-05-19 11:38:19 -04:00
Sandy Carter
2fcbf437f2 tools: for vcpkg hint, use host install path 2024-05-19 07:31:02 -04:00
Jimmy Lord
d7f59648a8 ew option to allow "example-common" project to not be included in build. (#225)
* Added a new option to allow "example-common" project to not be included in build.

* Set BGFX_BUILD_EXAMPLE_COMMON as a dependent option, it will be set ON if either tools or examples are included in the build, OFF otherwise.

* cmake format

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Sandy <bwrsandman@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-18 20:42:20 -04:00
dependabot[bot]
e8db646d2c build(deps): bump the submodules group with 2 updates
Bumps the submodules group with 2 updates: [bgfx](https://github.com/bkaradzic/bgfx) and [bx](https://github.com/bkaradzic/bx).


Updates `bgfx` from `0244cc4` to `57d8a08`
- [Commits](0244cc4af2...57d8a0838b)

Updates `bx` from `3072cf3` to `34ba9c7`
- [Commits](3072cf37df...34ba9c7a5c)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 21:44:55 -04:00
dependabot[bot]
e12aba94c7 build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `56ad576` to `0244cc4`
- [Commits](56ad576dcd...0244cc4af2)

Updates `bx` from `dc3bf29` to `3072cf3`
- [Commits](dc3bf2990e...3072cf37df)

Updates `bimg` from `0903ea2` to `e9fa0ce`
- [Commits](0903ea21d5...e9fa0ceff2)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 13:19:46 -04:00
dependabot[bot]
8dcc50e992 build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `d9e1845` to `56ad576`
- [Commits](d9e184501f...56ad576dcd)

Updates `bx` from `e5d5d0b` to `dc3bf29`
- [Commits](e5d5d0b7c6...dc3bf2990e)

Updates `bimg` from `daedacc` to `0903ea2`
- [Commits](daedacc877...0903ea21d5)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 23:36:37 -05:00
dependabot[bot]
011e8efe23 build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `03a2c26` to `d9e1845`
- [Commits](03a2c26457...d9e184501f)

Updates `bx` from `03fd6f4` to `e5d5d0b`
- [Commits](03fd6f4771...e5d5d0b7c6)

Updates `bimg` from `678b750` to `daedacc`
- [Commits](678b750128...daedacc877)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 12:15:14 -05:00
dependabot[bot]
871eed8f8a build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `5de37d0` to `03a2c26`
- [Commits](5de37d0e22...03a2c26457)

Updates `bx` from `be3e348` to `03fd6f4`
- [Commits](be3e348eb2...03fd6f4771)

Updates `bimg` from `6c4d188` to `678b750`
- [Commits](6c4d1888eb...678b750128)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 05:42:25 +01:00
Zone.N
2f0e950b8f Remove dx9 shader compilation option 2023-12-02 09:08:29 -05:00
dependabot[bot]
26af75d78b build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `66b020e` to `5de37d0`
- [Commits](66b020e939...5de37d0e22)

Updates `bx` from `610b8e4` to `be3e348`
- [Commits](610b8e4df1...be3e348eb2)

Updates `bimg` from `dce2c35` to `6c4d188`
- [Commits](dce2c35a49...6c4d1888eb)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-02 09:08:29 -05:00
dependabot[bot]
1f65bfcb44 build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `3e5bfb8` to `66b020e`
- [Commits](3e5bfb81b6...66b020e939)

Updates `bx` from `16c5569` to `610b8e4`
- [Commits](16c55699c1...610b8e4df1)

Updates `bimg` from `ab96ba9` to `dce2c35`
- [Commits](ab96ba9dda...dce2c35a49)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-03 11:16:06 -04:00
Sandy Carter
875927a712 _bgfx_shaderc_parse: Must have profile specified. 2023-10-01 18:44:37 -04:00
dependabot[bot]
f46699bb4a build(deps): bump the submodules group with 3 updates
Bumps the submodules group with 3 updates: [bgfx](https://github.com/bkaradzic/bgfx), [bx](https://github.com/bkaradzic/bx) and [bimg](https://github.com/bkaradzic/bimg).


Updates `bgfx` from `98f16cd` to `3e5bfb8`
- [Commits](98f16cd125...3e5bfb81b6)

Updates `bx` from `198cd12` to `16c5569`
- [Commits](198cd120e4...16c55699c1)

Updates `bimg` from `ec02df8` to `ab96ba9`
- [Commits](ec02df824a...ab96ba9dda)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bimg
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 18:44:37 -04:00
dependabot[bot]
6a8aba37ff build(deps): bump the submodules group with 1 update
Bumps the submodules group with 1 update: [bgfx](https://github.com/bkaradzic/bgfx).

- [Commits](8b6a6bdf0e...98f16cd125)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 08:02:07 -04:00
dependabot[bot]
38de01cd8a build(deps): bump the submodules group with 2 updates (#214)
* build(deps): bump the submodules group with 2 updates

Bumps the submodules group with 2 updates: [bgfx](https://github.com/bkaradzic/bgfx) and [bx](https://github.com/bkaradzic/bx).


Updates `bgfx` from `e2c5b1d` to `8b6a6bd`
- [Commits](e2c5b1d3e1...8b6a6bdf0e)

Updates `bx` from `96748d9` to `198cd12`
- [Commits](96748d9a58...198cd120e4)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update to c++17

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sandy <bwrsandman@gmail.com>
2023-08-01 14:36:58 -04:00
Sandy Carter
560dcb227e always run _bgfx_crosscompile_use_host_tool 2023-07-15 20:05:35 -04:00
Sandy Carter
b3dae62c95 Don't fail if installed from build without tools 2023-07-15 20:05:35 -04:00
Sandy Carter
a1a7828ab0 Fix the way headers are installed
Fix missing bx headers when compiling SHARED
Fix compat and tinystl being installed in include root
Move submodule specific installs to their respecive config files.
2023-07-14 23:28:00 -04:00
Sandy
11810052be Add missing ARRAY_NAME to bin2c example 2023-07-14 15:42:10 -04:00
dependabot[bot]
688224d5f0 build(deps): bump the submodules group with 2 updates
Bumps the submodules group with 2 updates: [bgfx](https://github.com/bkaradzic/bgfx) and [bx](https://github.com/bkaradzic/bx).


Updates `bgfx` from `e7e75e4` to `e2c5b1d`
- [Commits](e7e75e4bff...e2c5b1d3e1)

Updates `bx` from `7ac95d5` to `96748d9`
- [Commits](7ac95d5131...96748d9a58)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
  dependency-group: submodules
- dependency-name: bx
  dependency-type: direct:production
  dependency-group: submodules
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-06 21:26:04 -04:00
Sandy Carter
3c1f8bac82 add @bwrsandman as default reviewer 2023-07-06 20:26:35 -04:00
Sandy Carter
ec52497189 dependabot: Add groups, a beta feature 2023-07-06 20:15:50 -04:00
Sandy Carter
1925f436e7 dependabot: Add groups, a beta feature 2023-07-06 20:14:42 -04:00
Sandy Carter
b208d0c37b release: Fix typo in file directory 2023-06-11 09:09:45 -04:00
Sandy Carter
b5041def8e release: Isolate source from binaries 2023-06-11 08:29:30 -04:00
Sandy Carter
29b62260f6 Improve release archive names and structure 2023-06-11 08:11:49 -04:00
Sandy Carter
4cfb204f26 Use commas to separate artefacts 2023-06-11 07:25:09 -04:00
Sandy Carter
715b2a2c67 Debug artifact location 2023-06-11 06:26:34 -04:00
Sandy Carter
9d8213645b Fix artifact grepping 2023-06-11 05:40:26 -04:00
Sandy Carter
376cdd9205 fix typo in linux 2023-06-11 05:00:01 -04:00
Sandy Carter
9ad4a8a69a Compress repo folder 2023-06-11 04:19:43 -04:00
Sandy Carter
398b09ef17 Fix tar exclusion 2023-06-10 22:27:17 -04:00
Sandy Carter
0fc04361c8 fix directory 2023-06-10 21:46:04 -04:00
Sandy Carter
f5afee9379 Add built binaries to assets 2023-06-10 21:45:02 -04:00
Sandy Carter
16ae1476f0 Zip submodules 2023-06-10 20:55:21 -04:00
Sandy Carter
c2eb5368fa Auto generate release notes 2023-06-10 20:39:51 -04:00
Sandy Carter
86fa198254 Fix set output deprecation 2023-06-10 20:04:57 -04:00
Sandy Carter
84f51c4f0f update checkout action 2023-06-10 20:01:12 -04:00
19 changed files with 866 additions and 730 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @bwrsandman

View File

@@ -4,3 +4,8 @@ updates:
directory: "/"
schedule:
interval: "monthly"
groups:
# Name of the group
submodules:
patterns:
- "*"

View File

@@ -17,13 +17,13 @@ jobs:
env:
CMAKE_VERSION: 3.10.2
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt install -y libgl1-mesa-dev
sudo apt install -y libgl1-mesa-dev libwayland-dev libwayland-egl-backend-dev
- uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ env.CMAKE_VERSION }}
@@ -57,13 +57,13 @@ jobs:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt install -y libgl1-mesa-dev
sudo apt install -y libgl1-mesa-dev libwayland-dev libwayland-egl-backend-dev
if: matrix.os == 'ubuntu-latest'
# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
@@ -94,13 +94,13 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt install -y libgl1-mesa-dev
sudo apt install -y libgl1-mesa-dev libwayland-dev libwayland-egl-backend-dev
if: matrix.os == 'ubuntu-latest'
# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.

View File

@@ -12,7 +12,7 @@ jobs:
name: cmake-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
@@ -21,7 +21,7 @@ jobs:
if: startsWith(github.event_name, 'pull_request')
- name: Format CMake files
id: cmake-format
uses: PuneetMatharu/cmake-format-lint-action@main
uses: PuneetMatharu/cmake-format-lint-action@v1.0.6
with:
args: --config-files .cmake-format.py --check
# Run only if a PR and cmake-format has failed
@@ -31,7 +31,7 @@ jobs:
needs: cmake-format-check
if: always() && startsWith(github.event_name, 'pull_request') && needs.cmake-format-check.result == 'failure'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
@@ -40,12 +40,12 @@ jobs:
if: startsWith(github.event_name, 'pull_request')
- name: Format CMake files
id: cmake-format
uses: PuneetMatharu/cmake-format-lint-action@v1.0.0
uses: PuneetMatharu/cmake-format-lint-action@v1.0.6
with:
args: --config-files .cmake-format.py --in-place
- run: |
git diff > cmake-format.patch
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: formatting-fix-${{github.sha}}
path: cmake-format.patch

View File

@@ -18,7 +18,7 @@ jobs:
sha: ${{ steps.version.outputs.sha }}
tag: ${{ steps.version.outputs.tag }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
@@ -29,9 +29,9 @@ jobs:
BGFX_CMAKE_REVISION=$(git rev-list HEAD --count)
SHA=$(cd bgfx && git rev-parse HEAD)
TAG="v1.${API_VERSION}.${BGFX_REVISION}-${BGFX_CMAKE_REVISION}"
echo "::set-output name=revision::${BGFX_REVISION}"
echo "::set-output name=sha::${SHA}"
echo "::set-output name=tag::${TAG}"
echo "revision=${BGFX_REVISION}" >> $GITHUB_OUTPUT
echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
build:
name: ${{ matrix.os }}
@@ -51,13 +51,13 @@ jobs:
CMAKE_INSTALL_DIR: ${{ github.workspace }}/install/
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt install -y libgl1-mesa-dev
sudo apt install -y libgl1-mesa-dev libwayland-dev libwayland-egl-backend-dev
if: matrix.os == 'ubuntu-latest'
# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest
@@ -80,7 +80,7 @@ jobs:
- name: Build
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install --config Release
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: ${{ github.workspace }}/install/
@@ -93,11 +93,86 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
path: src/bgfx.cmake
- run: |
find src/bgfx.cmake -name ".git*" -exec rm -rf {} +
find src/bgfx.cmake -name ".editorconfig" -delete
rm src/bgfx.cmake/.cmake-format.py
- uses: actions/download-artifact@v4
with:
name: windows-latest
path: ${{ github.workspace }}/install/windows/bgfx.cmake
- uses: actions/download-artifact@v4
with:
name: ubuntu-latest
path: ${{ github.workspace }}/install/linux/bgfx.cmake
- uses: actions/download-artifact@v4
with:
name: macos-latest
path: ${{ github.workspace }}/install/macos/bgfx.cmake
- name: Create Source Zip
uses: thedoctor0/zip-release@0.7.6
with:
type: 'zip'
filename: 'bgfx.cmake.${{ needs.version.outputs.tag }}.zip'
directory: 'src'
path: 'bgfx.cmake'
- name: Create Source Tar
uses: thedoctor0/zip-release@0.7.6
with:
type: 'tar'
filename: 'bgfx.cmake.${{ needs.version.outputs.tag }}.tar.gz'
directory: 'src'
path: 'bgfx.cmake'
- name: Create Windows Zip
uses: thedoctor0/zip-release@0.7.6
with:
type: 'zip'
filename: 'bgfx.cmake.binary.windows.${{ needs.version.outputs.tag }}.zip'
directory: 'install/windows'
path: 'bgfx.cmake'
- name: Create Windows Tar
uses: thedoctor0/zip-release@0.7.6
with:
type: 'tar'
filename: 'bgfx.cmake.binary.windows.${{ needs.version.outputs.tag }}.tar.gz'
directory: 'install/windows'
path: 'bgfx.cmake'
- name: Create Linux Zip
uses: thedoctor0/zip-release@0.7.6
with:
type: 'zip'
filename: 'bgfx.cmake.binary.linux.${{ needs.version.outputs.tag }}.zip'
directory: 'install/linux'
path: 'bgfx.cmake'
- name: Create Linux Tar
uses: thedoctor0/zip-release@0.7.6
with:
type: 'tar'
filename: 'bgfx.cmake.binary.linux.${{ needs.version.outputs.tag }}.tar.gz'
directory: 'install/linux'
path: 'bgfx.cmake'
- name: Create MacOS Zip
uses: thedoctor0/zip-release@0.7.6
with:
type: 'zip'
filename: 'bgfx.cmake.binary.macos.${{ needs.version.outputs.tag }}.zip'
directory: 'install/macos'
path: 'bgfx.cmake'
- name: Create MacOS Tar
uses: thedoctor0/zip-release@0.7.6
with:
type: 'tar'
filename: 'bgfx.cmake.binary.macos.${{ needs.version.outputs.tag }}.tar.gz'
directory: 'install/macos'
path: 'bgfx.cmake'
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.version.outputs.tag }}
artifacts: "src/bgfx.cmake.${{ needs.version.outputs.tag }}.zip,src/bgfx.cmake.${{ needs.version.outputs.tag }}.tar.gz,install/*/*.${{ needs.version.outputs.tag }}.zip,install/*/*.${{ needs.version.outputs.tag }}.tar.gz"
generateReleaseNotes: true

View File

@@ -13,7 +13,7 @@ project(bgfx)
cmake_policy(SET CMP0054 NEW)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -22,10 +22,6 @@ if(APPLE AND NOT XCODE)
set(CMAKE_CXX_FLAGS "-ObjC++")
endif()
if(MSVC AND (MSVC_VERSION GREATER_EQUAL 1914))
add_compile_options("/Zc:__cplusplus")
endif()
include(CMakeDependentOption)
option(BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF)
@@ -38,11 +34,16 @@ cmake_dependent_option(BGFX_BUILD_TOOLS_GEOMETRY "Build bgfx geometry tools." ON
cmake_dependent_option(BGFX_BUILD_TOOLS_TEXTURE "Build bgfx texture tools." ON BGFX_BUILD_TOOLS OFF)
set(BGFX_TOOLS_PREFIX "" CACHE STRING "Prefix name to add to name of tools (to avoid clashes)")
option(BGFX_BUILD_EXAMPLES "Build bgfx examples." ON)
cmake_dependent_option(
BGFX_BUILD_EXAMPLE_COMMON "Build bgfx example-common project." OFF "NOT BGFX_BUILD_EXAMPLES;NOT BGFX_BUILD_TOOLS"
ON
)
option(BGFX_BUILD_TESTS "Build bgfx tests." OFF)
option(BGFX_INSTALL "Create installation target." ON)
cmake_dependent_option(
BGFX_INSTALL_EXAMPLES "Install examples and their runtimes." OFF "BGFX_INSTALL;BGFX_BUILD_EXAMPLES" OFF
)
cmake_dependent_option(BGFX_WITH_WAYLAND "Use Wayland backend." ON "CMAKE_SYSTEM_NAME STREQUAL Linux" OFF)
option(BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON)
option(BGFX_CONFIG_MULTITHREADED "Build bgfx with multithreaded configuration" ON)
option(BGFX_CONFIG_RENDERER_WEBGPU "Enable the webgpu renderer" OFF)
@@ -160,18 +161,6 @@ if(BGFX_INSTALL)
install(FILES ${BGFX_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/licences/${PROJECT_NAME})
# install headers (this should be done as a target probably... ^)
install(DIRECTORY ${BX_DIR}/include/bx ${BX_DIR}/include/compat ${BX_DIR}/include/tinystl
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(DIRECTORY ${BIMG_DIR}/include/bimg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(DIRECTORY ${BGFX_DIR}/include/bgfx DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
# header required for shader compilation
install(FILES ${BGFX_DIR}/src/bgfx_shader.sh ${BGFX_DIR}/src/bgfx_compute.sh
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bgfx"
)
# install tools
if(BGFX_CMAKE_USER_SCRIPT)
install(FILES ${BGFX_CMAKE_USER_SCRIPT} DESTINATION "${config_install_dir}")

View File

@@ -48,8 +48,9 @@ Adding these `INPUT_FILE` as source files to a target will run `bin2c` at build
#### Examples: Generating an image as a header
```cmake
bgfx_compile_binary_to_header(
INPUT_FILE image.png
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/image.png
OUTPUT_FILE ${CMAKE_BINARY_DIR}/include/generated/images/image.png.h
ARRAY_NAME image_bytes
)
add_library(myLib image.png)
target_include_directories(myLib ${CMAKE_BINARY_DIR}/include/generated/images)
@@ -58,6 +59,7 @@ target_include_directories(myLib ${CMAKE_BINARY_DIR}/include/generated/images)
```cpp
// main.cpp
#include <image.png.h>
// You now have access to a static const uint8_t or char array named image_bytes
```
### `bgfx_compile_texture`
@@ -84,35 +86,38 @@ bgfx_compile_texture(
)
```
### `bgfx_compile_shader_to_header`
### `bgfx_compile_shaders`
Add a build rule for a `*.sc` shader to the generated build system using shaderc.
```cmake
bgfx_compile_shader_to_header(
bgfx_compile_shaders(
TYPE VERTEX|FRAGMENT|COMPUTE
SHADERS filenames
VARYING_DEF filename
OUTPUT_DIR directory
[AS_HEADERS]
)
```
This defines a shaderc command to generate headers for a number of `TYPE` shaders with `SHADERS` files and `VARYING_DEF` file in the `OUTPUT_DIR` directory. There will be one generated shader for each supported rendering API on this current platform according to the `BGFX_EMBEDDED_SHADER` macro in `bgfx/embedded_shader.h`.
This defines a shaderc command to generate binaries or headers for a number of `TYPE` shaders with `SHADERS` files and `VARYING_DEF` file in the `OUTPUT_DIR` directory. There will be one generated shader for each supported rendering API on this current platform according to the `BGFX_EMBEDDED_SHADER` macro in `bgfx/embedded_shader.h` for headers and in the directory expected by `load_shader` in `bgfx_utils.h`.
The generated headers will have names in the format of `${SHADERS}.${RENDERING_API}.bin.h` where `RENDERING_API` can be `glsl`, `essl`, `spv`, `dx9`, `dx11` and `mtl` depending on the availability of the platform.
The generated headers will have names in the format of `${RENDERING_API}/${SHADERS}.bin[.h]` where `RENDERING_API` can be `glsl`, `essl`, `spv`, `dx11` and `mtl` depending on the availability of the platform.
Adding these `SHADERS` as source files to a target will run `shaderc` at build time and they will rebuild if either the contents of the `SHADERS` or the `VARYING_DEF` change.
#### Examples: Generating shaders as headers
```cmake
bgfx_compile_shader_to_header(
bgfx_compile_shaders(
TYPE VERTEX
SHADERS vs.sc
VARYING_DEF varying.def.sc
OUTPUT_DIR ${CMAKE_BINARY_DIR}/include/generated/shaders
AS_HEADERS
)
bgfx_compile_shader_to_header(
bgfx_compile_shaders(
TYPE FRAGMENT
SHADERS fs.sc
VARYING_DEF ${CMAKE_SOURCE_DIR}/varying.def.sc
OUTPUT_DIR ${CMAKE_BINARY_DIR}/include/generated/shaders
AS_HEADERS
)
add_library(myLib main.cpp vs.sc fs.sc)
@@ -121,21 +126,19 @@ target_include_directories(myLib ${CMAKE_BINARY_DIR}/include/generated/shaders)
```cpp
// main.cpp
#include <vs.sc.glsl.bin.h>
#include <vs.sc.essl.bin.h>
#include <vs.sc.spv.bin.h>
#include <fs.sc.glsl.bin.h>
#include <fs.sc.essl.bin.h>
#include <fs.sc.spv.bin.h>
#include <glsl/vs.sc.bin.h>
#include <essl/vs.sc.bin.h>
#include <spv/vs.sc.bin.h>
#include <glsl/fs.sc.bin.h>
#include <essl/fs.sc.bin.h>
#include <spv/fs.sc.bin.h>
#if defined(_WIN32)
#include <vs.sc.dx9.bin.h>
#include <vs.sc.dx11.bin.h>
#include <fs.sc.dx9.bin.h>
#include <fs.sc.dx11.bin.h>
#include <dx11/vs.sc.bin.h>
#include <dx11/fs.sc.bin.h>
#endif // defined(_WIN32)
#if __APPLE__
#include <vs.sc.mtl.bin.h>
#include <fs.sc.mtl.bin.h>
#include <mtl/vs.sc.bin.h>
#include <mtl/fs.sc.bin.h>
#endif // __APPLE__
const bgfx::EmbeddedShader k_vs = BGFX_EMBEDDED_SHADER(vs);

2
bgfx

Submodule bgfx updated: e7e75e4bff...23baae9e00

2
bimg

Submodule bimg updated: ec02df824a...3af74f3fe1

2
bx

Submodule bx updated: 7ac95d5131...d858859d17

View File

@@ -9,28 +9,23 @@ list(GET BGFX_INCLUDE_PATH 0 BGFX_INCLUDE_PATH_1) # bgfx::bgfx exports include d
set(BGFX_SHADER_INCLUDE_PATH ${BGFX_INCLUDE_PATH_1}/bgfx)
# If cross compiling, we need a host-compatible version of shaderc to compile shaders
if(@CMAKE_CROSSCOMPILING@)
macro(_bgfx_crosscompile_use_host_tool TOOL_NAME)
if(NOT TARGET bgfx::${TOOL_NAME})
find_program(
${TOOL_NAME}_EXECUTABLE REQUIRED
NAMES bgfx-${TOOL_NAME} ${TOOL_NAME}
PATHS /usr/bin #
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-linux/tools/bgfx
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-windows/tools/bgfx
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-osx/tools/bgfx
)
add_executable(bgfx::${TOOL_NAME} IMPORTED)
set_target_properties(bgfx::${TOOL_NAME} PROPERTIES IMPORTED_LOCATION "${${TOOL_NAME}_EXECUTABLE}")
endif()
endmacro()
macro(_bgfx_crosscompile_use_host_tool TOOL_NAME)
if(NOT TARGET bgfx::${TOOL_NAME})
find_program(
${TOOL_NAME}_EXECUTABLE
NAMES bgfx-${TOOL_NAME} ${TOOL_NAME}
PATHS @BGFX_ADDITIONAL_TOOL_PATHS@ /usr/bin
)
add_executable(bgfx::${TOOL_NAME} IMPORTED)
set_target_properties(bgfx::${TOOL_NAME} PROPERTIES IMPORTED_LOCATION "${${TOOL_NAME}_EXECUTABLE}")
endif()
endmacro()
_bgfx_crosscompile_use_host_tool(bin2c)
_bgfx_crosscompile_use_host_tool(texturec)
_bgfx_crosscompile_use_host_tool(shaderc)
_bgfx_crosscompile_use_host_tool(texturev)
_bgfx_crosscompile_use_host_tool(geometryv)
endif()
_bgfx_crosscompile_use_host_tool(bin2c)
_bgfx_crosscompile_use_host_tool(texturec)
_bgfx_crosscompile_use_host_tool(shaderc)
_bgfx_crosscompile_use_host_tool(texturev)
_bgfx_crosscompile_use_host_tool(geometryv)
include("${CMAKE_CURRENT_LIST_DIR}/bgfxToolUtils.cmake")
check_required_components("@PROJECT_NAME@")

View File

@@ -70,10 +70,14 @@ file(
${SPIRV_TOOLS}/source/spirv_validator_options.h
${SPIRV_TOOLS}/source/table.cpp
${SPIRV_TOOLS}/source/table.h
${SPIRV_TOOLS}/source/table2.cpp
${SPIRV_TOOLS}/source/table2.h
${SPIRV_TOOLS}/source/text.cpp
${SPIRV_TOOLS}/source/text.h
${SPIRV_TOOLS}/source/text_handler.cpp
${SPIRV_TOOLS}/source/text_handler.h
${SPIRV_TOOLS}/source/to_string.cpp
${SPIRV_TOOLS}/source/to_string.h
${SPIRV_TOOLS}/source/util/bit_vector.cpp
${SPIRV_TOOLS}/source/util/bit_vector.h
${SPIRV_TOOLS}/source/util/bitutils.h
@@ -112,6 +116,7 @@ file(
${SPIRV_TOOLS}/source/val/validate_image.cpp
${SPIRV_TOOLS}/source/val/validate_instruction.cpp
${SPIRV_TOOLS}/source/val/validate_interfaces.cpp
${SPIRV_TOOLS}/source/val/validate_invalid_type.cpp
${SPIRV_TOOLS}/source/val/validate_layout.cpp
${SPIRV_TOOLS}/source/val/validate_literals.cpp
${SPIRV_TOOLS}/source/val/validate_logicals.cpp
@@ -127,6 +132,8 @@ file(
${SPIRV_TOOLS}/source/val/validate_ray_tracing_reorder.cpp
${SPIRV_TOOLS}/source/val/validate_scopes.cpp
${SPIRV_TOOLS}/source/val/validate_small_type_uses.cpp
${SPIRV_TOOLS}/source/val/validate_tensor.cpp
${SPIRV_TOOLS}/source/val/validate_tensor_layout.cpp
${SPIRV_TOOLS}/source/val/validate_type.cpp
${SPIRV_TOOLS}/source/val/validation_state.cpp
)

View File

@@ -12,9 +12,6 @@ include(bgfx.cmake)
include(3rdparty/meshoptimizer.cmake)
include(3rdparty/dear-imgui.cmake)
include(shared.cmake)
include(examples.cmake)
if(BGFX_BUILD_TOOLS_TEXTURE)
include(texturev.cmake)
endif()
@@ -31,3 +28,6 @@ if(BGFX_BUILD_TOOLS_SHADER)
include(3rdparty/webgpu.cmake)
include(shaderc.cmake)
endif()
include(shared.cmake)
include(examples.cmake)

View File

@@ -85,6 +85,11 @@ if(NOT ${BGFX_CONFIG_DEFAULT_MAX_ENCODERS} STREQUAL "")
)
endif()
if(BGFX_WITH_WAYLAND)
target_compile_definitions(bgfx PRIVATE "WL_EGL_PLATFORM=1")
target_link_libraries(bgfx PRIVATE wayland-egl)
endif()
set(BGFX_CONFIG_OPTIONS "")
list(
APPEND
@@ -217,4 +222,11 @@ if(BGFX_INSTALL)
INCLUDES
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(DIRECTORY ${BGFX_DIR}/include/bgfx DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
# header required for shader compilation
install(FILES ${BGFX_DIR}/src/bgfx_shader.sh ${BGFX_DIR}/src/bgfx_compute.sh
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bgfx"
)
endif()

View File

@@ -33,19 +33,6 @@ function(add_bgfx_shader FILE FOLDER)
set(OUTPUTS_PRETTY "")
if(WIN32)
# dx9
if(NOT "${TYPE}" STREQUAL "COMPUTE")
set(DX9_OUTPUT ${BGFX_DIR}/examples/runtime/shaders/dx9/${FILENAME}.bin)
_bgfx_shaderc_parse(
DX9 ${COMMON} WINDOWS
PROFILE s_3_0
O 3
OUTPUT ${DX9_OUTPUT}
)
list(APPEND OUTPUTS "DX9")
set(OUTPUTS_PRETTY "${OUTPUTS_PRETTY}DX9, ")
endif()
# dx11
set(DX11_OUTPUT ${BGFX_DIR}/examples/runtime/shaders/dx11/${FILENAME}.bin)
if(NOT "${TYPE}" STREQUAL "COMPUTE")
@@ -78,7 +65,7 @@ function(add_bgfx_shader FILE FOLDER)
# essl
if(NOT "${TYPE}" STREQUAL "COMPUTE")
set(ESSL_OUTPUT ${BGFX_DIR}/examples/runtime/shaders/essl/${FILENAME}.bin)
_bgfx_shaderc_parse(ESSL ${COMMON} ANDROID OUTPUT ${ESSL_OUTPUT})
_bgfx_shaderc_parse(ESSL ${COMMON} ANDROID PROFILE 100_es OUTPUT ${ESSL_OUTPUT})
list(APPEND OUTPUTS "ESSL")
set(OUTPUTS_PRETTY "${OUTPUTS_PRETTY}ESSL, ")
endif()
@@ -149,14 +136,19 @@ function(add_example ARG_NAME)
target_link_libraries(
example-${ARG_NAME} PUBLIC bgfx bx bimg bimg_decode ${DEAR_IMGUI_LIBRARIES} ${MESHOPTIMIZER_LIBRARIES}
)
if(BGFX_WITH_WAYLAND)
target_compile_definitions(example-${ARG_NAME} PUBLIC ENTRY_CONFIG_USE_WAYLAND=1)
endif()
if(BGFX_WITH_GLFW)
find_package(glfw3 REQUIRED)
target_link_libraries(example-${ARG_NAME} PUBLIC glfw)
target_compile_definitions(example-${ARG_NAME} PUBLIC ENTRY_CONFIG_USE_GLFW)
target_compile_definitions(example-${ARG_NAME} PUBLIC ENTRY_CONFIG_USE_GLFW=1)
elseif(BGFX_WITH_SDL)
find_package(SDL2 REQUIRED)
target_link_libraries(example-${ARG_NAME} PUBLIC ${SDL2_LIBRARIES})
target_compile_definitions(example-${ARG_NAME} PUBLIC ENTRY_CONFIG_USE_SDL)
target_compile_definitions(example-${ARG_NAME} PUBLIC ENTRY_CONFIG_USE_SDL=1)
elseif(UNIX AND NOT APPLE AND NOT ANDROID)
target_link_libraries(example-${ARG_NAME} PUBLIC X11)
endif()
@@ -276,17 +268,19 @@ if(BGFX_CUSTOM_TARGETS)
endif()
# Add common library for examples
add_example(
common
COMMON
DIRECTORIES
${BGFX_DIR}/examples/common/debugdraw
${BGFX_DIR}/examples/common/entry
${BGFX_DIR}/examples/common/font
${BGFX_DIR}/examples/common/imgui
${BGFX_DIR}/examples/common/nanovg
${BGFX_DIR}/examples/common/ps
)
if(BGFX_BUILD_EXAMPLE_COMMON)
add_example(
common
COMMON
DIRECTORIES
${BGFX_DIR}/examples/common/debugdraw
${BGFX_DIR}/examples/common/entry
${BGFX_DIR}/examples/common/font
${BGFX_DIR}/examples/common/imgui
${BGFX_DIR}/examples/common/nanovg
${BGFX_DIR}/examples/common/ps
)
endif()
# Only add examples if set, otherwise we still need exmaples common for tools
if(BGFX_BUILD_EXAMPLES)

View File

@@ -1,4 +1,3 @@
#include "@BGFX_DIR@/src/shader.cpp"
#include "@BGFX_DIR@/src/shader_dx9bc.cpp"
#include "@BGFX_DIR@/src/shader_dxbc.cpp"
#include "@BGFX_DIR@/src/shader_spirv.cpp"
#include "@BGFX_DIR@/src/shader_spirv.cpp"

File diff suppressed because it is too large Load Diff

View File

@@ -43,7 +43,7 @@ target_link_libraries(
${MINIZ_LIBRARIES} #
)
if(BGFX_INSTALL AND NOT BGFX_LIBRARY_TYPE MATCHES "SHARED")
if(BGFX_INSTALL)
install(
TARGETS bimg
EXPORT "${TARGETS_EXPORT_NAME}"
@@ -53,4 +53,5 @@ if(BGFX_INSTALL AND NOT BGFX_LIBRARY_TYPE MATCHES "SHARED")
INCLUDES
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(DIRECTORY ${BIMG_DIR}/include/bimg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif()

View File

@@ -81,7 +81,7 @@ target_include_directories(
$<BUILD_INTERFACE:${BX_DIR}/3rdparty> #
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> #
$<BUILD_INTERFACE:${BX_DIR}/include/compat/${BX_COMPAT_PLATFORM}> #
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/${BX_COMPAT_PLATFORM}> #
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/bx/compat/${BX_COMPAT_PLATFORM}> #
)
# All configurations
@@ -92,7 +92,7 @@ target_compile_definitions(bx PUBLIC "__STDC_CONSTANT_MACROS")
target_compile_features(bx PUBLIC cxx_std_14)
# (note: see bx\scripts\toolchain.lua for equivalent compiler flag)
target_compile_options(bx PUBLIC $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>)
target_compile_options(bx PUBLIC $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus /Zc:preprocessor>)
# Link against psapi on Windows
if(WIN32)
@@ -121,14 +121,18 @@ endif()
# Put in a "bgfx" folder in Visual Studio
set_target_properties(bx PROPERTIES FOLDER "bgfx")
if(NOT BGFX_LIBRARY_TYPE MATCHES "SHARED")
if(BGFX_INSTALL)
install(
TARGETS bx
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
INCLUDES
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
# We will make sure tinystl and compat are not installed in /usr/include
install(DIRECTORY "${BX_DIR}/include/bx" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(DIRECTORY "${BX_DIR}/include/compat/${BX_COMPAT_PLATFORM}"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bx/compat"
)
install(DIRECTORY "${BX_DIR}/include/tinystl" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bx")
endif()