Indexing with non-constants offsets requires relative addressing in SM4. In assembly, this is written like in the following example:
```
x1[r1.x + 3]
```
The first part of this patch series only includes support for indexing vectors with non-constant indexes.
Following patches in https://gitlab.winehq.org/fcasas/vkd3d/-/commits/nonconst-offsets-3.
---
Non-constant indexing of vectors cannot be implemented with relative addressing in SM4 because this
indexation cannot be performed at the level of register-components, only whole registers.
Mathematical operations must be used instead.
For floats, the native compiler seems to index an identity matrix, to
get the i-th column, and then proceedes to compute the dot product
between that column and the vector. For ints, bit operations seem to be
performed.
While probably less efficient, this implementation complies with the
type-checking at the IR level and when writing bytecode.
--
v3: vkd3d-shader/hlsl: Support non-constant vector indexing.
vkd3d-shader/hlsl: Lower dot for non-float types.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/207
This fixes some crashes especially when dealing with very long C++ names
(like template classes).
Fortunately, dwarf internals don't require type lookup by name (eg.
on forward declaration), so the impact of thrashing some names is limited.
It's very likely native doesn't store directly these very long names
(it could either store the qualified mangled name - which can be way shorter
for template classes - or use the names in lexical hierarchy: both boil down
to storing less information, and recompute it (unmangle or class hierarchy
walk) upon request).
But this would need a proper C++ support in dbghelp. Not for today.
Signed-off-by: Eric Pouech <epouech(a)codeweavers.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2932