mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader: Set xxxx swizzle for scalar registers.
Mainly for vOutputControlPointID. Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3fbbc68160
commit
7b84adec32
@ -1511,6 +1511,25 @@ static bool shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool shader_sm4_is_scalar_register(const struct vkd3d_shader_register *reg)
|
||||||
|
{
|
||||||
|
switch (reg->type)
|
||||||
|
{
|
||||||
|
case VKD3DSPR_COVERAGE:
|
||||||
|
case VKD3DSPR_DEPTHOUT:
|
||||||
|
case VKD3DSPR_DEPTHOUTGE:
|
||||||
|
case VKD3DSPR_DEPTHOUTLE:
|
||||||
|
case VKD3DSPR_GSINSTID:
|
||||||
|
case VKD3DSPR_LOCALTHREADINDEX:
|
||||||
|
case VKD3DSPR_OUTPOINTID:
|
||||||
|
case VKD3DSPR_PRIMID:
|
||||||
|
case VKD3DSPR_SAMPLEMASK:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static bool shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end,
|
static bool shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end,
|
||||||
enum vkd3d_data_type data_type, struct vkd3d_shader_src_param *src_param)
|
enum vkd3d_data_type data_type, struct vkd3d_shader_src_param *src_param)
|
||||||
{
|
{
|
||||||
@ -1541,7 +1560,10 @@ static bool shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD *
|
|||||||
switch (swizzle_type)
|
switch (swizzle_type)
|
||||||
{
|
{
|
||||||
case VKD3D_SM4_SWIZZLE_NONE:
|
case VKD3D_SM4_SWIZZLE_NONE:
|
||||||
src_param->swizzle = VKD3D_NO_SWIZZLE;
|
if (shader_sm4_is_scalar_register(&src_param->reg))
|
||||||
|
src_param->swizzle = VKD3D_SWIZZLE(VKD3D_SWIZZLE_X, VKD3D_SWIZZLE_X, VKD3D_SWIZZLE_X, VKD3D_SWIZZLE_X);
|
||||||
|
else
|
||||||
|
src_param->swizzle = VKD3D_NO_SWIZZLE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VKD3D_SM4_SWIZZLE_SCALAR:
|
case VKD3D_SM4_SWIZZLE_SCALAR:
|
||||||
@ -1562,25 +1584,6 @@ static bool shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD *
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool shader_sm4_is_scalar_register(const struct vkd3d_shader_register *reg)
|
|
||||||
{
|
|
||||||
switch (reg->type)
|
|
||||||
{
|
|
||||||
case VKD3DSPR_COVERAGE:
|
|
||||||
case VKD3DSPR_DEPTHOUT:
|
|
||||||
case VKD3DSPR_DEPTHOUTGE:
|
|
||||||
case VKD3DSPR_DEPTHOUTLE:
|
|
||||||
case VKD3DSPR_GSINSTID:
|
|
||||||
case VKD3DSPR_LOCALTHREADINDEX:
|
|
||||||
case VKD3DSPR_OUTPOINTID:
|
|
||||||
case VKD3DSPR_PRIMID:
|
|
||||||
case VKD3DSPR_SAMPLEMASK:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end,
|
static bool shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end,
|
||||||
enum vkd3d_data_type data_type, struct vkd3d_shader_dst_param *dst_param)
|
enum vkd3d_data_type data_type, struct vkd3d_shader_dst_param *dst_param)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user