mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
tests/vkd3d-shader: Set uninitialized uniforms to a value.
Avoids a potential source of non-determinism because the padding bytes between uniforms could be left uninitialized.
This commit is contained in:
parent
5eba031fa1
commit
0f9f5269e9
Notes:
Alexandre Julliard
2024-02-13 23:11:43 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/616
@ -551,9 +551,13 @@ static void set_resource(struct shader_runner *runner, struct resource *resource
|
||||
|
||||
static void set_uniforms(struct shader_runner *runner, size_t offset, size_t count, const void *uniforms)
|
||||
{
|
||||
size_t initial_count = runner->uniform_count;
|
||||
|
||||
runner->uniform_count = align(max(runner->uniform_count, offset + count), 4);
|
||||
vkd3d_array_reserve((void **)&runner->uniforms, &runner->uniform_capacity,
|
||||
runner->uniform_count, sizeof(*runner->uniforms));
|
||||
memset(runner->uniforms + initial_count, 127,
|
||||
(runner->uniform_count - initial_count) * sizeof(*runner->uniforms));
|
||||
memcpy(runner->uniforms + offset, uniforms, count * sizeof(*runner->uniforms));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user