vkd3d-shader: Align the start offset instead of the size in bytecode_put_bytes().

The practical effect this has is that we avoid potential trailing padding at
the end of DXBC blobs. Unfortunately this also means we need to be more
careful about using bytecode_get_size() to find the offset where subsequent
data would get written, although in many cases this follows a put_u32() call.
This commit is contained in:
Henri Verbeet
2023-04-04 18:27:59 +02:00
committed by Alexandre Julliard
parent a0a3fb0e5f
commit d6d9aab31c
Notes: Alexandre Julliard 2023-04-04 22:36:34 +02:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/144
5 changed files with 23 additions and 19 deletions

View File

@@ -1094,6 +1094,11 @@ static inline size_t bytecode_get_size(struct vkd3d_bytecode_buffer *buffer)
return buffer->size;
}
static inline size_t bytecode_get_next_offset(struct vkd3d_bytecode_buffer *buffer)
{
return align(buffer->size, 4);
}
uint32_t vkd3d_parse_integer(const char *s);
struct vkd3d_shader_message_context