mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Handle error expressions in initializers.
This commit is contained in:
parent
dfe79cb6a9
commit
d95962068a
Notes:
Henri Verbeet
2024-10-17 17:39:41 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1185
@ -2512,6 +2512,14 @@ static void initialize_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *dst,
|
||||
{
|
||||
unsigned int store_index = 0;
|
||||
|
||||
/* If any of the elements has an error type, then initializer_size() is not
|
||||
* meaningful. */
|
||||
for (unsigned int i = 0; i < initializer->args_count; ++i)
|
||||
{
|
||||
if (initializer->args[i]->data_type->class == HLSL_CLASS_ERROR)
|
||||
return;
|
||||
}
|
||||
|
||||
if (initializer_size(initializer) != hlsl_type_component_count(dst->data_type))
|
||||
{
|
||||
hlsl_error(ctx, &initializer->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
|
||||
|
Loading…
Reference in New Issue
Block a user