wined3d: Handle half-float attributes in load_numbered_arrays().

Fixes a bunch of graphic glitches in WildStar on Nvidia.
This commit is contained in:
Matteo Bruni 2014-08-27 18:40:51 +02:00 committed by Alexandre Julliard
parent 5aeb834dd4
commit 6eb242a275
1 changed files with 24 additions and 5 deletions

View File

@ -4203,13 +4203,32 @@ static void load_numbered_arrays(struct wined3d_context *context,
break;
case WINED3DFMT_R16G16_FLOAT:
/* Are those 16 bit floats. C doesn't have a 16 bit float type. I could read the single bits and calculate a 4
* byte float according to the IEEE standard
*/
FIXME("Unsupported WINED3DDECLTYPE_FLOAT16_2\n");
if (gl_info->supported[NV_HALF_FLOAT] && gl_info->supported[NV_VERTEX_PROGRAM])
{
/* Not supported by GL_ARB_half_float_vertex. */
GL_EXTCALL(glVertexAttrib2hvNV(i, (const GLhalfNV *)ptr));
}
else
{
float x = float_16_to_32(((const unsigned short *)ptr) + 0);
float y = float_16_to_32(((const unsigned short *)ptr) + 1);
GL_EXTCALL(glVertexAttrib2fARB(i, x, y));
}
break;
case WINED3DFMT_R16G16B16A16_FLOAT:
FIXME("Unsupported WINED3DDECLTYPE_FLOAT16_4\n");
if (gl_info->supported[NV_HALF_FLOAT] && gl_info->supported[NV_VERTEX_PROGRAM])
{
/* Not supported by GL_ARB_half_float_vertex. */
GL_EXTCALL(glVertexAttrib4hvNV(i, (const GLhalfNV *)ptr));
}
else
{
float x = float_16_to_32(((const unsigned short *)ptr) + 0);
float y = float_16_to_32(((const unsigned short *)ptr) + 1);
float z = float_16_to_32(((const unsigned short *)ptr) + 2);
float w = float_16_to_32(((const unsigned short *)ptr) + 3);
GL_EXTCALL(glVertexAttrib4fARB(i, x, y, z, w));
}
break;
default: