@@ -789,8 +789,7 @@ R_DrawWorldTask
789789*/
790790static void R_DrawWorldTask (int index , void * use_tasks )
791791{
792- const int cbx_index = index + CBX_WORLD_0 ;
793- cb_context_t * cbx = & vulkan_globals .secondary_cb_contexts [cbx_index ];
792+ cb_context_t * cbx = & vulkan_globals .secondary_cb_contexts [SCBX_WORLD ][index ];
794793 R_SetupContext (cbx );
795794 Fog_EnableGFog (cbx );
796795 if (indirect )
@@ -806,10 +805,10 @@ R_DrawSkyAndWaterTask
806805*/
807806static void R_DrawSkyAndWaterTask (void * unused )
808807{
809- R_SetupContext (& vulkan_globals .secondary_cb_contexts [CBX_SKY_AND_WATER ]);
810- Fog_EnableGFog (& vulkan_globals .secondary_cb_contexts [CBX_SKY_AND_WATER ]);
811- Sky_DrawSky (& vulkan_globals .secondary_cb_contexts [CBX_SKY_AND_WATER ]);
812- R_DrawWorld_Water (& vulkan_globals .secondary_cb_contexts [CBX_SKY_AND_WATER ]);
808+ R_SetupContext (& vulkan_globals .secondary_cb_contexts [SCBX_SKY_AND_WATER ][ 0 ]);
809+ Fog_EnableGFog (& vulkan_globals .secondary_cb_contexts [SCBX_SKY_AND_WATER ][ 0 ]);
810+ Sky_DrawSky (& vulkan_globals .secondary_cb_contexts [SCBX_SKY_AND_WATER ][ 0 ]);
811+ R_DrawWorld_Water (& vulkan_globals .secondary_cb_contexts [SCBX_SKY_AND_WATER ][ 0 ]);
813812}
814813
815814/*
@@ -819,10 +818,10 @@ R_DrawEntitiesTask
819818*/
820819static void R_DrawEntitiesTask (int index , void * use_tasks )
821820{
822- const int cbx_index = index + CBX_ENTITIES_0 ;
823- R_SetupContext (& vulkan_globals . secondary_cb_contexts [ cbx_index ] );
824- Fog_EnableGFog (& vulkan_globals . secondary_cb_contexts [ cbx_index ] ); // johnfitz
825- R_DrawEntitiesOnList (& vulkan_globals . secondary_cb_contexts [ cbx_index ] , false, index + chain_model_0 , use_tasks ? true : false);
821+ cb_context_t * cbx = & vulkan_globals . secondary_cb_contexts [ SCBX_ENTITIES ][ index ] ;
822+ R_SetupContext (cbx );
823+ Fog_EnableGFog (cbx ); // johnfitz
824+ R_DrawEntitiesOnList (cbx , false, index + chain_model_0 , use_tasks ? true : false);
826825}
827826
828827/*
@@ -832,11 +831,11 @@ R_DrawAlphaEntitiesTask
832831*/
833832static void R_DrawAlphaEntitiesTask (void * unused )
834833{
835- R_SetupContext ( & vulkan_globals .secondary_cb_contexts [CBX_ALPHA_ENTITIES ]) ;
836- Fog_EnableGFog ( & vulkan_globals . secondary_cb_contexts [ CBX_ALPHA_ENTITIES ] );
837- R_DrawEntitiesOnList (
838- & vulkan_globals . secondary_cb_contexts [ CBX_ALPHA_ENTITIES ] , true, chain_alpha_model ,
839- false); // johnfitz -- true means this is the pass for alpha entities
834+ cb_context_t * cbx = & vulkan_globals .secondary_cb_contexts [SCBX_ALPHA_ENTITIES ][ 0 ] ;
835+ R_SetupContext ( cbx );
836+ Fog_EnableGFog ( cbx );
837+ R_DrawEntitiesOnList ( cbx , true, chain_alpha_model ,
838+ false); // johnfitz -- true means this is the pass for alpha entities
840839}
841840
842841/*
@@ -846,11 +845,12 @@ R_DrawParticlesTask
846845*/
847846static void R_DrawParticlesTask (void * unused )
848847{
849- R_SetupContext (& vulkan_globals .secondary_cb_contexts [CBX_PARTICLES ]);
850- Fog_EnableGFog (& vulkan_globals .secondary_cb_contexts [CBX_PARTICLES ]); // johnfitz
851- R_DrawParticles (& vulkan_globals .secondary_cb_contexts [CBX_PARTICLES ]);
848+ cb_context_t * cbx = & vulkan_globals .secondary_cb_contexts [SCBX_PARTICLES ][0 ];
849+ R_SetupContext (cbx );
850+ Fog_EnableGFog (cbx ); // johnfitz
851+ R_DrawParticles (cbx );
852852#ifdef PSET_SCRIPT
853- PScript_DrawParticles (& vulkan_globals . secondary_cb_contexts [ CBX_PARTICLES ] );
853+ PScript_DrawParticles (cbx );
854854#endif
855855}
856856
@@ -861,10 +861,11 @@ R_DrawViewModelTask
861861*/
862862static void R_DrawViewModelTask (void * unused )
863863{
864- R_SetupContext (& vulkan_globals .secondary_cb_contexts [CBX_VIEW_MODEL ]);
865- R_DrawViewModel (& vulkan_globals .secondary_cb_contexts [CBX_VIEW_MODEL ]); // johnfitz -- moved here from R_RenderView
866- R_ShowTris (& vulkan_globals .secondary_cb_contexts [CBX_VIEW_MODEL ]); // johnfitz
867- R_ShowBoundingBoxes (& vulkan_globals .secondary_cb_contexts [CBX_VIEW_MODEL ]); // johnfitz
864+ cb_context_t * cbx = & vulkan_globals .secondary_cb_contexts [SCBX_VIEW_MODEL ][0 ];
865+ R_SetupContext (cbx );
866+ R_DrawViewModel (cbx ); // johnfitz -- moved here from R_RenderView
867+ R_ShowTris (cbx ); // johnfitz
868+ R_ShowBoundingBoxes (cbx ); // johnfitz
868869}
869870
870871/*
@@ -932,7 +933,6 @@ void R_RenderView (qboolean use_tasks, task_handle_t begin_rendering_task, task_
932933 else
933934 stats_ready = false;
934935
935- cb_context_t * primary_cbx = & vulkan_globals .primary_cb_context ;
936936 if (use_tasks )
937937 {
938938 task_handle_t before_mark = Task_AllocateAndAssignFunc (R_SetupViewBeforeMark , NULL , 0 );
@@ -943,7 +943,7 @@ void R_RenderView (qboolean use_tasks, task_handle_t begin_rendering_task, task_
943943 task_handle_t chain_surfaces = INVALID_TASK_HANDLE ;
944944 R_MarkSurfaces (use_tasks , before_mark , & store_efrags , & cull_surfaces , & chain_surfaces );
945945
946- task_handle_t update_warp_textures = Task_AllocateAndAssignFunc ((task_func_t )R_UpdateWarpTextures , & primary_cbx , sizeof ( cb_context_t * ) );
946+ task_handle_t update_warp_textures = Task_AllocateAndAssignFunc ((task_func_t )R_UpdateWarpTextures , NULL , 0 );
947947 Task_AddDependency (cull_surfaces , update_warp_textures );
948948 Task_AddDependency (begin_rendering_task , update_warp_textures );
949949 Task_AddDependency (update_warp_textures , draw_done_task );
@@ -981,10 +981,10 @@ void R_RenderView (qboolean use_tasks, task_handle_t begin_rendering_task, task_
981981
982982 task_handle_t build_tlas_task = Task_AllocateAndAssignFunc (R_BuildTopLevelAccelerationStructure , NULL , 0 );
983983 Task_AddDependency (begin_rendering_task , build_tlas_task );
984+ Task_AddDependency (build_tlas_task , draw_done_task );
984985
985986 task_handle_t update_lightmaps_task = Task_AllocateAndAssignFunc (R_UpdateLightmapsAndIndirect , NULL , 0 );
986987 Task_AddDependency (cull_surfaces , update_lightmaps_task );
987- Task_AddDependency (build_tlas_task , update_lightmaps_task );
988988 Task_AddDependency (draw_entities_task , update_lightmaps_task );
989989 Task_AddDependency (draw_alpha_entities_task , update_lightmaps_task );
990990 Task_AddDependency (update_lightmaps_task , draw_done_task );
@@ -1016,7 +1016,7 @@ void R_RenderView (qboolean use_tasks, task_handle_t begin_rendering_task, task_
10161016 {
10171017 R_SetupViewBeforeMark (NULL );
10181018 R_MarkSurfaces (use_tasks , INVALID_TASK_HANDLE , NULL , NULL , NULL ); // johnfitz -- create texture chains from PVS
1019- R_UpdateWarpTextures (& primary_cbx );
1019+ R_UpdateWarpTextures (NULL );
10201020 R_DrawWorldTask (0 , NULL );
10211021 R_DrawSkyAndWaterTask (NULL );
10221022 R_DrawEntitiesTask (0 , NULL );
0 commit comments