Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
"Source type of a GEP instruction is not a pointer or aggregate.");
return;
}
if ((operand = sm6_parser_get_value_idx_by_ref(sm6, record, NULL, &operand_idx)) == SIZE_MAX)
return;
elem_value = &sm6->values[operand];
is_constant = sm6_value_is_constant(elem_value);
elem_idx = is_constant ? sm6_value_get_constant_uint(elem_value) : 0;
if (sm6_type_is_pointer(type))
type = type->u.pointer.type;
else
type = sm6_type_get_element_type_at_index(type, elem_idx);
In this case shouldn't you validate that the index is constant? Because if it's not it seems to me that the first field is selected without any error.