Repository navigation
Configure bgfx through CMake and restore uniform checks - #1807
Merged
Merged
Conversation
bghgary
added a commit
that referenced
this pull request
Aug 14, 2026
…amping the pool (#1837) [Created by Copilot on behalf of @bghgary] ## Context The pool floor added in #1715 (512) and raised in #1830 (2048) clamps any smaller value upward, so the three CI workflows passing `-D BGFX_CONFIG_MAX_FRAME_BUFFERS=256` have had no effect since June while reading as deliberate coverage of a 256-slot pool. The clamp is also wrong on its own terms: an embedder that deliberately picks a smaller pool is overridden with no diagnostic. ## Worth a look - Both changes are in one commit because the ordering is a constraint, not a preference. Relaxing the clamp on its own would make CI's `=256` take effect and reintroduce the pool exhaustion #1830 fixed, since `build-win32.yml` and `nightly.yml` run the validation sweep the larger pool exists for. - `build-win32-shader.yml` builds only `PrecompiledShaderTest`, where the value never mattered. - #1807 replaces this block with a general default-if-unset macro across every `BGFX_CONFIG_` setting. It predates #1830 and still carries 512, so its merge from master needs to keep 2048. ## Verification Configured Win32 x64 D3D11 both ways: with no flag bgfx still compiles with `BGFX_CONFIG_MAX_FRAME_BUFFERS=2048`, so CI is unchanged, and `-D BGFX_CONFIG_MAX_FRAME_BUFFERS=256` now reaches the compile line instead of being clamped up. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e327caab-46c0-4c04-a3c0-1577ad67f08c
bghgary
force-pushed
the
bgfx-config-overridable
branch
2 times, most recently
from
October 16, 2026 17:52
fb3a4f8 to
0d96ebf
Compare
Keep Babylon Native's fixed bgfx integration settings in the sorted CMake configuration block without changing their values. Remove the temporary uniform-debug override. Apply cached textures once per submission and select Canvas clipping and composite uniforms without overwriting values within a draw. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 082c63a9-7e4b-426f-9b1e-fe59305417cb
bghgary
force-pushed
the
bgfx-config-overridable
branch
from
October 16, 2026 18:04
ca8cc0f to
2972a31
Compare
bghgary
enabled auto-merge (squash)
October 16, 2026 18:10
bkaradzic-microsoft
approved these changes
Oct 16, 2026
bgfx shares uniform handles by name, but shader programs can assign the same sampler to different texture stages. Replaying every cached stage therefore writes the same sampler uniform more than once. Ignore cached bindings absent from the current program or left at a stage used by a previous program. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 082c63a9-7e4b-426f-9b1e-fe59305417cb
Derive sampler handles and stages from the current program while keeping texture bindings by stage. Bind missing textures explicitly so unsetting a sampler still assigns its texture unit, including for transform-feedback dispatches. Upload Canvas stencil uniforms only when submitting stencil geometry. Empty and two-point fills otherwise upload the same uniforms again for the paint pass without an intervening draw. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 082c63a9-7e4b-426f-9b1e-fe59305417cb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


[Created by Copilot on behalf of @bghgary]
The bgfx integration settings remain controlled by Babylon Native, not exposed as consumer tuning options.
Remove the temporary uniform-debug override so bgfx’s normal Debug checks apply. This requires fixing duplicate uniform assignments in NativeEngine texture binding and Canvas clipping/filtering.