Commit Graph

442 Commits

Author SHA1 Message Date
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 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 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
pezcode
e8d4b3dcce Fixes for multiple windows and example 22 (#2483) 2021-04-19 15:30:03 -07:00
Christophe Dehais
2433b598e7 Fix BGFX_STATE_FRONT_CCW flag being ignored in DX12 and VK (#2438) 2021-04-01 08:47:45 -07:00
pezcode
f983367d75 Vulkan synchronization fixes (#2386)
* Fix out of bounds index for unknown device types

* Vulkan: Insert barrier before image host reads

* Vulkan: Make commands wait for the wait semaphore

Making commands wait at BOTTOM_OF_PIPE is a no-op, resulting in instant execution

* Vulkan: Insert barrier between views/dispatches instead of waiting on the host

* Vulkan: Fix determination of access flag from image layout

This fixes two write-after-write races with copy commands after a layout transition to VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL

* Add BGFX_MAX_FRAME_LATENCY define

Affected backends either used a magic value of 3 or defined their own XX_MAX_FRAMES_IN_FLIGHT to be 3

* Vulkan: Include indirect draw in pipeline barrier

* Vulkan: honor init.resolution.numBackBuffers for swapchain size

* Make max frame latency configurable at compile time
2021-02-11 20:29:52 -08:00
Бранимир Караџић
af49c5d264 Happy New Year! 2021-01-14 15:53:49 -08:00
Branimir Karadžić
5c304dad3b Fixed issue #2330. Added support for 32-bit indices in transient index buffer. 2020-12-15 19:01:25 -08:00
Бранимир Караџић
796acfa98b Added Attachment.numLayers needed for viewport layer array support. 2020-12-12 10:04:14 -08:00
pezcode
09c11bca29 Mip + blit fixes (#2281)
* D3D12: Fix readback for non-zero mip

* Fix blit with non-zero mip

This required clamping the blit extents to the mip size, which is moved out of the renderers now

* Assert formatting
2020-10-09 15:32:50 -07:00
pezcode
3142be44a5 D3D12: Fix readback src pitch calculation (#2278) 2020-10-08 16:47:29 -07:00
Бранимир Караџић
e878147cf9 Added version info to debug stats. 2020-10-05 19:45:22 -07:00
kingscallop
436b7fab9e Adds UAV support for D3D12, Vulkan and reworked for OpenGL, D3D11 (#2119)
* Adds UAV support for D3D12, Vulkan and reworked support for OpenGL, D3D11

UAV support is now uniform across compute and draw.
To set a UAV you just use bgfx::setImage() and IMAGE2D in the shader, just like in compute.
Due to these changes shaders will have to be recompiled.

The changes include:
	- D3D11 requires patching of the UAV slot number (which is now done by modifying the DXBC instead of using a macro)
	- If the DXBC binary includes a debug chunk, that is also patched to match the new slot number
	- All the other renderers don't need any kind of patching
	- There are some shader annotations to better convert the UAV format used in hlsl to spirv

Possibility of further enhancements:
	- bgfx::setViewFrameBuffer() only supports binding to a framebuffer or, using BGFX_INVALID_HANDLE, to bind the default backbuffer. This doesn't allow for the case where there is no need to bind to either one of them, for example when using a fragment shader only to read and write to an UAV.

* Bump shader version, because they need to be recompiled.
2020-10-04 21:51:41 -07:00
Julian Xhokaxhiu
2c38e090d2 Various Vulkan/Direct3D 12 enhancements (#2246)
* [VK] Add RT MSAA support

* [VK] Add GenerateMips support

* [VK] Add Screenshot feature

* [D3D12] Add MSAA RT support

* [VK] Fix blit operation on MSAA RT textures

* [D3D12] Fix blit operation on MSAA RT textures
2020-10-04 14:21:12 -07:00