mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/d3dbc: Destroy the SM1 parser on parsing errors.
This commit is contained in:
parent
d1cb6b41b1
commit
a2fb9588c7
Notes:
Alexandre Julliard
2023-09-22 22:46:19 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/317
@ -1341,12 +1341,19 @@ int vkd3d_shader_sm1_parser_create(const struct vkd3d_shader_compile_info *compi
|
|||||||
++instructions->count;
|
++instructions->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
*parser = &sm1->p;
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(sm1->p.shader_desc.flat_constant_count); ++i)
|
for (i = 0; i < ARRAY_SIZE(sm1->p.shader_desc.flat_constant_count); ++i)
|
||||||
sm1->p.shader_desc.flat_constant_count[i].external = get_external_constant_count(sm1, i);
|
sm1->p.shader_desc.flat_constant_count[i].external = get_external_constant_count(sm1, i);
|
||||||
|
|
||||||
return sm1->p.failed ? VKD3D_ERROR_INVALID_SHADER : VKD3D_OK;
|
if (sm1->p.failed)
|
||||||
|
{
|
||||||
|
WARN("Failed to parse shader.\n");
|
||||||
|
shader_sm1_destroy(&sm1->p);
|
||||||
|
return VKD3D_ERROR_INVALID_SHADER;
|
||||||
|
}
|
||||||
|
|
||||||
|
*parser = &sm1->p;
|
||||||
|
|
||||||
|
return VKD3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hlsl_sm1_register_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semantic *semantic,
|
bool hlsl_sm1_register_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semantic *semantic,
|
||||||
|
Loading…
Reference in New Issue
Block a user