On Fri, 16 Apr 2021 at 02:04, Zebediah Figura zfigura@codeweavers.com wrote:
- ctab_start = buffer->count;
- put_dword(buffer, sizeof(D3DXSHADER_CONSTANTTABLE)); /* size of this header */
- put_dword(buffer, 0); /* creator */
...
- set_dword(buffer, ctab_start + 1, (buffer->count - ctab_start) * sizeof(*buffer->data));
- put_string(buffer, vkd3d_shader_get_version(NULL, NULL));
Just a thought, but it might be helpful for things like put_dword() and put_string() to return the offset at which they wrote something, so that you could instead do something like the following:
ctab_base = put_dword(buffer, sizeof(D3DXSHADER_CONSTANTTABLE)); creator_offset = put_dword(buffer, 0); ... offset = put_string(buffer, vkd3d_shader_get_version(NULL, NULL)); set_dword(buffer, creator_offset, (offset - ctab_base) * sizeof(*buffer->data));