vkd3d-shader: Document the null terminator appended for textual formats.

vkd3d_string_buffer uses vsnprintf() and therefore null-terminates when
appending, so no code changes are necessary.
This commit is contained in:
Elizabeth Figura
2025-09-02 18:04:37 -05:00
committed by Henri Verbeet
parent bb7c95f7d6
commit df1c94dd60
Notes: Henri Verbeet 2025-09-10 12:03:47 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1697

View File

@@ -422,10 +422,17 @@ struct vkd3d_shader_code
{ {
/** /**
* Pointer to the code. Note that textual formats are not null-terminated. * Pointer to the code. Note that textual formats are not null-terminated.
* Therefore \a size should not include a null terminator, when this * Therefore \a size should not include a null terminator when this
* structure is passed as input to a vkd3d-shader function, and the * structure is passed as input to a vkd3d-shader function, and \a size
* allocated string will not include a null terminator when this structure * will not include a null terminator when this structure is used as
* is used as output. * output.
*
* For convenience, vkd3d_shader_preprocess() and vkd3d_shader_compile()
* will append a null terminator past the end of their output when
* outputting textual formats like VKD3D_SHADER_TARGET_D3D_ASM. This makes
* it safe to call functions like strlen() on \a code for such output,
* although doing so will obviously not account for any embedded null
* characters that may be present.
*/ */
const void *code; const void *code;
/** Size of \a code, in bytes. */ /** Size of \a code, in bytes. */