The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

comp: Get num_images from the fd compositor

+11 -9
+1
doc/changes/compositor/mr.270.md
··· 1 + client: Make sure that the number of images is decided by the fd compositor.
+7 -6
src/xrt/compositor/client/comp_gl_client.c
··· 173 173 uint32_t mip_count) 174 174 { 175 175 struct client_gl_compositor *c = client_gl_compositor(xc); 176 - uint32_t num_images = 3; 177 176 178 177 if (array_size > 1) { 179 178 const char *version_str = (const char *)glGetString(GL_VERSION); ··· 200 199 return NULL; 201 200 } 202 201 202 + 203 203 struct client_gl_swapchain *sc = 204 204 U_TYPED_CALLOC(struct client_gl_swapchain); 205 205 sc->base.base.destroy = client_gl_swapchain_destroy; 206 206 sc->base.base.acquire_image = client_gl_swapchain_acquire_image; 207 207 sc->base.base.wait_image = client_gl_swapchain_wait_image; 208 208 sc->base.base.release_image = client_gl_swapchain_release_image; 209 - sc->base.base.num_images = num_images; 209 + // Fetch the number of images from the fd swapchain. 210 + sc->base.base.num_images = xsc->num_images; 210 211 sc->xscfd = xrt_swapchain_fd(xsc); 211 212 212 213 GLuint prev_texture = 0; ··· 214 215 : GL_TEXTURE_BINDING_2D_ARRAY, 215 216 (GLint *)&prev_texture); 216 217 217 - glGenTextures(num_images, sc->base.images); 218 - for (uint32_t i = 0; i < num_images; i++) { 218 + glGenTextures(xsc->num_images, sc->base.images); 219 + for (uint32_t i = 0; i < xsc->num_images; i++) { 219 220 glBindTexture(array_size == 1 ? GL_TEXTURE_2D 220 221 : GL_TEXTURE_2D_ARRAY, 221 222 sc->base.images[i]); 222 223 } 223 - glCreateMemoryObjectsEXT(num_images, &sc->base.memory[0]); 224 - for (uint32_t i = 0; i < num_images; i++) { 224 + glCreateMemoryObjectsEXT(xsc->num_images, &sc->base.memory[0]); 225 + for (uint32_t i = 0; i < xsc->num_images; i++) { 225 226 GLint dedicated = GL_TRUE; 226 227 glMemoryObjectParameterivEXT(sc->base.memory[i], 227 228 GL_DEDICATED_MEMORY_OBJECT_EXT,
+3 -3
src/xrt/compositor/client/comp_vk_client.c
··· 183 183 { 184 184 struct client_vk_compositor *c = client_vk_compositor(xc); 185 185 VkCommandBuffer cmd_buffer; 186 - uint32_t num_images = 3; 187 186 VkResult ret; 188 187 189 188 struct xrt_swapchain *xsc = c->xcfd->base.create_swapchain( ··· 213 212 sc->base.base.acquire_image = client_vk_swapchain_acquire_image; 214 213 sc->base.base.wait_image = client_vk_swapchain_wait_image; 215 214 sc->base.base.release_image = client_vk_swapchain_release_image; 216 - sc->base.base.num_images = num_images; 215 + // Fetch the number of images from the fd swapchain. 216 + sc->base.base.num_images = xsc->num_images; 217 217 sc->c = c; 218 218 sc->xscfd = xrt_swapchain_fd(xsc); 219 219 220 - for (uint32_t i = 0; i < num_images; i++) { 220 + for (uint32_t i = 0; i < xsc->num_images; i++) { 221 221 ret = vk_create_image_from_fd( 222 222 &c->vk, bits, format, width, height, array_size, mip_count, 223 223 &sc->xscfd->images[i], &sc->base.images[i],