Commit Graph

321 Commits

Author SHA1 Message Date
twinaphex 39d3dd4b3c Revert vulkan_framebuffer_generate_mips 2020-07-10 11:20:50 +02:00
twinaphex e10f4eed8d (Vulkan) Cleanups 2020-07-09 03:48:42 +02:00
twinaphex e48ffd14cd Cleanups 2020-07-09 00:24:09 +02:00
twinaphex 00518d3470 Add TODO/FIXME notes 2020-07-07 03:02:55 +02:00
Connor McLaughlin 7b7cffd545 (Vulkan) Fix incorrect structure type in vulkan_create_buffer 2020-07-05 22:36:58 +10:00
twinaphex 09180e64b5 Start unifying more macros 2020-07-03 18:00:40 +02:00
twinaphex 276e86a403 (Vulkan) Turn some of these functions into macros 2020-07-03 17:48:46 +02:00
twinaphex 25f682249f (Vulkan) Turn vulkan_image_layout_transition into macro 2020-07-03 08:45:53 +02:00
twinaphex 7a22eb1f44 Turn vulkan_image_layout_transition_levels into macro 2020-07-03 08:32:33 +02:00
twinaphex 570f6ffb87 vulkan_copy_staging_to_dynamic - avoid memset 2020-06-29 00:14:50 +02:00
twinaphex 26969dd4e1 (Vulkan) Avoid callocs and memsets 2020-06-28 23:56:33 +02:00
twinaphex c600fbc6ff Cleanups 2020-06-28 21:33:07 +02:00
twinaphex bc73a815b7 Prevent memsets for vk->tracker 2020-06-28 19:18:48 +02:00
twinaphex 9e65ab63fe (vulkan_common) Prevent memsets and implicit memsets 2020-06-28 18:45:46 +02:00
twinaphex 9684bde88a Cleanup vulkan_create_texture 2020-06-28 18:25:17 +02:00
twinaphex 776e95d4e1 (vulkan_common.c) Cleanups 2020-06-27 18:28:33 +02:00
twinaphex 72d1a313ae (vulkan_common.c) Cleanups 2020-06-27 18:17:33 +02:00
twinaphex d8cf551608 Silence 'suggest braces around initialization of subobject' warning 2020-06-11 17:38:11 +02:00
Themaister f089e1ccf5 Vulkan: Do not emulate mailbox on Android. 2020-06-09 00:24:29 +02:00
Themaister cd4f22c275 Vulkan: Add path which uses WSI acquire semaphores.
Fence wait path has some issues on certain platforms. For now, gate this
on whether the GPU is integrated or not.
2020-06-09 00:24:29 +02:00
Themaister 15df55d011 Vulkan: Refactor swapchain index and frame index.
Do not tie these concepts together, it will not work for upcoming
refactor of swapchain logic.
2020-06-09 00:24:29 +02:00
Themaister 6f68571805 Vulkan: Use VK_LAYER_KHRONOS_validation in VULKAN_DEBUG=1.
LUNARG_standard_validation was deprecated and removed ages ago.
2020-06-09 00:24:28 +02:00
twinaphex fc491e9ea4 Add more environ logs 2020-06-08 17:32:36 +02:00
twinaphex bde18ba86a Style nits 2020-05-12 14:36:27 +02:00
twinaphex cb0c145e3d Cleanups 2020-02-14 12:55:36 +01:00
trioan 0e20be17cc
fix vulkan_framebuffer_generate_mips (msvc2017)
{0} initializer
2020-01-25 21:14:28 -05:00
twinaphex 920e89a506 Move pass set texture to vulkan_common.c 2020-01-22 14:27:24 +01:00
twinaphex 90874b434e (shader_vulkan.cpp) Move more C code to vulkan_common.c 2020-01-22 12:09:08 +01:00
twinaphex f853632260 Move framebuffer generate_mips function to vulkan_common.c 2020-01-22 10:52:20 +01:00
twinaphex e9c73bd9a6 (Vulkan) Move more C code to vulkan_common.c 2020-01-22 10:41:38 +01:00
twinaphex ef27a660a7 (shader vulkan) Cleanups - moving C code out of the C++ file 2020-01-22 10:11:42 +01:00
twinaphex 6c97a7514c (Vulkan) turn superfluous functions in vulkan_common.c into macros
to avoid unnecessary function overhead
2020-01-03 20:20:59 +01:00
Hans-Kristian Arntzen 96723c6f70 Vulkan/Android: Workaround weird WSI return codes in landscape mode.
Android WSI wants you to use preTransform, and if it is not used
correctly, Android 10 will return VK_SUBOPTIMAL_KHR, and we would create
a new swapchain every frame.

