Commit 50fbe733 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Support the mimap lod bias extension.

parent d098f55d
......@@ -1953,11 +1953,12 @@ GL_IDirect3DDeviceImpl_7_3T_SetTextureStageState(LPDIRECT3DDEVICE7 iface,
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 @@ static void fill_opengl_primcaps(D3DPRIMCAPS *pc)
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 |
......@@ -3938,6 +3943,14 @@ d3ddevice_init_at_startup(void *gl_handle)
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... */
fill_caps();
......
......@@ -91,6 +91,7 @@ GL_API_FUNCTION(glStencilMask)
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)
......
......@@ -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
......
......@@ -400,6 +400,12 @@ void set_render_state(IDirect3DDeviceImpl* This,
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) {
......
......@@ -162,6 +162,7 @@ typedef struct {
typedef struct {
/* Mirrored Repeat */
BOOLEAN mirrored_repeat;
BOOLEAN mipmap_lodbias;
} GL_EXTENSIONS_LIST;
extern GL_EXTENSIONS_LIST GL_extensions;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment