The open source OpenXR runtime
0
fork

Configure Feed

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

c/comp+ipc: Use array indices again.

This fixes a regression introduced by the IPC and layer rendering
patchsets and passes the array_index to the correct places, so the
correct VkImageView is used instead of the one with index 0.

+27 -11
+4 -3
src/xrt/compositor/main/comp_compositor.c
··· 390 390 image = &quad->sc->images[quad->image_index]; 391 391 comp_renderer_set_quad_layer(c->r, image, &quad->pose, 392 392 &quad->size, layer->flip_y, 393 - i); 393 + i, quad->array_index); 394 394 } break; 395 395 case COMP_LAYER_STEREO_PROJECTION: { 396 396 struct comp_layer_stereo *stereo = &layer->stereo; ··· 399 399 left = &stereo->l.sc->images[stereo->l.image_index]; 400 400 right = &stereo->l.sc->images[stereo->r.image_index]; 401 401 402 - comp_renderer_set_projection_layer(c->r, left, right, 403 - layer->flip_y, i); 402 + comp_renderer_set_projection_layer( 403 + c->r, left, right, layer->flip_y, i, 404 + stereo->l.array_index, stereo->r.array_index); 404 405 } break; 405 406 } 406 407 }
+8 -4
src/xrt/compositor/main/comp_renderer.c
··· 478 478 struct xrt_pose *pose, 479 479 struct xrt_vec2 *size, 480 480 bool flip_y, 481 - uint32_t layer) 481 + uint32_t layer, 482 + uint32_t array_index) 482 483 { 483 484 comp_layer_update_descriptors(r->lr->layers[layer], image->sampler, 484 - image->views[0]); 485 + image->views[array_index]); 485 486 486 487 struct xrt_matrix_4x4 model_matrix; 487 488 math_matrix_4x4_quad_model(pose, size, &model_matrix); ··· 499 500 struct comp_swapchain_image *left_image, 500 501 struct comp_swapchain_image *right_image, 501 502 bool flip_y, 502 - uint32_t layer) 503 + uint32_t layer, 504 + uint32_t left_array_index, 505 + uint32_t right_array_index) 503 506 { 504 507 comp_layer_update_stereo_descriptors( 505 508 r->lr->layers[layer], left_image->sampler, right_image->sampler, 506 - left_image->views[0], right_image->views[0]); 509 + left_image->views[left_array_index], 510 + right_image->views[right_array_index]); 507 511 508 512 comp_layer_set_flip_y(r->lr->layers[layer], flip_y); 509 513
+5 -2
src/xrt/compositor/main/comp_renderer.h
··· 59 59 struct comp_swapchain_image *left_image, 60 60 struct comp_swapchain_image *right_image, 61 61 bool flip_y, 62 - uint32_t layer); 62 + uint32_t layer, 63 + uint32_t left_array_index, 64 + uint32_t right_array_index); 63 65 64 66 void 65 67 comp_renderer_set_quad_layer(struct comp_renderer *r, ··· 67 69 struct xrt_pose *pose, 68 70 struct xrt_vec2 *size, 69 71 bool flip_y, 70 - uint32_t layer); 72 + uint32_t layer, 73 + uint32_t array_index); 71 74 72 75 73 76 void
+2
src/xrt/ipc/ipc_server.h
··· 87 87 { 88 88 uint32_t swapchain_index; 89 89 uint32_t image_index; 90 + uint32_t array_index; 90 91 91 92 struct xrt_pose pose; 92 93 struct xrt_vec2 size; ··· 98 99 { 99 100 uint32_t swapchain_index; 100 101 uint32_t image_index; 102 + uint32_t array_index; 101 103 } l, r; 102 104 }; 103 105
+4
src/xrt/ipc/ipc_server_client.c
··· 119 119 rl->stereo.r.swapchain_index = 120 120 sl->stereo.r.swapchain_id; 121 121 rl->stereo.r.image_index = sl->stereo.r.image_index; 122 + rl->stereo.l.array_index = sl->stereo.l.array_index; 123 + rl->stereo.r.array_index = sl->stereo.r.array_index; 124 + 122 125 break; 123 126 case IPC_LAYER_QUAD: 124 127 rl->quad.swapchain_index = sl->quad.swapchain_id; 125 128 rl->quad.image_index = sl->quad.image_index; 126 129 rl->quad.pose = sl->quad.pose; 127 130 rl->quad.size = sl->quad.size; 131 + rl->quad.array_index = sl->quad.array_index; 128 132 break; 129 133 } 130 134 }
+4 -2
src/xrt/ipc/ipc_server_process.c
··· 538 538 l = &cl->images[layer->stereo.l.image_index]; 539 539 r = &cr->images[layer->stereo.r.image_index]; 540 540 541 - comp_renderer_set_projection_layer(c->r, l, r, layer->flip_y, i); 541 + comp_renderer_set_projection_layer(c->r, l, r, layer->flip_y, i, 542 + layer->stereo.l.array_index, 543 + layer->stereo.r.array_index); 542 544 543 545 return true; 544 546 } ··· 564 566 struct xrt_vec2 size = layer->quad.size; 565 567 566 568 comp_renderer_set_quad_layer(c->r, image, &pose, &size, layer->flip_y, 567 - i); 569 + i, layer->quad.array_index); 568 570 569 571 return true; 570 572 }