Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
+ "Multi-dimensional addressing in GEP instructions is not supported."); + return; + } + + if (!(dst->type = sm6_type_get_pointer_to_type(type, addr_space, sm6))) + { + FIXME("Failed to get pointer type for type %u.\n", type->class); + vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_MODULE, + "Module does not define a pointer type for a GEP instruction."); + return; + } + + reg = &dst->u.reg; + *reg = src->u.reg; + reg->idx[1].offset = 0; + register_index_address_init(®->idx[1], elem_value, sm6); Here the previous index of the register is replaced rather than added. So code like this:
%1 = some global address
%2 = GEP %1, 2
%3 = GEP %2, 3
will have `%3` initialized at 3 elements inside the global rather then 5. Is that intended? Maybe it would make sense to emit a warning if a situation like `%3` happens? Or to simply add the offset? Also, do we already have a way to have pointers to structs? `sm6_parser_declare_global()` allows us to declare arrays of scalars, but right now I don't remember anything about structs. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/471#note_52836