vkd3d-shader/ir: Check that SAMPLEMASK registers have dimension SCALAR.

Also fix the DXIL parser to emit them accordingly.
This commit is contained in:
Giovanni Mascellani
2025-07-18 20:20:33 +02:00
committed by Henri Verbeet
parent 226afa47c4
commit b02c3759be
Notes: Henri Verbeet 2025-07-22 17:20:14 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1631
2 changed files with 2 additions and 4 deletions

View File

@@ -4104,6 +4104,7 @@ static enum vkd3d_shader_register_type register_type_from_dxil_semantic_kind(
case VKD3D_SHADER_SV_SAMPLE_INDEX:
return VKD3DSPR_NULL;
case VKD3D_SHADER_SV_COVERAGE:
*dimension = is_input ? VSIR_DIMENSION_VEC4 : VSIR_DIMENSION_SCALAR;
return is_input ? VKD3DSPR_COVERAGE : VKD3DSPR_SAMPLEMASK;
case VKD3D_SHADER_SV_DEPTH:
*dimension = VSIR_DIMENSION_SCALAR;

View File

@@ -9553,6 +9553,7 @@ static void vsir_validate_register(struct validation_context *ctx,
[VKD3DSPR_LOCALTHREADID] = {true, 0, VSIR_DIMENSION_VEC4},
[VKD3DSPR_LOCALTHREADINDEX] = {true, 0, VSIR_DIMENSION_VEC4},
[VKD3DSPR_COVERAGE] = {true, 0, VSIR_DIMENSION_VEC4},
[VKD3DSPR_SAMPLEMASK] = {true, 0, VSIR_DIMENSION_SCALAR},
[VKD3DSPR_DEPTHOUTGE] = {true, 0, VSIR_DIMENSION_SCALAR},
[VKD3DSPR_DEPTHOUTLE] = {true, 0, VSIR_DIMENSION_SCALAR},
};
@@ -9691,10 +9692,6 @@ static void vsir_validate_register(struct validation_context *ctx,
vsir_validate_register_without_indices(ctx, reg);
break;
case VKD3DSPR_SAMPLEMASK:
vsir_validate_register_without_indices(ctx, reg);
break;
case VKD3DSPR_GSINSTID:
vsir_validate_register_without_indices(ctx, reg);
break;