Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.c:
> type->reg_size[HLSL_REGSET_TEXTURES] = 1;
> break;
>
> + case HLSL_CLASS_UAV:
> + type->reg_size[HLSL_REGSET_UAVS] = 1;
> + break;
Maybe you just don't care, but this could be
```c
case HLSL_CLASS_SAMPLER:
case HLSL_CLASS_TEXTURE:
case HLSL_CLASS_UAV:
type->reg_size[type_get_regset(type)] = 1;
break;
```
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/781#note_67911
Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.c:
> return type->reg_size[regset];
> }
>
> +static struct hlsl_type *hlsl_new_simple_type(struct hlsl_ctx *ctx, const char *name, enum hlsl_type_class class)
> +{
> + struct hlsl_type *type;
> +
> + if (!(type = hlsl_alloc(ctx, sizeof(*type))))
> + return NULL;
> + if (!(type->name = hlsl_strdup(ctx, name)))
> + {
> + vkd3d_free(type);
> + return NULL;
> + }
> + type->class = class;
This doesn't set `dimx` and `dimy`, while in the documentation for `struct hlsl_type` we specify them for all classes. Either relaxing the specification or setting them here is fine for me, but at least one of those should happen, I think.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/781#note_67910
Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/d3dbc.c:
> return D3DXPC_STRUCT;
> case HLSL_CLASS_VECTOR:
> return D3DXPC_VECTOR;
> - default:
> - ERR("Invalid class %#x.\n", type->class);
> - vkd3d_unreachable();
> + case HLSL_CLASS_VOID:
> + /* This shouldn't happen. */
Is the comment useful? Doesn't the following `vkd3d_unreachable()` already convey that information?
Also, could you please add a `break`? clang seems to be touchy about it:
```
../libs/vkd3d-shader/d3dbc.c:1521:30: error: label at end of compound statement: expected statement
case HLSL_CLASS_VOID:
^
;
1 error generated.
make[1]: *** [libs/vkd3d-shader/libvkd3d_shader_la-d3dbc.lo] Error 1
```
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/781#note_67909
Shader Model 6 wave ops require instructions not available by extension in SPIR-V 1.0, and device support info is found in VkPhysicalDeviceSubgroupProperties, which also has no equivalent by extension in Vulkan 1.0.
--
v3: vkd3d-shader: Introduce a wave ops feature flag.
vkd3d: Use Vulkan 1.1 if available.
vkd3d-shader: Introduce SPIRV_ENVIRONMENT_VULKAN_1_1.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/776
~~This goes atop !773. The last three commits belong to this MR.~~
Trampolines and launchers allow us to handle code doing multilevel jumps, but they partially virtualize the control flow, which potentially makes the jobs of downstream compilers harder. So we avoid them every time we can.
--
v2: vkd3d-shader/ir: Only emit launchers when needed.
vkd3d-shader/ir: Only emit trampolines when needed.
vkd3d-shader/ir: Swap selection branches if the if branch is empty.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/785
These tests cover code paths untested in DXIL, except for the last commit which is to catch any signed int resource issues.
--
v3: tests/hlsl: Add tests for texture UAV signed atomics.
tests/hlsl: Add tests for texture UAV atomics.
tests/hlsl: Add a test for UAV InterlockedExchange().
tests/hlsl: Add a test for a structured UAV scalar store.
tests/hlsl: Add tests for min() and integer max().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/684