This commit is part of a series of commits intended to remove all uses of hlsl_type_get_regset().
However, I think it deserves to be upstreamed sooner since it solves a rather important SM1 regression (explained below) introduced in e0031d2a1f40792ac85619a495bf5197f248b0e1 .
---
In SM1 we can expect all variables to always belong to a single regset.
structs in particular, should always be allocated to HLSL_REGSET_NUM,
since they are only allowed if all their components are numeric.
We are not covering the structs case because of the use of
hlsl_type_get_regset(), which is currently not defined for structs.
So the current shader
```hlsl
struct
{
float4 a;
float4 b;
} apple;
float4 main() : sv_target
{
return apple.a + apple.b;
}
```
fails with
```
vkd3d/libs/vkd3d-shader/hlsl.c:224: Aborting, reached unreachable code.
```
The solution is to iterate over all regsets to find the one where the
variable is allocated (if any), and ignore all others.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/236
On Fri Jun 23 06:46:32 2023 +0000, Huw Davies wrote:
> This is changing the allocator for `vols`, so you'll need commits that
> change that first.
> As this MR is already too long, let's split this into a new one and
> leave the first seven or eight commits here.
Sounds good. `malloc()` and `free()` are preferred, right?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3112#note_36613
Huw Davies (@huw) commented about dlls/winealsa.drv/mmdevdrv.c:
> - params.duration = duration;
> - params.period = period;
> - params.fmt = fmt;
> - params.channel_count = &channel_count;
> - params.stream = &stream;
> -
> - ALSA_CALL(create_stream, ¶ms);
> -
> - free(name);
> -
> - if(FAILED(params.result)){
> - sessions_unlock();
> - return params.result;
> - }
> -
> - This->vols = HeapAlloc(GetProcessHeap(), 0, channel_count * sizeof(float));
This is changing the allocator for `vols`, so you'll need commits that change that first.
As this MR is already too long, let's split this into a new one and leave the first seven or eight commits here.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3112#note_36612