Module: vkd3d Branch: master Commit: 6e634ad6902000363788cb0a4baad4e00e4389c5 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/6e634ad6902000363788cb0a4baad4...
Author: Conor McCarthy cmccarthy@codeweavers.com Date: Fri Feb 9 12:02:13 2024 +1000
vkd3d-shader: Raise the instruction parameter allocation size if necessary.
Monolithic switch instructions have no definite case count limit.
---
libs/vkd3d-shader/vkd3d_shader_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 1ef8d949..ebabf50e 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -2048,9 +2048,12 @@ void *shader_param_allocator_get(struct vkd3d_shader_param_allocator *allocator,
if (count > allocator->count - allocator->index) { - struct vkd3d_shader_param_node *next = shader_param_allocator_node_create(allocator); + struct vkd3d_shader_param_node *next;
- if (!next) + /* Monolithic switch has no definite parameter count limit. */ + allocator->count = max(allocator->count, count); + + if (!(next = shader_param_allocator_node_create(allocator))) return NULL; if (allocator->current) allocator->current->next = next;