Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
GPU string overhaul (#1531)
* GPU string overhaul Big string cleanup, yet again, for GPU. We still had this tricky double indirection happening with strings for OptiX -- the string was a pointer to a "global", which in turn held the hash. No, throw all that out. Just directly store strings as the ustring hash on OptiX. No extra indirection. Many fewer differences between how things are handled on OptiX versus CPU (except for the fact itself that the "string" holds the hash rather than the char*). Some details worth noting: * LLVM_Util loses "type_string()" and calls it "type_ustring()" to emphasize it's the type we're using to represent a ustring, and definitely not a C or C++std string. Also, LLVM_Util itself now lets the caller tell it whether it prefers that the representation of a ustring be the charptr or the hash, and then handles most of the details internally. The BackendLLVM, then, makes that decision early on, charptr for CPU and hash for GPU. * Several more spots in LLVM_Util and BackendLLVM have been plumbed to pass around llvm IR SSA variable names to try to make the resulting LLVM IR more readable when I'm trying to debug it. (This was strictly debugging scaffalding aid for me, but comes along for the ride because it's useful to keep.) I also added a BackendLLVM::llnamefmt to format strings, which only does the formatting when the shading system knows it's going to save the IR for inspection, and otherwise (that is, in production) it does not do the string formatting or pass the names along, so it's not doing all that string manipulation when no human is going to be looking at the IR dumps. * A lot of clunky OptiX-only code disappears. * Some side effects of my reducing complexity of the IR as I debugged: there were times we were generating redundant pointer casting in the IR, such as grabbing a pointer, then casting it to a void*, then casting back to some other kind of pointer. In some cases I reduced that quite a bit. Again, this was mostly just a scramble to make the IR more readable while I debugged, but it probably has a minor performance gain as well since it reduced somewhat the sheer amount of IR we generate and pass to the optimizer and JIT. Signed-off-by: Larry Gritz <lg@larrygritz.com> * Remove register_string entirely from RendererServices Signed-off-by: Larry Gritz <lg@larrygritz.com> * Remove more register_string remnants Signed-off-by: Larry Gritz <lg@larrygritz.com> * comment typo Signed-off-by: Larry Gritz <lg@larrygritz.com>
- Loading branch information