cinera_handmade.network/cmuratori/hero/code/code332.hmml

40 lines
3.8 KiB
Plaintext

[video output=day332 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Disabling Sort for Debug Overlays" vod_platform=youtube id=9ZUndaaFNzg annotator=Miblo]
[0:08][Recap and set the stage for the day]
[1:03][Consider how to address the problem of sorting the debug overlay]
[3:26][Run the game, toggle on the sort groups and see the extent of the sorting in the debug overlay]
[4:34][build.bat: Temporarily switch to -O2, run the game and consult the profiler]
[5:50][handmade_debug.cpp: Consider how DrawFrameBars() could aggregate the rectangles]
[7:14][handmade_render_group.h: Introduce render_entry_rectangle_batch and render_entry_bitmap_batch structs]
[10:28][handmade_debug.cpp: Make DrawFrameBars() initialise a batch to pass to PushRect()]
[13:15][handmade_render_group.cpp: Begin to implement BeginRectangleBatch() and EndBatch()]
[16:41][handmade_render_group.h: Introduce rectangle_batch struct]
[17:33][handmade_render_group.cpp: Implement BeginRectangleBatch() as NewRectangleBatch() and leave out EndBatch() for now]
[22:03][handmade_render_group.cpp: Consider how the SortKey aggregation works]
[25:23][handmade_render_group.cpp: Make NewRectangleBatch() take SortZ and introduce a version of PushRect() that takes a rectangle_batch]
[33:30][handmade_render_group.cpp: Consider how to aggregate the bounds]
[35:02][handmade_render_group.cpp: Revert everything, in favour of turning off the sorting for the debug overlay]
[38:20][handmade_render.cpp: Enable SortEntries() to skip sorting and simplify BuildSpriteGraph()]
[44:31][handmade_render.cpp: Introduce UnsortedOutput()]
[47:22][Run the game and consult the profiler]
[47:38][handmade_render_group.cpp: Make PushSortBarrier() take a TurnOffSorting boolean and DEBUGEnd() set that value]
[50:55][Run the game and find that the debug overlay is now unsorted]
[51:51][handmade_debug_ui.cpp: Change the order in which TextOp() and BasicTextElement() draw]
[53:00][Run the game and consult the profiler]
[54:18][handmade_debug_ui.cpp: Enable the tooltips to be drawn last]
[56:26][handmade_debug_ui.cpp: Introduce DrawTooltips() and rework AddTooltip()]
[1:01:52][handmade_debug.cpp: Make DEBUGEnd() call DrawTooltips()]
[1:03:03][Run the game and see the tooltips correctly hovering]
[1:03:46][Q&A][:speech]
[1:05:31][@internal_static_void][Is internal a #define static internal]
[1:05:39][@anonymous519][Could you talk a bit about the metaprogramming stuff you use at work? I'm kind of annoyed at the limitations of C/C++ and it looks like the JAI compiler won't be released anytime soon. Do you actually parse the code and construct an AST, or is it simpler than that?]
[1:05:57][@internal_static_void][Also, are you a fan of templates or do you use void * instead]
[1:06:09][@mr4thdimention][Why was the grouping approach for speeding up the debug sorting the first one you tried? Would it have been better in some way?]
[1:08:31][@internal_static_void][So would you recommend using a .bat file or bash script over a cmake file, for instance]
[1:09:41][@internal_static_void][And finally, at your work are there any people that program in OOP, or are they shunned and thrown out?]
[1:11:04][@dr_s80][Related to yesterday's sim region issue, would it be feasible to merge overlapping regions, and then make a pass to slice it back up into non-overlapping regions?]
[1:11:30][@sean_bryant][Can you imagine any scenarios where batched rendering might be useful in Handmade Hero?]
[1:12:06][@anonymous519][I've only recently started to think about metaprogramming. Not expecting you to go in-depth, but could you briefly list some of the features you've implemented?]
[1:12:24][@longboolean][Will you be composing the music / SFX for Handmade Hero (if any) or do you have someone else doing that?]
[1:14:44][That's about it][:speech]
[/video]