[video output=day250 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Cleaning Up Debug GUIDs" vod_platform=youtube id=ceMQT1DZkpo annotator=ffsjs]
[0:12][Setting the stage and getting right back into cleaning up the debug layer]
[2:21][Fixing compile errors after reactivating the -DHANDMADE_INTERNAL switch]
[3:10][handmade_world_mode.cpp: Removing EntityDebugID from the DEBUG_DATA_BLOCK() call and considering adding it in a DEBUG_VALUE() call, if needed]
[4:46][Replacing BlockName with GUID and further cleaning up the debug code]
[5:58][handmade_debug_interface.h: Wrapping names that pass through the system in DEBUG_NAME()]
[8:17][Fixing the TIMED_BLOCK macros]
[9:58][handmade_render.cpp: Changing various BEGIN_BLOCK() calls to reference strings]
[11:31][Removing names from END_BLOCK() calls]
[13:50][Running after fixing compile errors]
[16:58][handmade_debug.h: Deciding to simplify the debug_state struct]
[17:43][handmade_debug.cpp: Checking if and where HighPriorityQueue is used, and removing it afterwards]
[18:39][Removing the compiler feature from the debug system, but leaving it in place in the platform layer for the moment]
[22:17][Reacquainting with the debug view system]
[24:52][Breakdown of debug_view, debug_stored_event, debug_element and debug_tree]
[28:34][Parsing the content of the GUID in the debug_element in order to obtain a more readable format]
[30:04][handmade_debug.cpp: Hashing the strings in order for having them persistent across hot-reloads]
[35:46][handmade_debug.h: Re-adding the GUID to the debug_element struct]
[37:42][Storing the GUIDs in the persistent storage DebugArena]
[38:35][Parsing the GUIDs to obtain FileNameCount, LineNumber and NameStartsAt]
[41:16][handmade_debug_interface.h: Optimizing the UniqueFileCounterString__  macro for parsing]
[45:12][Adding functions to easily retrieve the name and filename using counted strings from the debug element GUID]
[47:17][Fixing compile errors]
[49:06][Running and verifying the results - the parsing partially works]
[50:21][handmade_debug.cpp: Reassigning the correct GUID when storing events so that they are safe across hot-reloads]
[53:47][Changing the pre-storing of the GUID with the already extracted name]
[54:28][Changing the separators from underscores to slashes]
[56:40][Q&A][:speech]
[56:56][@desuused][Please use the following hash computation: HashValue = HashValue * 65599 + *Scan; (sdbm, source: http://www.cse.yorku.ca/~oz/hash.html). Simply using a sum of chars *will* produce a lot of collisions. (source: http://programmers.stackexchange.com/a/145633)]
[1:00:47][@Pseudonym73][Yes, the reasoning behind the hash is that it's used for symbols in ELF. If you think about it, symbols tend to come in clusters: i, j, k, x1, x2, x3 etc. ElfHash is designed to behave sensibly in that case]
[1:03:29][@caffeine_storm][Do you have a stream schedule?]
[1:04:26][@Pseudonym73][Actually, could you humour me and look at the disassembly for that hash function? The 65599 one? I'm curious to know how well it compiles]
[1:09:33][@Cubercaleb][what is imul, int multiply?]
[1:16:18][@x13pixels][Dude, you inspired me to write a handmade Windows debugger. Thanks for everything you do]
[1:16:46][@Mojobojo][Why did you put the delta time of each frame into the input struct (Input->dtForFrame). That seemed a bit strange to me while looking through the source code today]
[1:17:13][@Cubercaleb][Why are the half-bytes of the hex value 1003fh reversed in the instruction. I could understand the bytes being reversed, but the half-bytes?]
[1:20:41][@quartertron][And you want Intel to ship a unifying ISA for all GPUs...]
[1:22:20][@x13pixels][I'll keep that in mind]
[1:22:54][@Mojobojo][Why was it passed in that structure? I was specifically looking for the delta time variable and that was the last place I expected it to be]
[1:24:13][@Mojobojo][To add on, since each player has their own input struct, passing it through each one when it's going to be the same for each player seems redundant]
[1:25:39][Wrap up. Thank you][:speech]
[/video]
