[PATCH vkd3d 5/5] vkd3d-shader: Implement DEQ instruction.

Henri Verbeet hverbeet at gmail.com
Tue Jul 13 09:24:51 CDT 2021


On Fri, 9 Jul 2021 at 17:32, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
> @@ -1018,6 +1019,7 @@ static void shader_sm5_read_sync(struct vkd3d_shader_instruction *ins,
>   * R -> VKD3D_DATA_RESOURCE
>   * S -> VKD3D_DATA_SAMPLER
>   * U -> VKD3D_DATA_UAV
> + * d -> VKD3D_DATA_DOUBLE
>   */
It would probably be best to keep these sorted.

> @@ -1352,6 +1355,8 @@ static enum vkd3d_data_type map_data_type(char t)
>              return VKD3D_DATA_SAMPLER;
>          case 'U':
>              return VKD3D_DATA_UAV;
> +        case 'd':
> +            return VKD3D_DATA_DOUBLE;
>          default:
>              ERR("Invalid data type '%c'.\n", t);
>              return VKD3D_DATA_FLOAT;
And here.

> @@ -1799,6 +1804,8 @@ static bool shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD *
>      }
>
>      dst_param->write_mask = (token & VKD3D_SM4_WRITEMASK_MASK) >> VKD3D_SM4_WRITEMASK_SHIFT;
> +    if (data_type == VKD3D_DATA_DOUBLE)
> +        dst_param->write_mask = vkd3d_write_mask_64_from_32(dst_param->write_mask);
>      /* Scalar registers are declared with no write mask in shader bytecode. */
>      if (!dst_param->write_mask && shader_sm4_is_scalar_register(&dst_param->reg))
>          dst_param->write_mask = VKD3DSP_WRITEMASK_0;

Does this need a corresponding change in trace.c? Also, should we do
the same for swizzles?

> @@ -9879,8 +9879,8 @@ static void test_shader_instructions(void)
>          {&ps_dmovc,     {.d = {{1.5, 0.0}}},  {.d = {1.5, 0.0}}, true, true},
>          {&ps_dmodifier, {.d = {{1.5, 0.0}}},  {.d = {1.5f, 2.5f}}, true, true},
>          {&ps_dmodifier, {.d = {{-1.5, 0.0}}}, {.d = {1.5f, 1.5f}}, true, true},
> -        {&ps_deq, {.d = {{0.0, 0.0}}}, {{0xffffffff}}, true, true},
> -        {&ps_deq, {.d = {{1.0, 0.0}}}, {{0x00000000}}, true, true},
> +        {&ps_deq, {.d = {{0.0, 0.0}}}, {{0xffffffff}}, true, false},
> +        {&ps_deq, {.d = {{1.0, 0.0}}}, {{0x00000000}}, true, false},
>          {&ps_dne, {.d = {{0.0, 0.0}}}, {{0x00000000}}, true, true},
>          {&ps_dne, {.d = {{1.0, 0.0}}}, {{0xffffffff}}, true, true},
>          {&ps_dtou, {.d = {{     -NAN}}}, {{ 0,  0 }}, true, true},

We can drop final "false" values.



More information about the wine-devel mailing list