This workaround just ignores this error, since it's not really an error.
A more "proper" fix is to use prerotate and modify the MVP matrices,
which might help certain devices with crummy display processors.
2019-12-17 19:08:20 +01:00
Rinnegatamante d1a74e1b96 Fix for crash on Linux. 2019-10-15 09:07:15 +02:00
LazyBumHorse 3c6a46d95d fix handling of vulkan_gpu_list (use after free, not always being initialized) 2019-08-15 17:52:24 +02:00
twinaphex c4c7a1b8cc (Vulkan) Dehardcode application name 2019-07-19 20:12:12 +02:00
twinaphex b04e057b5d Revert "(Win32/Vulkan) Dehardcode more program name strings"
This reverts commit 5cefcb8327.
2019-07-19 19:39:43 +02:00
twinaphex 5cefcb8327 (Win32/Vulkan) Dehardcode more program name strings 2019-07-19 19:27:24 +02:00
stoofin 1b57cf6112 Fall back to libvulkan.so.1 if libvulkan.so isn't present 2019-06-27 14:08:14 -07:00
twinaphex 48eeb15d2c Silence warnings 2019-06-20 01:16:05 +02:00
Brad Parker d01f04c146 d3d10/11/12: add GPU selection 2019-06-18 16:35:50 -04:00
Brad Parker c962da0ddb add video setting to select gpu (currently implemented for vulkan) 2019-06-13 12:47:08 -04:00
twinaphex 17b2019e11 (Vulkan) Fix potential memory leak 2019-05-26 08:18:42 +02:00
Nathan S 775c272029 Menu widgets stuff + vulkan sanity check (#8710)
* task_screenshot: fix hang with menu widgets

* word_wrap: add max_lines parameter

* vulkan: better instance creation sanity check
2019-05-06 21:10:57 +02:00
Huw Pascoe fed06044c4 silence warnings 2019-04-12 17:32:11 +01:00
Brad Parker 10df615d14 add "Send Debug Info" option under Help 2019-03-07 19:17:54 -05:00
orbea 28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08:00
twinaphex 83241ed0b1 Some header cleanups 2019-01-19 23:27:59 +01:00
twinaphex b027395341 (Android/Vulkan) Enable 'emulate mailbox' for Android 2018-12-03 00:40:50 +01:00
Themaister f51ef85f27 Vulkan: Fix scissor in menu driver. 2018-11-08 21:57:53 +01:00
twinaphex 77fba6d58d (Vulkan) Silence warning 2018-10-01 00:41:29 +02:00
twinaphex 2125f92281 Silence warnings/cleanups 2018-09-30 13:43:56 +02:00
twinaphex 4c23fa02e9 (MSVC 2013) Fix build for rcheevos
(MSVC) Fix some warnings; unused variables, etc.
2018-09-30 13:38:58 +02:00
Themaister a1989afba9 Vulkan: Fix race condition in threaded mailbox emulation. 2018-09-10 19:35:13 +02:00
Themaister d338dac277 Only do mailbox emulation for fullscreen.
Too large impact on performance in Windowed mode.
2018-09-08 16:27:25 +02:00
Themaister d39f66a738 Emulate mailbox by wrapping acquire in a thread.
Needed on nVidia Windows since they don't support timeout == 0 ...
2018-09-08 15:56:49 +02:00
Themaister 157d1e7e63 Only use mailbox emulation on AMD. 2018-09-08 11:47:58 +02:00
Themaister 66c4f8fd35 Make sure to always clear out swapchain_fence_signalled. 2018-09-08 11:47:58 +02:00
Themaister 9ebac87638 Vulkan: Emulate mailbox on Windows. 2018-09-08 11:47:58 +02:00
Themaister af534f0fa8 Vulkan maintenance fixes.
- Use VkBuffer instead of linear VkImage for staging uploads.
  Not guaranteed to be supported, and desktop IHVs recommend using
  buffers.

- Fix validation error where swapchain recreation with reuse of the old
  VkSwapchainKHR does not create a fence properly, leading to validation
  error next time that swapchain index is observed.
2018-09-08 11:47:58 +02:00
orbea 260ce526c2 Fix segfaults when starting vulkan without a working vulkan driver.
RetroArch will crash in several places when running vulkan in an
environment that does not have working vulkan drivers.

This should guard against those crashes and allow RetroArch to fail
safely in those cases.
2018-08-24 19:36:03 -07:00
twinaphex 4a54826d9b Remove unused variable 2018-08-16 21:14:56 +02:00
twinaphex a1d5b0fd03 Update MSVC 2012 solution 2018-08-16 20:49:31 +02:00
Hans-Kristian Arntzen 52cb0fe375 Vulkan: Fix crash when we get two create_swapchain errors in a row. 2018-07-04 20:25:03 +02:00
Hans-Kristian Arntzen f1d2dac213 Vulkan: Fix various stability issues with WSI.
Added an ifdef to trigger "hardening" which will return spurious errors
for critical WSI things like acquire next image, queue submit and
surface dimension queries.
2018-07-04 19:45:54 +02:00
Themaister f2cae17021 Vulkan: Try to avoid creating swapchains redundantly.
Win32: Only make resize events when needed.
Do not create swapchain unless necessary.
Deal better with Windows WSI workarounds.
2018-07-01 16:21:09 +02:00
Themaister c4ba8d26a0 Support multiple displays in VK_KHR_display. 2018-07-01 01:21:51 +02:00
Stuart Carnie 411bcf8bdd feat(apple): Metal support for macOS
* includes rgui
* shader support

This is a work-in-progress and there are some bugs and visual artifacts
still to be fixed.
2018-06-20 21:33:45 -07:00
Hans-Kristian Arntzen 16c797f057 Vulkan: Fix two validation errors.
- Mipgen was only transitioning the first miplevel to GENERAL.
  Fix the image barrier helper function to transition all levels and
  layers.

- Validation layer was complaining that a VkSwapchainKHR was not
  properly destroyed. After recycling the swapchain, destroy the old
  one.
2018-06-06 23:23:32 +02:00
Stuart Carnie 0a4ff225be Update Vulkan 2018-05-13 21:35:18 +02:00
twinaphex 72428a23c5 (shader_vulkan.cpp) Move some functions to vulkan_common.c 2018-04-24 07:07:58 +02:00
twinaphex 163be3ccfd (vulkan_common.c) Prevent some more collissions in the future 2018-03-28 17:41:04 +02:00
twinaphex de1efd7878 This hack is no longer needed with latest nvidia windows
drivers (390.77)
2018-01-31 18:10:53 +01:00
twinaphex 2178b6d10f Vulkan temporary workaround for swapchain recycling (nvidia) -
Both swapchain recreation methods are proper andwithin the Vulkan specs.
The differnece is retroarch follows method (apparently proposed in
vulkan samples) that "hopes" the driver will reuse some of the old
swapchain resources, while the other method destroys everything and
recreates from scratch. At the moment on Nvidia drivers the second
method is stable while the first method is unreliable in all cases
today.
2018-01-21 04:40:01 +01:00
gblues 6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
Themaister f8447c4648 Set correct buffer size. 2017-12-09 17:28:20 +01:00
Themaister 75b84b4f94 Support pending swapchain creation. 2017-12-09 17:28:20 +01:00
Themaister ac42b87400 Recreate swapchain directly if vkAcquireNextImageKHR fails. 2017-12-09 17:28:20 +01:00
Themaister 714684a4d3 Don't wait for WSI fence unless it has been signalled. 2017-12-09 17:28:20 +01:00
twinaphex d5b3104cfb Cleanups/warning fixes 2017-12-06 19:51:07 +01:00
Hans-Kristian Arntzen 5c67fc3040 Vulkan: Enable VK_KHR_sampler_mirror_clamp_to_edge extension. 2017-10-01 20:20:45 +02:00
twinaphex 9c32d03c1e (Vulkan/Win32) C89_BUILD fixes 2017-08-12 17:56:30 +02:00
twinaphex 126a5bf121 Use string_is_equal_fast/string_is_not_equal_fast 2017-05-16 04:00:37 +02:00
aliaspider 36137d22e5 Vulkan: use the command buffer provided as parameter in
vulkan_copy_staging_to_dynamic.
2017-05-15 05:35:17 +01:00
twinaphex 05e4ec733e Move uint variables 2017-04-28 21:03:04 +02:00
twinaphex 765e636214 (Vulkan) Cleanups 2017-04-24 17:21:29 +02:00
Hans-Kristian Arntzen 2d88530c98 Vulkan: Simple snow pipeline works.
Some other fixes too.
2017-02-20 20:53:59 +01:00
Hans-Kristian Arntzen 6395907887 Vulkan: Find supported composite alpha in swapchain. 2017-02-13 16:30:02 +01:00
twinaphex 374fd57270 Remove the few performance counters that depend on runloop_ctl 2017-01-25 18:15:58 +01:00
twinaphex 6661c0fb94 Rewrite performance counter stop/start/init into macros 2017-01-25 16:53:06 +01:00
twinaphex 96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
Hans-Kristian Arntzen 4c99809cde Vulkan: Fix VSync toggling on Windows.
Retarded bug, but haven't actually had access to a Windows machine until
now.
2016-12-17 12:06:43 +01:00
twinaphex b43f786f89 Cleanups 2016-09-08 08:15:40 +02:00
twinaphex 467451fccc Cleanup more header includes 2016-09-01 18:18:55 +02:00
twinaphex ba7d638b99 Use string_is_equal 2016-08-29 18:46:41 +02:00
Hans-Kristian Arntzen 96818a297c Vulkan: Fix validation errors with OriginalHistory.
For some reason, OriginalHistory blit happened inside a render pass.
Also add more TRANSFER_SRC_BIT caps to images as they might have to be
copied to history.
2016-08-07 01:09:15 +02:00
Hans-Kristian Arntzen 4ac9ebd579 Vulkan: Allow configuring mip/wrap/filter for LUTs.
LUTs are feature complete with CGP now.
2016-07-31 16:16:47 +02:00
Hans-Kristian Arntzen 0eca956789 Vulkan: Create image views with right amount of mip levels. 2016-07-31 14:01:39 +02:00
Hans-Kristian Arntzen 4e8e79eabd Vulkan: Add mipmapping support. 2016-07-31 13:47:10 +02:00
Hans-Kristian Arntzen 7813d40c9e Log if Vulkan debug layers are enabled. 2016-07-31 12:54:10 +02:00
Hans-Kristian Arntzen f54b0c0ff0 Vulkan: Implement swap_interval > 1.
We have to fake it by duping since Vulkan has no native support for
this.
2016-07-24 00:34:48 +02:00
Hans-Kristian Arntzen 8c1b935969 Vulkan: Implement BFI. 2016-07-24 00:07:32 +02:00
twinaphex 4e68bc0b53 CXX_BUILD fix 2016-07-21 21:54:43 +02:00
Hans-Kristian Arntzen 8569028189 Vulkan: Use manual memory management for cached/incoherent devices. 2016-07-15 16:12:30 +00:00
Hans-Kristian Arntzen f5bddd45e8 Vulkan: Don't query layout if we have optimal tiling. 2016-07-14 23:15:39 +02:00
Hans-Kristian Arntzen d382e1069e Basic VK_KHR_display integration works! :) 2016-07-07 19:28:27 +02:00
Hans-Kristian Arntzen d2fafc5451 Sketch out vulkan_create_display_surface. 2016-07-06 20:27:39 +02:00
Hans-Kristian Arntzen e9046dd06f Begin implementing VK_KHR_display. 2016-07-06 19:37:47 +02:00
twinaphex 9fab75c4b5 Cleanups; 80-char width limit 2016-06-30 07:40:25 +02:00
Hans-Kristian Arntzen c80127d29d Vulkan: Hook up async compute test more properly.
Supports multiple queues and queues from different families.
2016-06-27 20:54:53 +02:00
Hans-Kristian Arntzen 4abb0ef331 Vulkan: Cache destroy device callback. 2016-06-27 20:54:53 +02:00
Hans-Kristian Arntzen 6841b5ad00 Vulkan: Keep dylib around if caching instance. 2016-06-27 20:54:53 +02:00
Hans-Kristian Arntzen 54c1759f45 Vulkan: Make a more general purpose symbol loader.
Avoids painful manual loading and wrapping function pointers everywhere
...

Reusable for cores, so move to libretro-common.
Also update built-in Vulkan headers.
2016-06-26 13:10:58 +02:00
Hans-Kristian Arntzen 1da2e2dbab Vulkan: Hook up negotiation interface device creation. 2016-06-26 10:40:07 +02:00
Hans-Kristian Arntzen 10a6d7a458 Vulkan: Begin hooking up negotiation interface. 2016-06-25 21:01:36 +02:00
Hans-Kristian Arntzen 972a5db7ae Vulkan: Fix shader module leak. 2016-06-25 14:06:14 +02:00
Hans-Kristian Arntzen de36f572d1 Vulkan: Fix more validation issues. 2016-06-25 14:01:10 +02:00
Hans-Kristian Arntzen 07880e3f45 Vulkan: Begin hooking up validation layers.
Found lots of regressions due to bad reformatting.
2016-06-25 13:52:33 +02:00
Hans-Kristian Arntzen d043123f71 Vulkan: Add support for queue transfers in HW rendering. 2016-06-25 11:39:52 +02:00
Hans-Kristian Arntzen 82c7aa0e6f Use max swapchain image setting when creating swapchain. 2016-06-25 09:52:46 +02:00
Hans-Kristian Arntzen 21be54501b Log which present modes are supported. 2016-06-13 22:00:32 +02:00
Hans-Kristian Arntzen e7b4f4fd4d Fix various Android Vulkan issues.
Was getting bogus swapchain width/height causing weird issues.
Also, create swapchain after swap interval is correctly set.
2016-06-13 19:51:44 +02:00
Hans-Kristian Arntzen c374c9853d Some potential fixes for Android Vulkan. 2016-06-07 01:43:14 +02:00
twinaphex 6bd7fd482c Performance counters got function name changes 2016-05-21 13:14:25 +02:00
Twinaphex 72e1a33715 Merge pull request #3016 from Themaister/master
Add perf counter to fence waits.
2016-05-21 12:36:25 +02:00
Hans-Kristian Arntzen 218ecc07c1 Add perf counter to fence waits.
Makes it easy to check if we're GPU bound or not.
2016-05-21 12:13:46 +02:00
twinaphex 0d833c903a Merge remote-tracking branch 'origin/vulkan-windows' 2016-05-16 07:51:01 +02:00
twinaphex fc56f6ebdb Add some HAVE_THREADS ifdefs 2016-05-11 10:10:30 +02:00
Hans-Kristian Arntzen d723411436 De ioctl video_driver. 2016-05-08 14:00:51 +02:00
Hans-Kristian Arntzen 464a4add66 XMB ribbon works in Vulkan. 2016-05-08 11:11:28 +02:00
Hans-Kristian Arntzen e04bbfbae2 Vulkan: Add more logging ... 2016-03-29 17:57:13 +02:00
Hans-Kristian Arntzen c7b96b75b8 Vulkan: Add more error logging. 2016-03-29 17:36:13 +02:00
Hans-Kristian Arntzen 8ade7fb274 Vulkan: Attempt Windows backend support.
Completely bind since I cannot test myself, but compiles.
2016-03-29 15:50:12 +02:00
Hans-Kristian Arntzen ca62f342b0 Vulkan: Fix original history.
Verified to work now.
2016-03-25 18:50:49 +01:00
Hans-Kristian Arntzen 83ab0d799f Vulkan: Begin implementing history and feedback. 2016-03-25 14:51:37 +01:00
Hans-Kristian Arntzen f1a5725f66 Vulkan: Host writes are implicitly flushed on submit.
Use TOP_OF_PIPE/0 access instead to work
around spammy asserts on Anvil.

