mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
tests: Store resources in a fixed-size array.
We will need to allocate some structures in the Vulkan backend; this is easier if we don't need to worry about allocating them dynamically. Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
02182ce4f7
commit
e208d87847
@ -327,7 +327,9 @@ static void set_resource(struct shader_runner *runner, struct resource *resource
|
||||
}
|
||||
}
|
||||
|
||||
runner->resources = realloc(runner->resources, (runner->resource_count + 1) * sizeof(*runner->resources));
|
||||
if (runner->resource_count == MAX_RESOURCES)
|
||||
fatal_error("Too many resources declared.\n");
|
||||
|
||||
runner->resources[runner->resource_count++] = resource;
|
||||
}
|
||||
|
||||
@ -846,7 +848,6 @@ out:
|
||||
if (runner->resources[i])
|
||||
runner->ops->destroy_resource(runner, runner->resources[i]);
|
||||
}
|
||||
free(runner->resources);
|
||||
|
||||
fclose(f);
|
||||
|
||||
|
@ -87,6 +87,8 @@ struct input_element
|
||||
unsigned int index;
|
||||
};
|
||||
|
||||
#define MAX_RESOURCES 32
|
||||
|
||||
struct shader_runner
|
||||
{
|
||||
const struct shader_runner_ops *ops;
|
||||
@ -98,7 +100,7 @@ struct shader_runner
|
||||
uint32_t *uniforms;
|
||||
size_t uniform_count, uniform_capacity;
|
||||
|
||||
struct resource **resources;
|
||||
struct resource *resources[MAX_RESOURCES];
|
||||
size_t resource_count;
|
||||
|
||||
struct sampler *samplers;
|
||||
|
Loading…
Reference in New Issue
Block a user