Stefan Dösinger : wined3d: Store if half float conversion is needed in the decl.

Alexandre Julliard julliard at winehq.org
Thu Dec 20 06:21:47 CST 2007


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Thu Dec 20 01:34:22 2007 +0100

wined3d: Store if half float conversion is needed in the decl.

---

 dlls/wined3d/drawprim.c          |    4 ++--
 dlls/wined3d/state.c             |    2 +-
 dlls/wined3d/vertexdeclaration.c |    6 +++++-
 dlls/wined3d/wined3d_private.h   |    2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index f044a92..59a952f 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -201,7 +201,7 @@ void primitiveDeclarationConvertToStridedData(
                 if((UINT_PTR)data < -This->stateBlock->loadBaseVertexIndex * stride) {
                     FIXME("System memory vertex data load offset is negative!\n");
                 }
-            } else if(vertexDeclaration->half_float_used && !GL_SUPPORT(NV_HALF_FLOAT)) {
+            } else if(vertexDeclaration->half_float_conv_needed) {
                 WARN("Half float vertex data used, but GL_NV_half_float is not supported. Not using vbos\n");
                 streamVBO = 0;
                 data = ((IWineD3DVertexBufferImpl *) This->stateBlock->streamSource[element->Stream])->resource.allocatedMemory;
@@ -1127,7 +1127,7 @@ void drawPrimitive(IWineD3DDevice *iface,
             /* Instancing emulation with mixing immediate mode and arrays */
             drawStridedInstanced(iface, &This->strided_streams, calculatedNumberOfindices, glPrimType,
                             idxData, idxSize, minIndex, StartIdx, StartVertexIndex);
-        } else if(GL_SUPPORT(NV_HALF_FLOAT) || (!((IWineD3DVertexDeclarationImpl *) This->stateBlock->vertexDecl)->half_float_used)) {
+        } else if(!((IWineD3DVertexDeclarationImpl *) This->stateBlock->vertexDecl)->half_float_conv_needed) {
             drawStridedFast(iface, calculatedNumberOfindices, glPrimType,
                             idxData, idxSize, minIndex, StartIdx, StartVertexIndex);
         } else {
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 29dd4e6..d26b91d 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -2884,7 +2884,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, WineDi
     /* Default to no instancing */
     stateblock->wineD3DDevice->instancedDraw = FALSE;
 
-    if(((IWineD3DVertexDeclarationImpl *)stateblock->vertexDecl)->half_float_used && !GL_SUPPORT(NV_HALF_FLOAT)) {
+    if(((IWineD3DVertexDeclarationImpl *)stateblock->vertexDecl)->half_float_conv_needed) {
         /* This will be handled using drawStridedSlow */
         return;
     }
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c
index 929fd45..4e1e1b6 100644
--- a/dlls/wined3d/vertexdeclaration.c
+++ b/dlls/wined3d/vertexdeclaration.c
@@ -26,6 +26,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d_decl);
 
+#define GLINFO_LOCATION This->wineD3DDevice->adapter->gl_info
+
 static void dump_wined3dvertexelement(const WINED3DVERTEXELEMENT *element) {
     TRACE("     Stream: %d\n", element->Stream);
     TRACE("     Offset: %d\n", element->Offset);
@@ -185,7 +187,9 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
             This->num_swizzled_attribs++;
         } else if(This->pDeclarationWine[i].Type == WINED3DDECLTYPE_FLOAT16_2 ||
                   This->pDeclarationWine[i].Type == WINED3DDECLTYPE_FLOAT16_4) {
-            This->half_float_used = TRUE;
+            if(!GL_SUPPORT(NV_HALF_FLOAT)) {
+                This->half_float_conv_needed = TRUE;
+            }
         }
     }
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d3f3a59..ad8047c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1268,7 +1268,7 @@ typedef struct IWineD3DVertexDeclarationImpl {
     DWORD                   streams[MAX_STREAMS];
     UINT                    num_streams;
     BOOL                    position_transformed;
-    BOOL                    half_float_used;
+    BOOL                    half_float_conv_needed;
 
     /* Ordered array of declaration types that need swizzling in a vshader */
     attrib_declaration      swizzled_attribs[MAX_ATTRIBS];




More information about the wine-cvs mailing list