We still have to invalidate the caches however.
2016-03-21 16:57:04 +01:00
Hans-Kristian Arntzen fa7eeb57b8 Vulkan: Use 1.0.6.
1.0.2 is pre public release version I think ...
2016-03-21 10:03:15 +01:00
Hans-Kristian Arntzen 84923a0465 Vulkan: Tighten up pipeline barrier usage.
Lots of memory barriers used with TOP_OF_PIPE which is not valid.
2016-03-21 10:02:00 +01:00
twinaphex 34958ec39a (Vulkan) Don't use VK_API_VERSION any more 2016-03-20 03:04:52 +01:00
twinaphex f79418459f Ability to compile now with --enable-wayland and --disable-x11
defined
2016-03-09 09:21:07 +01:00
Hans-Kristian Arntzen f02faeea27 Vulkan: Fix segfault on nVidia. 2016-03-06 12:33:46 +01:00
Hans-Kristian Arntzen ebdb7168ed Vulkan: Clean up symbol loading.
Should use GetDeviceProcAddr when appropriate.
2016-03-06 11:27:36 +01:00
twinaphex 7d0205deac (vulkan_common.c) Add log error when vkCreateInstance fails 2016-03-02 03:13:31 +01:00
twinaphex 86a8899b0f (Android) Start preparing Android JNI Makefiles for Android 2016-03-01 18:46:40 +01:00
twinaphex b79edb6095 Reimplement function pointers 2016-03-01 02:21:53 +01:00
twinaphex 9a10ef5591 (Vulkan) Add more Vulkan function pointers 2016-02-29 23:28:12 +01:00
twinaphex 860b7fde62 (Vulkan) Add DeviceWaitIdle function pointer 2016-02-29 23:25:25 +01:00
twinaphex 1d9220d9d1 (Vulkan) Add vkCmdBindVertexBuffers function pointer 2016-02-29 23:22:56 +01:00
twinaphex c8b9bb609f (Vulkan) More image function pointers 2016-02-29 23:19:23 +01:00
twinaphex 30eac5b778 (Vulkan) Add vkDestroyDescriptorPool fp 2016-02-29 23:13:13 +01:00