~bl4ckb0ne/wxrc

099c570f8d245df62d49a55915db7634dd929188 — Simon Zeni 6 months ago 537278f master
display: disable cube layer
3 files changed, 18 insertions(+), 7 deletions(-)

M src/display.c
M src/display.h
M src/openxr.c
M src/display.c => src/display.c +12 -4
@@ 340,6 340,7 @@ load_skybox(struct wxrc_layer_cube *layer)
	return true;
}

/* TODO: cube layer in monado
static bool
init_cube_layer(struct wxrc_display *display)
{


@@ 348,7 349,7 @@ init_cube_layer(struct wxrc_display *display)
	struct wxrc_server *server = display->server;
	struct wxrc_layer_cube *layer = &display->cube;

	/* TODO use values from HMD view size? */
	// TODO use values from HMD view size?
	uint32_t width = 2048, height = 2048;

	XrSwapchainCreateInfo info = {


@@ 413,6 414,7 @@ init_cube_layer(struct wxrc_display *display)

	return true;
}
*/

struct wxrc_display *
wxrc_display_create(struct wxrc_server *server)


@@ 503,11 505,13 @@ wxrc_display_create(struct wxrc_server *server)
		return NULL;
	}

/* TODO: cube layer in monado
	if (!init_cube_layer(display)) {
		wlr_log(WLR_ERROR, "failed to create cube layer");
		wxrc_display_destroy(display);
		return NULL;
	}
*/

	return display;
}


@@ 548,6 552,7 @@ wxrc_display_destroy(struct wxrc_display *display)
	free(cylinder->fbos);
	finish_swapchain(&cylinder->swapchain);

/* TODO: cube layer in monado
	struct wxrc_layer_cube *cube = &display->cube;
	wxrc_xr_view_v1_destroy(cube->xr_view);
	glDeleteTextures(1, &cube->skybox_tex);


@@ 555,6 560,7 @@ wxrc_display_destroy(struct wxrc_display *display)
	glDeleteFramebuffers(cube->swapchain.nimages, cube->fbos);
	free(cube->fbos);
	finish_swapchain(&cube->swapchain);
*/

	free(display);
}


@@ 827,6 833,7 @@ wxrc_display_render_cylinder(struct wxrc_display *display,
	return true;
}

/*
bool
wxrc_display_render_cube(struct wxrc_display *display,
		XrCompositionLayerCubeKHR *layer)


@@ 847,7 854,7 @@ wxrc_display_render_cube(struct wxrc_display *display,
	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, cube->fbos[index]);
	glViewport(0, 0, swapchain->width, swapchain->height);

	/* TODO read from config */
	// TODO read from config
	glClearColor(0.08f, 0.07f, 0.16f, 1.f);
	glClear(GL_COLOR_BUFFER_BIT);



@@ 869,7 876,7 @@ wxrc_display_render_cube(struct wxrc_display *display,
		}
	}

	/*
	*
	struct timespec now = {0};
	wxrc_xr_time_to_ts(server->instance, server->display_time, &now);



@@ 878,7 885,7 @@ wxrc_display_render_cube(struct wxrc_display *display,
			&server->xr_surfaces[XR_SHELL_V1_SURFACE_SKYBOX], link) {
		wxrc_render_xr_surface_skybox(server, surface, cube->xr_view, &now);
	}
	*/
	*

	glBindFramebuffer(GL_FRAMEBUFFER, 0);



@@ 914,3 921,4 @@ wxrc_display_render_cube(struct wxrc_display *display,
	TracyCZoneEnd(tctx);
	return true;
}
*/

M src/display.h => src/display.h +2 -1
@@ 96,7 96,8 @@ bool wxrc_display_render_cylinder(struct wxrc_display *display,
/**
 * TODO
 */
/* TODO: cube layer in monado
bool wxrc_display_render_cube(struct wxrc_display *display,
	XrCompositionLayerCubeKHR *layer);

*/
#endif

M src/openxr.c => src/openxr.c +4 -2
@@ 1,4 1,4 @@
#define _GNU_SOURCE
#define _GNU_SOURCE // for pthread_setname_np

#include "display.h"
#include "input.h"


@@ 36,7 36,7 @@ get_exts(uint32_t *len)
{
	char *required[] = {
		XR_KHR_COMPOSITION_LAYER_CYLINDER_EXTENSION_NAME,
		XR_KHR_COMPOSITION_LAYER_CUBE_EXTENSION_NAME,
		//XR_KHR_COMPOSITION_LAYER_CUBE_EXTENSION_NAME,
		XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME,
		XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME,
		XR_MNDX_EGL_ENABLE_EXTENSION_NAME,


@@ 797,11 797,13 @@ xr_frame(struct wxrc_server *server)
	uint32_t nlayers = 0;
	const XrCompositionLayerBaseHeader* layers[XR_MIN_COMPOSITION_LAYERS_SUPPORTED] = {0};

/* TODO cube layer in monado
	XrCompositionLayerCubeKHR cube = {0};
	if (wxrc_display_render_cube(display, &cube)) {
		layers[nlayers++] =
			(const XrCompositionLayerBaseHeader* const) &cube;
	}
*/

	XrCompositionLayerProjection projection = {0};
	if (wxrc_display_render_projection(display, &projection)) {