vkd3d-shader/hlsl: Enforce FOG component count for sm1 VS output.

This commit is contained in:
Elizabeth Figura 2024-11-04 22:33:13 -06:00 committed by Henri Verbeet
parent f50b20ddd6
commit 5a513ffcec
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
2 changed files with 5 additions and 1 deletions

View File

@ -6523,6 +6523,10 @@ static void generate_vsir_signature_entry(struct hlsl_ctx *ctx, struct vsir_prog
&& program->shader_version.type == VKD3D_SHADER_TYPE_VERTEX && var->data_type->dimx > 1) && program->shader_version.type == VKD3D_SHADER_TYPE_VERTEX && var->data_type->dimx > 1)
hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SEMANTIC, hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SEMANTIC,
"PSIZE output must have only 1 component in this shader model."); "PSIZE output must have only 1 component in this shader model.");
if (!ascii_strcasecmp(var->semantic.name, "FOG") && output && program->shader_version.major < 3
&& program->shader_version.type == VKD3D_SHADER_TYPE_VERTEX && var->data_type->dimx > 1)
hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SEMANTIC,
"FOG output must have only 1 component in this shader model.");
mask = (1 << var->data_type->dimx) - 1; mask = (1 << var->data_type->dimx) - 1;
use_mask = mask; /* FIXME: retrieve use mask accurately. */ use_mask = mask; /* FIXME: retrieve use mask accurately. */

View File

@ -1,7 +1,7 @@
[require] [require]
shader model < 3.0 shader model < 3.0
[vertex shader fail todo] [vertex shader fail]
void main(float4 pos : position, out float2 fog : fog, out float4 out_pos : sv_position) void main(float4 pos : position, out float2 fog : fog, out float4 out_pos : sv_position)
{ {
fog = 0.5; fog = 0.5;