libs/vkd3d-shader: Parse precise flags.

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:
Józef Kucia 2018-05-29 12:50:30 +02:00 committed by Alexandre Julliard
parent b59ad01dd2
commit 3ddb29c16a
2 changed files with 14 additions and 1 deletions

View File

@ -56,6 +56,9 @@
#define VKD3D_SM4_GLOBAL_FLAGS_SHIFT 11
#define VKD3D_SM4_GLOBAL_FLAGS_MASK (0xffu << VKD3D_SM4_GLOBAL_FLAGS_SHIFT)
#define VKD3D_SM5_PRECISE_SHIFT 19
#define VKD3D_SM5_PRECISE_MASK (0xfu << VKD3D_SM5_PRECISE_SHIFT)
#define VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT 11
#define VKD3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT)
@ -1641,6 +1644,7 @@ void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct vkd3d_sha
unsigned int i, len;
SIZE_T remaining;
const DWORD *p;
DWORD precise;
list_move_head(&priv->src_free, &priv->src);
@ -1703,12 +1707,13 @@ void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct vkd3d_sha
shader_sm4_read_instruction_modifier(previous_token = *p++, ins);
ins->flags = (opcode_token & VKD3D_SM4_INSTRUCTION_FLAGS_MASK) >> VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT;
if (ins->flags & VKD3D_SM4_INSTRUCTION_FLAG_SATURATE)
{
ins->flags &= ~VKD3D_SM4_INSTRUCTION_FLAG_SATURATE;
instruction_dst_modifier = VKD3DSPDM_SATURATE;
}
precise = (opcode_token & VKD3D_SM5_PRECISE_MASK) >> VKD3D_SM5_PRECISE_SHIFT;
ins->flags |= precise << VKD3DSI_PRECISE_SHIFT;
for (i = 0; i < ins->dst_count; ++i)
{

View File

@ -480,6 +480,14 @@ enum vkd3d_tessellator_partitioning
#define VKD3DSI_SAMPLE_INFO_UINT 0x1
#define VKD3DSI_SAMPLER_COMPARISON_MODE 0x1
#define VKD3DSI_PRECISE_X 0x100
#define VKD3DSI_PRECISE_Y 0x200
#define VKD3DSI_PRECISE_Z 0x400
#define VKD3DSI_PRECISE_W 0x800
#define VKD3DSI_PRECISE_XYZW (VKD3DSI_PRECISE_X | VKD3DSI_PRECISE_Y \
| VKD3DSI_PRECISE_Z | VKD3DSI_PRECISE_W)
#define VKD3DSI_PRECISE_SHIFT 8
enum vkd3d_shader_rel_op
{
VKD3D_SHADER_REL_OP_GT = 1,