Update glad command to include GLX 1.3 and regenerate.
This will be useful to implement proper OpenGL context saving,
switching, and restoring.
reuse: Add glad/glx.h
Previously, xrt_device_get_tracked_pose was called with
XRT_INPUT_GENERIC_HEAD_POSE when getting the pose of a SIMPLE_CONTROLLER device.
When using the 'remote' driver, this lead to two warnings per frame [1] and more
importantly the device pose wasn't being read. I haven't tested this with any
other drivers, but it appears that at least the QUERTY driver likely has an
issue with this too, as it uses the input name to determine whether to return
the HMD or controller pose.
[1] ERROR [r_device_get_tracked_pose] Unknown input name
Fixes in particular the space transform submitted in composition layers
in local reference space.
Consider a pose given with a pose offset to an XrSpace as its origin.
To construct the Pose in global space, simply add up XrSpace pose in
global space, XrSpace pose offset and the given pose.
Given pose with a
pose offset to XrSpace as origin
/|\ /|\
/ |
/ |
XrSpace pose offset |
/|\ |
| |
| |
XrSpace pose |
in global space |
/|\ |
\ |
\ |
Global Space origin
Fixes CTS on nvidia.
Example code given by the driver devs in the nvidia forums was
VkBool32 dedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE) ||
(memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
However on GTX 1080, nvidia 470.103 with
./conformance_cli "Timed Pipelined Frame Submission" -G Vulkan2
we are to create a VkImage with
DEBUG [create_image] create_image: Use dedicated allocation: 0 (preferred: 0, required: 0)
doing so causes the VkFence wait in vk_submit_cmd_buffer to fail randomly with
either VK_TIMEOUT or VK_ERROR_DEVICE_LOST.
On AMD radv we are told to use dedicated allocation:
DEBUG [create_image] create_image: Use dedicated allocation: 1 (preferred: 1, required: 1)
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.
Only the camera tracking config writes and uses the version field.
Unfortunately the tracking override config is written into the same json
object while not making use of the version field.
* Adds support for querying the device's currently set display refresh rate to
be used for android driver on creation. Allowing for devices which support
selecting other refresh rate modes beyond 60hz.
* Changes hardcoded sensor polling rate to now match refresh queried from the
device.
If the last returned display time shifts backwards slightly with respect to the
last sampled display time from the compositor, the next predicted display time
will not move forward by one frame. Adding half the display period to the
comparison makes the pacing robust to this case.
If we click button to enable DisplayOverOtherApps for monado, use
back button to com back to Launcher and hot-start monado app, the
disabled status fragment is not removed, and enabled status fraqgment is
added top on disabled status fragment, that causes text overlap.
This CL will use FragmentTransaction#replace instead of
FragmentTransaction#add to ensure there is only one
DisplayOverOtherAppsStatusFragment, and new status will replace old
status without any overlap.
Signed-off-by: utzcoz <utzcoz@outlook.com>
- Add CMakeUserPresets.json to .gitignore
- Fix DASSERTs warning for release builds
- Do not use one euro filter with invalid poses
- Other NFC style changes
A previous change didn't really ignore the return value of fread() and
a warning was still emitted:
-----------------------------------------------------------------------
[103/1571] Building C object src/xrt/drivers/CMakeFiles/drv_ns.dir/north_star/ns_hmd.c.o
../src/xrt/drivers/north_star/ns_hmd.c: In function ‘ns_config_load’:
../src/xrt/drivers/north_star/ns_hmd.c:512:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
512 | (void)fread(json, 1, file_size, config_file);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------
Check the return value of fread to fix the warning for good, and declare
the return value of ftell as long as stated in the man page.
Add some missing returns pointed out by -Wreturn-type:
-----------------------------------------------------------------------
[75/1571] Building C object src/xrt/auxiliary/CMakeFiles/aux_util.dir/util/u_config_json.c.o
.../src/xrt/auxiliary/util/u_config_json.c: In function ‘u_gui_state_scene_to_string’:
.../src/xrt/auxiliary/util/u_config_json.c:524:1: warning: control reaches end of non-void function [-Wreturn-type]
524 | }
| ^
-----------------------------------------------------------------------
On some systems fread() is declared with attribute warn_unused_result
and this results in a build warning:
-----------------------------------------------------------------------
Building C object src/xrt/drivers/CMakeFiles/drv_ns.dir/north_star/ns_hmd.c.o
.../src/xrt/drivers/north_star/ns_hmd.c: In function ‘ns_config_load’:
.../src/xrt/drivers/north_star/ns_hmd.c:512:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
512 | fread(json, 1, file_size, config_file);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------
Explicitly ignore the return value of that fread() to silence the
warning.
And while at it also close config_file in some error paths between
fopen() and fclose() which where leaking the file pointer when jumping
to the parse_error label.
Newer wayland protocols have a new filed in xdg_toplevel_listener which
is not initialized:
-----------------------------------------------------------------------
[215/315] Building C object src/xrt/compositor/CMakeFiles/comp_main.dir/main/comp_window_wayland.c.o
.../src/xrt/compositor/main/comp_window_wayland.c:182:1: warning: missing field 'configure_bounds' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
-----------------------------------------------------------------------
Detect the version when this is needed and initialize the field to
silence the warning.
Some variables are only used in asserts, so they may be unused
depending on the build type:
-----------------------------------------------------------------------
[68/315] Building C object src/xrt/auxiliary/CMakeFiles/aux_util.dir/util/u_sink_combiner.c.o
.../src/xrt/auxiliary/util/u_sink_combiner.c:188:11: warning: unused variable 'diff_ns' [-Wunused-variable]
int64_t diff_ns = frames[0]->timestamp - frames[1]->timestamp;
^
1 warning generated.
[205/315] Building C object src/xrt/compositor/CMakeFiles/comp_main.dir/main/comp_renderer.c.o
.../src/xrt/compositor/main/comp_renderer.c:872:17: warning: unused variable 'layer_count' [-Wunused-variable]
const uint32_t layer_count = c->base.slot.layer_count;
^
1 warning generated.
-----------------------------------------------------------------------
Mark them as XRT_MAYBE_UNUSED to fix the build warnings.
Add some missing returns pointed out by -Wreturn-type:
-----------------------------------------------------------------------
[32/315] Building C object src/xrt/auxiliary/CMakeFiles/aux_gstreamer.dir/gstreamer/gst_sink.c.o
.../src/xrt/auxiliary/gstreamer/gst_sink.c:53:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
1 warning generated.
[84/315] Building C object src/xrt/auxiliary/CMakeFiles/aux_vk.dir/vk/vk_compositor_flags.c.o
.../src/xrt/auxiliary/vk/vk_compositor_flags.c:117:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
.../src/xrt/auxiliary/vk/vk_compositor_flags.c:146:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
2 warnings generated.
-----------------------------------------------------------------------
For the function returning VkImageAspectFlags return a literal 0 because
the enum values VK_IMAGE_ASPECT_NONE or VK_IMAGE_ASPECT_NONE_KHR may not
always be defined.
The size field in comp_buffer was never assigned, and also never used as
all comp_buffer users rely on the allocation_size field.
Use the size field to store the size originally requested when creating
the buffer which could be different from the value returned in the
allocation_size field.
Having both sizes available allows a user to check if allocation_size is
in fact different from the requested size.
The dy name was kept. It can now be thought of as "[d]erivative of [y]"
instead of the previous "change of y". Also, the beta parameters of the
one-euro users were adjusted by approximately multiplying them by 0.016
to compensate.
This is mainly to avoid problems with filters that calculate
their dt from previous calls. In particular the one euro filter fix
that gets implemented in the next commit would crash because of dt=0.
The overrides didn't do anything unless Monado was compiled for
in-process, and even then the device might return a differnt fov.
The todo was for a driver and shouldn't be in the state tracker.
This also fixes two errors:
* VK_IMAGE_USAGE_SAMPLED_BIT was not always added to depth formats.
* VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT was added to image
views for sampling, where the spec only allows one of them.
Usually renderdoc captures frames by hooking the present functions to
recognize when an application is finished rendering a frame.
OpenXR applications might not present to a window. Therefore use the
renderdoc API to capture application frames between xrBeginFrame and
and xrEndFrame.
This allows renderdoc to capture application frames without the need
to modify the application.