Commit Graph

201 Commits

Author SHA1 Message Date
Бранимир Караџић
ab03a8ae60 Cleanup. 2020-11-30 22:14:05 -08:00
Бранимир Караџић
6425f3be51 Cleanup. 2020-11-30 21:12:02 -08:00
Бранимир Караџић
c1f7bf1b7f VK: Fixed memory corruption. 2020-11-30 21:11:20 -08:00
Бранимир Караџић
925cee63c0 Cleanup. 2020-11-01 21:28:42 -08:00
Бранимир Караџић
fa97a50df0 VK: GPU timer stub. 2020-10-19 19:30:39 -07:00
Бранимир Караџић
eaddeb98fa Cleanup. 2020-10-11 20:55:01 -07:00
pheonix
13bbf02a67 Vulkan API version auto selector (#2283)
* [vulkan] Vulkan API auto-selection for latest available.
- Selects for the maximum vulkan API version available on the host's vulkan driver for a created instance.
- Stores the created instance's vulkan API version on RendererContextVK.
- Created instance's vulkan API version dumped using BX_TRACE in MAJOR.MINOR.PATCH format.
- Physical Device's vulkan API version dumped in MAJOR.MINOR.PATCH format.

* Address code review notes.
- Actually use `vkEnumerateInstanceVersion` if it exists.
- Remove "bgfx supported" vulkan api static array.
2020-10-11 20:38:57 -07: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
2829df055c Vulkan: Add texture readback (#2280)
* Vulkan: Add texture readback support

* Vulkan: Simplify screenshot code
2020-10-09 13:05:44 -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
Бранимир Караџић
32aa281147 Cleanup. 2020-10-04 15:01:05 -07:00
Branimir Karadžić
082b71676c Cleanup. 2020-10-04 14:23:33 -07:00
Бранимир Караџић
a1d12fe7f3 Cleanup. 2020-10-04 14:23:00 -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
Бранимир Караџић
d1685a366a Fixed build. 2020-09-03 23:45:20 -07:00
Бранимир Караџић
f20fd61e4f Revert "[ VK/DX12] Bring setScissor on par with the other renderers (#2239)"
This reverts commit fbd7e9efd6.
2020-08-22 09:10:49 -07:00
Julian Xhokaxhiu
fbd7e9efd6 [ VK/DX12] Bring setScissor on par with the other renderers (#2239) 2020-08-22 09:09:11 -07:00
kingscallop
b297b48e88 Vulkan validation fixes (#2205)
When resizing the window, there's a race condition between the
validation of vkCreateSwapchainKHR's arguments and the actual
size of the window.
This ignores the validation warning when vkCreateSwapchainKHR succeeds.

On some graphic drivers vkAcquireNextImage and vkQueuePresentKHR
may return VK_SUBOPTIMAL_KHR. This is being handled as an error, which
leads to those frames being unnecessarily skipped.
2020-08-16 21:08:32 -07:00
Бранимир Караџић
486fdecbcc Cleanup. 2020-07-24 14:55:03 -07:00
kingscallop
ff9f624b9b Improves handling of window resizes on vulkan (avoids crashes) (#2123)
* Improves handling of window resizes on vulkan (avoids crashes)

* Change to previous commit as requested.
Rebased and added refresh swapchain check inside updateResolution(),
similar to renderer_d3d12.cpp.
2020-07-18 13:41:35 -07:00
kingscallop
6093250a3b Fix crash on window minimize on vulkan renderer (#2204)
On some platforms (Windows) the framebuffer size becomes 0x0 when
the window is minimized. This leads to a validation error and
subsequently crashes.

This change correctly cleans up semaphores and the swapchain.
2020-07-18 11:42:53 -07:00
Бранимир Караџић
4f3d1875e6 Cleanup. 2020-07-17 19:59:43 -07:00
Бранимир Караџић
5b05c6c09e Cleanup. 2020-06-24 17:57:35 -07:00
Бранимир Караџић
54e4b60055 Cleanup. 2020-06-20 14:05:18 -07:00
Бранимир Караџић
7f333698cc Cleanup. 2020-06-20 13:20:20 -07:00
Бранимир Караџић
d86c16213e Cleanup. 2020-06-18 21:20:01 -07:00
Бранимир Караџић
2cbcb6ea90 RRenamed BX_CHECK to BX_ASSERT. 2020-06-16 10:06:18 -07:00
Бранимир Караџић
05dcebb53a Removed useless check. 2020-06-06 09:13:56 -07:00
Бранимир Караџић
10dfece7ec VK: Fixed caps. 2020-06-03 20:38:34 -07:00
Бранимир Караџић
0ca67d5940 VK: Detect maxTextureLayers. 2020-06-03 19:04:15 -07:00
Бранимир Караџић
3f5a38380c Removed VK_LAYER_RENDERDOC_Capture https://github.com/baldurk/renderdoc/issues/1392#issuecomment-495894791. 2020-05-31 17:04:29 -07:00
Бранимир Караџић
1329731f3c Cleanup. 2020-05-31 13:26:16 -07:00
Бранимир Караџић
52f728b253 Updated vulkan headers. 2020-05-15 23:36:29 -07:00
Hugo Amnov
b62302631e Add Webgpu backend (#2132)
* WebGPU first draft (shaderc bin version 8)

* WebGPU scripts
2020-05-08 08:53:53 -07:00
Hugo Amnov
6601a4a6f7 Fix Vulkan texture update/upload (#2130) 2020-05-03 14:22:20 -07:00
Hugo Amnov
b48b084d25 Vulkan cleanup for Webgpu (#2127)
* Harmonize and simplify Vulkan SPIRV bindings mappings

* Handle Vulkan V-flip properly

* Update Embedded shaders
2020-05-03 13:54:30 -07:00
Hugo Amnov
f9b1a9f5d4 Vulkan cleanup and minor bug fixes (#2129) 2020-05-03 13:27:31 -07:00
kingscallop
55a0427f93 Don't bind descriptorSetLayout if not present on program (#2124) 2020-05-01 09:39:30 -07:00
kingscallop
d619783769 Reworked vulkan layers and extensions support (#2117)
Better support for enabling and disabling vulkan instance layers and instance extensions and vulkan device layers and device extensions.
2020-05-01 07:39:21 -07:00
kingscallop
cb113a95fb Fix the missing clear of the depth buffer handle (#2122) 2020-04-26 20:32:27 -07:00
kingscallop
845f8692a5 Fix vulkan validation warning about alignment (#2121) 2020-04-26 20:32:10 -07:00
kingscallop
09c02f999d Fixed small typo (#2120) 2020-04-26 20:30:45 -07:00
Бранимир Караџић
36ec2a462d Removed alignment macros, and added functions instead. 2020-04-19 18:23:04 -07:00
Pablo Escobar
eeb5fe7c02 Don't double-quote profiler literals 2020-04-03 21:56:54 +00:00
Pablo Escobar
c08d451493 Formatting 2020-04-03 21:56:54 +00:00
Pablo Escobar
08360a338a Vulkan: streamline debug labels (+ color) 2020-04-03 21:56:54 +00:00
Pablo Escobar
be626359f9 Fix #2071 again 2020-03-29 16:16:33 +00:00
Pablo Escobar
1c9e6e6bb6 Fix #2071, #1950 2020-03-28 16:35:41 +00:00
Pablo Escobar
1f5ca837de Vulkan: fall back to deprecated validation layers if necessary 2020-03-27 04:35:19 +00:00