vkd3d-shader/ir: Force fog and point size to 1 component when normalizing I/O.

This commit is contained in:
Elizabeth Figura 2024-10-05 12:13:39 -05:00 committed by Henri Verbeet
parent 5a513ffcec
commit a10ee075ff
Notes: Henri Verbeet 2024-11-05 20:06:25 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1247

View File

@ -1932,6 +1932,8 @@ static bool shader_dst_param_io_normalise(struct vkd3d_shader_dst_param *dst_par
const struct shader_signature *signature; const struct shader_signature *signature;
const struct signature_element *e; const struct signature_element *e;
write_mask = dst_param->write_mask;
switch (reg->type) switch (reg->type)
{ {
case VKD3DSPR_OUTPUT: case VKD3DSPR_OUTPUT:
@ -1987,6 +1989,10 @@ static bool shader_dst_param_io_normalise(struct vkd3d_shader_dst_param *dst_par
signature = normaliser->output_signature; signature = normaliser->output_signature;
reg->type = VKD3DSPR_OUTPUT; reg->type = VKD3DSPR_OUTPUT;
dcl_params = normaliser->output_dcl_params; dcl_params = normaliser->output_dcl_params;
/* Fog and point size are scalar, but fxc/d3dcompiler emits a full
* write mask when writing to them. */
if (reg->idx[0].offset > 0)
write_mask = VKD3DSP_WRITEMASK_0;
break; break;
default: default:
@ -1994,7 +2000,6 @@ static bool shader_dst_param_io_normalise(struct vkd3d_shader_dst_param *dst_par
} }
id_idx = reg->idx_count - 1; id_idx = reg->idx_count - 1;
write_mask = dst_param->write_mask;
if (!shader_signature_find_element_for_reg(signature, reg_idx, write_mask, &element_idx)) if (!shader_signature_find_element_for_reg(signature, reg_idx, write_mask, &element_idx))
vkd3d_unreachable(); vkd3d_unreachable();
e = &signature->elements[element_idx]; e = &signature->elements[element_idx];