Commit graph

746 commits

Author SHA1 Message Date
Ryan Pavlik d5bed66734 c/render: Docs improvements 2022-05-17 14:42:02 -05:00
Ryan Pavlik 7af6a78e54 c/client: doc and naming convention improvements 2022-05-17 14:42:02 -05:00
Ryan Pavlik 8cb26df99d c/multi: Name some threads 2022-05-17 12:39:44 -05:00
Ryan Pavlik e33a9b3481 c/main: Name some threads 2022-05-17 12:39:44 -05:00
Ryan Pavlik e123a50438 comp/multi: Name the multi-system-compositor thread. 2022-05-17 12:39:44 -05:00
Jakob Bornecrantz 0201274764 c/render: Drop s from interface file for consistant naming 2022-05-15 18:04:45 +01:00
Jakob Bornecrantz ccfe8c8de0 c/main: Fix doxygen ref 2022-05-11 10:08:03 +01:00
Christoph Haag 71c7ec2382 c/main: Add thread waiting for vblank events
Co-authored-by: Christoph Haag <christoph.haag@collabora.com>
Co-authored-by: Jakob Bornecrantz <jakob@collabora.com>
2022-05-10 11:22:51 +01:00
Jakob Bornecrantz c6b0089c51 xrt: Pass external_[fence|semaphore]_fd status in 2022-05-09 14:01:20 +00:00
Jakob Bornecrantz 989c4334a3 c/client: Pass external_[fence|semaphore]_fd status in 2022-05-09 14:01:20 +00:00
Jakob Bornecrantz c8de67ad94 c/main: Make VK_KHR_external_[fence|semaphore]_fd optional 2022-05-09 14:01:20 +00:00
Jakob Bornecrantz cd018c98f8 c/main: Work around clang-format (NFC) 2022-05-09 14:01:20 +00:00
Jakob Bornecrantz fd35f6668a c/util: Print device info as well 2022-05-09 14:01:20 +00:00
Jakob Bornecrantz e092a3687b a/vk: Pass external_[fence|samaphore]_fd status to vk_init_from_given 2022-05-09 14:01:20 +00:00
Christoph Haag 2064fd8721 c/main: zero initialize xrt_system_compositor_info
Fixes valgrind warning

