[PATCH vkd3d 1/5] include: Document vkd3d-shader swizzles.

Henri Verbeet hverbeet at gmail.com
Thu Sep 3 10:08:10 CDT 2020


On Thu, 3 Sep 2020 at 05:41, Zebediah Figura <z.figura12 at gmail.com> wrote:
> +/**
> + * A helper macro which returns a vkd3d-shader swizzle with the given
> + * components. The components are specified as the suffixes to members of
> + * \ref vkd3d_shader_swizzle_component. For example, the swizzle ".xwyy" can be
> + * represented as:
> + * \code
> + * VKD3D_SHADER_SWIZZLE(X, W, Y, Y)
> + * \endcode
> + */
>  #define VKD3D_SHADER_SWIZZLE(x, y, z, w) \
>          vkd3d_shader_create_swizzle(VKD3D_SHADER_SWIZZLE_ ## x, \
>                  VKD3D_SHADER_SWIZZLE_ ## y, \
>                  VKD3D_SHADER_SWIZZLE_ ## z, \
>                  VKD3D_SHADER_SWIZZLE_ ## w)
>
> +/** The identity swizzle, ie ".xyzw". */
>  #define VKD3D_SHADER_NO_SWIZZLE VKD3D_SHADER_SWIZZLE(X, Y, Z, W)
"i.e."

> +/** Programmatically build a vkd3d-shader swizzle with the given components. */
>  static inline uint32_t vkd3d_shader_create_swizzle(enum vkd3d_shader_swizzle_component x,
>          enum vkd3d_shader_swizzle_component y, enum vkd3d_shader_swizzle_component z,
>          enum vkd3d_shader_swizzle_component w)
"Programmatically", as opposed to what? If this is about
distinguishing it from VKD3D_SHADER_SWIZZLE, it probably makes more
sense to describe that one explicitly as a convenience macro in terms
of vkd3d_shader_create_swizzle().



More information about the wine-devel mailing list