vkd3d-shader/hlsl: Handle error expressions in array indexes.

This commit is contained in:
Elizabeth Figura 2024-08-29 12:48:23 -05:00 committed by Henri Verbeet
parent 41ff4343e1
commit c66f25016b
Notes: Henri Verbeet 2024-10-07 17:53:50 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1148

View File

@ -1012,6 +1012,12 @@ static bool add_array_access(struct hlsl_ctx *ctx, struct hlsl_block *block, str
const struct hlsl_type *expr_type = array->data_type, *index_type = index->data_type;
struct hlsl_ir_node *return_index, *cast;
if (array->data_type->class == HLSL_CLASS_ERROR || index->data_type->class == HLSL_CLASS_ERROR)
{
block->value = ctx->error_instr;
return true;
}
if ((expr_type->class == HLSL_CLASS_TEXTURE || expr_type->class == HLSL_CLASS_UAV)
&& expr_type->sampler_dim != HLSL_SAMPLER_DIM_GENERIC)
{