==354193== Thread 39:
==354193== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
==354193==    at 0xC0A146D: sendmsg (in /usr/lib/libc.so.6)
==354193==    by 0x18527D: ipc_send (src/xrt/ipc/shared/ipc_utils.c:65)
==354193==    by 0x157771: ipc_dispatch (ipc_server_generated.c:165)
==354193==    by 0x15C88D: client_loop (src/xrt/ipc/server/ipc_server_per_client_thread.c:112)
==354193==    by 0x15C60C: ipc_server_client_thread (src/xrt/ipc/server/ipc_server_per_client_thread.c:183)
==354193==    by 0xC01A5C1: start_thread (in /usr/lib/libc.so.6)
==354193==    by 0xC09F583: clone (in /usr/lib/libc.so.6)
==354193==  Address 0xc0866afc is on thread 39's stack
==354193==  in frame #2, created by ipc_dispatch (ipc_server_generated.c:23)
==354193==  Uninitialised value was created by a stack allocation
==354193==    at 0x15F830: xrt_gfx_provider_create_system (src/xrt/compositor/main/comp_compositor.c:1118)
2022-05-09 15:53:25 +02:00
Jakob Bornecrantz a24551b24b c/main: Refactor image count selection 2022-05-09 10:57:05 +00:00
Jakob Bornecrantz 9b8fe97ba9 c/main: Remove pre-declared function declarations
Split in two commits to improve git diff for previous commit.
2022-05-09 10:57:05 +00:00
Jakob Bornecrantz c052b856cf c/main: Refactor comp_target_swapchain to not pre-declare any internal functions 2022-05-09 10:57:05 +00:00
Jakob Bornecrantz 41cb0bc2e3 c/main: Whitespace in comp_target_swapchain 2022-05-09 10:57:05 +00:00
Jakob Bornecrantz 35e7a7c6ff c/main: Fix copy typo 2022-05-09 10:57:05 +00:00
Jakob Bornecrantz 8cf120a6f2 c/render: Fix comment (NFC) 2022-05-08 10:09:07 +01:00
Jakob Bornecrantz d2f2a06e91 c/render: Use query pool to measure GPU time 2022-05-08 10:09:07 +01:00
Jakob Bornecrantz 6d02d67f78 c/main: Ask for VK_EXT_calibrated_timestamps if available 2022-05-08 10:09:07 +01:00
Jakob Bornecrantz c4f0e17e88 c/main: Setting logging level when checking vulkan caps 2022-05-08 10:09:07 +01:00
Christoph Haag 611a0f644d c/main: Use at least 3 vk images for comp target swapchain if supported 2022-05-08 10:09:07 +01:00
Ryan Pavlik dd6b0debd0 c/main: Populate LUID in xrt_system_compositor_info 2022-05-06 00:26:34 +01:00
Jakob Bornecrantz 38f68dc104 xrt: Use xrt_luid_t for deviceLUID 2022-05-04 15:11:24 +00:00
Jakob Bornecrantz 45ba6ff1b1 c/client: Add support for xrt_swapchain_create_properties 2022-05-04 15:51:34 +01:00
Jakob Bornecrantz f78f334473 c/multi: Add support for xrt_swapchain_create_properties 2022-05-04 15:50:20 +01:00
Jakob Bornecrantz dd1da49aa5 c/base: Add support for xrt_swapchain_create_properties 2022-05-04 15:50:00 +01:00
Ryan Pavlik 49c45bf16a c/main: Store LUID 2022-05-03 22:34:47 +01:00
Ryan Pavlik 63fdadae3f c/util: Query GPU LUID when possible 2022-05-03 22:33:57 +01:00
Jakob Bornecrantz 96fbb1e59a c/client: Print the EGL return when failing to set context 2022-05-03 15:20:19 +00:00
Jakob Bornecrantz a98c589a30 c/client: Fix conversion warning 2022-05-02 17:16:04 +01:00
Jakob Bornecrantz 065c1c4ee2 c/render: Fix conversion warnings
c/render: Fix conversion warnings
2022-05-02 17:16:04 +01:00
Jakob Bornecrantz e39648bab1 c/multi: Fix conversion warnings 2022-05-02 17:16:04 +01:00
Jakob Bornecrantz 32d563d26c c/main: Fix conversion warnings
c/main: Fix conversion warnings
2022-05-02 17:16:04 +01:00
Jakob Bornecrantz 91facd10f1 xrt: Add xrt_uuid_t 2022-05-02 17:16:04 +01:00
Jakob Bornecrantz c6208482b8 c/util: Avoid using sprintf 2022-05-02 17:16:04 +01:00
Jakob Bornecrantz 175ff58f10 build: Remove meson files 2022-04-28 21:36:25 +00:00
Jakob Bornecrantz bc89a23280 c/client: Use helper function to see if timeline semaphore is avaiable 2022-04-28 10:55:55 +01:00
Jakob Bornecrantz 3aa4fdb096 a/vk: Add function to print device features 2022-04-24 11:10:03 +01:00
Jakob Bornecrantz 7b82b63896 c/render: Remove unused timewarp shader 2022-04-18 18:48:54 +01:00
Jakob Bornecrantz 95d5343c9a c/render: Make distortion shader optionally do timewarp 2022-04-18 18:48:54 +01:00
Jakob Bornecrantz 0be36ccc9d c/render: Use shader specialisation to set distortion_texel_count 2022-04-18 18:48:54 +01:00
Jakob Bornecrantz 7ba7f43e83 a/vk: Add specialization_info argument to vk_create_compute_pipeline 2022-04-18 18:48:54 +01:00
Ryan Pavlik 5dcb5c360c comp: Fix warnings on MSVC 2022-04-18 10:53:02 -05:00
Ryan Pavlik 11e0d7ed76 comp: Fix comment typo 2022-04-18 10:52:45 -05:00
Jakob Bornecrantz 8ed5a082be c/render: Add missing comments to timewarp shader 2022-04-18 13:03:32 +01:00
Jakob Bornecrantz 1999891a19 c/render: Use a Vulkan projection matrix with Y down in projection space 2022-04-18 13:03:32 +01:00
Jakob Bornecrantz e561bec87d c/render: Use specialization constant for distortion size
This would allow Vulkan shader specialization to be used to change
the size and runtime instead of having to recompile.
2022-04-18 13:03:32 +01:00
Jakob Bornecrantz 87ea035416 c/render: Document compute distortion shader sampling code 2022-04-18 13:03:32 +01:00
Jakob Bornecrantz f4d3c8a93f c/render: Correctly calculate uv to tan angle offset values 2022-04-18 13:03:32 +01:00
Jakob Bornecrantz f20031ec99 c/render: Correctly convert shader index to target pixel uv 2022-04-18 13:03:32 +01:00
Jakob Bornecrantz ca33ac434c c/render: Correctly scale uv for compute distortion 2022-04-17 15:26:51 +00:00
Christoph Haag 7ebd11e1d4 comp/render: Add VkExternalMemoryBufferCreateInfo
Fixes validation error when calling render_buffer_init_exportable

VUID-vkBindBufferMemory-memory-02726(ERROR / SPEC): msgNum: -168767885 - Validation Error: [ VUID-vkBindBufferMemory-memory-02726 ] Object 0: handle = 0xe88693000000000c, type = VK_OBJECT_TYPE_BUFFER; Object 1: handle = 0xcad092000000000d, type = VK_OBJECT_TYPE_DEVICE_MEMORY; | MessageID = 0xf5f0ce73 | vkBindBufferMemory(): The VkDeviceMemory (VkDeviceMemory 0xcad092000000000d[]) has an external handleType of VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT which does not include at least one handle from VkBuffer (VkBuffer 0xe88693000000000c[]) handleType Unhandled VkExternalMemoryHandleTypeFlagBits. The Vulkan spec states: If the value of VkExportMemoryAllocateInfo::handleTypes used to allocate memory is not 0, it must include at least one of the handles set in VkExternalMemoryBufferCreateInfo::handleTypes when buffer was created (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkBindBufferMemory-memory-02726)
    Objects: 2
        [0] 0xe88693000000000c, type: 9, name: NULL
        [1] 0xcad092000000000d, type: 8, name: NULL
2022-04-15 01:27:38 +02:00
Ryan Pavlik 3e6ec47296 monado: Apply clang-tidy fixes to most of the codebase.
All at least visually inspected, some revised from the auto-fixit
2022-04-13 09:34:54 -05:00
Ryan Pavlik 0ae0316400 cmake: Format build files 2022-04-13 01:11:13 +01:00
Ryan Pavlik f769ff8977 comp/main: Manual fixes to clang-tidy issues 2022-04-13 01:10:46 +01:00
Ryan Pavlik 71580213aa comp/client: Fix doxygen warnings 2022-04-12 23:06:11 +00:00
Ryan Pavlik b999b326dc comp/render: Silence warning 2022-04-12 23:06:11 +00:00
Ryan Pavlik fe7cf853e9 comp/render: Guard gcc pragmas 2022-04-12 23:06:11 +00:00
Jakob Bornecrantz b26a602322 c/main: Fix copy-typo 2022-04-08 20:15:00 +01:00
Jakob Bornecrantz 42df7b7b21 c/main: Lock cmd pool mutex when reading back frames 2022-04-08 19:30:06 +01:00
Jakob Bornecrantz 400c3900f0 c/render: Take the pool lock to fix threading errors 2022-04-08 19:20:33 +01:00
Jakob Bornecrantz 0ee1127431 aux/vk: Rename barrier functions and introduce new variant 2022-04-08 19:17:41 +01:00
Jakob Bornecrantz 6e13a0a21b aux/vk: Use correct aspect for image barrier 2022-04-08 17:34:30 +00:00
Jakob Bornecrantz 0d152381a8 c/client: Move NOOP begin/end to EGL client 2022-04-08 11:32:40 +01:00
Jakob Bornecrantz 46debec4fd c/client: Use begin and end in layer commit 2022-04-08 11:21:06 +01:00
Jakob Bornecrantz 7996457f3e c/client: Tidy 2022-04-08 11:21:06 +01:00
Christoph Haag cb7855b8bd c/client: Ensure the correct GL context is current
when running OpenGL functions.

