vkd3d-shader/hlsl: Force sm1 inputs to be 4-component only for vertex shaders.

Pixel shaders still have an appropriate writemask.
This commit is contained in:
Zebediah Figura 2023-07-31 13:00:45 -05:00 committed by Alexandre Julliard
parent 39e62ed2be
commit 926575a6f3
Notes: Alexandre Julliard 2023-08-24 23:11:35 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/293
2 changed files with 4 additions and 3 deletions

View File

@ -321,9 +321,10 @@ static void prepend_input_copy(struct hlsl_ctx *ctx, struct hlsl_block *block, s
if (!semantic->name)
return;
vector_type_src = hlsl_get_vector_type(ctx, type->base_type,
(ctx->profile->major_version < 4) ? 4 : hlsl_type_minor_size(type));
vector_type_dst = hlsl_get_vector_type(ctx, type->base_type, hlsl_type_minor_size(type));
vector_type_src = vector_type_dst;
if (ctx->profile->major_version < 4 && ctx->profile->type == VKD3D_SHADER_TYPE_VERTEX)
vector_type_src = hlsl_get_vector_type(ctx, type->base_type, 4);
for (i = 0; i < hlsl_type_major_size(type); ++i)
{

View File

@ -630,7 +630,7 @@ static void test_scan_signatures(void)
{
{"COLOR", 0, 0, VKD3D_SHADER_SV_NONE, VKD3D_SHADER_COMPONENT_FLOAT, 0, 0xf, 0xf},
{"TEXCOORD", 2, 0, VKD3D_SHADER_SV_NONE, VKD3D_SHADER_COMPONENT_FLOAT, 1, 0xf, 0xf},
{"DEPTH", 0, 0, VKD3D_SHADER_SV_NONE, VKD3D_SHADER_COMPONENT_FLOAT, 2, 0xf, 0xf},
{"DEPTH", 0, 0, VKD3D_SHADER_SV_NONE, VKD3D_SHADER_COMPONENT_FLOAT, 2, 0x1, 0x1},
{"BLENDINDICES", 0, 0, VKD3D_SHADER_SV_NONE, VKD3D_SHADER_COMPONENT_FLOAT, 3, 0xf, 0xf},
{"VPOS", 0, 0, VKD3D_SHADER_SV_POSITION, VKD3D_SHADER_COMPONENT_FLOAT, 0, 0xf, 0xf},
{"VFACE", 0, 0, VKD3D_SHADER_SV_IS_FRONT_FACE, VKD3D_SHADER_COMPONENT_FLOAT, 1, 0x1, 0x1},