15 Jul
2021
15 Jul
'21
3:54 a.m.
On 7/14/21 10:42 PM, Conor McCarthy wrote:
July 14, 2021 9:20 PM, "Henri Verbeet" <hverbeet(a)gmail.com> wrote:
+#define RANGE_STRING_SIZE 24 + +static void register_range_format_string(char range_str[RANGE_STRING_SIZE], + const struct vkd3d_shader_register_range *range) +{ + if (range->last != ~0u) + sprintf(range_str, "[%u:%u]", range->first, range->last); + else + sprintf(range_str, "[%u:*]", range->first); +} +
I'd prefer building that on top of the string buffer cache.
Where is this located?
struct vkd3d_string_buffer_cache and the vkd3d_string_buffer_*() helpers. It's currently only used in the HLSL compiler (which has its own wrappers for it, because of memory allocation failure tracking), but should probably be used more generally.