[D3D] Support for MIPMAP_LOD_BIAS extension.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog:
 - supports the mimap lod bias extension

-- 
		 Lionel Ulmer - http://www.bbrox.org/
--- dlls/ddraw_CVS/d3ddevice/mesa.c	Sat Aug  2 18:03:07 2003
+++ dlls/ddraw/d3ddevice/mesa.c	Sun Aug  3 07:57:31 2003
@@ -1953,11 +1953,12 @@
 	    D3DVALUE value = *((D3DVALUE *) &dwState);
 	    BOOLEAN handled = TRUE;
 	    
-	    if (value != 0.0)
+	    if ((value != 0.0) && (GL_extensions.mipmap_lodbias == FALSE))
 	        handled = FALSE;
 
 	    if (handled) {
 	        TRACE(" Stage type : D3DTSS_MIPMAPLODBIAS => %f\n", value);
+		glTexEnvf(GL_TEXTURE_FILTER_CONTROL_WINE, GL_TEXTURE_LOD_BIAS_WINE, value);
 	    } else {
 	        FIXME(" Unhandled stage type : D3DTSS_MIPMAPLODBIAS => %f\n", value);
 	    }
@@ -3770,7 +3771,11 @@
     pc->dwMiscCaps = D3DPMISCCAPS_CONFORMANT | D3DPMISCCAPS_CULLCCW | D3DPMISCCAPS_CULLCW |
       D3DPMISCCAPS_LINEPATTERNREP | D3DPMISCCAPS_MASKPLANES | D3DPMISCCAPS_MASKZ;
     pc->dwRasterCaps = D3DPRASTERCAPS_DITHER | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_FOGTABLE |
-      D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_STIPPLE | D3DPRASTERCAPS_ZBIAS | D3DPRASTERCAPS_ZTEST | D3DPRASTERCAPS_SUBPIXEL;
+      D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_STIPPLE | D3DPRASTERCAPS_ZBIAS | D3DPRASTERCAPS_ZTEST | D3DPRASTERCAPS_SUBPIXEL |
+	  D3DPRASTERCAPS_ZFOG;
+    if (GL_extensions.mipmap_lodbias == TRUE) {
+	pc->dwRasterCaps |= D3DPRASTERCAPS_MIPMAPLODBIAS;
+    }
     pc->dwZCmpCaps = D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_EQUAL | D3DPCMPCAPS_GREATER | D3DPCMPCAPS_GREATEREQUAL |
       D3DPCMPCAPS_LESS | D3DPCMPCAPS_LESSEQUAL | D3DPCMPCAPS_NEVER | D3DPCMPCAPS_NOTEQUAL;
     pc->dwSrcBlendCaps  = D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_DESTCOLOR | D3DPBLENDCAPS_INVDESTCOLOR |
@@ -3937,6 +3942,14 @@
 	((major >= 1) && (minor >= 4))) {
 	TRACE(" - mirrored repeat\n");
 	GL_extensions.mirrored_repeat = TRUE;
+    }
+
+    /* Texture LOD Bias :
+         - GL_EXT_texture_lod_bias
+    */
+    if (strstr(glExtensions, "GL_EXT_texture_lod_bias")) {
+	TRACE(" - texture lod bias\n");
+	GL_extensions.mipmap_lodbias = TRUE;
     }
     
     /* Fill the D3D capabilities according to what GL tells us... */
--- dlls/ddraw_CVS/mesa.c	Sun Jul 13 08:35:30 2003
+++ dlls/ddraw/mesa.c	Sun Aug  3 07:58:59 2003
@@ -400,6 +400,12 @@
 	        glThis->blending = dwRenderState;
 	        break;
 
+	    case D3DRENDERSTATE_MIPMAPLODBIAS: /* 46 */
+	        IDirect3DDevice7_SetTextureStageState(ICOM_INTERFACE(This, IDirect3DDevice7),
+						      0, D3DTSS_MIPMAPLODBIAS,
+						      dwRenderState);
+	        break;
+	      
 	    case D3DRENDERSTATE_ZBIAS: /* 47 */
 	        /* This is a tad bit hacky.. But well, no idea how to do it better in OpenGL :-/ */
 	        if (dwRenderState == 0) {
--- dlls/ddraw_CVS/mesa_private.h	Sat Aug  2 18:03:07 2003
+++ dlls/ddraw/mesa_private.h	Sun Aug  3 07:45:00 2003
@@ -162,6 +162,7 @@
 typedef struct {
     /* Mirrored Repeat */
     BOOLEAN mirrored_repeat;
+    BOOLEAN mipmap_lodbias;
 } GL_EXTENSIONS_LIST; 
 extern GL_EXTENSIONS_LIST GL_extensions;
 
--- dlls/ddraw_CVS/gl_api.h	Sat Aug  2 18:03:07 2003
+++ dlls/ddraw/gl_api.h	Sun Aug  3 08:01:19 2003
@@ -91,6 +91,7 @@
 GL_API_FUNCTION(glStencilOp)
 GL_API_FUNCTION(glTexCoord2f)
 GL_API_FUNCTION(glTexCoord2fv)
+GL_API_FUNCTION(glTexEnvf)
 GL_API_FUNCTION(glTexEnvfv)
 GL_API_FUNCTION(glTexEnvi)
 GL_API_FUNCTION(glTexImage2D)
--- dlls/ddraw_CVS/gl_private.h	Sat Aug  2 18:03:07 2003
+++ dlls/ddraw/gl_private.h	Sun Aug  3 08:01:31 2003
@@ -54,7 +54,9 @@
 
    Note: this is perfectly 'legal' as the three variants of the enum have exactly the same value
 */
-#define GL_MIRRORED_REPEAT_WINE 0x8370
+#define GL_MIRRORED_REPEAT_WINE                 0x8370
+#define GL_TEXTURE_FILTER_CONTROL_WINE          0x8500
+#define GL_TEXTURE_LOD_BIAS_WINE                0x8501
 
 #ifndef GLPRIVATE_NO_REDEFINE
 
@@ -123,6 +125,7 @@
 #define glStencilOp pglStencilOp
 #define glTexCoord2f pglTexCoord2f
 #define glTexCoord2fv pglTexCoord2fv
+#define glTexEnvf pglTexEnvf
 #define glTexEnvfv pglTexEnvfv
 #define glTexEnvi pglTexEnvi
 #define glTexImage2D pglTexImage2D

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux