Commit graph

149 commits

Author SHA1 Message Date
Jakob Bornecrantz 2b996f30c4 xrt: Reflow after column change 2021-01-15 13:50:32 +00:00
Lubosz Sarnecki b005f4e2fa comp/vk: Guard VkCommandBuffer usage with command pool mutex.
Lock all queue submits with 2 mutexes using a new vk_locked_submit
function.
2021-01-13 12:42:26 +01:00
Lubosz Sarnecki c97404e873 comp/vk_client: Improve error messages.
As we use u_logging here, new lines are redundant. Also showing the
VkError code is handy.
2021-01-13 12:33:15 +01:00
Lubosz Sarnecki cc44816026 comp/vk: Put queue mutex around vkDeviceWaitIdle calls. 2021-01-13 12:33:15 +01:00
Lubosz Sarnecki 9a9d46b85a comp/vk: Lock our only VkQueue with a mutex.
This resolved mutlithreading issues as seen in the `multithreading` test
of the OpenXR CTS.

This patch fixes the test on Vulkan Android and resolves Vulkan
validation errors when running on Linux with OpenGL.
2021-01-13 12:33:15 +01:00
Jakob Bornecrantz eea8036e91 c/client: Ensure that EGL_ANDROID_native_fence_sync 2021-01-11 16:50:02 +00:00
Jakob Bornecrantz 15320d9ebe c/client: Insert fence and give sync handle on layer_commit (EGL for now only) 2020-12-28 15:22:46 +00:00
Jakob Bornecrantz 1302b07d68 xrt: Add sync_handle argument to layer_commit 2020-12-28 15:22:06 +00:00
Lubosz Sarnecki 4acab28f3f c/client: Port printfs to static u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki ba1d966f9f aux/vk: Port to u_logging.
Fix log calls where no valid state struct was provided.
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki dc45a201db c+ipc+st: Complete equirect1 boilerplate. 2020-12-14 18:59:28 +00:00
Lubosz Sarnecki f334b8b6c7 src: Consistently append 2 to equirect2 code.
Rename XRT_FEATURE_OPENXR_LAYER_EQUIRECT to XRT_FEATURE_OPENXR_LAYER_EQUIRECT2.
Rename equirect to equirect2.
Rename shader files.
2020-12-14 18:59:28 +00:00
Ryan Pavlik 5ea9fe04a3 comp: Add comments near Vulkan extension lists about updating docs. 2020-12-06 23:07:05 +00:00
Ryan Pavlik 69a33c642d comp/client: Clean up Vulkan extension list, and add Windows extensions. 2020-11-23 14:18:20 -06:00
Jakob Bornecrantz e0a7df0f1d st/oxr: Make sure to restore old EGL display/context/drawables when creating a EGL compositor 2020-11-15 22:47:42 +00:00
Benjamin Saunders 15a89005ca Fix trailing space in xrGetVulkanDeviceExtensionsKHR
Also tweak the instance extensions definition for consistency.
2020-11-07 12:50:25 -08:00
Lubosz Sarnecki a8c7ac2074 c/eglimage_swapchain: Actually return created swapchain. 2020-10-28 12:12:31 -05:00
Lubosz Sarnecki af4c6a8ba3 c/gl_client: Check if swapchain is not NULL. 2020-10-28 12:12:31 -05:00
Lubosz Sarnecki bd107095fd c/gl_client: Port to u_logging. 2020-10-28 12:12:31 -05:00
Lubosz Sarnecki 3cc8793d7d aux+comp: Add Android hardware buffer device extension. 2020-10-28 12:12:31 -05:00
Jakob Bornecrantz 309037a445 c/client: The client compositors doesn't own the native compositor 2020-10-04 13:04:52 +01:00
Ryan Pavlik dae3ab3a4f xrt: Be sure to include config headers 2020-09-18 13:56:24 +01:00
Jakob Bornecrantz 1496262564 xrt: Constify compositor interface 2020-08-26 15:25:00 +01:00
Jakob Bornecrantz 16b9dc13e2 xrt: Correct assert for ipc data type 2020-08-25 14:55:43 +01:00
Jakob Bornecrantz cd6a237b4a c/client: Add support for depth projection 2020-08-25 14:55:43 +01:00
Christoph Haag a9193b0e89 st/oxr: Pass through depth layer to compositor
The compositor does not make use of this layer yet.
2020-08-24 10:30:23 +02:00
Christoph Haag 092dddc2da comp: Support Vk and GL depth and depth stencil formats
For now add only the depth formats mandated by OpenGL to maximize the
chances of the Vulkan driver supporting a reasonable set of usage flags
for the formats.
2020-08-24 10:18:12 +02:00
Jakob Bornecrantz fba9f2532c c/client: Fix warning and tidy 2020-08-21 18:17:12 +01:00
Ryan Pavlik 640f24438d comp/client: Clean up commented-out code. 2020-08-19 16:06:30 -05:00
Ryan Pavlik c49ccd7b46 comp/client: Improve EGLimage-based swapchain 2020-08-19 16:06:30 -05:00
Ryan Pavlik 3250617dcb comp/client: Use new texture target utility for OpenGL 2020-08-19 16:06:30 -05:00
Ryan Pavlik 521de8ecfd comp: Add a URL for sample Android EGL code. 2020-08-19 11:01:49 -05:00
Jakob Bornecrantz 1292173b5e c/client: Add support for cube, cylinder and equirect layers 2020-08-14 19:15:02 +00:00
Ryan Pavlik bf37b9d999 comp: Use u_logging in some EGL code. 2020-08-13 17:34:05 -05:00
Ryan Pavlik ab4ceee720 comp: Save/restore the correct texture binding on Android 2020-08-13 17:34:05 -05:00
Ryan Pavlik f9a613a349 comp: Fix compile-time conditionals 2020-08-13 17:34:05 -05:00
Ryan Pavlik c5d1dec60c comp: Move GLAD loading and extension checking to places with more information.
They will be sure to load the right combination.
2020-08-13 17:34:05 -05:00
Ryan Pavlik 9087d1c7a9 xrt: Use our generic graphics buffer typedefs all over.
This adds some Android support in composition clients,
and fixes the breakage from 2 commits ago.

Thanks to Jakob for finding my error in an earlier version.
2020-08-13 17:34:05 -05:00
Ryan Pavlik fc73ba0401 comp: Split OpenGL[ES] swapchain types 2020-08-13 17:34:05 -05:00
Ryan Pavlik 475192ec73 xrt: Rename "fd" references to "handle"
This breaks some Android pieces, which will be fixed shortly.
2020-08-12 17:11:42 -05:00
Jakob Bornecrantz ca786df18c xrt: Make xrt_swapchain_create_info argument const 2020-08-07 19:15:18 +01:00
Christoph Haag e48c748a57 xrt: suggest correct GPU in xrGetVulkanGraphicsDevice()
As before, on the service side the GPU index the compositor runs on can be selected with
* XRT_COMPOSITOR_FORCE_GPU_INDEX=INDEX1

By default xrGetVulkanGraphicsDevice() will suggest the same GPU the compositor runs on.

It is also possible to override the GPU index suggested to applications with
* XRT_COMPOSITOR_FORCE_CLIENT_GPU_INDEX=INDEX2

The reason this is both done on the service side is that if compositor and client run
on different GPUs, the swapchains use linear tiling instead of optimal tiling.

To make chosen GPUs comparable across the compositor's and the client's vulkan instance,
VkPhysicalDeviceIDProperties.deviceUUID is used.
2020-08-07 17:01:13 +02:00
Jakob Bornecrantz d1d841e7c3 xrt: Use new info struct for compositor formats 2020-08-06 15:14:49 +00:00
Ryan Pavlik d8ad620bd2 xrt: Update GLAD again, to a "merged" distribution.
This merges the OpenGL and OpenGL-ES code.
2020-08-05 20:50:00 +00:00
Jakob Bornecrantz b93017911e xrt: Make xrt_compositor::create_swapchain return xrt_result_t 2020-07-20 13:50:01 +00:00
Jakob Bornecrantz a8a4e80746 vk: Use xrt_swapchain_create_info in vk_create_image_from_native 2020-07-20 13:50:01 +00:00
Jakob Bornecrantz 0d05eb6cae xrt: Make some fields on xrt_gl_swapchain private 2020-07-20 13:50:01 +00:00
Jakob Bornecrantz 34843c3ffe xrt: Make some fields on xrt_vk_swapchain private 2020-07-20 13:50:01 +00:00
Ryan Pavlik 6f56d91c05 xrt: Add separate build config for OpenGL ES 2020-07-17 15:17:42 -05:00
Ryan Pavlik ebf1b01d48 comp: Improve OpenGL extension checking 2020-07-17 13:53:39 -05:00
Ryan Pavlik cb69223532 aux: Move responsibility for clearing image FD to the helper. 2020-07-17 11:46:22 -05:00
Christoph Haag 4ec6f46717 comp/gl: hack: glFlush() before committing a layer
This works around corruption in layers on several drivers caused by
writes to the OpenGL textures not having finished when used by the
compositor.

This should be properly fixed with external semaphores later.
2020-07-17 17:11:35 +02:00
Ryan Pavlik 54f56716fd xrt: Rename references to compositor/swapchain/image_fd to ..._native.
Reflecting that the native buffer isn't an FD on all platforms.
2020-07-15 09:11:58 -05:00
Benjamin Saunders 1c78dd0246 c/client: Slightly improve barriers, taken from !360
Transplanted by Jakob, all the hard spec reading done by Ben.
2020-07-14 17:25:28 +01:00
Jakob Bornecrantz 8ee7086ea6 xrt: Introduce xrt_swapchain_create_info 2020-07-04 11:04:07 +00:00
Jakob Bornecrantz bf086f8be2 c/client: Add two new linear formats to OpenGL 2020-06-25 19:55:08 +00:00
Pete Black bd5aa24463 xrt: Add multi client and overlay client support 2020-06-25 15:48:34 +01:00
Jakob Bornecrantz a26fa7bbdc c/client: Tidy whitespace 2020-06-25 12:58:22 +01:00
Jakob Bornecrantz b75f4f844b xrt: Add frame_id to compositor frame calls 2020-06-23 21:31:00 +01:00
Jakob Bornecrantz d778c236fe c/client: A working but non-spec conforming way to get Vulkan clients working 2020-06-16 16:33:04 +01:00
Ryan Pavlik 7446dc08d5 xrt: Rename output parameter of acquire_image to out_image.
As is tradition.
2020-06-09 15:56:26 -05:00
Ryan Pavlik e0e5aeceda xrt: name xrt_swapchain pointers consistently "xsc" or similar.
As is tradition.
2020-06-09 15:29:46 -05:00
Jakob Bornecrantz 55e026245a xrt: Use new xrt_layer_data in layer functions 2020-06-09 19:04:48 +00:00
Christoph Haag cc9b415a8f xrt: Add xrt_result_t return type to many functions
Many functions returned void and were assumed to always succeed, and some functions
returned only a bool to indicate vague success/failure.

Now that these functions get piped over IPC all of them have to be able to indicate
an IPC failure like for example an unreachable service.

With the xrt_result_t return type they now have the opportunity to report various
types of failures.
2020-06-05 16:06:32 +02:00
Jakob Bornecrantz 077087bb15 xrt: Introduce xrt_comp_fd_destroy to avoid some error prone casting 2020-06-04 16:37:06 +00:00
Ryan Pavlik 4ee0ad7767 comp/client: Decrease visibility of downcast helpers. 2020-06-03 16:28:36 -05:00
Ryan Pavlik cc609f5fb7 comp/client: Use helper functions, comment. 2020-06-03 16:28:36 -05:00
Ryan Pavlik bc6cc85e7d xrt: Improve doxygen documentation. 2020-06-03 16:28:18 -05:00
Jakob Bornecrantz 5b0085f1c1 c/client: Mark consumed FDs as invalid 2020-06-02 13:02:04 +01:00
Lubosz Sarnecki 9c8d0ae3cc xrt: Pass the flip y on layer per layer basis.
st/oxr: Adopt to flip y in layers change.
c/client: Adapt to flip y in layers change.
Set true for GL and false for Vulkan.
2020-05-26 11:33:58 +01:00
Jakob Bornecrantz e36e457560 c/client: Add full support for new layer interface 2020-05-26 11:33:58 +01:00
Ryan Pavlik 457d411016 comp: Remaining 32-bit warning fixes 2020-04-29 17:47:32 -05:00
Ryan Pavlik 128abac9e8 comp: Codespell fixes. 2020-04-24 15:30:46 -05:00
Pete Black ccb1b911f6 c/client: Get the supported formats from the fd compositor 2020-04-22 22:00:13 +01:00
Pete Black 80d1d29cb5 comp: Tidy and spell check 2020-04-09 14:50:35 +01:00
Jakob Bornecrantz 6fe02588f9 comp: Get num_images from the fd compositor 2020-04-08 15:20:36 +01:00
Ryan Pavlik f3eac87504 xrt: Correct usage of XRT_MAYBE_UNUSED on functions.
It shouldn't be used on a function marked "static inline" - that's
sufficient to avoid the warning. So, it should almost never be in
a header.
2020-03-04 11:15:35 +00:00
Ryan Pavlik ffa5a76cea comp/client: More 32-bit porting fixes 2020-03-03 10:33:14 +00:00
Jakob Bornecrantz a925af90e7 xrt: Do not pass in timestate into compositor 2020-03-02 20:18:49 +00:00
Jakob Bornecrantz 8c06787d93 comp: Refactor documentation 2020-03-02 12:00:22 +00:00
Jakob Bornecrantz b308facf90 comp: Move all glue code into client folder 2020-03-02 12:00:22 +00:00
Jakob Bornecrantz 09aa8794b2 aux/vk: Refactor out helper code into own library 2020-03-02 11:58:40 +00:00
Ryan Pavlik e35c87d59e comp: Fix glXGetProcAddress prototype when building as C++ 2020-01-16 22:37:43 +00:00
Ryan Pavlik 9668437c78 comp: Rename comp_xlib_client to indicate it's also GL related 2019-12-07 18:25:37 +00:00
Simon Ser 9347ecfe00
xrt: check arraySize==1 when using OpenGL ES 2
Only OpenGL ES 3 supports GL_TEXTURE_2D_ARRAY.
2019-11-18 15:16:16 +01:00
Simon Ser 81cace0250
comp: replace glCreateTextures with glGenTextures+glBindTexture
glCreateTextures is only available on OpenGL 4.5. It's not supported on
OpenGL ES.
2019-11-18 15:16:16 +01:00
Jakob Bornecrantz b5ee4f0dbd comp: Make it obvious that you should implement destroy yourself 2019-10-30 11:06:02 +00:00
Jakob Bornecrantz e327d56bf4 aux/ogl: Introduce a single small OpenGL library 2019-10-09 17:07:23 +01:00
Jakob Bornecrantz 042d30c590 comp: Fix warnings 2019-08-17 10:34:12 +01:00
Ryan Pavlik 2aca9821fa comp: Clang-tidy 2019-08-16 17:20:01 -05:00
Nova King 2d016b3385 xrt: Added support for XR Swapchain flags 2019-08-16 22:06:28 +00:00
Ryan Pavlik edfa0323a3 comp: Use U_ZERO 2019-06-18 14:14:01 -05:00
Benjamin Saunders 74165d7e0e comp: Support sRGB swapchain under OpenGL 2019-05-04 13:25:24 -07:00
Benjamin Saunders 13cef1b8b9 comp: Support rendering individual array layers 2019-05-01 17:45:43 -07:00
Benjamin Saunders b6f2013bc5 st/oxr: Frame end uses the most recently released image 2019-05-01 17:45:43 -07:00
Benjamin Saunders f6b8cb25b8 comp: Respect swapchain array size 2019-05-01 17:45:43 -07:00
Lubosz Sarnecki bbf484f51e comp: Free client command pool.
As pointed out by Vulkan validation on the client intance.
2019-03-29 11:00:57 +01:00
Ryan Pavlik f7d990c7e3 xrt: Use U_TYPED_CALLOC 2019-03-22 13:47:51 -05:00
Jakob Bornecrantz 15a97422ba xrt: Add all of Monado 2019-03-18 05:52:32 +00:00