mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/tpf: Output interpolation modifiers for input declarations.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
8479ceedfc
commit
3af629cf8c
Notes:
Alexandre Julliard
2023-10-09 23:10:36 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/358
@ -4174,7 +4174,33 @@ static void write_sm4_dcl_semantic(const struct tpf_writer *tpf, const struct hl
|
|||||||
enum vkd3d_shader_interpolation_mode mode = VKD3DSIM_LINEAR;
|
enum vkd3d_shader_interpolation_mode mode = VKD3DSIM_LINEAR;
|
||||||
|
|
||||||
if ((var->storage_modifiers & HLSL_STORAGE_NOINTERPOLATION) || type_is_integer(var->data_type))
|
if ((var->storage_modifiers & HLSL_STORAGE_NOINTERPOLATION) || type_is_integer(var->data_type))
|
||||||
|
{
|
||||||
mode = VKD3DSIM_CONSTANT;
|
mode = VKD3DSIM_CONSTANT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static const struct
|
||||||
|
{
|
||||||
|
unsigned int modifiers;
|
||||||
|
enum vkd3d_shader_interpolation_mode mode;
|
||||||
|
}
|
||||||
|
modes[] =
|
||||||
|
{
|
||||||
|
{ HLSL_STORAGE_CENTROID | HLSL_STORAGE_NOPERSPECTIVE, VKD3DSIM_LINEAR_NOPERSPECTIVE_CENTROID },
|
||||||
|
{ HLSL_STORAGE_NOPERSPECTIVE, VKD3DSIM_LINEAR_NOPERSPECTIVE },
|
||||||
|
{ HLSL_STORAGE_CENTROID, VKD3DSIM_LINEAR_CENTROID },
|
||||||
|
};
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(modes); ++i)
|
||||||
|
{
|
||||||
|
if ((var->storage_modifiers & modes[i].modifiers) == modes[i].modifiers)
|
||||||
|
{
|
||||||
|
mode = modes[i].mode;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
instr.extra_bits |= mode << VKD3D_SM4_INTERPOLATION_MODE_SHIFT;
|
instr.extra_bits |= mode << VKD3D_SM4_INTERPOLATION_MODE_SHIFT;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user