The open source OpenXR runtime
0
fork

Configure Feed

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

c/main: Tidy and make dispatch code more uniform

+31 -21
+31 -21
src/xrt/compositor/main/comp_renderer.c
··· 790 790 791 791 struct comp_compositor *c = r->c; 792 792 struct comp_target *ct = c->target; 793 + VkResult ret; 793 794 794 - struct render_gfx_target_resources *rtr = &r->rtr_array[r->acquired_buffer]; 795 + // Basics 796 + const struct comp_layer *layers = c->base.slot.layers; 797 + uint32_t layer_count = c->base.slot.layer_count; 795 798 bool fast_path = c->base.slot.one_projection_layer_fast_path; 796 799 bool do_timewarp = !c->debug.atw_off; 800 + 801 + // Resources for the distortion render target. 802 + struct render_gfx_target_resources *rtr = &r->rtr_array[r->acquired_buffer]; 797 803 798 804 // Sanity check. 799 805 assert(!fast_path || c->base.slot.layer_count >= 1); ··· 817 823 world_poses, // world_poses[2] 818 824 eye_poses); // eye_poses[2] 819 825 820 - // Need to be begin for all paths. 826 + // Start the graphics pipeline. 821 827 render_gfx_begin(rr); 822 828 823 - 824 - VkResult ret = VK_SUCCESS; 825 - 826 - comp_render_gfx_dispatch( // 827 - rr, // rr 828 - &r->scratch, // rsi 829 - r->scratch_targets, // rsi_rtrs 830 - c->base.slot.layers, // layers 831 - c->base.slot.layer_count, // layer_count 832 - world_poses, // world_poses 833 - eye_poses, // eye_poses 834 - fovs, // fovs 835 - vertex_rots, // vertex_rots 836 - rtr, // rtr 837 - viewport_datas, // viewport_datas 838 - fast_path, // fast_path 839 - do_timewarp); // do_timewarp 840 - 829 + // Build the command buffer. 830 + comp_render_gfx_dispatch( // 831 + rr, // rr 832 + &r->scratch, // rsi 833 + r->scratch_targets, // rsi_rtrs 834 + layers, // layers 835 + layer_count, // layer_count 836 + world_poses, // world_poses 837 + eye_poses, // eye_poses 838 + fovs, // fovs 839 + vertex_rots, // vertex_rots 840 + rtr, // rtr 841 + viewport_datas, // viewport_datas 842 + fast_path, // fast_path 843 + do_timewarp); // do_timewarp 841 844 842 845 // Make the command buffer submittable. 843 846 render_gfx_end(rr); ··· 868 871 869 872 struct comp_compositor *c = r->c; 870 873 struct comp_target *ct = c->target; 874 + VkResult ret; 871 875 872 876 // Basics 873 877 const struct comp_layer *layers = c->base.slot.layers; ··· 897 901 // Start the compute pipeline. 898 902 render_compute_begin(crc); 899 903 904 + // Build the command buffer. 900 905 comp_render_cs_dispatch( // 901 906 crc, // crc 902 907 &r->scratch, // rsi ··· 910 915 fast_path, // fast_path 911 916 do_timewarp); // do_timewarp 912 917 918 + // Make the command buffer submittable. 913 919 render_compute_end(crc); 914 920 921 + // Everything is ready, submit to the queue. 922 + ret = renderer_submit_queue(r, crc->r->cmd, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT); 923 + 924 + // We mark afterwards to not include CPU time spent. 915 925 comp_target_mark_submit(ct, c->frame.rendering.id, os_monotonic_get_ns()); 916 926 917 - return renderer_submit_queue(r, crc->r->cmd, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT); 927 + return ret; 918 928 } 919 929 920 930