mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-19 13:18:32 +00:00
st/oxr: Less obvious warning fixes
Co-authored-by: Jakob Bornecrantz <jakob@collabora.com>
This commit is contained in:
parent
ae16cb4f13
commit
a97b9a5990
|
@ -220,8 +220,11 @@ oxr_swapchain_common_acquire(struct oxr_logger *log, struct oxr_swapchain *sc, u
|
||||||
XrResult
|
XrResult
|
||||||
oxr_swapchain_common_wait(struct oxr_logger *log, struct oxr_swapchain *sc, XrDuration timeout)
|
oxr_swapchain_common_wait(struct oxr_logger *log, struct oxr_swapchain *sc, XrDuration timeout)
|
||||||
{
|
{
|
||||||
uint32_t index;
|
uint32_t index = UINT32_MAX;
|
||||||
u_index_fifo_pop(&sc->acquired.fifo, &index);
|
if (u_index_fifo_pop(&sc->acquired.fifo, &index) != 0) {
|
||||||
|
return oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "u_index_fifo_pop: failed!");
|
||||||
|
}
|
||||||
|
assert(index < INT32_MAX);
|
||||||
|
|
||||||
struct xrt_swapchain *xsc = (struct xrt_swapchain *)sc->swapchain;
|
struct xrt_swapchain *xsc = (struct xrt_swapchain *)sc->swapchain;
|
||||||
|
|
||||||
|
@ -230,7 +233,7 @@ oxr_swapchain_common_wait(struct oxr_logger *log, struct oxr_swapchain *sc, XrDu
|
||||||
|
|
||||||
// The app can only wait on one image.
|
// The app can only wait on one image.
|
||||||
sc->inflight.yes = true;
|
sc->inflight.yes = true;
|
||||||
sc->inflight.index = index;
|
sc->inflight.index = (int)index;
|
||||||
sc->images[index].state = OXR_IMAGE_STATE_WAITED;
|
sc->images[index].state = OXR_IMAGE_STATE_WAITED;
|
||||||
|
|
||||||
return XR_SUCCESS;
|
return XR_SUCCESS;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "oxr_logger.h"
|
#include "oxr_logger.h"
|
||||||
#include "oxr_swapchain_common.h"
|
#include "oxr_swapchain_common.h"
|
||||||
#include "oxr_xret.h"
|
#include "oxr_xret.h"
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#define WAIT_IN_ACQUIRE (true)
|
#define WAIT_IN_ACQUIRE (true)
|
||||||
|
|
||||||
|
@ -59,8 +60,11 @@ vk_implicit_wait_image(struct oxr_logger *log, struct oxr_swapchain *sc, const X
|
||||||
{
|
{
|
||||||
CHECK_OXR_RET(oxr_swapchain_verify_wait_state(log, sc));
|
CHECK_OXR_RET(oxr_swapchain_verify_wait_state(log, sc));
|
||||||
|
|
||||||
uint32_t index;
|
uint32_t index = UINT32_MAX;
|
||||||
u_index_fifo_pop(&sc->acquired.fifo, &index);
|
if (u_index_fifo_pop(&sc->acquired.fifo, &index) != 0) {
|
||||||
|
return oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "u_index_fifo_pop: failed!");
|
||||||
|
}
|
||||||
|
assert(index < INT32_MAX);
|
||||||
|
|
||||||
struct xrt_swapchain *xsc = (struct xrt_swapchain *)sc->swapchain;
|
struct xrt_swapchain *xsc = (struct xrt_swapchain *)sc->swapchain;
|
||||||
|
|
||||||
|
@ -74,7 +78,7 @@ vk_implicit_wait_image(struct oxr_logger *log, struct oxr_swapchain *sc, const X
|
||||||
|
|
||||||
// The app can only wait on one image.
|
// The app can only wait on one image.
|
||||||
sc->inflight.yes = true;
|
sc->inflight.yes = true;
|
||||||
sc->inflight.index = index;
|
sc->inflight.index = (int)index;
|
||||||
sc->images[index].state = OXR_IMAGE_STATE_WAITED;
|
sc->images[index].state = OXR_IMAGE_STATE_WAITED;
|
||||||
|
|
||||||
return XR_SUCCESS;
|
return XR_SUCCESS;
|
||||||
|
|
Loading…
Reference in a new issue