Matteo Bruni : wined3d: Handle half-float attributes in load_numbered_arrays().
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Aug 28 14:52:09 CDT 2014
Module: wine
Branch: master
Commit: 6eb242a2757ee59822c23e0feb6a89d72a1f4fa7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6eb242a2757ee59822c23e0feb6a89d72a1f4fa7
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Wed Aug 27 18:40:51 2014 +0200
wined3d: Handle half-float attributes in load_numbered_arrays().
Fixes a bunch of graphic glitches in WildStar on Nvidia.
---
dlls/wined3d/state.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 3712f3b..700db84 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -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:
More information about the wine-cvs
mailing list