formatting

This commit is contained in:
jacob 2026-02-05 17:13:12 -06:00
parent d7b7f8dfca
commit 4dbaa19024
3 changed files with 16 additions and 17 deletions

View File

@ -2753,7 +2753,7 @@ void V_TickForever(WaveLaneCtx *lane)
V_Window *window = PushStruct(perm, V_Window); V_Window *window = PushStruct(perm, V_Window);
window->panel = panel; window->panel = panel;
window->key = UI_RandKey(); // TODO: Don't use random keys window->key = UI_RandKey(); // TODO: Don't use random keys
window->is_ent_window = 1; window->is_prefab_window = 1;
DllQueuePushNP(panel->first_window, panel->last_window, window, next_in_panel, prev_in_panel); DllQueuePushNP(panel->first_window, panel->last_window, window, next_in_panel, prev_in_panel);
++panel->windows_count; ++panel->windows_count;
++V.windows_count; ++V.windows_count;
@ -3077,9 +3077,9 @@ void V_TickForever(WaveLaneCtx *lane)
{ {
tab_name = Lit("Tiles"); tab_name = Lit("Tiles");
} }
else if (window->is_ent_window) else if (window->is_prefab_window)
{ {
tab_name = Lit("Entities"); tab_name = Lit("Prefabs");
} }
else else
{ {
@ -3349,9 +3349,9 @@ void V_TickForever(WaveLaneCtx *lane)
} }
////////////////////////////// //////////////////////////////
//- Build spawn window //- Build prefab window
if (window->is_ent_window) if (window->is_prefab_window)
{ {
} }
} }
@ -4612,18 +4612,18 @@ void V_TickForever(WaveLaneCtx *lane)
} }
frame->emitters = G_PushStructuredBufferRef(frame->gpu_arena, gpu_emitters, V_Emitter); frame->emitters = G_PushStructuredBufferRef(frame->gpu_arena, gpu_emitters, V_Emitter);
// Upload gpu frame data // Upload gpu frame
{ {
// Gpu frame // Gpu frame
G_ResourceHandle gpu_frame = G_PushBufferFromCpuCopy( G_ResourceHandle gpu_frame_res = G_PushBufferFromCpuCopy(
frame->gpu_arena, frame->cl, frame->gpu_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_ref = G_PushStructuredBufferRef(frame->gpu_arena, gpu_frame, V_SharedFrame); G_StructuredBufferRef gpu_frame = G_PushStructuredBufferRef(frame->gpu_arena, gpu_frame_res, V_SharedFrame);
// Set constants // Set constants
G_SetConstant(frame->cl, V_ShaderConst_Frame, gpu_frame_ref); G_SetConstant(frame->cl, V_ShaderConst_Frame, gpu_frame);
G_SetConstant(frame->cl, V_ShaderConst_NoiseTex, G_BasicNoiseTexture()); G_SetConstant(frame->cl, V_ShaderConst_NoiseTex, G_BasicNoiseTexture());
} }
@ -4646,11 +4646,11 @@ void V_TickForever(WaveLaneCtx *lane)
G_Compute(frame->cl, V_ClearParticlesCS, V_ThreadGroupSizeFromBufferSize(V_ParticlesCap)); G_Compute(frame->cl, V_ClearParticlesCS, V_ThreadGroupSizeFromBufferSize(V_ParticlesCap));
} }
// Clear albedo RT
G_ClearRenderTarget(frame->cl, albedo_target, VEC4(0, 0, 0, 0));
// Discard screen RT // Discard screen RT
G_DiscardRenderTarget(frame->cl, screen_target); G_DiscardRenderTarget(frame->cl, screen_target);
// Clear albedo RT
G_ClearRenderTarget(frame->cl, albedo_target, VEC4(0, 0, 0, 0));
} }
// Sync // Sync

View File

@ -202,7 +202,7 @@ Struct(V_Window)
UI_Key key; UI_Key key;
b32 is_tile_window; b32 is_tile_window;
b32 is_ent_window; b32 is_prefab_window;
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -25,8 +25,7 @@ ComputeShader2D(V_PrepareShadeCS, 8, 8)
{ {
V_SharedFrame frame = G_Dereference<V_SharedFrame>(V_ShaderConst_Frame)[0]; V_SharedFrame frame = G_Dereference<V_SharedFrame>(V_ShaderConst_Frame)[0];
RWTexture2D<Vec4> shade = G_Dereference<Vec4>(frame.shade_rw); RWTexture2D<Vec4> shade = G_Dereference<Vec4>(frame.shade_rw);
Vec2 shade_pos = SV_DispatchThreadID; Vec2 shade_pos = SV_DispatchThreadID + 0.5;
if (all(shade_pos < countof(shade))) if (all(shade_pos < countof(shade)))
{ {
// Clear shade // Clear shade
@ -40,7 +39,7 @@ ComputeShader2D(V_PrepareCellsCS, 8, 8)
V_SharedFrame frame = G_Dereference<V_SharedFrame>(V_ShaderConst_Frame)[0]; V_SharedFrame frame = G_Dereference<V_SharedFrame>(V_ShaderConst_Frame)[0];
RWTexture2D<Vec4> cells = G_Dereference<Vec4>(frame.cells); RWTexture2D<Vec4> cells = G_Dereference<Vec4>(frame.cells);
RWTexture2D<f32> drynesses = G_Dereference<f32>(frame.drynesses); RWTexture2D<f32> drynesses = G_Dereference<f32>(frame.drynesses);
Vec2 cells_pos = SV_DispatchThreadID; Vec2 cells_pos = SV_DispatchThreadID + 0.5;
if (all(cells_pos < countof(cells))) if (all(cells_pos < countof(cells)))
{ {
// Clear cell // Clear cell
@ -306,7 +305,7 @@ ComputeShader2D(V_ShadeCS, 8, 8)
RWTexture2D<f32> drynesses = G_Dereference<f32>(frame.drynesses); RWTexture2D<f32> drynesses = G_Dereference<f32>(frame.drynesses);
SamplerState clamp_sampler = G_Dereference(frame.pt_clamp_sampler); SamplerState clamp_sampler = G_Dereference(frame.pt_clamp_sampler);
Vec2 shade_pos = SV_DispatchThreadID + Vec2(0.5, 0.5); Vec2 shade_pos = SV_DispatchThreadID + 0.5;
Vec2 world_pos = mul(frame.af.shade_to_world, Vec3(shade_pos, 1)); Vec2 world_pos = mul(frame.af.shade_to_world, Vec3(shade_pos, 1));
Vec2 cell_pos = mul(frame.af.world_to_cell, Vec3(world_pos, 1)); Vec2 cell_pos = mul(frame.af.world_to_cell, Vec3(world_pos, 1));
Vec2 tile_pos = mul(frame.af.world_to_tile, Vec3(world_pos, 1)); Vec2 tile_pos = mul(frame.af.world_to_tile, Vec3(world_pos, 1));