mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Allow accounting for interpolation mode when allocating semantics.
For now this has no effect since semantics are allocated with reg_size 4, but will have effect when optimizing interstage signatures.
This commit is contained in:
committed by
Henri Verbeet
parent
b65f5fb069
commit
7fd6c29ee8
Notes:
Henri Verbeet
2024-10-22 20:54:15 +02:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1193
@@ -4894,38 +4894,9 @@ static void tpf_write_dcl_semantic(const struct tpf_compiler *tpf,
|
||||
|
||||
if (version->type == VKD3D_SHADER_TYPE_PIXEL)
|
||||
{
|
||||
enum vkd3d_shader_interpolation_mode mode = VKD3DSIM_LINEAR;
|
||||
|
||||
if ((var->storage_modifiers & HLSL_STORAGE_NOINTERPOLATION) || type_is_integer(var->data_type))
|
||||
{
|
||||
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 },
|
||||
{ HLSL_STORAGE_CENTROID | HLSL_STORAGE_LINEAR, 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
enum vkd3d_shader_interpolation_mode mode;
|
||||
|
||||
mode = sm4_get_interpolation_mode(var->data_type, var->storage_modifiers);
|
||||
instr.extra_bits |= mode << VKD3D_SM4_INTERPOLATION_MODE_SHIFT;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user