Commit Graph
453 Commits
Author SHA1 Message Date
Branimir Karadžić 98d88d9fc6 Fixed draw indirect. 2024-02-09 20:55:44 -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
Justin Boswell db40a04a08 Minor changes to support Clang on Windows (#3216)
* Minor changes to support Clang on Windows

* Use _MSC_VER instead of BX_PLATFORM_WINDOWS
2023-12-06 17:42:01 -08:00
Бранимир Караџић e9e2e224ee Replaced macros with C++17 attributes. 2023-12-02 20:16:56 -08:00
Бранимир Караџић 67107e5511 Cleanup. 2023-11-09 07:26:23 -08:00
Nacho García 466e87fc0e Fix DX12 backend ignoring Init::PlatformData::context (#3197) 2023-11-08 13:31:34 -08:00
Edu GarciaandБранимир Караџић 13d1f19947 Fix D3D12 VBV reading size (#3194)
* Fix D3D12 VBV reading size

When `stream.m_startVertex` is not 0 we target a position past the start of the buffer, so `BufferLocation + SizeInBytes` will be past the end of the buffer, which the debug layer will complaining about.

With this fix we're only creating a view for the part of the buffer we actually need to access.

* Reordered buffer size calculation.

---------

Co-authored-by: Бранимир Караџић <branimirkaradzic@gmail.com>
2023-11-06 11:15:22 -08:00
Carlos CarrascoandCarlos 6054b49cef fix dx12 dynamic texture array update (#3182)
Co-authored-by: Carlos <carlos@carloscarrasco.com>
2023-10-04 09:03:37 -07:00
Jamil Halabi f059531885 Added a new capability to check for PrimitiveID support (#3154) 2023-08-04 16:42:33 +02:00
Andy Fillebrown 5ae4386bf0 Fix D3D12 clear rect not being passed to frameBuffer.clear (#3113) 2023-06-23 20:12:04 -07:00
Branimir Karadžić cd4f64b643 Issue #3093. 2023-05-05 19:22:44 -07:00
Branimir Karadžić 290295136b Added bx::Location, and removed allocator macros. 2023-04-23 19:19:22 -07:00
HumanBean4 9cc4d85b69 Fixed texture side iterator being too small (#3026) 2023-01-19 07:16:28 -08:00
Бранимир Караџић 466c6a4e95 Happy New Year! 2023-01-14 10:05:12 -08:00
Branimir Karadžić eb7f79c358 D3D12: Fixed setting draw scissor. 2022-12-22 20:21:39 -08:00
Branimir Karadžić 7911b10c07 D3D12: Probe highest version of device. 2022-12-08 18:57:42 -08:00
Branimir Karadžić 6d08be28f7 D3D12: Dump all feature support options. 2022-12-03 09:22:27 -08:00
Бранимир Караџић ab207b67a4 D3D12: Fixed R16U format. #2987 2022-12-01 16:45:55 -08:00
Raziel AlphadiosandRaziel 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
Бранимир Караџић a855f1cf2d Cleanup. 2022-10-07 17:30:27 -07:00
Ciro Mondueri bf411dd393 d3d12: fixes triangle list primitive state change not ackd. after touch call (#2951)
Suppose this is the draw call sequence in a frame:
- triangle strip
- touch (required to apply stencil changes for example)
- triangle list

Touch masks the change (as it's triangle list by default) by setting
changedFlags, but not primIndex. When the triangle list is processed,
the STATE_PT is already set to triangle list, so the test for
changedFlags is skipped and primIndex stays with triangle strip.

The fix detects the change in the STATE_PT and updates primIndex.
2022-10-07 17:28:18 -07:00
Бранимир Караџић 8a405a0c73 Improved internal handle. 2022-10-05 21:10:19 -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
Branimir Karadžić 408988946d Cleanup. 2022-09-16 20:12:31 -07:00
Бранимир Караџић cbbaba4099 Cleanup. 2022-09-16 19:32:41 -07:00
Бранимир Караџић 4c0baf5603 D3D11: Enable compilation on Linux. 2022-09-15 22:13:34 -07:00
Бранимир Караџић 9ad3825cee D3D12: Linux build. 2022-09-14 20:59:59 -07:00
Branimir Karadžić 11ac9f27c7 D3D12: Removed dependency on D3DX12 header. 2022-09-13 22:03:20 -07:00
Branimir Karadžić 358f48879a Updated directx-headers. 2022-09-12 20:19:21 -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
Branimir Karadžić cea9c033fc D3D12: Fixed R5G6B5 format. 2022-08-22 20:14:34 -07:00
Branimir Karadžić 186c95fd29 D3D12: Added texture format component mapping from PR #2869. 2022-08-19 18:50:02 -07:00
Бранимир Караџић 2449610af7 Revert "Resolve texture format correctly on D3D11/D3D12 (#2859)" (#2865)
This reverts commit 8358bf6ecf.
2022-08-17 16:44:30 -07:00
Julian Xhokaxhiu 8358bf6ecf Resolve texture format correctly on D3D11/D3D12 (#2859)
* D3D12: Fix ResolveSubresource texture format parameter

For depth textures this always returned the TYPELESS one, but instead it should have passed the FLOAT.

* D3D11: Fix ResolveSubresource texture format parameter

For depth textures this always returned the TYPELESS one, but instead it should have passed the FLOAT.
2022-08-09 11:37:44 -07:00
Cedric Guillemet bedab93431 Fix D3D12 InputSlot when having streams w/ instances (#2853) 2022-08-03 08:02:03 -07:00
James Fulop d9cdc67993 add missing semicolon (#2751) 2022-03-30 07:26:40 -07:00
Branimir Karadžić da9e2f0400 D3D12: Fixed texture array update. 2022-03-05 16:44:56 -08:00
Бранимир Караџић 4581f14cd4 Happy New Year! 2022-01-15 11:59:06 -08:00
Cedric GuillemetandCedric Guillemet 64a28415a8 Disable Batch indirect mode for Microsoft WARP (#2672)
* Disable Batch indirect mode for Microsoft WARP

* idl

Co-authored-by: Cedric Guillemet <ceguille@microsoft.com>
2021-12-01 11:19:47 -08:00
Branimir Karadžić da8a5ff449 VK: Fixed update surface size when texture is transcoded. 2021-11-11 17:39:41 -08:00
Branimir Karadžić 67d1cce8f8 D3D1x: Fixed update surface size when texture is transcoded. 2021-11-11 15:46:29 -08:00
Бранимир Караџић 5bc3b18227 Cleanup. 2021-10-31 20:51:13 -07:00
Branimir Karadžić 2cfba5474d Fixed windows build. 2021-10-25 19:10:41 -07:00
Бранимир Караџић 9ecd462538 Cleanup. 2021-09-09 09:50:17 -07:00
James Fulop bbc2b76948 Dxgi tearing support (#2601)
* present tearing support

* use existing syncInterval variable
2021-09-09 07:20:01 -07:00
James Fulop 82ed74ddb6 cleanup (#2579)
* cleanup

remove unused macro parameters

* de-macro CASE_IMPLEMENT_UNIFORM in d3d11, d3d12, mtl, vk

* fix whitespace

* remove undef of macro that was deleted

* collapse switch statements
2021-08-14 06:57:30 -07:00
pezcode 2c21f68998 VPRT support for D3D11, D3D12, GL (#2507)
* glsl-optimizer: whitelist ARB_shader_viewport_layer_array_enable

* D3D11: remove duplicate structs and enums

* D3D11: report BGFX_CAPS_VIEWPORT_LAYER_ARRAY

* D3D12: report BGFX_CAPS_VIEWPORT_LAYER_ARRAY

* GL: support for BGFX_CAPS_VIEWPORT_LAYER_ARRAY

* D3D11: multi-layer MSAA resolve

* D3D12: multi-layer MSAA resolve

* D3D12: fix binding multi-layer resolved textures

* GL: fix multi-layer rendertarget creation
2021-05-05 11:58:21 -07:00
Hugo Amnov 24be4a38d0 WebGPU: Add texture format to shaderc (bin version 10) + streamline storage Images in shaders (#2482)
* WebGPU: Add texture format (shaderc bin version 10)

* WebGPU: Simplify storage images + Fix format decorations

* Shaderc: Cleanup Texture name assumption in textures
2021-04-20 20:18:49 -07:00