formatting

This commit is contained in:
jacob 2025-07-18 09:27:30 -05:00
parent 0c1047bc9c
commit 37796ea505
2 changed files with 55 additions and 72 deletions

View File

@ -44,7 +44,7 @@ INLINE float4 get_light_in_dir(uint2 pos, float2 dir)
uint2 flood = g_emittance_flood_textures[g_constants.emittance_flood_tex_urid][at];
int2 dist_vec = (int2)at - (int2)flood;
float dist = length(dist_vec);
if (dist <= 1) {
if (dist <= 2) {
result = g_gbuff_textures[g_constants.emittance_tex_urid][flood];
break;
} else {

View File

@ -714,7 +714,7 @@ INTERNAL void dx12_init_pipelines(void)
desc->rtvs[0].blending = 1;
dict_set(G.pipelines_arena, G.pipeline_descs, hash_fnv64(HASH_FNV64_BASIS, desc->name), (u64)desc);
}
/* Material pipeline */
/* UI pipeline */
{
struct pipeline_desc *desc = arena_push(G.pipelines_arena, struct pipeline_desc);
desc->name = LIT("ui");
@ -2667,7 +2667,8 @@ void gp_run_render(struct gp_render_sig *render_sig, struct gp_render_params par
struct command_queue *cq = G.command_queues[DX12_QUEUE_DIRECT];
struct command_list *cl = command_list_open(cq->cl_pool);
{
__profnc_dx12(cl->cq->prof, cl->cl, "Run", RGB32_F(0.5, 0.2, 0.2));
__profn("Run render");
__profnc_dx12(cl->cq->prof, cl->cl, "Run render", RGB32_F(0.5, 0.2, 0.2));
struct mat4x4 vp_matrix = calculate_vp(params.draw_target_view, params.draw_target_viewport.width, params.draw_target_viewport.height);
/* Upload dummmy vert & index buffer */
@ -2764,10 +2765,6 @@ void gp_run_render(struct gp_render_sig *render_sig, struct gp_render_params par
__profn("Material pass");
__profnc_dx12(cl->cq->prof, cl->cl, "Material pass", RGB32_F(0.5, 0.2, 0.2));
/* Dispatch */
__profn("Material pass run");
__profnc_dx12(cl->cq->prof, cl->cl, "Material pass run", RGB32_F(0.5, 0.2, 0.2));
/* Bind pipeline */
ID3D12GraphicsCommandList_SetPipelineState(cl->cl, material_pipeline->pso);
ID3D12GraphicsCommandList_SetGraphicsRootSignature(cl->cl, material_pipeline->rootsig);
@ -2894,10 +2891,6 @@ void gp_run_render(struct gp_render_sig *render_sig, struct gp_render_params par
__profn("Shade pass");
__profnc_dx12(cl->cq->prof, cl->cl, "Shade pass", RGB32_F(0.5, 0.2, 0.2));
/* Dispatch */
__profn("Shade pass run");
__profnc_dx12(cl->cq->prof, cl->cl, "Shade pass run", RGB32_F(0.5, 0.2, 0.2));
/* Bind pipeline */
ID3D12GraphicsCommandList_SetPipelineState(cl->cl, shade_pipeline->pso);
ID3D12GraphicsCommandList_SetComputeRootSignature(cl->cl, shade_pipeline->rootsig);
@ -3050,7 +3043,8 @@ void gp_run_ui(struct gp_ui_sig *ui_sig, struct gp_ui_params params)
struct command_queue *cq = G.command_queues[DX12_QUEUE_DIRECT];
struct command_list *cl = command_list_open(cq->cl_pool);
{
__profnc_dx12(cl->cq->prof, cl->cl, "Run", RGB32_F(0.5, 0.2, 0.2));
__profn("Run ui");
__profnc_dx12(cl->cq->prof, cl->cl, "Run ui", RGB32_F(0.5, 0.2, 0.2));
struct mat4x4 vp_matrix = calculate_vp(params.draw_target_view, params.draw_target_viewport.width, params.draw_target_viewport.height);
/* Upload dummmy vert & index buffer */
@ -3118,14 +3112,9 @@ void gp_run_ui(struct gp_ui_sig *ui_sig, struct gp_ui_params params)
}
/* UI rect pass */
{
__profn("UI rect");
__profnc_dx12(cl->cq->prof, cl->cl, "UI rect", RGB32_F(0.5, 0.2, 0.2));
/* Dispatch */
if (ui_pipeline->success) {
__profn("UI rect run");
__profnc_dx12(cl->cq->prof, cl->cl, "UI rect run", RGB32_F(0.5, 0.2, 0.2));
__profn("UI rect pass");
__profnc_dx12(cl->cq->prof, cl->cl, "UI rect pass", RGB32_F(0.5, 0.2, 0.2));
/* Bind pipeline */
ID3D12GraphicsCommandList_SetPipelineState(cl->cl, ui_pipeline->pso);
@ -3155,18 +3144,12 @@ void gp_run_ui(struct gp_ui_sig *ui_sig, struct gp_ui_params params)
ID3D12GraphicsCommandList_IASetIndexBuffer(cl->cl, &ibv);
ID3D12GraphicsCommandList_DrawIndexedInstanced(cl->cl, 6, instance_count, 0, 0, 0);
}
}
/* Shape pass */
{
if (shape_pipeline->success) {
__profn("Shape pass");
__profnc_dx12(cl->cq->prof, cl->cl, "Shape pass", RGB32_F(0.5, 0.2, 0.2));
/* Dispatch */
if (shape_pipeline->success) {
__profn("Shape pass run");
__profnc_dx12(cl->cq->prof, cl->cl, "Shape pass run", RGB32_F(0.5, 0.2, 0.2));
/* Bind pipeline */
ID3D12GraphicsCommandList_SetPipelineState(cl->cl, shape_pipeline->pso);
ID3D12GraphicsCommandList_SetGraphicsRootSignature(cl->cl, shape_pipeline->rootsig);
@ -3194,7 +3177,6 @@ void gp_run_ui(struct gp_ui_sig *ui_sig, struct gp_ui_params params)
ID3D12GraphicsCommandList_DrawIndexedInstanced(cl->cl, index_count, 1, 0, 0, 0);
}
}
}
command_list_close(cl);
pipeline_scope_end(pipeline_scope);
sprite_scope_end(sprite_scope);
@ -3400,6 +3382,7 @@ INTERNAL void present_blit(struct swapchain_buffer *dst, struct dx12_resource *s
struct command_queue *cq = G.command_queues[DX12_QUEUE_DIRECT];
struct command_list *cl = command_list_open(cq->cl_pool);
{
__profn("Blit");
__profnc_dx12(cl->cq->prof, cl->cl, "Blit", RGB32_F(0.5, 0.2, 0.2));
struct swapchain *swapchain = dst->swapchain;