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

66 lines
5.4 KiB
Plaintext
Raw Normal View History

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Removing Records and Translation Units from the Debug Code" vod_platform=youtube id=hwLSZuxK6aU annotator=Miblo]
[1:05][Recap where we left last time and set the stage for the day]
[2:54][handmade_debug_interface.h: Throw all of the debug annotation code into this new header file]
[4:01][handmade_debug.h: Remove debug_variable entirely and give its functionality to debug_event]
[6:15][handmade_debug.cpp: Rename DEBUGVariableToText to DEBUGEventToText]
[6:30][handmade_debug.cpp: Introduce GetName]
[8:02][handmade_debug.cpp: Replace Var->Event. with Event->]
[8:10]["Everyone's happy and fine and dancing around..."][quote 284]
[12:14][handmade_debug_interface.h: Consider extending the concept of debug_event to support an additional Name and stop storing DebugRecordIndex]
[15:10][handmade_debug.cpp: Comment out Var->Name in CollateCreateVariable and ZeroStruct *Var]
[15:45][handmade_debug.cpp: Continue moving debug_variable functionality to debug_event]
[16:45][Debugger: Notice that we don't currently support some of the DebugTypes]
[18:06][handmade_debug.cpp: Assert that the Type != EndBlock]
[18:47][handmade_debug_interface.h: Remove DebugType_FirstUIType from debug_type]
[19:19][Run the game and see that it's all good]
[19:28][handmade_debug_interface.h: Replace DebugRecordIndex with *Name and remove TranslationUnit from debug_event]
[22:23][Pig Hat Time][quote 285]
[22:31][handmade_debug_interface.h: Stuff *FileName, *BlockName and LineNumber into debug_event and remove the concept of debug_record]
[28:25]["Sometimes you're dumb"][quote 283]
[28:54][handmade_debug.cpp: Change Source to Event]
[30:40][handmade_debug.h and .cpp: Change ScopeToRecord to be a char and change how it is used in DebugType_EndBlock]
[32:58][handmade_debug.cpp: Remove GetRecordFrom]
[33:26][handmade_debug.h: Add *Event to debug_frame_region]
[34:27][handmade_debug.cpp: Set ColorIndex to OpeningEvent->BlockName]
[35:15][handmade_debug.cpp: Rename Source to Event]
[35:26][handmade_debug.cpp: Change HotRecord to HotEvent]
[36:10][handmade_debug.cpp: Remove the check on GlobalDebugTable]
[36:25][Run the game and see that we're getting a lot closer]
[37:00][build.bat: Remove TRANSLATION_UNIT_INDEX]
[37:22][Run the game and check that it's still okay]
[37:25][handmade_debug_interface.h: Remove debug_record and put GetController back into handmade_platform.h]
[38:08][handmade_debug_interface.h: Move ThreadID and CoreIndex from threadid_coreindex to debug_event]
[39:07][Run the game and see that all is working nicely]
[39:19][handmade_debug_interface.h: Remove #define MAX_DEBUG_TRANSLATION_UNITS]
[39:50][handmade_optimized.cpp: Remove DebugRecords_Optimized_Count]
[40:08][handmade_debug.cpp: Remove DebugRecords nonsense]
[40:34][handmade_debug_interface.h: Consider packing debug_event a little more]
[42:18][handmade_debug.cpp: Add Var->BlockName back in to CollateCreateVariable]
[42:42][Run the game and see "Hot Entity" again]
[43:03][handmade_debug.cpp: Remove debug_event *Var]
[44:06][handmade_debug.cpp: Do CollateAddVariableGroup rather than CollateCreateGroupedVariable]
[45:10][handmade_debug.h: Remove DebugType_VarGroup from debug_type and call it OpenDataBlock everywhere]
[45:55][Debugger: Investigate why BeginBlock is happening]
[48:42][handmade_debug.cpp: Remove CollateCreateGroupedVariable]
[48:48][handmade_debug.cpp: Assert that Link->Event->Type != DebugType_BeginBlock in CollateAddVariableToGroup]
[49:14][Debugger: Inspect Stack and Depth]
[50:34][handmade_debug.cpp: Try doing RestartCollation on every frame]
[52:02][Run the game and find that it was an overwriting problem]
[52:50][Q&A]
[53:59][@hwd2ro][Will you get back to game related coding next week?]
[54:34][@fierydrake][Do you ever wear the piggie hat at work?]
[54:57][@elxenoaizd][What would be the thing that would impress you on a programmer's resume?]
[55:32][@thordurA][Bit off-topic, but when will you do the ODE stuff?]
[56:08][Blackboard: Ordinary Differential Equation]
[59:22][@culver_fly][I think he meant e^kt]
[1:01:36][@xDeadBringerx][I see a lot of branching in your code. Aren't you trashing the caches and the branch predictor?]
[1:05:16][@Angrycrow][Been soaking up so much of this stream as I catch up. I realized that I'm writing the usage code first nowadays. It's really streamlined my implementation brain. Just wanted to say thanks. Debate was great too]
[1:05:35][@ChronalDragon][Been learning about x86 assembly in one of my CS classes. Is there any way to force the compiler to use a register for a certain variable instead of a place on the stack?]
[1:06:59][@culver_fly][Just asking, but is it worthwhile to put so much effort on the debug system at this stage? There's a lot of things you're doing right now that I'm not sure how it will help in the future (maybe just because I have never programmed games before), but if I as a newbie game programmer were to work on this, do you suggest going as far as you're going right now or proceed on the gaming part to see what I need first before doing it?]
[1:08:37][@Mr4thDimention][Well if you would just replace the branches with polymorphism...]
[1:08:49][@elxenoaizd][What's more impressive: previous projects + practical experience vs college degree?]
[1:09:40][@JamesWidman][Compilers generally ignore the 'register' keyword]
[1:10:54][@xDeadBringerx][Ever thinking about running Handmade Hero through cachegrind?]
[1:13:05][Wind it down]
[/video]