[PATCH] wined3d: Add WINED3DFMT_R11G11B10_FLOAT vertex format.

Henri Verbeet hverbeet at gmail.com
Fri Dec 17 05:56:52 CST 2021


On Thu, 16 Dec 2021 at 19:19, Andrey Gusev <andrey.goosev at gmail.com> wrote:
> @@ -709,6 +709,7 @@ static const struct wined3d_format_vertex_info format_vertex_info[] =
>      {WINED3DFMT_R16G16B16A16_SNORM, WINED3D_FFP_EMIT_SHORT4N,   GL_SHORT},
>      {WINED3DFMT_R16G16_UNORM,       WINED3D_FFP_EMIT_USHORT2N,  GL_UNSIGNED_SHORT},
>      {WINED3DFMT_R16G16B16A16_UNORM, WINED3D_FFP_EMIT_USHORT4N,  GL_UNSIGNED_SHORT},
> +    {WINED3DFMT_R11G11B10_FLOAT,    WINED3D_FFP_EMIT_FLOAT3,    GL_FLOAT},

Unfortunately it's a little harder than that. GL_FLOAT expects 32-bit
float components (i.e., like R32_FLOAT), while
WINED3DFMT_R11G11B10_FLOAT is a packed "11.11.10" floating-point
format. This needs GL_UNSIGNED_INT_10F_11F_11F_REV, provided by the
ARB_vertex_type_10f_11f_11f_rev extension.

The WINED3DFMT_R10G10B10A2_UNORM format is somewhat similar; you could
use that as an example.



More information about the wine-devel mailing list