[Bug 3029] the creation of the shaderTextHashTable isn't "correct"
bugzilla-daemon at icculus.org
bugzilla-daemon at icculus.org
Wed Aug 22 20:13:28 EDT 2007
http://bugzilla.icculus.org/show_bug.cgi?id=3029
tim at ngus.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Comment #2 from tim at ngus.net 2007-08-22 20:13 EDT -------
Well done for spotting the bug, I can't imagine how you came across it.
Turns out it's not really as bad as you think. For the first n - 1 shader files
(where n is the number of shader files) it is broken as you correctly point
out. When it reaches the last shader file however, ( i < numShaders - 1 )
becomes false, so the check for the next file is never actually made. Since
buffers[] is backwards relative to s_shaderText, p now effectively points to
s_shaderText. So the loading the last file actually hashes ALL the shaders.
This is why it doesn't /appear/ broken :)
So in actual fact, rather than a sparse hash table, it's actually overpopulated
to the tune of n - 1 entries.
Regardless of the result, this code is totally wacky, so I've fixed it by
getting rid of buffers[] after loading from the files and just hashing directly
on s_shaderText.
Fixed, pending commit.
--
Configure bugmail: http://bugzilla.icculus.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
More information about the quake3-bugzilla
mailing list