[renderer] Move entity drawing in with view rendering

I really don't remember why I made it separate, though it may have been
to do with r_ent_queue. However, putting it together with the rest is
needed for the "render pass" rework.
This commit is contained in:
Bill Currie 2022-05-31 10:49:40 +09:00
parent 5e1ce5b46e
commit 3058a5103f
7 changed files with 4 additions and 20 deletions

View file

@ -114,7 +114,6 @@ typedef struct vid_render_funcs_s {
void (*begin_frame) (void); void (*begin_frame) (void);
void (*render_view) (void); void (*render_view) (void);
void (*draw_entities) (struct entqueue_s *queue);
void (*draw_particles) (struct psystem_s *psystem); void (*draw_particles) (struct psystem_s *psystem);
void (*draw_transparent) (void); void (*draw_transparent) (void);
void (*post_process) (struct framebuffer_s *src); void (*post_process) (struct framebuffer_s *src);

View file

@ -193,7 +193,6 @@ render_scene (void)
r_framecount++; r_framecount++;
EntQueue_Clear (r_ent_queue); EntQueue_Clear (r_ent_queue);
r_funcs->render_view (); r_funcs->render_view ();
r_funcs->draw_entities (r_ent_queue);
r_funcs->draw_particles (&r_psystem); r_funcs->draw_particles (&r_psystem);
r_funcs->draw_transparent (); r_funcs->draw_transparent ();
} }

View file

@ -264,6 +264,7 @@ gl_render_view (void)
// do 3D refresh drawing, and then update the screen // do 3D refresh drawing, and then update the screen
qfglClear (GL_DEPTH_BUFFER_BIT); qfglClear (GL_DEPTH_BUFFER_BIT);
gl_R_RenderView (); gl_R_RenderView ();
gl_R_RenderEntities (r_ent_queue);
} }
static void static void
@ -516,7 +517,6 @@ vid_render_funcs_t gl_vid_render_funcs = {
gl_R_LineGraph, gl_R_LineGraph,
gl_begin_frame, gl_begin_frame,
gl_render_view, gl_render_view,
gl_R_RenderEntities,
gl_R_DrawParticles, gl_R_DrawParticles,
gl_draw_transparent, gl_draw_transparent,
gl_post_process, gl_post_process,

View file

@ -225,6 +225,7 @@ glsl_render_view (void)
{ {
qfeglClear (GL_DEPTH_BUFFER_BIT); qfeglClear (GL_DEPTH_BUFFER_BIT);
glsl_R_RenderView (); glsl_R_RenderView ();
glsl_R_RenderEntities (r_ent_queue);
} }
static void static void
@ -460,7 +461,6 @@ vid_render_funcs_t glsl_vid_render_funcs = {
glsl_R_LineGraph, glsl_R_LineGraph,
glsl_begin_frame, glsl_begin_frame,
glsl_render_view, glsl_render_view,
glsl_R_RenderEntities,
glsl_R_DrawParticles, glsl_R_DrawParticles,
glsl_draw_transparent, glsl_draw_transparent,
glsl_post_process, glsl_post_process,

View file

@ -160,6 +160,7 @@ static void
sw_render_view (void) sw_render_view (void)
{ {
R_RenderView (); R_RenderView ();
R_DrawEntitiesOnList (r_ent_queue);
} }
static void static void
@ -480,7 +481,6 @@ vid_render_funcs_t sw_vid_render_funcs = {
R_LineGraph, R_LineGraph,
sw_begin_frame, sw_begin_frame,
sw_render_view, sw_render_view,
R_DrawEntitiesOnList,
R_DrawParticles, R_DrawParticles,
sw_draw_transparent, sw_draw_transparent,
sw_post_process, sw_post_process,

View file

@ -292,20 +292,6 @@ vulkan_render_view (void)
} }
} }
static void
vulkan_draw_entities (entqueue_t *queue)
{
__auto_type frame = &vulkan_ctx->frames.a[vulkan_ctx->curFrame];
uint32_t imageIndex = vulkan_ctx->swapImageIndex;
for (size_t i = 0; i < vulkan_ctx->renderPasses.size; i++) {
__auto_type rp = vulkan_ctx->renderPasses.a[i];
__auto_type rpFrame = &rp->frames.a[vulkan_ctx->curFrame];
frame->framebuffer = rp->framebuffers->a[imageIndex];
Vulkan_RenderEntities (queue, rpFrame);
}
}
static void static void
vulkan_draw_particles (struct psystem_s *psystem) vulkan_draw_particles (struct psystem_s *psystem)
{ {
@ -758,7 +744,6 @@ vid_render_funcs_t vulkan_vid_render_funcs = {
vulkan_R_LineGraph, vulkan_R_LineGraph,
vulkan_begin_frame, vulkan_begin_frame,
vulkan_render_view, vulkan_render_view,
vulkan_draw_entities,
vulkan_draw_particles, vulkan_draw_particles,
vulkan_draw_transparent, vulkan_draw_transparent,
vulkan_post_process, vulkan_post_process,

View file

@ -132,6 +132,7 @@ Vulkan_RenderView (qfv_renderframe_t *rFrame)
} }
Vulkan_DrawWaterSurfaces (rFrame); Vulkan_DrawWaterSurfaces (rFrame);
Vulkan_Bsp_Flush (ctx); Vulkan_Bsp_Flush (ctx);
Vulkan_RenderEntities (r_ent_queue, rFrame);
Vulkan_Scene_Flush (ctx); Vulkan_Scene_Flush (ctx);
} }