mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Handle error instructions in hlsl_new_swizzle().
We already check for error instructions when parsing swizzles, but if allocation fails at codegen time we would like to avoid asserting when subsequently constructing a swizzle.
This commit is contained in:
committed by
Henri Verbeet
parent
4072aa4a4b
commit
79ad8c9354
Notes:
Henri Verbeet
2025-02-20 16:07:11 +01:00
Approved-by: Henri Verbeet (@hverbeet) Approved-by: Francisco Casas (@fcasas) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1370
@ -1865,6 +1865,9 @@ struct hlsl_ir_node *hlsl_new_swizzle(struct hlsl_ctx *ctx, uint32_t s, unsigned
|
||||
struct hlsl_ir_swizzle *swizzle;
|
||||
struct hlsl_type *type;
|
||||
|
||||
if (val->data_type->class == HLSL_CLASS_ERROR)
|
||||
return val;
|
||||
|
||||
VKD3D_ASSERT(val->data_type->class <= HLSL_CLASS_VECTOR);
|
||||
|
||||
if (!(swizzle = hlsl_alloc(ctx, sizeof(*swizzle))))
|
||||
|
Reference in New Issue
Block a user