Co-authored-by: James Hogan <james@albanarts.com>
Co-authored-by: Jakob Bornecrantz <jakob@collabora.com>
2022-04-07 20:17:29 +02:00
Ryan Pavlik 16c016c4ca comp/render: Use a helper 2022-04-05 22:48:24 +00:00
Jakob Bornecrantz 48fd3e626c c/client: Tidy VK compositor 2022-04-05 23:22:26 +01:00
Jakob Bornecrantz 3bff3827d9 c/client: Remove acquire_release_fence completely
The barriers are a completely GPU affair no need to syncronize with the host.
2022-04-05 23:22:26 +01:00
Jakob Bornecrantz e7713bf1e4 c/multi: Be slightly smarter about late frames 2022-04-05 23:22:26 +01:00
Jakob Bornecrantz cf413a445f c/multi: Add per client thread that waits for sync objects 2022-04-05 23:22:26 +01:00
Jakob Bornecrantz 47649f56b6 u/pacing: Track when the app wants the frame to be displayed 2022-04-05 22:01:17 +00:00
Jakob Bornecrantz 8e8a0b38c6 u/pacing: Add gpu done time tracking to app pacer 2022-04-05 22:01:17 +00:00
Jakob Bornecrantz cfb8d36b46 c/render: Rename files 2022-04-05 22:45:45 +01:00
Jakob Bornecrantz ee09070608 c/render: Rename all functions and structs with new prefix 2022-04-05 22:45:12 +01:00
Jakob Bornecrantz d93c2dc4d8 c/render: Remove unused comp_rendering_compute_data 2022-04-05 22:45:12 +01:00
Jakob Bornecrantz 2f24353556 c/render: Remove main/comp_compositor include 2022-04-05 22:45:10 +01:00
Jakob Bornecrantz aaa2d4e8e6 aux/vk: Move compositor image format list here 2022-04-01 19:44:07 +01:00
Jakob Bornecrantz dea7bc847e c/util: Make COMP_VULKAN_FORMATS differentiate between depth-stencil, depth and stencil formats 2022-04-01 18:53:47 +01:00
Christoph Haag 5aa7ef25b8 c/util: Remove old format checking code
It's not the compositors job to check the format.
2022-04-01 18:53:47 +01:00
Christoph Haag 322ce27163 c/util: Print warning when attempting to create protected content swapchain 2022-04-01 18:53:47 +01:00
Jakob Bornecrantz 4f0b425da7 c/client: Tidy error messages in GL compositor 2022-03-31 01:14:04 +01:00
Jakob Bornecrantz d53659a476 c/client: Add a littel bit of tracing to GL compositor 2022-03-31 01:09:25 +01:00
Jakob Bornecrantz 38e7a0a1e6 c/client: Format format list 2022-03-31 00:45:51 +01:00
Jakob Bornecrantz 4fe8e89be9 c/client: Add new formats to GL 2022-03-31 00:43:53 +01:00
Jakob Bornecrantz 4f1dfa7ae4 aux/vk: Refactor out some printing functions 2022-03-30 20:14:38 +01:00
Jakob Bornecrantz 922fdff62d c/main: Use new format checking helpers 2022-03-29 16:26:34 +01:00
Jakob Bornecrantz c3eb8cd014 c/util: s/colour/color/g 2022-03-29 16:26:34 +01:00
Jakob Bornecrantz 08e025522f c/util: Add missing AHardwareBuffer formats 2022-03-29 16:26:34 +01:00
Jakob Bornecrantz 658c67b0fc c/util: Add vulkan format checking code 2022-03-29 16:26:34 +01:00
Jakob Bornecrantz 8cfe941c01 aux/vk: Rename vk_[color_]format_string 2022-03-29 16:26:34 +01:00
Antonio Ospite 28b53689f4 c/render: add comp_buffer_init_exportable helper to create exportable buffers
Some downstream user might want to use the very handy comp_buffer_init()
helper to create buffers, but the latter does not cover the case when
the buffer needs to be exportable for API interoperability.

Add a new comp_buffer_init_exportable() helper to cover that case, this
is done in a way that is not particularly invasive for existing users of
comp_buffer_init(), as all the logic about the exportability is handled
by the new function.
2022-03-23 21:38:22 +00:00
Jakob Bornecrantz 074a0afc32 c/vk: Make it possible to request higher Vulkan version 2022-03-22 15:19:48 +00:00
Jakob Bornecrantz 8d660b6994 cmake: Make it possible to select SPIR-V version to target 2022-03-22 15:19:48 +00:00
Jakob Bornecrantz 170fe0e5d9 aux/vk: Refactor out semaphore and native creation into a helper 2022-03-19 00:41:29 +00:00