Commit Graph

846 Commits

Author SHA1 Message Date
Branimir Karadžić
8377801ee0 Add BC4S, BC5S, BC6HU, RGB10A2U and D32FS8 texture formats. (#3857) 2026-07-29 21:25:53 +00:00
Branimir Karadžić
1862bf0480 Guard against undersized texture updates. Fix compute image views. (#3856) 2026-07-29 14:10:57 +00:00
Branimir Karadžić
ce18bdb6c6 Allow negative x/y in bgfx::setViewRect. (#3848) 2026-07-25 15:04:06 +00:00
Branimir Karadžić
435627021d Added clear texture API. (#3836) 2026-07-16 05:41:58 +00:00
Branimir Karadžić
a4555482f9 Increased number of texcoord attributes, increased instance data, added int32/uint32 vertex attributes. (#3832) 2026-07-14 05:15:13 +00:00
Branimir Karadžić
6eb09a4a9b Added setImage with array layer range for compute images. (#3829) 2026-07-13 04:19:07 +00:00
Branimir Karadžić
6425068e04 Fixed bgfx::Init default numDrawCalls/numDrawCallsPeakFrames. (#3816) 2026-07-08 19:21:52 +00:00
Branimir Karadžić
a62a6f008b Fixed indexed draw indirect with dynamic/transient index buffers. (#3813) 2026-07-06 21:45:53 +00:00
Branimir Karadžić
e8ad6b69d7 Fixed alignment issue. Closes #3809. (#3810) 2026-07-04 04:49:00 +00:00
Branimir Karadžić
63a75bc0ea Fixed s_renderFrameCalled cleanup. (#3804) 2026-07-01 05:31:36 +00:00
Branimir Karadžić
86ad82cfe2 Reduce amount of memory used. Allow dynamic draw call buffer resizing per frame. (#3790) 2026-06-28 05:05:25 +00:00
Branimir Karadžić
d6a333709d D3D12: Fix ExecuteIndirect path. (#3787) 2026-06-27 04:48:01 +00:00
Branimir Karadžić
bb86d0a221 Reduce binary size when features are not used. (#3781) 2026-06-25 02:49:38 +00:00
Branimir Karadžić
73629ada72 Dedup bindings per encoder. (#3772) 2026-06-20 05:22:12 +00:00
Branimir Karadžić
4f101d98be Don't present BGFX_FRAME_FLUSH frames. Fixed D3D12/VK flush sync. (#3771) 2026-06-19 19:39:42 +00:00
Branimir Karadžić
a0959eaf39 Do not set default BGFX_RESOLVE_AUTO_GEN_MIPS to depth textures. (#3766) 2026-06-17 16:39:33 +00:00
Branimir Karadžić
2f8d0d5f7e Validate depth attachments don't use BGFX_RESOLVE_AUTO_GEN_MIPS. Closes #2862. (#3764) 2026-06-16 21:26:46 -07:00
Branimir Karadžić
befae614da Fix amalgamated build. (#3760) 2026-06-15 17:13:38 +00:00
Branimir Karadžić
d5ea625272 Added video decoder support. (#3756) 2026-06-14 06:49:15 +00:00
Branimir Karadžić
bd0137f3fb Asserted vertex layout override stride matches buffer stride. Closes #2762. (#3745) 2026-06-08 22:06:29 -07:00
Branimir Karadžić
e92490c3f7 Added _layer parameter to bgfx::readTexture for texture array/cubemap readback. Closes #3235. (#3737) 2026-06-07 09:22:37 -07:00
Branimir Karadžić
11151de78d Added setTexture view API. (#3728) 2026-06-06 17:34:02 +00:00
Branimir Karadžić
65f9425d8c Updated to new SIMD. (#3699) 2026-05-03 18:51:10 +00:00
ShuangLiu1992
cceedb60cf Fix: reset s_renderFrameCalled in bgfx::shutdown() to allow re-init (#3690)
bgfx::renderFrame() sets s_renderFrameCalled = true on its first call
(line 1541) and never clears it. bgfx::shutdown() resets s_threadIndex
to 0 (line 3958) but leaves s_renderFrameCalled sticky, which means
that on a 2nd renderFrame after shutdown the gate at line 1534 still
runs BGFX_CHECK_RENDER_THREAD(). That assertion checks
(s_ctx != NULL && single-threaded) || (~BGFX_API_THREAD_MAGIC == s_threadIndex);
both branches fail post-shutdown (s_ctx is NULL, s_threadIndex is 0),
and the assertion fires in debug builds — blocking re-init of the
bgfx context within the same process.

Adding the symmetric s_renderFrameCalled reset to shutdown() makes
shutdown leave bgfx in the same state as a fresh process, so a
subsequent renderFrame()+init() pair behaves like the first one.

Verified locally: a downstream test that constructs an SDL+bgfx
context, runs a frame, destroys it, then constructs another from the
same thread now passes in debug builds with this patch (it asserts at
line 1536 without it).
2026-04-25 20:15:29 -07:00
Branimir Karadžić
e528e9d880 Fixed stremMask check. (#3681) 2026-04-21 11:15:04 -07:00
Branimir Karadžić
6c820091e4 macOS: Fixed deprecated warning. (#3672) 2026-04-19 01:36:19 +00:00
Branimir Karadžić
0b0ddb7f6b Added generate mips on frame buffer resolve. (#3664) 2026-04-17 05:04:57 +00:00
Branimir Karadžić
f3ad0e91af Removed bgfx::weldVertices. (#3659) 2026-04-13 01:30:57 +00:00
Branimir Karadžić
8532b2c45d Fix race between bgfx::begin and bgfx::frame encoder allocation. (#3646)
* Fix race between bgfx::begin and bgfx::frame encoder allocation.

* Update src/bgfx.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-25 21:36:02 -07:00
Matteo Valdina
fd8d480b28 Fix x86 crash: CreateTexture command buffer read uses wrong type (#3643)
The _external parameter is written to the command buffer as uint64_t (8 bytes)
but read back as uintptr_t (4 bytes on 32-bit). This causes a 4-byte
deserialization misalignment on x86, corrupting all subsequent command
buffer reads and leading to EXCEPTION_ACCESS_VIOLATION (0xC0000005) during
D3D11 initialization.

Co-authored-by: Matteo Valdina <mavaldin@microsoft.com>
2026-03-23 16:05:18 +00:00
Branimir Karadžić
b28febb4a8 NonLocalAllocator: Remove orphaned slabs. Fixed #2867. (#3625) 2026-03-08 04:02:40 +00:00
Branimir Karadžić
2721c747ae Added BGFX_FRAME_FLUSH. (#3623) 2026-03-07 04:50:46 +00:00
Branimir Karadžić
91814c9729 Added flag for texture formats that can be used as back-buffer format. (#3605) 2026-02-22 02:44:26 +00:00
Branimir Karadžić
651c203116 Undo default back buffer format. Fix VK. (#3604) 2026-02-20 03:14:27 +00:00
Branimir Karadžić
856208328c Use back buffer format when capturing screen shot. (#3603) 2026-02-20 00:46:41 +00:00
Branimir Karadžić
c85fa25266 Added BGFX_FRAME_* flags to add ability to discard all draw calls. (#3599) 2026-02-19 01:42:31 +00:00
Branimir Karadžić
40e614c45d Added external texture parameter. (#3596)
* Added external texture parameter.

* Use uint64_t instead of uintptr_t for external texture because VkImage is always 64-bit.
2026-02-18 20:12:37 +00:00
Martijn Courteaux
85d0b7ad3f Switch to BGRA8 as the default swapchain format. (#3569) 2026-01-30 18:58:02 +00:00
Branimir Karadžić
4baed6e076 Happy New Year! (#3550) 2026-01-14 16:26:51 +00:00
Branimir Karadžić
cded7e8d6c Fixed amalgamated build. (#3546) 2026-01-10 17:39:37 +00:00
Branimir Karadžić
868c66e1ed Added WebGPU. (#3544) 2026-01-10 04:09:39 +00:00
Branimir Karadžić
ae944eea43 Fixed MSAA texture validation. (#3529) 2025-12-31 22:30:19 +00:00
Бранимир Караџић
d19f3a5222 Validate that texutre supports MSAA. 2025-12-28 18:26:47 -08:00
Branimir Karadžić
241e9c3330 Added Init.fallback option. Cleanup. (#3522) 2025-12-24 04:29:32 +00:00
Branimir Karadžić
23410d248c Fixed build.a (#3513) 2025-12-13 20:46:12 +00:00
Branimir Karadžić
d396404fd3 Added Superluminal Profiler support. (#3504) 2025-11-21 19:08:12 +00:00
Бранимир Караџић
8a6a40108a Improved profiler colors. 2025-11-21 10:31:54 -08:00
Branimir Karadžić
f888f9d9a4 Fixed per view uniform order, and added more validation. (#3497) 2025-11-14 15:56:46 +00:00
Branimir Karadžić
35911ac2d9 Added uniform frequency. (#3485)
* Added uniform frequency.

* Cleanup.

* Cleanup.
2025-11-10 23:41:33 +00:00
Бранимир Караџић
8a9bc3ed65 EGL: Improved initialization. 2025-11-08 20:16:08 -08:00