summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_uniforms.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2011-10-24 19:33:16 -0700
committerIan Romanick <[email protected]>2011-10-25 17:51:43 -0700
commitca95593d49a2d99a16c160c2a04acc4be007d8a4 (patch)
tree15754272e39bd38e586b73817983dfd1dd4deed0 /src/glsl/link_uniforms.cpp
parent960d722bf7db636863a05ddf9258236fccb58ecd (diff)
ralloc: Add new [v]asprintf_rewrite_tail functions.
This can be useful if you want to create a bunch of temporary strings with a common prefix. For example, when iterating over uniform structure fields, one might want to create temporary strings like "pallete.primary", "palette.outline", and "pallette.shadow". This could be done by overwriting the '.' with a null-byte and calling ralloc_asprintf_append, but that incurs the cost of strlen("pallete") every time...when this is already known. These new functions allow you rewrite the tail of the string, given a starting index. If the starting index is the length of the string, this is equivalent to appending. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/link_uniforms.cpp')
0 files changed, 0 insertions, 0 deletions