Henri Verbeet : wined3d: Enable GL_HALF_FLOAT_NV when NV_HALF_FLOAT is supported.

Alexandre Julliard julliard at winehq.org
Thu Jan 8 08:31:14 CST 2009


Module: wine
Branch: master
Commit: 45a61d1ac4b88082d1d38201eba73047ca2ffb8e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=45a61d1ac4b88082d1d38201eba73047ca2ffb8e

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Jan  8 10:19:17 2009 +0100

wined3d: Enable GL_HALF_FLOAT_NV when NV_HALF_FLOAT is supported.

This makes more sense than the other way around.

---

 dlls/wined3d/utils.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 0acd3b4..cc09584 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -499,8 +499,8 @@ static WINED3DGLTYPE const glTypeLookupTemplate[WINED3DDECLTYPE_UNUSED] =
     {WINED3DDECLTYPE_USHORT4N,  4, GL_UNSIGNED_SHORT, 4, GL_TRUE,  sizeof(short int)},
     {WINED3DDECLTYPE_UDEC3,     3, GL_UNSIGNED_SHORT, 3, GL_FALSE, sizeof(short int)},
     {WINED3DDECLTYPE_DEC3N,     3, GL_SHORT,          3, GL_TRUE,  sizeof(short int)},
-    {WINED3DDECLTYPE_FLOAT16_2, 2, GL_HALF_FLOAT_NV,  2, GL_FALSE, sizeof(GLhalfNV)},
-    {WINED3DDECLTYPE_FLOAT16_4, 4, GL_HALF_FLOAT_NV,  4, GL_FALSE, sizeof(GLhalfNV)}
+    {WINED3DDECLTYPE_FLOAT16_2, 2, GL_FLOAT,          2, GL_FALSE, sizeof(GLhalfNV)},
+    {WINED3DDECLTYPE_FLOAT16_4, 4, GL_FLOAT,          4, GL_FALSE, sizeof(GLhalfNV)}
 };
 
 void init_type_lookup(WineD3D_GL_Info *gl_info) {
@@ -511,12 +511,13 @@ void init_type_lookup(WineD3D_GL_Info *gl_info) {
         gl_info->glTypeLookup[WINED3DDECLTYPE_D3DCOLOR].format = GL_BGRA;
     }
 
-    if(!GL_SUPPORT(NV_HALF_FLOAT)) {
+    if (GL_SUPPORT(NV_HALF_FLOAT))
+    {
         /* Do not change the size of the type, it is CPU side. We have to change the GPU-side information though.
          * It is the job of the vertex buffer code to make sure that the vbos have the right format
          */
-        gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_2].glType = GL_FLOAT;
-        gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_4].glType = GL_FLOAT;
+        gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_2].glType = GL_HALF_FLOAT_NV;
+        gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_4].glType = GL_HALF_FLOAT_NV;
     }
 }
 




More information about the wine-cvs mailing list