mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 09:51:41 +00:00
[vulkan] Flush bsp vertex indices after all drawing
This commit is contained in:
parent
36e98f013e
commit
869cc4050c
3 changed files with 23 additions and 11 deletions
|
@ -170,6 +170,7 @@ void Vulkan_ClearElements (struct vulkan_ctx_s *ctx);
|
|||
void Vulkan_DrawWorld (struct qfv_renderframe_s *rFrame);
|
||||
void Vulkan_DrawSky (struct qfv_renderframe_s *rFrame);
|
||||
void Vulkan_DrawWaterSurfaces (struct qfv_renderframe_s *rFrame);
|
||||
void Vulkan_Bsp_Flush (struct vulkan_ctx_s *ctx);
|
||||
void Vulkan_LoadSkys (const char *sky, struct vulkan_ctx_s *ctx);
|
||||
void Vulkan_RegisterTextures (model_t **models, int num_models,
|
||||
struct vulkan_ctx_s *ctx);
|
||||
|
|
|
@ -1041,7 +1041,7 @@ build_tex_elechain (vulktex_t *tex, bspctx_t *bctx, bspframe_t *bframe)
|
|||
elements_t *el = 0;
|
||||
|
||||
for (is = tex->tex_chain; is; is = is->tex_chain) {
|
||||
// emit the polygon indices for the the surface to the texture's
|
||||
// emit the polygon indices for the surface to the texture's
|
||||
// element chain
|
||||
add_surf_elements (tex, is, &ec, &el, bctx, bframe);
|
||||
}
|
||||
|
@ -1110,7 +1110,15 @@ Vulkan_DrawWorld (qfv_renderframe_t *rFrame)
|
|||
tex->elechain_tail = &tex->elechain;
|
||||
}
|
||||
bsp_end (ctx);
|
||||
}
|
||||
|
||||
void
|
||||
Vulkan_Bsp_Flush (vulkan_ctx_t *ctx)
|
||||
{
|
||||
qfv_device_t *device = ctx->device;
|
||||
qfv_devfuncs_t *dfunc = device->funcs;
|
||||
bspctx_t *bctx = ctx->bsp_context;
|
||||
bspframe_t *bframe = &bctx->frames.a[ctx->curFrame];
|
||||
size_t atom = device->physDev->properties.limits.nonCoherentAtomSize;
|
||||
size_t atom_mask = atom - 1;
|
||||
size_t offset = bframe->index_offset;
|
||||
|
@ -1119,7 +1127,6 @@ Vulkan_DrawWorld (qfv_renderframe_t *rFrame)
|
|||
offset &= ~atom_mask;
|
||||
size = (size + atom_mask) & ~atom_mask;
|
||||
|
||||
//FIXME this needs to come at the end of the frame after all passes
|
||||
VkMappedMemoryRange range = {
|
||||
VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, 0,
|
||||
bctx->index_memory, offset, size
|
||||
|
@ -1165,7 +1172,7 @@ Vulkan_DrawWaterSurfaces (qfv_renderframe_t *rFrame)
|
|||
}
|
||||
tex = surf->texinfo->texture->render;
|
||||
}
|
||||
// emit the polygon indices for the the surface to the texture's
|
||||
// emit the polygon indices for the surface to the texture's
|
||||
// element chain
|
||||
add_surf_elements (tex, is, &ec, &el, bctx, bframe);
|
||||
}
|
||||
|
@ -1227,7 +1234,7 @@ Vulkan_DrawSky (qfv_renderframe_t *rFrame)
|
|||
}
|
||||
tex = surf->texinfo->texture->render;
|
||||
}
|
||||
// emit the polygon indices for the the surface to the texture's
|
||||
// emit the polygon indices for the surface to the texture's
|
||||
// element chain
|
||||
add_surf_elements (tex, is, &ec, &el, bctx, bframe);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ void
|
|||
Vulkan_RenderView (qfv_renderframe_t *rFrame)
|
||||
{
|
||||
vulkan_ctx_t *ctx = rFrame->vulkan_ctx;
|
||||
double t[9] = {};
|
||||
double t[10] = {};
|
||||
int speeds = r_speeds->int_val;
|
||||
|
||||
if (!r_worldentity.renderer.model) {
|
||||
|
@ -165,14 +165,18 @@ Vulkan_RenderView (qfv_renderframe_t *rFrame)
|
|||
Vulkan_DrawParticles (ctx);
|
||||
if (speeds)
|
||||
t[8] = Sys_DoubleTime ();
|
||||
Vulkan_Bsp_Flush (ctx);
|
||||
if (speeds)
|
||||
t[9] = Sys_DoubleTime ();
|
||||
if (speeds) {
|
||||
double total = (t[9] - t[0]) * 1000;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
t[i] = (t[i + 1] - t[i]) * 1000;
|
||||
}
|
||||
Sys_Printf ("frame: %g, setup: %g, mark: %g, pushdl: %g, world: %g,"
|
||||
" sky: %g, ents: %g, water: %g, part: %g\n",
|
||||
(t[8] - t[0]) * 1000, (t[1] - t[0]) * 1000,
|
||||
(t[2] - t[1]) * 1000, (t[3] - t[2]) * 1000,
|
||||
(t[4] - t[3]) * 1000, (t[5] - t[4]) * 1000,
|
||||
(t[6] - t[5]) * 1000, (t[7] - t[6]) * 1000,
|
||||
(t[8] - t[7]) * 1000);
|
||||
" sky: %g, ents: %g, water: %g, flush: %g, part: %g\n",
|
||||
total,
|
||||
t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue