The open source OpenXR runtime
0
fork

Configure Feed

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

c/client: Implement excplicit transitions in Vulkan and D3D12

+22 -22
+10 -8
src/xrt/compositor/client/comp_d3d12_client.cpp
··· 357 357 // OK, we got the image in the native compositor, now need the keyed mutex in d3d11. 358 358 xret = sc->data->keyed_mutex_collection.waitKeyedMutex(index, timeout_ns); 359 359 } 360 - if (xret == XRT_SUCCESS) { 361 - // OK, we got the image in the native compositor, now need the transition in d3d12. 362 - xret = client_d3d12_swapchain_barrier_to_app(sc, index); 363 - } 364 360 365 361 //! @todo discard old contents? 366 362 return xret; ··· 369 365 static xrt_result_t 370 366 client_d3d12_swapchain_barrier_image(struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index) 371 367 { 372 - return XRT_SUCCESS; 368 + struct client_d3d12_swapchain *sc = as_client_d3d12_swapchain(xsc); 369 + xrt_result_t xret; 370 + 371 + switch (direction) { 372 + case XRT_BARRIER_TO_APP: xret = client_d3d12_swapchain_barrier_to_app(sc, index); break; 373 + case XRT_BARRIER_TO_COMP: xret = client_d3d12_swapchain_barrier_to_compositor(sc, index); break; 374 + default: assert(false); 375 + } 376 + 377 + return xret; 373 378 } 374 379 375 380 static xrt_result_t ··· 385 390 xret = sc->data->keyed_mutex_collection.releaseKeyedMutex(index); 386 391 } 387 392 388 - if (xret == XRT_SUCCESS) { 389 - xret = client_d3d12_swapchain_barrier_to_compositor(sc, index); 390 - } 391 393 return xret; 392 394 } 393 395
+12 -14
src/xrt/compositor/client/comp_vk_client.c
··· 289 289 return xret; 290 290 } 291 291 292 - xret = submit_image_barrier(sc, sc->acquire[index]); 293 - if (xret != XRT_SUCCESS) { 294 - return xret; 295 - } 296 - 297 292 // Finally done. 298 293 *out_index = index; 299 294 ··· 314 309 static xrt_result_t 315 310 client_vk_swapchain_barrier_image(struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index) 316 311 { 317 - return XRT_SUCCESS; 312 + COMP_TRACE_MARKER(); 313 + 314 + struct client_vk_swapchain *sc = client_vk_swapchain(xsc); 315 + VkCommandBuffer cmd_buffer = VK_NULL_HANDLE; 316 + 317 + switch (direction) { 318 + case XRT_BARRIER_TO_APP: cmd_buffer = sc->acquire[index]; break; 319 + case XRT_BARRIER_TO_COMP: cmd_buffer = sc->release[index]; break; 320 + default: assert(false); 321 + } 322 + 323 + return submit_image_barrier(sc, cmd_buffer); 318 324 } 319 325 320 326 static xrt_result_t ··· 323 329 COMP_TRACE_MARKER(); 324 330 325 331 struct client_vk_swapchain *sc = client_vk_swapchain(xsc); 326 - xrt_result_t xret; 327 - 328 - xret = submit_image_barrier(sc, sc->release[index]); 329 - if (xret != XRT_SUCCESS) { 330 - return xret; 331 - } 332 - 333 - COMP_TRACE_IDENT(release_image); 334 332 335 333 // Pipe down call into native swapchain. 336 334 return xrt_swapchain_release_image(&sc->xscn->base, index);