Commit Graph

672 Commits

Author SHA1 Message Date
Martijn Courteaux
1109f3c5bf
Vulkan: improve staging data performance by using scratch buffers per frame. (#3295)
* Vulkan: improve staging data performance by using scratch buffers per frame.

* vulkan: Add alignment parameter to request scratch space.

* Align staging buffers to texel block size.

* Fix scratch buffer allocation bug.

* Fix some non-deterministic behavior found by Valgrind. Paranoid printing.

* Remove debugging printing

* Fix alignment of converted formats.

* Remove forgotten debug print.
2024-06-21 07:32:00 -07:00
Бранимир Караџић
2ad67a4dfd Cleanup. 2024-03-29 16:36:55 -07:00
pheonix
0b049d4897
Use bx::bit_cast where appropriate for type punning, applying packed struct for arrays when necessary (#3212) 2024-02-24 15:47:04 -08:00
Branimir Karadžić
98d88d9fc6 Fixed draw indirect. 2024-02-09 20:55:44 -08:00
Бранимир Караџић
b927f9e187 Use 32-bit arguments for indirect draw APIs. 2024-01-26 20:18:24 -08:00
Бранимир Караџић
83dfadf673 Happy New Year! 2024-01-14 01:56:36 -08:00
Raziel Alphadios
f4a9bfc4bc
Fix D3D12 debug crash due to validation layers SDK bug (#3222)
* Fix D3D12 debug crash due to validation layers SDK bug

* Change LONG to FARPROC to be technically correct

* Make requested changes:
Move windows version checking to function in bgfx.cpp
Change windowsVersionIs to also use this technique
Use bgfx code style
Specify dwOSVersionInfoSize prior to calling rtlGetVersion

* Merge both functions into one
Use bx::dlsym instead of GetProcAddress directly
Fix major & minor comparison logic

* Fix win10 version comment

* Revert rendererCreate check back to Win 0x0602

* Clean up logic as per suggestion
2023-12-13 19:20:07 -08:00
Jamil Halabi
f91c6faaf2
Fixed calcNumMips for non-power-of-2 texture dimensions (#3219) 2023-12-11 07:39:02 -08:00
Бранимир Караџић
2d17b36a61 Cleanup. 2023-11-23 09:42:25 -08:00
Бранимир Караџић
cf440e29f3 Use bx::assertFunction in BGFX_ASSERT. 2023-11-13 20:57:54 -08:00
Бранимир Караџић
49c0e49527
Removed WebGPU. (#3198) 2023-11-09 17:15:22 -08:00
Бранимир Караџић
f14c14a485
Removed D3D9. (#3191) 2023-11-03 21:15:42 -07:00
Бранимир Караџић
fa1897bd1f Added headless validation for bgfx::init and bgfx::reset. 2023-06-23 19:16:32 -07:00
Бранимир Караџић
02e67ff404 Cleanup. 2023-06-13 18:27:31 -07:00
云风
498c34273b
Larger debug text for retina display (#3109)
* Add Init.Resolution.scaleDebug

* clamp scale to BGFX_CONFIG_MAX_SCALE_DEBUG

* update version

* Use textWdith/textHeight in helloworld
2023-06-13 18:17:38 -07:00
Бранимир Караџић
b5471d14f8 Acquire resource API lock when calling bgfx::reset. 2023-06-12 20:10:07 -07:00
Бранимир Караџић
f611d68f72 Fixed validation when creating dynamic index buffer with compute read flag. 2023-05-09 18:14:30 -07:00
Branimir Karadžić
290295136b Added bx::Location, and removed allocator macros. 2023-04-23 19:19:22 -07:00
Бранимир Караџић
466c6a4e95 Happy New Year! 2023-01-14 10:05:12 -08:00
Branimir Karadžić
30176ceab8 Fixed MSVC warning. 2022-12-02 19:19:13 -08:00
Бранимир Караџић
c4d4b90e32 shaderc: Fixed SPIR-V uniform array size reflection. Issue #2964. 2022-10-27 19:43:17 -07:00
Бранимир Караџић
4ec3ab3532 Cleanup. 2022-10-15 07:29:00 -07:00
Бранимир Караџић
8a405a0c73 Improved internal handle. 2022-10-05 21:10:19 -07:00
Бранимир Караџић
e87f08b1e5 Cleanup. 2022-10-01 08:48:57 -07:00
Бранимир Караџић
76923d21d9 Cleanup. 2022-10-01 08:29:58 -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
pezcode
ba467be036
Add support for indirect draw with indirect count (#2925)
* Add indirect draw with indirect count (BGFX_CAPS_DRAW_INDIRECT_COUNT)

* Update bindings

* VK: Add support for BGFX_CAPS_DRAW_INDIRECT_COUNT

* D3D12: Add support for BGFX_CAPS_DRAW_INDIRECT_COUNT

* GL: Add support for BGFX_CAPS_DRAW_INDIRECT_COUNT

* 48-drawindirect: Use BGFX_CAPS_DRAW_INDIRECT_COUNT if available

* 48-drawindirect: Update shaders
2022-09-17 18:16:19 -07:00
云风
8207645355
fix getUniformInfo(), See Issue #2883 (#2885) 2022-08-23 19:53:49 -07:00
Branimir Karadžić
99770c9f43 Overallocate dynamic buffers on resize. 2022-08-19 18:21:11 -07:00
Бранимир Караџић
67f27573b9 Cleanup. 2022-08-19 10:40:00 -07:00
Branimir Karadžić
b35b3fa2a7 Fixed dynamic buffer leak. Issue #2867. 2022-08-19 09:51:23 -07:00
Бранимир Караџић
e34ae05cdf Cleanup. 2022-07-19 10:36:18 -07:00
Бранимир Караџић
9022ffcb64 Add warning when calling RESET with unusupported feature. 2022-07-18 19:25:50 -07:00
bdunkin
f9ab3b5c68
Increase the buffer size if necessary before adding markers (#2838) 2022-07-08 11:46:03 -07:00
Branimir Karadžić
8e7774f735 Fixed build. 2022-05-17 11:30:10 -07:00
Alexander Knorre
7b1d6a98a9
Compute kSortKeyViewNumBits automatically. (#2796)
Compute kSortKeyViewNumBits automatically via log2(BGFX_CONFIG_MAX_VIEWS), so that we could change BGFX_CONFIG_MAX_VIEWS to be above 2^10 = 1024 without changing the `bgfx` source code.
One possible problem with this approach is running out of bits, so maybe we could assert for that, I am not sure where to do it and how many bits we can use though.
Using `bx::uint32_cntlz` because `bx::log2` is not constexpr.
Tested on linux opengl with BGFX_CONFIG_MAX_VIEWS=4096, seems to work.
2022-05-15 19:24:53 -07:00
Бранимир Караџић
36be8a72cc Fixed blit key encoding. 2022-05-14 21:26:20 -07:00
Бранимир Караџић
4581f14cd4 Happy New Year! 2022-01-15 11:59:06 -08:00
Бранимир Караџић
af68e138fe Cleanup. 2021-12-31 09:43:21 -08:00
Бранимир Караџић
99a7af712f Added more info about transparency sort table. 2021-12-26 09:21:02 -08:00
Бранимир Караџић
5fd83e7a41 Added BGFX_TEXTURE_BLIT_DST validation. 2021-11-01 18:27:20 -07:00
Бранимир Караџић
8392a44b3a Fixed assert macros, and improved error handling. 2021-10-25 18:59:32 -07:00
Branimir Karadžić
46384208ad Define WIN32_LEAN_AND_MEAN if it's not defined when including windows.h. 2021-10-13 20:18:03 -07:00
Бранимир Караџић
84a38eede0 Cleanup. 2021-10-13 19:54:27 -07:00
Бранимир Караџић
73db386165 Added uniform name validation. 2021-09-30 17:24:36 -07:00
Gaetan de Villele
89b6c25c4a
fix usage of fatal() function when Clang analyzer is used (#2617) 2021-09-27 19:07:32 -07:00
Бранимир Караџић
227ea05dee Fixed transient vertex buffer when vertex layout allocation fails. 2021-09-16 18:32:58 -07:00
Бранимир Караџић
ee0fbea726 Added AGC renderer stub. 2021-08-24 19:35:09 -07:00
James Fulop
9694171d1b
cleanup (#2545)
spelling: treshold -> threshold
2021-06-23 07:14:11 -07:00
Branimir Karadžić
24f047b078 Fixed VS warnings. 2021-06-06 14:51:39 -07:00