Commit Graph

75 Commits

Author SHA1 Message Date
Pino Toscano
de1d577492
Various GNU/Hurd fixes (#13792)
* bx: Small platform detection/usage improvements

* Use BX_PLATFORM_POSIX where needed

The semaphone implementation already uses BX_PLATFORM_POSIX to include
<pthread.h> on all the POSIX platforms; do the same also in other places
for consistency. This is done also for <sched.h>, which is a POSIX API,
and sched_yield() from it is already guarded by BX_PLATFORM_POSIX.

* Drop support for GNU libc older than 2.12

glibc 2.12 was released on 2010, and at this point any supported Linux
distro has that version or way greather than that.

From bkaradzic/bx@b59b7debd3

* bx: fix <pthread/pthread.h> include on Hurd

<pthread/pthread.h> does not exist, the standard <pthread.h> does exist
so switch to it.

* osd/modules/file: use dirent::d_type on any GNU libc platform

This BSD extension is provided by GNU libc, so enable its usage with
that C library.

* osd/modules/file: use <pty.h> on any GNU libc platform

openpty() is implemented by GNU libc for all the OSes, so include
<pty.h> when using that C library.

* osd/modules/file: cast dirent::d_name to const char* before using it

According to POSIX [1], the type of dirent::d_name is loosely defined
as "char d_name[]", as array with an undefined size. In particular, few
ways are seen in the wild:
(a) "char d_name[size]", i.e. as proper array with a full size
(b) "char d_name[1]"/"char d_name[0]", i.e. as C flexible arrays
Regardless of its type, dirent::d_name is used as if it was a classic
const char *, i.e. as pointer to a null-terminated string.

util::string_format() uses C++ templates to collect all the arguments,
and thus it will use the actual type of dirent::d_name. In case of (a)
there is no issue, however for (b) the result is that only the first
character is used.

To ensure that dirent::d_name is fully used, explicitly cast it to
const char * before passing it to util::string_format(), so the whole
string is used.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
2025-06-09 10:35:50 +02:00
Patrick Mackinlay
dc8ba812c1
Updated GENie and changed Visual Studio target to Visual Studio 2022. (#13000)
* Updated to GENie 1181.
* Applied local fix for GENie resource include directory bug, sent upstream as bkaradzic/GENie#572.
* Set MSVC flags to use conformant preprocessor, standards conformance mode, and assume UTF-8 encoding.
2024-11-27 04:39:05 +11:00
Justin Kerk
28210363d0 Fix compile error in 3rdparty/bx with newer Emscripten versions (#12098)
From bkaradzic/bx@03fd6f4771
2024-03-13 11:41:25 -07:00
Vas Crabb
44eb5ea3c6 Revert "Updated bgfx, bx and bimg to current upstream versions. (#11493)"
This reverts commit 1c61ccfe84.
2023-09-08 05:14:35 +10:00
Julian Sikorski
1c61ccfe84
Updated bgfx, bx and bimg to current upstream versions. (#11493)
* Reverted "macOS, iOS: Removed OpenGL/OpenGLES support. (commit 4693983242a698eaafed87faf4ffef1789adc8f9).
* Reverted "Fix macOS build" (commit ce2c2c13eda7d699051f75f598e740a447343a88).
* Reverted "macOS: Fixed deprecated warnings." (commit 10a8cb61f882ebc9bb376ee2341d003880b7037f).
* Added bgfx/README.mame explaining deviations from upstream.
2023-09-06 01:10:24 +10:00
Miodrag Milanović
812e6094f4
Update BGFX, BX and BIMG (#10789)
* Update to bgfx a93a714632b79b5ddbf5c86ac323fa9b76ed3433
Co-authored-by: Бранимир Караџић <branimirkaradzic@gmail.com>
2023-01-05 09:32:40 -05:00
R. Belmont
94b1e168b2
Revert "Update BGFX, BX and BIMG (#10750)" (#10787)
This reverts commit 5581eaa50a due to link failure on macOS.
2023-01-04 23:29:18 -05:00
Miodrag Milanović
5581eaa50a
Update BGFX, BX and BIMG (#10750)
* Update to bgfx a93a714632b79b5ddbf5c86ac323fa9b76ed3433
Co-authored-by: Бранимир Караџић <branimirkaradzic@gmail.com>
2023-01-04 23:12:10 -05:00
Julian Sikorski
0eeb918991
Update bgfx, bx and bimg to latest upstream (fixes issue #8057) (#8645) 2021-10-02 12:21:12 -04:00
Бранимир Караџић
a851430879 Update bx to latest 2021-08-10 20:26:34 +02:00
Julian Sikorski
0c70101b74 Sync bgfx, bx and bimg with upstream; fix the hlsl fs_chroma.sc matrix transposition properly (#5875)
* Sync bgfx with upstream revision 280420d

* Sync bx with upstream revision 267727d

* Sync bimg with upstream revision c1bab10

* Use bgfx helper functions to ensure correct matrix orientation

* Rebuild hlsl chain
2019-11-12 22:08:23 -05:00
Julian Sikorski
0837e7451a WIP: sync bgfx, bx and bimg with latest upstream (#5723)
* Sync with bgfx upstream revision b91d0b6

* Sync with bx upstream revision d60912b

* Sync with bimg upstream revision bd81f60

* Add astc-codec decoder

* Rename VertexDecl to VertexLayout

* Rename UniformType enum Int1 to Sampler.

* Add NVN stub

* Fix unused-const-variable error on macOS

* Drop redundant explicit language parameters
buildoptions_cpp are only applied to c++ files and buildoptions_objcpp are only
applied to objective c++ files. As such, hardcoding -x offers no benefit while
preventing overrides (such as one needed by 3rdparty/bgfx/src/renderer_vk.cpp on
macOS) from working.

* Re-introduce -x c++ in places where C code is compiled as C++ to prevent clang from throwing a warning

* Build bgfx as Objective-C++ on macOS
It is needed due to included headers

* Enable Direct3D12 and Vulkan bgfx rendering backends

* Enable building of spirv shaders

* Properly escape /c in cmd call

* Comment out dx12 bgfx renderer

* Honor VERBOSE setting during shaders build

* Only invert hlsl shader XYZ_TO_sRGB matrix for opengl

* Add spirv shaders

* OpenGL ES needs transposed matrix too

* Metal needs transposed matrix as well
2019-10-13 07:50:38 -04:00
mooglyguy
0bd02131b6 3rdparty: Updated bgfx, bimg, and bx to latest upstream. [Ryan Holtz] 2018-12-05 19:45:08 +01:00
Miodrag Milanovic
3917627494 Updated GENie, BGFX, BX, added BIMG since it is separated now, updated all shader binaries and MAME part of code to support new interfaces [Miodrag Milanovic] 2017-12-01 13:22:27 +01:00
Miodrag Milanovic
3fff3faf6c proper fix (nw) 2017-03-30 08:36:15 +02:00
Vas Crabb
ced3087742 assume LLVM libc++ if __llvm__ is defined but __GLIBC__ is undefined 2017-03-30 16:29:33 +11:00
dankan1890
b7adbf5438 VS fix. (nw) 2017-03-29 22:25:54 +02:00
Miodrag Milanovic
0921d7aaae 2nd try (nw) 2017-03-29 18:14:35 +02:00
Branimir Karadžić
49f7c99c77 Update BGFX and BX (nw) 2017-03-29 17:09:40 +02:00
Branimir Karadžić
1607745432 Update BGFX and BX (nw) 2017-02-05 13:56:35 +01:00
yz70s
487cd9395c bx: fix some mistakes that have already been corrected in upstream (nw)
Same as e0936a0278
2017-01-16 18:47:49 +01:00
Branimir Karadžić
04faaaf7ff Update BX (nw) 2017-01-02 14:04:09 +01:00
Branimir Karadžić
a3b4058bf7 Updated BGFX and BX and recompiled shaders (nw) 2016-10-29 09:11:50 +02:00
Miodrag Milanovic
d193abb0ad Update BGFX and BX packages and update MAME code to support new API (nw)
Generated missing shaders (nw)
2016-09-03 13:30:42 +02:00
Miodrag Milanovic
3917850b61 Update BX and BGFX (nw) 2016-08-06 14:20:16 +02:00
Jordi Mallach
e1464ffd64 Support GNU/Hurd systems. 2016-07-26 01:55:39 +02:00
Steven Chamberlain
ef8816ae18 bx: sync with upstream 2016-07-14 18:31:16 +01:00
Steven Chamberlain
6256946dee bx: further refactor #ifdefs
Trying to evaluate __GLIBC__ will result in an error if is not defined,
if the preprocessor does not short-cut the evaluation.

Split the macros onto separate lines and define the result in a new
BX_USE_GLIBC_PTHREAD_SETNAME_NP macro to avoid duplication.
2016-07-13 14:48:02 +01:00
Steven Chamberlain
423097c40f bx: refactor #ifdefs
Fix potential compilation error by ensuring __GLIBC__ is only evaluated
when actually defined.

When __GLIBC__ is defined, we do not need any additional headers on BSD
platforms (hence why using #elif).
2016-07-13 14:15:39 +01:00
Steven Chamberlain
f2ad7351ef bx: support glibc-based BSD platforms
On GNU/kFreeBSD, pthread_setname_np can be found in glibc's pthread.h
(same as on GNU/Linux).  pthread_np.h does not exist there.
2016-07-13 13:31:03 +01:00
Steven Chamberlain
8fb0ab46bb bx: use system signal.h on glibc systems
On GNU/kFreeBSD, sys/signal.h is only a wrapper around glibc signal.h
anyway, leading to a #include loop in this case.
2016-07-13 13:14:15 +01:00
Steven Chamberlain
c904fc121c bx: use real alloca.h on glibc systems
On GNU/kFreeBSD, the definition for alloca() can be found in the
system alloca.h
2016-07-13 12:25:55 +01:00
Miodrag Milanovic
a3af73bafc BGFX and BX update (nw) 2016-06-08 20:42:23 +02:00
Miodrag Milanovic
913861105b Update BGFX and BX (nw) 2016-05-27 20:57:02 +02:00
Miodrag Milanovic
71379c5648 Sync with BGFX (nw) 2016-05-16 14:17:04 +02:00
Miodrag Milanovic
2fe2089179 Update BGFX, BX, Benchmark and RapidJSON (nw) 2016-05-12 08:42:02 +02:00
Branimir Karadžić
f97b68d3ed Update GENie, BGFX and BX (nw) 2016-05-03 12:20:29 +02:00
Miodrag Milanovic
f89adf8b07 update flags for tools (nw) 2016-04-29 08:37:29 +02:00
Branimir Karadžić
94c7dd996b Update BGFX and BX (nw) 2016-04-27 17:57:45 +02:00
Branimir Karadžić
4172b54d84 Update BGFX and BX (nw) 2016-03-31 20:39:30 +02:00
Branimir Karadžić
fae7a2c486 Update to latest BGFX and BX(nw) 2016-03-20 16:50:14 +01:00
Branimir Karadžić
6412c5e076 Update BGFX and BX (nw) 2016-03-08 12:58:10 +01:00
Miodrag Milanovic
30ef0dc427 Update to latest BGFX including my SteamLink support (nw) 2016-02-16 07:52:59 +01:00
Branimir Karadžić
a8c8ec182f Update BGFX with latest code (nw) 2016-02-09 14:27:17 +01:00
Vas Crabb
503ae769d1 malloc.h is nonstandard, malloc/realloc/free are in stdlib.h 2016-02-08 13:41:39 +11:00
Branimir Karadžić
5bc83a2506 Update BGFX (nw) 2016-02-07 09:50:16 +01:00
Branimir Karadzic
fc07cc3621 Added latest BX and BGFX (nw) 2016-01-04 19:00:51 +01:00
Thomas Klausner
79fb7f4778 bx: add NetBSD support.
I've filed a more complete patch for this upstream:

https://github.com/bkaradzic/bx/pull/61

but this has been ignored since June. This patch is the minimal
set to fix the build on NetBSD.
2015-11-13 14:30:25 +01:00
Branimir Karadzic
5664971d3b update to latest BGFX and BX 2015-11-01 20:30:24 +01:00
Vas Crabb
79ae956643 Fix bx/bgfx on older OSX
Submitted upstream for consideration: https://github.com/bkaradzic/bx/pull/77
2015-10-31 19:34:52 +11:00