|
|
|
@ -335,6 +335,8 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Arena *perm = PermArena();
|
|
|
|
Arena *perm = PermArena();
|
|
|
|
G_ArenaHandle gpu_perm = G_PermArena();
|
|
|
|
G_ArenaHandle gpu_perm = G_PermArena();
|
|
|
|
|
|
|
|
G_ArenaHandle gpu_frame_arena = G_AcquireArena();
|
|
|
|
|
|
|
|
|
|
|
|
P_tl.debug_arena = AcquireArena(Gibi(64));
|
|
|
|
P_tl.debug_arena = AcquireArena(Gibi(64));
|
|
|
|
P_tl.debug_tint = VEC4(0, 0.4, 0.9, 0.75);
|
|
|
|
P_tl.debug_tint = VEC4(0, 0.4, 0.9, 0.75);
|
|
|
|
P_tl.out_msgs_arena = AcquireArena(Gibi(64));
|
|
|
|
P_tl.out_msgs_arena = AcquireArena(Gibi(64));
|
|
|
|
@ -522,7 +524,6 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
frame->quads_arena = AcquireArena(Gibi(64));
|
|
|
|
frame->quads_arena = AcquireArena(Gibi(64));
|
|
|
|
frame->dverts_arena = AcquireArena(Gibi(64));
|
|
|
|
frame->dverts_arena = AcquireArena(Gibi(64));
|
|
|
|
frame->dvert_idxs_arena = AcquireArena(Gibi(64));
|
|
|
|
frame->dvert_idxs_arena = AcquireArena(Gibi(64));
|
|
|
|
frame->gpu_arena = G_AcquireArena();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////
|
|
|
|
//////////////////////////////
|
|
|
|
@ -576,20 +577,18 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
Arena *old_quads_arena = frame->quads_arena;
|
|
|
|
Arena *old_quads_arena = frame->quads_arena;
|
|
|
|
Arena *old_dverts_arena = frame->dverts_arena;
|
|
|
|
Arena *old_dverts_arena = frame->dverts_arena;
|
|
|
|
Arena *old_dvert_idxs_arena = frame->dvert_idxs_arena;
|
|
|
|
Arena *old_dvert_idxs_arena = frame->dvert_idxs_arena;
|
|
|
|
G_ArenaHandle old_gpu_arena = frame->gpu_arena;
|
|
|
|
|
|
|
|
ZeroStruct(frame);
|
|
|
|
ZeroStruct(frame);
|
|
|
|
frame->arena = old_arena;
|
|
|
|
frame->arena = old_arena;
|
|
|
|
frame->quads_arena = old_quads_arena;
|
|
|
|
frame->quads_arena = old_quads_arena;
|
|
|
|
frame->dverts_arena = old_dverts_arena;
|
|
|
|
frame->dverts_arena = old_dverts_arena;
|
|
|
|
frame->dvert_idxs_arena = old_dvert_idxs_arena;
|
|
|
|
frame->dvert_idxs_arena = old_dvert_idxs_arena;
|
|
|
|
frame->gpu_arena = old_gpu_arena;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
frame->cl = G_PrepareCommandList(G_QueueKind_Direct);
|
|
|
|
frame->cl = G_PrepareCommandList(G_QueueKind_Direct);
|
|
|
|
ResetArena(frame->arena);
|
|
|
|
ResetArena(frame->arena);
|
|
|
|
ResetArena(frame->quads_arena);
|
|
|
|
ResetArena(frame->quads_arena);
|
|
|
|
ResetArena(frame->dverts_arena);
|
|
|
|
ResetArena(frame->dverts_arena);
|
|
|
|
ResetArena(frame->dvert_idxs_arena);
|
|
|
|
ResetArena(frame->dvert_idxs_arena);
|
|
|
|
G_ResetArena(frame->cl, frame->gpu_arena);
|
|
|
|
G_ResetArena(frame->cl, gpu_frame_arena);
|
|
|
|
|
|
|
|
|
|
|
|
// Persist state
|
|
|
|
// Persist state
|
|
|
|
CopyBytes(frame->held_buttons, prev_frame->held_buttons, sizeof(frame->held_buttons));
|
|
|
|
CopyBytes(frame->held_buttons, prev_frame->held_buttons, sizeof(frame->held_buttons));
|
|
|
|
@ -1053,15 +1052,23 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
//////////////////////////////
|
|
|
|
//////////////////////////////
|
|
|
|
//- Compute frame affines
|
|
|
|
//- Compute frame affines
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// World <-> screen (raw)
|
|
|
|
|
|
|
|
frame->af.world_to_screen_raw = AffineIdentity;
|
|
|
|
|
|
|
|
frame->af.screen_to_world_raw = AffineIdentity;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
f32 camera_scale = frame->screen_dims.x / (meters_per_camera_width * frame->camera_zoom);
|
|
|
|
|
|
|
|
frame->af.world_to_screen_raw = TranslateAffine(frame->af.world_to_screen_raw, MulVec2(frame->screen_dims, 0.5));
|
|
|
|
|
|
|
|
frame->af.world_to_screen_raw = ScaleAffine(frame->af.world_to_screen_raw, VEC2(camera_scale, camera_scale));
|
|
|
|
|
|
|
|
frame->af.world_to_screen_raw = TranslateAffine(frame->af.world_to_screen_raw, NegVec2(frame->camera_pos));
|
|
|
|
|
|
|
|
frame->af.screen_to_world_raw = InvertAffine(frame->af.world_to_screen_raw);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// World <-> screen
|
|
|
|
// World <-> screen
|
|
|
|
frame->af.world_to_screen = AffineIdentity;
|
|
|
|
frame->af.world_to_screen = AffineIdentity;
|
|
|
|
frame->af.screen_to_world = AffineIdentity;
|
|
|
|
frame->af.screen_to_world = AffineIdentity;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
f32 camera_scale = frame->screen_dims.x / (meters_per_camera_width * frame->camera_zoom);
|
|
|
|
frame->af.world_to_screen = frame->af.world_to_screen_raw;;
|
|
|
|
frame->af.world_to_screen = TranslateAffine(frame->af.world_to_screen, MulVec2(frame->screen_dims, 0.5));
|
|
|
|
frame->af.world_to_screen.og = RoundVec2(frame->af.world_to_screen.og);
|
|
|
|
frame->af.world_to_screen = ScaleAffine(frame->af.world_to_screen, VEC2(camera_scale, camera_scale));
|
|
|
|
|
|
|
|
frame->af.world_to_screen = TranslateAffine(frame->af.world_to_screen, NegVec2(frame->camera_pos));
|
|
|
|
|
|
|
|
// frame->af.world_to_screen.og = RoundVec2(frame->af.world_to_screen.og);
|
|
|
|
|
|
|
|
frame->af.screen_to_world = InvertAffine(frame->af.world_to_screen);
|
|
|
|
frame->af.screen_to_world = InvertAffine(frame->af.world_to_screen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -1073,7 +1080,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
frame->af.world_to_shade = TranslateAffine(frame->af.world_to_shade, MulVec2(frame->shade_dims, 0.5));
|
|
|
|
frame->af.world_to_shade = TranslateAffine(frame->af.world_to_shade, MulVec2(frame->shade_dims, 0.5));
|
|
|
|
frame->af.world_to_shade = ScaleAffine(frame->af.world_to_shade, VEC2(camera_scale, camera_scale));
|
|
|
|
frame->af.world_to_shade = ScaleAffine(frame->af.world_to_shade, VEC2(camera_scale, camera_scale));
|
|
|
|
frame->af.world_to_shade = TranslateAffine(frame->af.world_to_shade, NegVec2(frame->camera_pos));
|
|
|
|
frame->af.world_to_shade = TranslateAffine(frame->af.world_to_shade, NegVec2(frame->camera_pos));
|
|
|
|
// frame->af.world_to_shade.og = RoundVec2(frame->af.world_to_shade.og);
|
|
|
|
frame->af.world_to_shade.og = RoundVec2(frame->af.world_to_shade.og);
|
|
|
|
frame->af.shade_to_world = InvertAffine(frame->af.world_to_shade);
|
|
|
|
frame->af.shade_to_world = InvertAffine(frame->af.world_to_shade);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -1082,7 +1089,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
frame->af.screen_to_shade = AffineIdentity;
|
|
|
|
frame->af.screen_to_shade = AffineIdentity;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frame->af.shade_to_screen = MulAffine(frame->af.world_to_screen, frame->af.shade_to_world);
|
|
|
|
frame->af.shade_to_screen = MulAffine(frame->af.world_to_screen, frame->af.shade_to_world);
|
|
|
|
// frame->af.shade_to_screen.og = RoundVec2(frame->af.shade_to_screen.og);
|
|
|
|
frame->af.shade_to_screen.og = RoundVec2(frame->af.shade_to_screen.og);
|
|
|
|
frame->af.screen_to_shade = InvertAffine(frame->af.shade_to_screen);
|
|
|
|
frame->af.screen_to_shade = InvertAffine(frame->af.shade_to_screen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -1093,7 +1100,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frame->af.world_to_cell = ScaleAffine(frame->af.world_to_cell, VEC2(P_CellsPerMeter, P_CellsPerMeter));
|
|
|
|
frame->af.world_to_cell = ScaleAffine(frame->af.world_to_cell, VEC2(P_CellsPerMeter, P_CellsPerMeter));
|
|
|
|
frame->af.world_to_cell = TranslateAffine(frame->af.world_to_cell, VEC2((P_WorldPitch / 2.0), (P_WorldPitch / 2.0)));
|
|
|
|
frame->af.world_to_cell = TranslateAffine(frame->af.world_to_cell, VEC2((P_WorldPitch / 2.0), (P_WorldPitch / 2.0)));
|
|
|
|
// frame->af.world_to_cell.og = RoundVec2(frame->af.world_to_cell.og);
|
|
|
|
frame->af.world_to_cell.og = RoundVec2(frame->af.world_to_cell.og);
|
|
|
|
frame->af.cell_to_world = InvertAffine(frame->af.world_to_cell);
|
|
|
|
frame->af.cell_to_world = InvertAffine(frame->af.world_to_cell);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -4796,7 +4803,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
|
|
|
|
|
|
|
|
// Screen texture
|
|
|
|
// Screen texture
|
|
|
|
G_ResourceHandle screen_target = G_PushTexture2D(
|
|
|
|
G_ResourceHandle screen_target = G_PushTexture2D(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
frame->screen_dims,
|
|
|
|
frame->screen_dims,
|
|
|
|
G_Layout_DirectQueue_RenderTarget,
|
|
|
|
G_Layout_DirectQueue_RenderTarget,
|
|
|
|
@ -4805,12 +4812,12 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
Rng3 screen_viewport = RNG3(VEC3(0, 0, 0), VEC3(frame->screen_dims.x, frame->screen_dims.y, 1));
|
|
|
|
Rng3 screen_viewport = RNG3(VEC3(0, 0, 0), VEC3(frame->screen_dims.x, frame->screen_dims.y, 1));
|
|
|
|
Rng2 screen_scissor = RNG2(VEC2(screen_viewport.p0.x, screen_viewport.p0.y), VEC2(screen_viewport.p1.x, screen_viewport.p1.y));
|
|
|
|
Rng2 screen_scissor = RNG2(VEC2(screen_viewport.p0.x, screen_viewport.p0.y), VEC2(screen_viewport.p1.x, screen_viewport.p1.y));
|
|
|
|
frame->screen_ro = G_PushTexture2DRef(frame->gpu_arena, screen_target);
|
|
|
|
frame->screen_ro = G_PushTexture2DRef(gpu_frame_arena, screen_target);
|
|
|
|
frame->screen_rw = G_PushRWTexture2DRef(frame->gpu_arena, screen_target);
|
|
|
|
frame->screen_rw = G_PushRWTexture2DRef(gpu_frame_arena, screen_target);
|
|
|
|
|
|
|
|
|
|
|
|
// Bloom texture
|
|
|
|
// Bloom texture
|
|
|
|
G_ResourceHandle bloom_target = G_PushTexture2D(
|
|
|
|
G_ResourceHandle bloom_target = G_PushTexture2D(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
G_DimsFromMip2D(G_Count2D(screen_target), 1),
|
|
|
|
G_DimsFromMip2D(G_Count2D(screen_target), 1),
|
|
|
|
G_Layout_DirectQueue_General,
|
|
|
|
G_Layout_DirectQueue_General,
|
|
|
|
@ -4820,24 +4827,24 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
for (i32 mip_idx = 0; mip_idx < G_CountMips(bloom_target); ++mip_idx)
|
|
|
|
for (i32 mip_idx = 0; mip_idx < G_CountMips(bloom_target); ++mip_idx)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frame->bloom_mips_ro[mip_idx] = G_PushTexture2DRef(frame->gpu_arena, bloom_target, .mips = RNGI32(mip_idx, mip_idx));
|
|
|
|
frame->bloom_mips_ro[mip_idx] = G_PushTexture2DRef(gpu_frame_arena, bloom_target, .mips = RNGI32(mip_idx, mip_idx));
|
|
|
|
frame->bloom_mips_rw[mip_idx] = G_PushRWTexture2DRef(frame->gpu_arena, bloom_target, .mips = RNGI32(mip_idx, mip_idx));
|
|
|
|
frame->bloom_mips_rw[mip_idx] = G_PushRWTexture2DRef(gpu_frame_arena, bloom_target, .mips = RNGI32(mip_idx, mip_idx));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Albedo texture
|
|
|
|
// Albedo texture
|
|
|
|
G_ResourceHandle albedo_target = G_PushTexture2D(
|
|
|
|
G_ResourceHandle albedo_target = G_PushTexture2D(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
frame->screen_dims,
|
|
|
|
frame->screen_dims,
|
|
|
|
G_Layout_DirectQueue_RenderTarget,
|
|
|
|
G_Layout_DirectQueue_RenderTarget,
|
|
|
|
.flags = G_ResourceFlag_AllowRenderTarget,
|
|
|
|
.flags = G_ResourceFlag_AllowRenderTarget,
|
|
|
|
.name = StringF(frame->arena, "Albedo target [%F]", FmtSint(frame->tick))
|
|
|
|
.name = StringF(frame->arena, "Albedo target [%F]", FmtSint(frame->tick))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
frame->albedo_ro = G_PushTexture2DRef(frame->gpu_arena, albedo_target);
|
|
|
|
frame->albedo_ro = G_PushTexture2DRef(gpu_frame_arena, albedo_target);
|
|
|
|
|
|
|
|
|
|
|
|
// Backdrop texture
|
|
|
|
// Backdrop texture
|
|
|
|
G_ResourceHandle backdrop_target = G_PushTexture2D(
|
|
|
|
G_ResourceHandle backdrop_target = G_PushTexture2D(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
G_DimsFromMip2D(G_Count2D(screen_target), 0),
|
|
|
|
G_DimsFromMip2D(G_Count2D(screen_target), 0),
|
|
|
|
G_Layout_DirectQueue_General,
|
|
|
|
G_Layout_DirectQueue_General,
|
|
|
|
@ -4847,13 +4854,13 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
for (i32 mip_idx = 0; mip_idx < G_CountMips(bloom_target); ++mip_idx)
|
|
|
|
for (i32 mip_idx = 0; mip_idx < G_CountMips(bloom_target); ++mip_idx)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frame->backdrop_mips_ro[mip_idx] = G_PushTexture2DRef(frame->gpu_arena, backdrop_target, .mips = RNGI32(mip_idx, mip_idx));
|
|
|
|
frame->backdrop_mips_ro[mip_idx] = G_PushTexture2DRef(gpu_frame_arena, backdrop_target, .mips = RNGI32(mip_idx, mip_idx));
|
|
|
|
frame->backdrop_mips_rw[mip_idx] = G_PushRWTexture2DRef(frame->gpu_arena, backdrop_target, .mips = RNGI32(mip_idx, mip_idx));
|
|
|
|
frame->backdrop_mips_rw[mip_idx] = G_PushRWTexture2DRef(gpu_frame_arena, backdrop_target, .mips = RNGI32(mip_idx, mip_idx));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Shade texture
|
|
|
|
// Shade texture
|
|
|
|
G_ResourceHandle shade_target = G_PushTexture2D(
|
|
|
|
G_ResourceHandle shade_target = G_PushTexture2D(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
G_Format_R16G16B16A16_Float,
|
|
|
|
frame->shade_dims,
|
|
|
|
frame->shade_dims,
|
|
|
|
G_Layout_DirectQueue_General,
|
|
|
|
G_Layout_DirectQueue_General,
|
|
|
|
@ -4862,29 +4869,29 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
Rng3 shade_viewport = RNG3(VEC3(0, 0, 0), VEC3(frame->shade_dims.x, frame->shade_dims.y, 1));
|
|
|
|
Rng3 shade_viewport = RNG3(VEC3(0, 0, 0), VEC3(frame->shade_dims.x, frame->shade_dims.y, 1));
|
|
|
|
Rng2 shade_scissor = RNG2(VEC2(shade_viewport.p0.x, shade_viewport.p0.y), VEC2(shade_viewport.p1.x, shade_viewport.p1.y));
|
|
|
|
Rng2 shade_scissor = RNG2(VEC2(shade_viewport.p0.x, shade_viewport.p0.y), VEC2(shade_viewport.p1.x, shade_viewport.p1.y));
|
|
|
|
frame->shade_ro = G_PushTexture2DRef(frame->gpu_arena, shade_target);
|
|
|
|
frame->shade_ro = G_PushTexture2DRef(gpu_frame_arena, shade_target);
|
|
|
|
frame->shade_rw = G_PushRWTexture2DRef(frame->gpu_arena, shade_target);
|
|
|
|
frame->shade_rw = G_PushRWTexture2DRef(gpu_frame_arena, shade_target);
|
|
|
|
|
|
|
|
|
|
|
|
// Quad buffers
|
|
|
|
// Quad buffers
|
|
|
|
G_ResourceHandle quads_buff = G_PushBufferFromCpuCopy(
|
|
|
|
G_ResourceHandle quads_buff = G_PushBufferFromCpuCopy(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
StringFromArena(frame->quads_arena),
|
|
|
|
StringFromArena(frame->quads_arena),
|
|
|
|
.name = StringF(frame->arena, "quads [%F]", FmtSint(frame->tick))
|
|
|
|
.name = StringF(frame->arena, "quads [%F]", FmtSint(frame->tick))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
frame->quads = G_PushStructuredBufferRef(frame->gpu_arena, quads_buff, V_Quad);
|
|
|
|
frame->quads = G_PushStructuredBufferRef(gpu_frame_arena, quads_buff, V_Quad);
|
|
|
|
|
|
|
|
|
|
|
|
// Debug shape buffers
|
|
|
|
// Debug shape buffers
|
|
|
|
G_ResourceHandle dverts_buff = G_PushBufferFromCpuCopy(
|
|
|
|
G_ResourceHandle dverts_buff = G_PushBufferFromCpuCopy(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
StringFromArena(frame->dverts_arena),
|
|
|
|
StringFromArena(frame->dverts_arena),
|
|
|
|
.name = StringF(frame->arena, "dverts [%F]", FmtSint(frame->tick))
|
|
|
|
.name = StringF(frame->arena, "dverts [%F]", FmtSint(frame->tick))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
G_ResourceHandle dvert_idxs_buff = G_PushBufferFromCpuCopy(
|
|
|
|
G_ResourceHandle dvert_idxs_buff = G_PushBufferFromCpuCopy(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
StringFromArena(frame->dvert_idxs_arena),
|
|
|
|
StringFromArena(frame->dvert_idxs_arena),
|
|
|
|
.name = StringF(frame->arena, "dvert idxs [%F]", FmtSint(frame->tick))
|
|
|
|
.name = StringF(frame->arena, "dvert idxs [%F]", FmtSint(frame->tick))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
frame->dverts = G_PushStructuredBufferRef(frame->gpu_arena, dverts_buff, V_DVert);
|
|
|
|
frame->dverts = G_PushStructuredBufferRef(gpu_frame_arena, dverts_buff, V_DVert);
|
|
|
|
G_IndexBufferDesc dvert_idxs_ib = G_IdxBuff32(dvert_idxs_buff);
|
|
|
|
G_IndexBufferDesc dvert_idxs_ib = G_IdxBuff32(dvert_idxs_buff);
|
|
|
|
|
|
|
|
|
|
|
|
// Particles
|
|
|
|
// Particles
|
|
|
|
@ -4901,20 +4908,20 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gpu_emitters = G_PushBufferFromCpuCopy(
|
|
|
|
gpu_emitters = G_PushBufferFromCpuCopy(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
StringFromStructs(flattened_emitters, frame->emitters_count),
|
|
|
|
StringFromStructs(flattened_emitters, frame->emitters_count),
|
|
|
|
.name = StringF(frame->arena, "emitters [%F]", FmtSint(frame->tick))
|
|
|
|
.name = StringF(frame->arena, "emitters [%F]", FmtSint(frame->tick))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
frame->emitters = G_PushStructuredBufferRef(frame->gpu_arena, gpu_emitters, V_Emitter);
|
|
|
|
frame->emitters = G_PushStructuredBufferRef(gpu_frame_arena, gpu_emitters, V_Emitter);
|
|
|
|
|
|
|
|
|
|
|
|
// Upload gpu frame
|
|
|
|
// Upload gpu frame
|
|
|
|
G_ResourceHandle gpu_frame_res = G_PushBufferFromCpuCopy(
|
|
|
|
G_ResourceHandle gpu_frame_res = G_PushBufferFromCpuCopy(
|
|
|
|
frame->gpu_arena, frame->cl,
|
|
|
|
gpu_frame_arena, frame->cl,
|
|
|
|
StringFromStruct(&frame->shared_frame),
|
|
|
|
StringFromStruct(&frame->shared_frame),
|
|
|
|
.name = StringF(frame->arena, "Gpu frame [%F]", FmtSint(frame->tick))
|
|
|
|
.name = StringF(frame->arena, "Gpu frame [%F]", FmtSint(frame->tick))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
G_StructuredBufferRef gpu_frame = G_PushStructuredBufferRef(frame->gpu_arena, gpu_frame_res, V_SharedFrame);
|
|
|
|
G_StructuredBufferRef gpu_frame = G_PushStructuredBufferRef(gpu_frame_arena, gpu_frame_res, V_SharedFrame);
|
|
|
|
|
|
|
|
|
|
|
|
// Set initial constants
|
|
|
|
// Set initial constants
|
|
|
|
V_GpuFlag gpu_flags = V_GpuFlag_None;
|
|
|
|
V_GpuFlag gpu_flags = V_GpuFlag_None;
|
|
|
|
@ -5075,6 +5082,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|
|
|
//////////////////////////////
|
|
|
|
//////////////////////////////
|
|
|
|
//- Debug shapes pass
|
|
|
|
//- Debug shapes pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dvert_idxs_ib.count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
G_DumbMemoryLayoutSync(frame->cl, screen_target, G_Layout_DirectQueue_RenderTarget);
|
|
|
|
G_DumbMemoryLayoutSync(frame->cl, screen_target, G_Layout_DirectQueue_RenderTarget);
|
|
|
|
|
|
|
|
|
|
|
|
|