Commit Graph

357 Commits

Author SHA1 Message Date
Бранимир Караџић
f7c4dd70f2 Cleanup. 2025-10-27 17:11:26 -07:00
Бранимир Караџић
cd3749dac9 Cleanup. 2025-10-25 22:18:15 -07:00
Gary Hsu
e7c2c69edb Add optional layerIndex argument to overrideInternal (#3477)
* Add optional layerIndex argument to overrideInternal

* Run genie idl
2025-10-26 05:12:34 +00:00
Бранимир Караџић
a9b8b0b0d5 Fixed build. 2025-10-21 18:52:56 -07:00
Martin Friedli
fab28297e0 Fix Metal: Persist new window handle (Metal layer) when swapping view (#3452)
* When using the Metal rendering backend and updating the window handle
via setPlatformData(), the passed in Metal layer was not stored.
* Instead, the old window handle was still used.
* The fix addresses a scenario where two BGFX-backed Metal views on iOS
are created and rendering needs to happen either on one view or the other.
2025-08-08 14:46:21 +00:00
Martijn Courteaux
abe193a407 Fix UniformBuffer UB regarding UniformType::Enum with extra bits. (#3398) 2025-01-28 09:58:22 -08:00
Martijn Courteaux
de56398919 Fix #3344 (#3399) 2025-01-25 14:10:01 -08:00
Бранимир Караџић
042ebe8814 Cleanup. 2024-12-07 22:49:45 -08:00
Бранимир Караџић
69acf28813 Cleanup. 2024-11-21 07:34:58 -08:00
luzpaz
e9c9d711d7 Fix various typos (#3377)
Found via `codespell -q 3 -S "./3rdparty,*.ttf,*.bin,./examples/common/imgui,./examples/common/font" -L attribut,ba,clude,conly,constan,espace,hashin,indext,inout,lod,nclude,retur,ser,sroll,struc,te,truct,unknwn,usin,utput,varyin`
2024-11-16 08:03:12 -08:00
Martijn Courteaux
e488a07f1b Support both X11 and Wayland in the same build. (#3360)
* Support both X11 and Wayland in the same build.

 - Works for both Vulkan and OpenGL.
 - Remove --with-wayland from genie options.
 - Vulkan loads all three extensions for surface creation instead of only one.
 - Add width and height parameter to GlContext::createSwapChain(), which is needed for EGL to create
   a SwapChain with the given window size.
 - Dirty-fix the example-22-windows to recreate the FrameBuffer by first destroying and then
   recreating to make sure the window is released of its swapchain.
 - Fix dbgText glitch in example-22-windows.
 - Remove old X11-related dependencies for GLFW3.

* Formatting.
2024-10-05 14:33:22 -07:00
Oskar Kwaśniewski
ed03259c41 fix: visionOS 1.2 build errors (#3347) 2024-08-28 09:22:38 -07:00
Oskar Kwaśniewski
0b73e8c7e2 fix: layer rendering (#3339) 2024-08-12 07:55:15 -07:00
Sim Saëns
3f3d3b4433 feat: optional immersive rendering in visionOS (#3335)
* Implements optional code path for immersive rendering based on the type of nwh

* Reverted change in SwapChainMtl destructor
2024-08-09 23:25:47 -07:00
Oskar Kwaśniewski
aa4f8c5833 feat: add world tracking provider to render on acutal device (#3326) 2024-07-30 08:15:23 -07:00
Oskar Kwaśniewski
b4df15f848 fix: properly set viewports and render targets (#3325)
fix: do not use STL
2024-07-25 01:17:47 -07:00
Sandy
987a6f89de Fix issue with visionOS not being defined (#3327)
VisionOS SDK was introduced in xcode 15.2.
xcode 15.0, 15.1 do not have the visionOS platform defined.
Additionally, if you use a different llvm such as llvm 17 or 18 from
homebrew, the platform might not be defined even when using xocde 15.2 or
newer.
2024-07-19 20:54:44 -07:00
Бранимир Караџић
530a558b11 Cleanup. 2024-06-03 08:27:44 -07:00
Oskar Kwaśniewski
3195593d8d feat: base visionOS bgfx implementation (#3289)
Co-authored-by: mani3xis <mariusz.pas+dev@protonmail.com>

fix: properly set storageMode

cleanup: remove unused variables

fix crash while releasing m_drawable on visionOS

fix: remove unused timing variable

fix: file name cases, cleanup

feat: integrate visionOS into bgfx examples
2024-06-03 08:14:53 -07:00
Martijn Courteaux
1437b5c966 Restore support for older macOS/iOS version. Determine features at init, and use at runtime. (#3284)
* Restore support for older macOS/iOS version. Determine features at init, and use at runtime.

* Fix typo for visionOS macro expansion.

* Silence warnings with pragmas and pointer casts where possible.

* Pragma macros.
2024-05-03 07:35:20 -07:00
Branimir Karadžić
98d88d9fc6 Fixed draw indirect. 2024-02-09 20:55:44 -08:00
Kitchen
d9e184501f metal use MTLPixelFormatDepth16Unorm for D16 format (#3246) 2024-02-01 07:06:10 -08:00
attilaz
7b8aa2ec75 Fixes metal texture/buffer binding issue (#3214)
Fixes metal texture/buffer binding when when the same resource is bound to both (vertex and fragment) stages

https://github.com/bkaradzic/bgfx/issues/3024
2023-12-04 07:37:39 -08:00
Бранимир Караџић
5f564db0d5 macOS: Fixed deprecated warnings. 2023-08-18 09:17:17 +02:00
Jamil Halabi
f059531885 Added a new capability to check for PrimitiveID support (#3154) 2023-08-04 16:42:33 +02:00
Robin Allen
506da0443c Metal: Fix framebuffer hash ignoring sampleCount (#3140) 2023-07-21 18:03:30 -07:00
Robin Allen
a50db8f8fd Fix toggling MSAA on Metal. (#3137)
* Fix toggling MSAA on Metal.

m_backBufferColorMsaa was set when sampleCount > 1, but was never reset when
sampleCount became 1 again.

Many other bits of code in the Metal renderer decide what to do by checking
m_backBufferColorMsaa, so these would all do the wrong thing if you toggled
MSAA on and them back off.

* Cleanup
2023-07-20 08:29:24 -07:00
Branimir Karadžić
290295136b Added bx::Location, and removed allocator macros. 2023-04-23 19:19:22 -07:00
Бранимир Караџић
c43c4479de Fixed issue #3067. 2023-04-02 09:00:18 -07:00
Бранимир Караџић
f8019cb3d4 Cleanup. 2023-03-02 21:45:20 -08:00
Бранимир Караџић
5ec297bc71 Fixed issue #3045. 2023-03-02 21:21:10 -08:00
Бранимир Караџић
9d5b980f5c Cleanup. 2023-02-15 21:54:54 -08:00
Raziel Alphadios
c2bc5177b5 Add support for remaining unsupported ASTC formats (#2963)
* Add support for remaining unsupported ASTC formats
Add new ASTC formats into pixelformats example and ninja scripts
Rebuild ASTC textures

* Update idl and generate
Move comma in pixelformats

Co-authored-by: Raziel Alphadios <raziely@gmail.com>
2022-10-25 17:03:40 -07:00
Бранимир Караџић
50250df026 Cleanup. 2022-10-03 20:43:48 -07:00
jwdevel
f1f77a6cd3 Record frame num in view stats (#2908)
* Add 'frameNumber' to Frame struct

Previously, the frame number returned from bgfx::frame() was tracked separately in the Context. Now,
we store that information in the Frame. This will allow us to attach the frame number to ViewStats.

* Add frame number to ViewStats

When ViewStats are enabled, we tag each timer query with the current frame number, then include
that information in the final results. In this way, clients can correlate specific work that they
submitted to specific GPU timing information.

NOTE: Some backends not implemented, yet. They will always have 0 for frame number.
The ones which are implemented are:
 * OpenGL
 * Vulkan
 * D3D 9,11,12
 * Noop
2022-09-18 19:09:48 -07:00
Sandy
85910e9778 Add BGR versions of 16 bit formats (#2897)
* pixelformats: Add BGRA4

* pixelformats: Add BGR5A1

* pixelformats: Add B5G6R5

* make idl
2022-08-25 16:08:06 -07:00
Sandy
536c4cdbf5 Texture format info: Invert R and B in R5G6B5 (#2886)
d3d9: Do software conversion to take advantage of B5G6R5.
d3d11: Do software conversion to take advantage of B5G6R5.
gl: Set internal representation to swap R and B.
metal: Swizzle R and B and remove software conversion.
2022-08-23 06:46:56 -07:00
Sandy
c334d7c8f1 metal: Fix BGR to RGB swizzle (#2879) 2022-08-22 19:42:19 -07:00
Sandy
054a9ecd83 Texture format info: Invert R and B in RGBA4 (#2878)
* texture format info: Invert R and B in RGBA4

d3d9: Revert 06c08adc9e to force software
      conversion because the format doesn't exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert 3e3e655262 to swizzle R and B
mtl: Swizzle channels

* metal: Remove explicit conversion of RGBA4 and RGB5A1 in osx

* metal: Set alpha bit to correct end of short
2022-08-22 19:03:22 -07:00
Sandy
58aeeaf155 texture format info: Invert R and B in RGB5A1 (#2876)
d3d9: Revert 76db2ed38d to force software
      conversion and use the format that does exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert b36aa71403 to swizzle R and B
mtl: Swizzle R and B
2022-08-22 17:36:50 -07:00
Бранимир Караџић
b5e7a4cccd MTL: Added texture format component mapping from PR #2869. 2022-08-20 09:31:53 -07:00
luzpaz
e7936efa6a Fix typos (#2839)
Found via `codespell -q 3 -S ./3rdparty,*.ttf -L attribut,ba,clude,conly,indext,inout,lod,nclude,retur,struc,unknwn,utput`
2022-07-12 14:21:31 -07:00
Бранимир Караџић
a153458735 Cleanup. 2022-06-20 05:58:22 -07:00
Бранимир Караџић
b8fdc3f8be Cleanup. 2022-04-25 21:13:29 -07:00
Kitchen
35c27cda3d Metal merge texture format (#2785)
* need check texture format is support read/write

* move read write check to s_textureFormat

* add check BGFX_CAPS_IMAGE_RW

* remove custom read write mask as MTLReadWriteTextureTier

* remove ReadWriteTierMask struct
2022-04-25 19:21:20 -07:00
Бранимир Караџић
ed5e2694dc Cleanup. 2022-04-25 07:19:18 -07:00
Kitchen
f76b678bef support Metal renderer to auto generate mipmap for render target (#2784)
* support render target auto generate mipmap

* move autoGenMipmap check to s_textureFormat table
2022-04-25 07:11:14 -07:00
Kitchen
33dd76eab5 fix metal renderer set image bug (#2779)
* fix metal renderer set image type bug

* add Binding::Image access check

* move s_accessNames outside of scope
2022-04-22 06:56:35 -07:00
Kitchen
2568ce7311 fix image is not set in pipeline state object in metal renderer (#2780)
* always set pipeline state object 'm_bindingTypes' when argument is texture

* fix the typo error casue cash
2022-04-21 20:11:37 -07:00
Kitchen
e42fe374c3 fix only msaa depth texutre in frame buffer error on iOS platform (#2725) 2022-02-09 06:29:14 -08:00