The open source OpenXR runtime
0
fork

Configure Feed

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

c/render: Remove unused render_gfx_view and other fields on render_gfx

+6 -55
+3 -27
src/xrt/compositor/render/render_gfx.c
··· 512 512 bool 513 513 render_gfx_init(struct render_gfx *rr, struct render_resources *r) 514 514 { 515 - struct vk_bundle *vk = r->vk; 516 - VkResult ret; 515 + // Init fields. 517 516 rr->r = r; 518 517 519 - 520 - /* 521 - * Mesh per view 522 - */ 523 - 524 - ret = vk_create_descriptor_set( // 525 - vk, // vk_bundle 526 - r->mesh.descriptor_pool, // descriptor_pool 527 - r->mesh.descriptor_set_layout, // descriptor_set_layout 528 - &rr->views[0].mesh.descriptor_set); // descriptor_set 529 - VK_CHK_WITH_RET(ret, "vk_create_descriptor_set", false); 530 - 531 - ret = vk_create_descriptor_set( // 532 - vk, // vk_bundle 533 - r->mesh.descriptor_pool, // descriptor_pool 534 - r->mesh.descriptor_set_layout, // descriptor_set_layout 535 - &rr->views[1].mesh.descriptor_set); // descriptor_set 536 - VK_CHK_WITH_RET(ret, "vk_create_descriptor_set", false); 537 - 538 518 // Used to sub-allocate UBOs from, restart from scratch each frame. 539 519 render_sub_alloc_tracker_init(&rr->ubo_tracker, &r->gfx.shared_ubo); 540 520 ··· 600 580 struct vk_bundle *vk = vk_from_rr(rr); 601 581 struct render_resources *r = rr->r; 602 582 603 - // Reclaimed by vkResetDescriptorPool. 604 - rr->views[0].mesh.descriptor_set = VK_NULL_HANDLE; 605 - rr->views[1].mesh.descriptor_set = VK_NULL_HANDLE; 606 - 583 + // Reclaim all descriptor sets. 607 584 vk->vkResetDescriptorPool( // 608 585 vk->device, // 609 586 r->mesh.descriptor_pool, // 610 587 0); // 611 588 589 + // This "reclaims" the allocated UBOs. 612 590 U_ZERO(rr); 613 591 } 614 592 ··· 662 640 // We currently only support two views. 663 641 assert(view == 0 || view == 1); 664 642 assert(rr->rtr != NULL); 665 - 666 - rr->current_view = view; 667 643 668 644 669 645 /*
+3 -28
src/xrt/compositor/render/render_interface.h
··· 720 720 721 721 /*! 722 722 * Each rendering (@ref render_gfx) render to one or more targets 723 - * (@ref render_gfx_target_resources), each target can have one or more 724 - * views (@ref render_gfx_view), this struct holds all the vulkan resources 725 - * that is specific to the target. 726 - * 727 - * Technically the framebuffer could be moved out of this struct and all of this 728 - * state be turned into a CSO object that depends only only the format and 729 - * external status of the target, but is combined to reduce the number of 730 - * objects needed to render. 723 + * (@ref render_gfx_target_resources), the target points to one render pass and 724 + * it's pipelines (@ref render_gfx_render_pass). It is up to the code using 725 + * these to do reuse of render passes and ensure they match. 731 726 */ 732 727 struct render_gfx_target_resources 733 728 { ··· 772 767 */ 773 768 774 769 /*! 775 - * Each rendering (@ref render_gfx) render to one or more targets 776 - * (@ref render_gfx_target_resources), each target can have one or more 777 - * views (@ref render_gfx_view), this struct holds all the vulkan resources 778 - * that is specific to the view. 779 - */ 780 - struct render_gfx_view 781 - { 782 - struct 783 - { 784 - VkDescriptorSet descriptor_set; 785 - } mesh; 786 - }; 787 - 788 - /*! 789 770 * A rendering is used to create command buffers needed to do one frame of 790 771 * compositor rendering, it holds onto resources used by the command buffer. 791 772 */ ··· 799 780 800 781 //! The current target we are rendering too, can change during command building. 801 782 struct render_gfx_target_resources *rtr; 802 - 803 - //! Holds per view data. 804 - struct render_gfx_view views[2]; 805 - 806 - //! The current view we are rendering to. 807 - uint32_t current_view; 808 783 }; 809 784 810 785 /*!