use standard indentation style for multi-line function parameters
This commit is contained in:
parent
83f7c48369
commit
c1b768282f
@ -275,13 +275,15 @@ void W32_BootstrapLogs(String logfile_path)
|
|||||||
TempArena scratch = BeginScratchNoConflict();
|
TempArena scratch = BeginScratchNoConflict();
|
||||||
{
|
{
|
||||||
wchar_t *path_wstr = WstrFromString(scratch.arena, logfile_path);
|
wchar_t *path_wstr = WstrFromString(scratch.arena, logfile_path);
|
||||||
W32.logfile = CreateFileW(path_wstr,
|
W32.logfile = CreateFileW(
|
||||||
|
path_wstr,
|
||||||
FILE_APPEND_DATA,
|
FILE_APPEND_DATA,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
0,
|
0,
|
||||||
CREATE_ALWAYS,
|
CREATE_ALWAYS,
|
||||||
FILE_ATTRIBUTE_NORMAL,
|
FILE_ATTRIBUTE_NORMAL,
|
||||||
0);
|
0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
EndScratch(scratch);
|
EndScratch(scratch);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -742,12 +742,14 @@ void G_Compute(G_CommandListHandle cl, ComputeShader cs, Vec3I32 groups);
|
|||||||
|
|
||||||
//- Rasterize
|
//- Rasterize
|
||||||
|
|
||||||
void G_Rasterize(G_CommandListHandle cl,
|
void G_Rasterize(
|
||||||
|
G_CommandListHandle cl,
|
||||||
VertexShader vs, PixelShader ps,
|
VertexShader vs, PixelShader ps,
|
||||||
u32 instances_count, G_IndexBufferDesc index_buffer,
|
u32 instances_count, G_IndexBufferDesc index_buffer,
|
||||||
u32 render_targets_count, G_ResourceHandle *render_targets,
|
u32 render_targets_count, G_ResourceHandle *render_targets,
|
||||||
Rng3 viewport, Rng2 scissor,
|
Rng3 viewport, Rng2 scissor,
|
||||||
G_RasterMode mode);
|
G_RasterMode mode
|
||||||
|
);
|
||||||
|
|
||||||
//- Clear
|
//- Clear
|
||||||
|
|
||||||
|
|||||||
@ -106,9 +106,11 @@ void G_Bootstrap(void)
|
|||||||
{
|
{
|
||||||
if (first_gpu_name.len > 0)
|
if (first_gpu_name.len > 0)
|
||||||
{
|
{
|
||||||
error = StringF(scratch.arena,
|
error = StringF(
|
||||||
|
scratch.arena,
|
||||||
"Could not initialize device '%F' with D3D_FEATURE_LEVEL_12_0. Ensure that the device is capable and drivers are up to date.",
|
"Could not initialize device '%F' with D3D_FEATURE_LEVEL_12_0. Ensure that the device is capable and drivers are up to date.",
|
||||||
FmtString(first_gpu_name));
|
FmtString(first_gpu_name)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Panic(error);
|
Panic(error);
|
||||||
}
|
}
|
||||||
@ -2563,9 +2565,11 @@ void G_CopyBufferToTexture(G_CommandListHandle cl_handle, G_ResourceHandle dst_h
|
|||||||
|
|
||||||
void G_CopyTextureToTexture(G_CommandListHandle cl_handle, G_ResourceHandle dst_handle, Vec3I32 dst_offset, G_ResourceHandle src_handle, Rng3I32 src_copy_range)
|
void G_CopyTextureToTexture(G_CommandListHandle cl_handle, G_ResourceHandle dst_handle, Vec3I32 dst_offset, G_ResourceHandle src_handle, Rng3I32 src_copy_range)
|
||||||
{
|
{
|
||||||
if (src_copy_range.p1.x > src_copy_range.p0.x &&
|
if (
|
||||||
|
src_copy_range.p1.x > src_copy_range.p0.x &&
|
||||||
src_copy_range.p1.y > src_copy_range.p0.y &&
|
src_copy_range.p1.y > src_copy_range.p0.y &&
|
||||||
src_copy_range.p1.z > src_copy_range.p0.z)
|
src_copy_range.p1.z > src_copy_range.p0.z
|
||||||
|
)
|
||||||
{
|
{
|
||||||
G_D12_SharedState *g = &G_D12_shared_state;
|
G_D12_SharedState *g = &G_D12_shared_state;
|
||||||
G_D12_CmdList *cl = G_D12_CmdListFromHandle(cl_handle);
|
G_D12_CmdList *cl = G_D12_CmdListFromHandle(cl_handle);
|
||||||
@ -2638,12 +2642,14 @@ void G_Compute(G_CommandListHandle cl_handle, ComputeShader cs, Vec3I32 groups)
|
|||||||
|
|
||||||
//- Rasterize
|
//- Rasterize
|
||||||
|
|
||||||
void G_Rasterize(G_CommandListHandle cl_handle,
|
void G_Rasterize(
|
||||||
|
G_CommandListHandle cl_handle,
|
||||||
VertexShader vs, PixelShader ps,
|
VertexShader vs, PixelShader ps,
|
||||||
u32 instances_count, G_IndexBufferDesc index_buffer,
|
u32 instances_count, G_IndexBufferDesc index_buffer,
|
||||||
u32 render_targets_count, G_ResourceHandle *render_targets,
|
u32 render_targets_count, G_ResourceHandle *render_targets,
|
||||||
Rng3 viewport, Rng2 scissor,
|
Rng3 viewport, Rng2 scissor,
|
||||||
G_RasterMode mode)
|
G_RasterMode mode
|
||||||
|
)
|
||||||
{
|
{
|
||||||
G_D12_CmdList *cl = G_D12_CmdListFromHandle(cl_handle);
|
G_D12_CmdList *cl = G_D12_CmdListFromHandle(cl_handle);
|
||||||
G_D12_Cmd *cmd = G_D12_PushCmd(cl);
|
G_D12_Cmd *cmd = G_D12_PushCmd(cl);
|
||||||
@ -3059,7 +3065,8 @@ void G_D12_CollectionWorkerEntryPoint(WaveLaneCtx *lane)
|
|||||||
/* Copy print buffer to readback buffer */
|
/* Copy print buffer to readback buffer */
|
||||||
G_CopyBufferToBuffer(cl, queue->print_readback_buffer, 0, queue->print_buffer, RNGU64(0, queue->print_buffer_size));
|
G_CopyBufferToBuffer(cl, queue->print_readback_buffer, 0, queue->print_buffer, RNGU64(0, queue->print_buffer_size));
|
||||||
/* Reset counters to 0 */
|
/* Reset counters to 0 */
|
||||||
G_MemorySync(cl, queue->print_buffer,
|
G_MemorySync(
|
||||||
|
cl, queue->print_buffer,
|
||||||
G_Stage_Copy, G_Access_CopyRead,
|
G_Stage_Copy, G_Access_CopyRead,
|
||||||
G_Stage_Copy, G_Access_CopyWrite
|
G_Stage_Copy, G_Access_CopyWrite
|
||||||
);
|
);
|
||||||
|
|||||||
@ -81,12 +81,14 @@ String StringFromMetaErrors(Arena *arena, M_ErrorList errors)
|
|||||||
{
|
{
|
||||||
line_col = LineColFromPos(token_file_data, token_pos);
|
line_col = LineColFromPos(token_file_data, token_pos);
|
||||||
}
|
}
|
||||||
String formatted = StringF(scratch.arena,
|
String formatted = StringF(
|
||||||
|
scratch.arena,
|
||||||
"%F:%F:%F: error: %F",
|
"%F:%F:%F: error: %F",
|
||||||
FmtString(token_file),
|
FmtString(token_file),
|
||||||
FmtSint(line_col.line),
|
FmtSint(line_col.line),
|
||||||
FmtSint(line_col.col),
|
FmtSint(line_col.col),
|
||||||
FmtString(e->msg));
|
FmtString(e->msg)
|
||||||
|
);
|
||||||
PushStringToList(scratch.arena, &error_strings, formatted);
|
PushStringToList(scratch.arena, &error_strings, formatted);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -824,14 +826,16 @@ void BuildEntryPoint(WaveLaneCtx *lane)
|
|||||||
if (lane->idx == WaveLaneIdxFromTaskIdx(lane, task_idx++) && GetBuildStatus() == 0)
|
if (lane->idx == WaveLaneIdxFromTaskIdx(lane, task_idx++) && GetBuildStatus() == 0)
|
||||||
{
|
{
|
||||||
Build.c_obj.obj_file = StringF(perm, "%F_gen_c.obj", FmtString(cmdline.leaf_layer_name));
|
Build.c_obj.obj_file = StringF(perm, "%F_gen_c.obj", FmtString(cmdline.leaf_layer_name));
|
||||||
String cmd = StringF(perm,
|
String cmd = StringF(
|
||||||
|
perm,
|
||||||
"cl.exe /c %F -Fo:%F %F %F %F %F",
|
"cl.exe /c %F -Fo:%F %F %F %F %F",
|
||||||
FmtString(c_out_file),
|
FmtString(c_out_file),
|
||||||
FmtString(Build.c_obj.obj_file),
|
FmtString(Build.c_obj.obj_file),
|
||||||
FmtString(StringFromList(perm, cp.flags_msvc, Lit(" "))),
|
FmtString(StringFromList(perm, cp.flags_msvc, Lit(" "))),
|
||||||
FmtString(StringFromList(perm, cp.compiler_only_flags_msvc, Lit(" "))),
|
FmtString(StringFromList(perm, cp.compiler_only_flags_msvc, Lit(" "))),
|
||||||
FmtString(StringFromList(perm, cp.warnings_msvc, Lit(" "))),
|
FmtString(StringFromList(perm, cp.warnings_msvc, Lit(" "))),
|
||||||
FmtString(StringFromList(perm, cp.defs, Lit(" "))));
|
FmtString(StringFromList(perm, cp.defs, Lit(" ")))
|
||||||
|
);
|
||||||
OS_CommandResult cmd_result = OS_RunCommand(perm, cmd);
|
OS_CommandResult cmd_result = OS_RunCommand(perm, cmd);
|
||||||
String cmd_output = TrimWhitespace(cmd_result.output);
|
String cmd_output = TrimWhitespace(cmd_result.output);
|
||||||
Build.c_obj.output = cmd_output;
|
Build.c_obj.output = cmd_output;
|
||||||
@ -861,14 +865,16 @@ void BuildEntryPoint(WaveLaneCtx *lane)
|
|||||||
: e->kind == ShaderEntryKind_PS ? Lit("ps_6_6")
|
: e->kind == ShaderEntryKind_PS ? Lit("ps_6_6")
|
||||||
: e->kind == ShaderEntryKind_CS ? Lit("cs_6_6")
|
: e->kind == ShaderEntryKind_CS ? Lit("cs_6_6")
|
||||||
: Lit("vs_6_6");
|
: Lit("vs_6_6");
|
||||||
String compile_cmd = StringF(perm,
|
String compile_cmd = StringF(
|
||||||
|
perm,
|
||||||
"dxc.exe -T %F -E %F -Fo %F %F %F %F",
|
"dxc.exe -T %F -E %F -Fo %F %F %F %F",
|
||||||
FmtString(target),
|
FmtString(target),
|
||||||
FmtString(e->name),
|
FmtString(e->name),
|
||||||
FmtString(out_file),
|
FmtString(out_file),
|
||||||
FmtString(gpu_out_file),
|
FmtString(gpu_out_file),
|
||||||
FmtString(StringFromList(perm, cp.defs, Lit(" "))),
|
FmtString(StringFromList(perm, cp.defs, Lit(" "))),
|
||||||
FmtString(StringFromList(perm, cp.flags_dxc, Lit(" "))));
|
FmtString(StringFromList(perm, cp.flags_dxc, Lit(" ")))
|
||||||
|
);
|
||||||
|
|
||||||
OS_CommandResult cmd_result = OS_RunCommand(perm, compile_cmd);
|
OS_CommandResult cmd_result = OS_RunCommand(perm, compile_cmd);
|
||||||
gpu_obj->output = cmd_result.output;
|
gpu_obj->output = cmd_result.output;
|
||||||
@ -937,12 +943,14 @@ void BuildEntryPoint(WaveLaneCtx *lane)
|
|||||||
obj_files_str = StringFromList(perm, obj_files, Lit(" "));
|
obj_files_str = StringFromList(perm, obj_files, Lit(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
String cmd = StringF(perm,
|
String cmd = StringF(
|
||||||
|
perm,
|
||||||
"link.exe %F /OUT:%F %F %F",
|
"link.exe %F /OUT:%F %F %F",
|
||||||
FmtString(obj_files_str),
|
FmtString(obj_files_str),
|
||||||
FmtString(exe_file),
|
FmtString(exe_file),
|
||||||
FmtString(StringFromList(perm, cp.flags_msvc, Lit(" "))),
|
FmtString(StringFromList(perm, cp.flags_msvc, Lit(" "))),
|
||||||
FmtString(StringFromList(perm, cp.linker_only_flags_msvc, Lit(" "))));
|
FmtString(StringFromList(perm, cp.linker_only_flags_msvc, Lit(" ")))
|
||||||
|
);
|
||||||
OS_CommandResult result = OS_RunCommand(perm, cmd);
|
OS_CommandResult result = OS_RunCommand(perm, cmd);
|
||||||
Build.link.output = TrimWhitespace(result.output);
|
Build.link.output = TrimWhitespace(result.output);
|
||||||
Build.link.return_code = result.code;
|
Build.link.return_code = result.code;
|
||||||
|
|||||||
@ -12,7 +12,8 @@ String W32_StringFromError(Arena *arena, DWORD err)
|
|||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||||
(LPSTR)&msg_cstr,
|
(LPSTR)&msg_cstr,
|
||||||
0,
|
0,
|
||||||
0);
|
0
|
||||||
|
);
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
result = PushString(arena, TrimWhitespace(StringFromCstr(msg_cstr, len)));
|
result = PushString(arena, TrimWhitespace(StringFromCstr(msg_cstr, len)));
|
||||||
|
|||||||
@ -289,10 +289,12 @@ void P_MkDir(String path)
|
|||||||
}
|
}
|
||||||
if (err.len > 0)
|
if (err.len > 0)
|
||||||
{
|
{
|
||||||
String msg = StringF(scratch.arena,
|
String msg = StringF(
|
||||||
|
scratch.arena,
|
||||||
"Failed to create directory \"%F\": %F",
|
"Failed to create directory \"%F\": %F",
|
||||||
FmtString(path),
|
FmtString(path),
|
||||||
FmtString(err));
|
FmtString(err)
|
||||||
|
);
|
||||||
Panic(msg);
|
Panic(msg);
|
||||||
}
|
}
|
||||||
EndScratch(scratch);
|
EndScratch(scratch);
|
||||||
|
|||||||
@ -1072,7 +1072,8 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
FmtUint(datetime.minute, .z = 2),
|
FmtUint(datetime.minute, .z = 2),
|
||||||
FmtUint(datetime.second, .z = 2),
|
FmtUint(datetime.second, .z = 2),
|
||||||
FmtUint(datetime.milliseconds, .z = 3),
|
FmtUint(datetime.milliseconds, .z = 3),
|
||||||
FmtString(text));
|
FmtString(text)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
UI_PushCP(UI_NilKey);
|
UI_PushCP(UI_NilKey);
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1440,7 +1440,8 @@ void PP_UpdateUser(void)
|
|||||||
"normal: (%F, %F)\n"
|
"normal: (%F, %F)\n"
|
||||||
"num contacts: %F"
|
"num contacts: %F"
|
||||||
);
|
);
|
||||||
String text = StringF(temp.arena, fmt,
|
String text = StringF(
|
||||||
|
temp.arena, fmt,
|
||||||
FmtUint(e0->key.idx),
|
FmtUint(e0->key.idx),
|
||||||
FmtUint(e1->key.idx),
|
FmtUint(e1->key.idx),
|
||||||
FmtHex(point.key),
|
FmtHex(point.key),
|
||||||
@ -1448,7 +1449,8 @@ void PP_UpdateUser(void)
|
|||||||
FmtFloat(point.tangent_impulse),
|
FmtFloat(point.tangent_impulse),
|
||||||
FmtFloatP(point.starting_separation, 6),
|
FmtFloatP(point.starting_separation, 6),
|
||||||
FmtFloatP(data->normal.x, 6), FmtFloatP(data->normal.y, 6),
|
FmtFloatP(data->normal.x, 6), FmtFloatP(data->normal.y, 6),
|
||||||
FmtUint(data->num_points));
|
FmtUint(data->num_points)
|
||||||
|
);
|
||||||
|
|
||||||
draw_text(g->render_sig, disp_font, AddVec2(RoundVec2(MulXformV2(g->world_to_ui_xf, dbg_pt)), VEC2(0, offset_px)), text);
|
draw_text(g->render_sig, disp_font, AddVec2(RoundVec2(MulXformV2(g->world_to_ui_xf, dbg_pt)), VEC2(0, offset_px)), text);
|
||||||
}
|
}
|
||||||
@ -1557,11 +1559,13 @@ void PP_UpdateUser(void)
|
|||||||
"e1 pos: (%F, %F)\n"
|
"e1 pos: (%F, %F)\n"
|
||||||
"e1 rot: %F\n"
|
"e1 rot: %F\n"
|
||||||
);
|
);
|
||||||
String text = StringF(temp.arena, fmt,
|
String text = StringF(
|
||||||
|
temp.arena, fmt,
|
||||||
FmtFloatP(e0_xf.og.x, 24), FmtFloatP(e0_xf.og.y, 24),
|
FmtFloatP(e0_xf.og.x, 24), FmtFloatP(e0_xf.og.y, 24),
|
||||||
FmtFloatP(RotationFromXform(e0_xf), 24),
|
FmtFloatP(RotationFromXform(e0_xf), 24),
|
||||||
FmtFloatP(e1_xf.og.x, 24), FmtFloatP(e1_xf.og.y, 24),
|
FmtFloatP(e1_xf.og.x, 24), FmtFloatP(e1_xf.og.y, 24),
|
||||||
FmtFloatP(RotationFromXform(e1_xf), 24));
|
FmtFloatP(RotationFromXform(e1_xf), 24)
|
||||||
|
);
|
||||||
|
|
||||||
draw_text(g->render_sig, disp_font, AddVec2(RoundVec2(MulXformV2(g->world_to_ui_xf, VEC2(0, 0))), VEC2(0, offset_px)), text);
|
draw_text(g->render_sig, disp_font, AddVec2(RoundVec2(MulXformV2(g->world_to_ui_xf, VEC2(0, 0))), VEC2(0, offset_px)), text);
|
||||||
}
|
}
|
||||||
@ -2261,7 +2265,8 @@ void PP_UpdateUser(void)
|
|||||||
sig.sampler = GPU_SamplerStateRidFromResource(GPU_GetCommonPointSampler());
|
sig.sampler = GPU_SamplerStateRidFromResource(GPU_GetCommonPointSampler());
|
||||||
sig.instances = GPU_StructuredBufferRidFromResource(material_instances_buffer);
|
sig.instances = GPU_StructuredBufferRidFromResource(material_instances_buffer);
|
||||||
sig.grids = GPU_StructuredBufferRidFromResource(grids_buffer);
|
sig.grids = GPU_StructuredBufferRidFromResource(grids_buffer);
|
||||||
GPU_Rasterize(cl,
|
GPU_Rasterize(
|
||||||
|
cl,
|
||||||
&sig,
|
&sig,
|
||||||
PP_MaterialVS, PP_MaterialPS,
|
PP_MaterialVS, PP_MaterialPS,
|
||||||
2,
|
2,
|
||||||
@ -2269,7 +2274,8 @@ void PP_UpdateUser(void)
|
|||||||
scissor,
|
scissor,
|
||||||
material_instances_count,
|
material_instances_count,
|
||||||
GPU_GetCommonQuadIndices(),
|
GPU_GetCommonQuadIndices(),
|
||||||
GPU_RasterizeMode_TriangleList);
|
GPU_RasterizeMode_TriangleList
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Prep flood pass
|
//- Prep flood pass
|
||||||
@ -2352,10 +2358,12 @@ void PP_UpdateUser(void)
|
|||||||
sig.tex_width = g->render_size.x;
|
sig.tex_width = g->render_size.x;
|
||||||
sig.tex_height = g->render_size.y;
|
sig.tex_height = g->render_size.y;
|
||||||
sig.exposure = 2.0;
|
sig.exposure = 2.0;
|
||||||
sig.frame_seed = VEC4U32((u32)(RandU64FromState(&g->frame_rand) & 0xFFFFFFFF),
|
sig.frame_seed = VEC4U32(
|
||||||
(u32)(RandU64FromState(&g->frame_rand) & 0xFFFFFFFF),
|
(u32)(RandU64FromState(&g->frame_rand) & 0xFFFFFFFF),
|
||||||
(u32)(RandU64FromState(&g->frame_rand) & 0xFFFFFFFF),
|
(u32)(RandU64FromState(&g->frame_rand) & 0xFFFFFFFF),
|
||||||
(u32)(RandU64FromState(&g->frame_rand) & 0xFFFFFFFF));
|
(u32)(RandU64FromState(&g->frame_rand) & 0xFFFFFFFF),
|
||||||
|
(u32)(RandU64FromState(&g->frame_rand) & 0xFFFFFFFF)
|
||||||
|
);
|
||||||
sig.frame_index = g->frame_index;
|
sig.frame_index = g->frame_index;
|
||||||
sig.camera_offset = g->world_to_render_xf.og;
|
sig.camera_offset = g->world_to_render_xf.og;
|
||||||
sig.noise = GPU_Texture3DRidFromResource(GPU_GetCommonNoise());
|
sig.noise = GPU_Texture3DRidFromResource(GPU_GetCommonNoise());
|
||||||
|
|||||||
@ -103,7 +103,8 @@ UI_Box *PP_BuildDebugConsole(b32 minimized)
|
|||||||
FmtUintZ(datetime.minute, 2),
|
FmtUintZ(datetime.minute, 2),
|
||||||
FmtUintZ(datetime.second, 2),
|
FmtUintZ(datetime.second, 2),
|
||||||
FmtUintZ(datetime.milliseconds, 3),
|
FmtUintZ(datetime.milliseconds, 3),
|
||||||
FmtString(text));
|
FmtString(text)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
UI_PushCP(0);
|
UI_PushCP(0);
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,11 +21,13 @@ void PT_RunForever(WaveLaneCtx *lane)
|
|||||||
{
|
{
|
||||||
/* Push resources */
|
/* Push resources */
|
||||||
Vec2I32 final_target_size = window_frame.draw_size;
|
Vec2I32 final_target_size = window_frame.draw_size;
|
||||||
G_ResourceHandle final_target = G_PushTexture2D(gpu_frame_arena,
|
G_ResourceHandle final_target = G_PushTexture2D(
|
||||||
|
gpu_frame_arena,
|
||||||
G_Format_R16G16B16A16_Float,
|
G_Format_R16G16B16A16_Float,
|
||||||
final_target_size,
|
final_target_size,
|
||||||
G_Layout_DirectQueue_ShaderReadWrite,
|
G_Layout_DirectQueue_ShaderReadWrite,
|
||||||
.flags = G_ResourceFlag_AllowShaderReadWrite);
|
.flags = G_ResourceFlag_AllowShaderReadWrite
|
||||||
|
);
|
||||||
|
|
||||||
/* Push resource handles */
|
/* Push resource handles */
|
||||||
G_Texture2DRef final_target_rhandle = G_PushTexture2DRef(gpu_frame_arena, final_target);
|
G_Texture2DRef final_target_rhandle = G_PushTexture2DRef(gpu_frame_arena, final_target);
|
||||||
@ -54,12 +56,14 @@ void PT_RunForever(WaveLaneCtx *lane)
|
|||||||
|
|
||||||
/* Blit pass */
|
/* Blit pass */
|
||||||
{
|
{
|
||||||
G_Rasterize(cl,
|
G_Rasterize(
|
||||||
|
cl,
|
||||||
PT_BlitVS, PT_BlitPS,
|
PT_BlitVS, PT_BlitPS,
|
||||||
1, G_GetSharedQuadIndices(),
|
1, G_GetSharedQuadIndices(),
|
||||||
1, &window_frame.backbuffer,
|
1, &window_frame.backbuffer,
|
||||||
G_ViewportFromTexture(window_frame.backbuffer), G_ScissorFromTexture(window_frame.backbuffer),
|
G_ViewportFromTexture(window_frame.backbuffer), G_ScissorFromTexture(window_frame.backbuffer),
|
||||||
G_RasterMode_TriangleList);
|
G_RasterMode_TriangleList
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finalize backbuffer layout */
|
/* Finalize backbuffer layout */
|
||||||
|
|||||||
@ -25,7 +25,8 @@ String SETTINGS_StringFromWindowSettings(Arena *arena, const P_WindowSettings *s
|
|||||||
"}\n"
|
"}\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
String formatted = FormatString(arena,
|
String formatted = FormatString(
|
||||||
|
,
|
||||||
fmt,
|
fmt,
|
||||||
FmtString(minimized),
|
FmtString(minimized),
|
||||||
FmtString(maximized),
|
FmtString(maximized),
|
||||||
@ -33,7 +34,8 @@ String SETTINGS_StringFromWindowSettings(Arena *arena, const P_WindowSettings *s
|
|||||||
FmtSint(x),
|
FmtSint(x),
|
||||||
FmtSint(y),
|
FmtSint(y),
|
||||||
FmtSint(width),
|
FmtSint(width),
|
||||||
FmtSint(height));
|
FmtSint(height)
|
||||||
|
);
|
||||||
|
|
||||||
return formatted;
|
return formatted;
|
||||||
}
|
}
|
||||||
@ -162,11 +164,13 @@ abort:
|
|||||||
{
|
{
|
||||||
if (json_error.msg.len > 0)
|
if (json_error.msg.len > 0)
|
||||||
{
|
{
|
||||||
*error_out = StringF(arena,
|
*error_out = StringF(
|
||||||
|
arena,
|
||||||
Lit("%F\n(%F:%F)"),
|
Lit("%F\n(%F:%F)"),
|
||||||
FmtString(json_error.msg),
|
FmtString(json_error.msg),
|
||||||
FmtUint(json_error.start),
|
FmtUint(json_error.start),
|
||||||
FmtUint(json_error.end));
|
FmtUint(json_error.end)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -85,10 +85,12 @@ AC_Asset *SND_LoadAsset(ResourceKey resource, SND_SoundFlag flags, b32 wait)
|
|||||||
|
|
||||||
/* Generate and append sound flags to name key */
|
/* Generate and append sound flags to name key */
|
||||||
String name = NameFromResource(resource);
|
String name = NameFromResource(resource);
|
||||||
String key = StringF(scratch.arena,
|
String key = StringF(
|
||||||
|
scratch.arena,
|
||||||
"%F%F_sound",
|
"%F%F_sound",
|
||||||
FmtString(name),
|
FmtString(name),
|
||||||
FmtUint((u64)flags));
|
FmtUint((u64)flags)
|
||||||
|
);
|
||||||
u64 hash = AC_HashFromKey(key);
|
u64 hash = AC_HashFromKey(key);
|
||||||
b32 is_first_touch;
|
b32 is_first_touch;
|
||||||
AC_Asset *asset = AC_TouchCache(key, hash, &is_first_touch);
|
AC_Asset *asset = AC_TouchCache(key, hash, &is_first_touch);
|
||||||
|
|||||||
@ -24,20 +24,24 @@ JobImpl(SPR_LoadTexture, sig, _)
|
|||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
GPU_ArenaHandle gpu_perm = GPU_PermArena();
|
GPU_ArenaHandle gpu_perm = GPU_PermArena();
|
||||||
GPU_ResourceHandle gpu_resource = GPU_PushTexture2D(gpu_perm,
|
GPU_ResourceHandle gpu_resource = GPU_PushTexture2D(
|
||||||
|
gpu_perm,
|
||||||
GPU_Format_R8G8B8A8_Unorm_Srgb,
|
GPU_Format_R8G8B8A8_Unorm_Srgb,
|
||||||
VEC2I32(decoded.width, decoded.height),
|
VEC2I32(decoded.width, decoded.height),
|
||||||
GPU_Layout_AnyQueue_ShaderRead_CopyRead_CopyWrite_Present);
|
GPU_Layout_AnyQueue_ShaderRead_CopyRead_CopyWrite_Present
|
||||||
|
);
|
||||||
// texture->texture = gpu_tex;
|
// texture->texture = gpu_tex;
|
||||||
texture->width = decoded.width;
|
texture->width = decoded.width;
|
||||||
texture->height = decoded.height;
|
texture->height = decoded.height;
|
||||||
|
|
||||||
GPU_CommandListHandle cl = GPU_PrepareCommandList();
|
GPU_CommandListHandle cl = GPU_PrepareCommandList();
|
||||||
{
|
{
|
||||||
GPU_ReadTexelsFromCpu(cl,
|
GPU_ReadTexelsFromCpu(
|
||||||
|
cl,
|
||||||
gpu_resource, VEC3I32(0,0,0),
|
gpu_resource, VEC3I32(0,0,0),
|
||||||
decoded.pixels, VEC3I32(decoded.width, decoded.height, 1),
|
decoded.pixels, VEC3I32(decoded.width, decoded.height, 1),
|
||||||
RNG3I32(VEC3I32(0,0,0), VEC3I32(decoded.width, decoded.height, 1)));
|
RNG3I32(VEC3I32(0,0,0), VEC3I32(decoded.width, decoded.height, 1))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
GPU_CommitCommandList(cl, GPU_QueueKind_AsyncCopy);
|
GPU_CommitCommandList(cl, GPU_QueueKind_AsyncCopy);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1411,23 +1411,27 @@ void UI_EndFrame(UI_Frame *frame)
|
|||||||
if (rects_count > 0)
|
if (rects_count > 0)
|
||||||
{
|
{
|
||||||
/* Render rects */
|
/* Render rects */
|
||||||
G_Rasterize(frame->cl,
|
G_Rasterize(
|
||||||
|
frame->cl,
|
||||||
UI_DRectVS, UI_DRectPS,
|
UI_DRectVS, UI_DRectPS,
|
||||||
rects_count, G_QuadIndices(),
|
rects_count, G_QuadIndices(),
|
||||||
1, &draw_target,
|
1, &draw_target,
|
||||||
draw_viewport, draw_scissor,
|
draw_viewport, draw_scissor,
|
||||||
G_RasterMode_TriangleList);
|
G_RasterMode_TriangleList
|
||||||
|
);
|
||||||
|
|
||||||
/* Render rect wireframes */
|
/* Render rect wireframes */
|
||||||
if (AnyBit(frame->frame_flags, UI_FrameFlag_Debug))
|
if (AnyBit(frame->frame_flags, UI_FrameFlag_Debug))
|
||||||
{
|
{
|
||||||
G_SetConstant(frame->cl, UI_ShaderConst_DebugDraw, 1);
|
G_SetConstant(frame->cl, UI_ShaderConst_DebugDraw, 1);
|
||||||
G_Rasterize(frame->cl,
|
G_Rasterize(
|
||||||
|
frame->cl,
|
||||||
UI_DRectVS, UI_DRectPS,
|
UI_DRectVS, UI_DRectPS,
|
||||||
rects_count, G_QuadIndices(),
|
rects_count, G_QuadIndices(),
|
||||||
1, &draw_target,
|
1, &draw_target,
|
||||||
draw_viewport, draw_scissor,
|
draw_viewport, draw_scissor,
|
||||||
G_RasterMode_WireTriangleList);
|
G_RasterMode_WireTriangleList
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1437,12 +1441,14 @@ void UI_EndFrame(UI_Frame *frame)
|
|||||||
G_DumbMemoryLayoutSync(frame->cl, backbuffer, G_Layout_DirectQueue_RenderTargetWrite);
|
G_DumbMemoryLayoutSync(frame->cl, backbuffer, G_Layout_DirectQueue_RenderTargetWrite);
|
||||||
|
|
||||||
{
|
{
|
||||||
G_Rasterize(frame->cl,
|
G_Rasterize(
|
||||||
|
frame->cl,
|
||||||
UI_BlitVS, UI_BlitPS,
|
UI_BlitVS, UI_BlitPS,
|
||||||
1, G_QuadIndices(),
|
1, G_QuadIndices(),
|
||||||
1, &backbuffer,
|
1, &backbuffer,
|
||||||
monitor_viewport, monitor_scissor,
|
monitor_viewport, monitor_scissor,
|
||||||
G_RasterMode_TriangleList);
|
G_RasterMode_TriangleList
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DumbMemoryLayoutSync(frame->cl, backbuffer, G_Layout_AnyQueue_ShaderRead_CopyRead_CopyWrite_Present);
|
G_DumbMemoryLayoutSync(frame->cl, backbuffer, G_Layout_AnyQueue_ShaderRead_CopyRead_CopyWrite_Present);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user