From 620a423b22663d3955f90555b0e62f11bcde0ee3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Mon, 3 Nov 2008 18:36:19 +0100 Subject: [PATCH] wined3d: Kill the GL_ATI_envmap_bumpmap code. GL_ATI_envmap_bumpmap provides two things: Signed V8U8 pixel formats, and bump mapping. The extension is only supported on fglrx, and this driver also supports GL_ARB_fragment_program. Thus the bump mapping code is never used on any driver out there. Furthermore, if it is used, it tends to crash the driver The signed pixel format is used, as it can be used by pixel shaders or the ARBfp replacement. However, the format is broken in fglrx, and negative values are clamped to 0.0. This results in test failures. WineD3D has an alternative codepath using scale+bias to enable V8U8 using a standard signed RGB which works correctly on fglrx. --- dlls/wined3d/arb_program_shader.c | 3 +- dlls/wined3d/directx.c | 7 +--- dlls/wined3d/glsl_shader.c | 3 +- dlls/wined3d/state.c | 88 +-------------------------------------- dlls/wined3d/surface.c | 12 ------ dlls/wined3d/utils.c | 6 +-- include/wine/wined3d_gl.h | 23 ---------- 7 files changed, 5 insertions(+), 137 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 3edeabfb643..493c5d2df9a 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -659,8 +659,7 @@ static void gen_color_correction(SHADER_BUFFER *buffer, const char *reg, const c switch(fmt) { case WINED3DFMT_V8U8: case WINED3DFMT_V16U16: - if(GL_SUPPORT(NV_TEXTURE_SHADER) || - (GL_SUPPORT(ATI_ENVMAP_BUMPMAP) && fmt == WINED3DFMT_V8U8)) { + if(GL_SUPPORT(NV_TEXTURE_SHADER) && fmt == WINED3DFMT_V8U8) { if(0) { /* The 3rd channel returns 1.0 in d3d, but 0.0 in gl. Fix this while we're at it :-) * disabled until an application that needs it is found because it causes unneeded diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 9cdc957334a..dbfd3f9782c 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -56,7 +56,6 @@ static const struct { {"GL_ATI_separate_stencil", ATI_SEPARATE_STENCIL, 0 }, {"GL_ATI_texture_env_combine3", ATI_TEXTURE_ENV_COMBINE3, 0 }, {"GL_ATI_texture_mirror_once", ATI_TEXTURE_MIRROR_ONCE, 0 }, - {"GL_ATI_envmap_bumpmap", ATI_ENVMAP_BUMPMAP, 0 }, {"GL_ATI_fragment_shader", ATI_FRAGMENT_SHADER, 0 }, {"GL_ATI_texture_compression_3dc", ATI_TEXTURE_COMPRESSION_3DC, 0 }, @@ -837,10 +836,6 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { gl_info->supported[NV_TEXGEN_REFLECTION] = TRUE; } if (gl_info->supported[NV_TEXTURE_SHADER2]) { - /* GL_ATI_envmap_bumpmap won't play nice with texture shaders, so disable it - * Won't occur in any real world situation though - */ - gl_info->supported[ATI_ENVMAP_BUMPMAP] = FALSE; if(gl_info->supported[NV_REGISTER_COMBINERS]) { /* Also disable ATI_FRAGMENT_SHADER if register combiners and texture_shader2 * are supported. The nv extensions provide the same functionality as the @@ -2915,7 +2910,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt break; case WINED3DFMT_V8U8: - if(!GL_SUPPORT(NV_TEXTURE_SHADER) || !GL_SUPPORT(ATI_ENVMAP_BUMPMAP)) { + if(!GL_SUPPORT(NV_TEXTURE_SHADER)) { TRACE_(d3d_caps)("[FAILED] - No converted formats on volumes\n"); return WINED3DERR_NOTAVAILABLE; } diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 22176e9abe9..bb9a8717cdc 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1296,8 +1296,7 @@ static void shader_glsl_color_correction(SHADER_OPCODE_ARG* arg) { switch(fmt) { case WINED3DFMT_V8U8: case WINED3DFMT_V16U16: - if(GL_SUPPORT(NV_TEXTURE_SHADER) || - (GL_SUPPORT(ATI_ENVMAP_BUMPMAP) && fmt == WINED3DFMT_V8U8)) { + if(GL_SUPPORT(NV_TEXTURE_SHADER) && fmt == WINED3DFMT_V8U8) { /* The 3rd channel returns 1.0 in d3d, but 0.0 in gl. Fix this while we're at it :-) */ mask = shader_glsl_add_dst_param(arg, arg->dst, WINED3DSP_WRITEMASK_2, &dst_param); mask_size = shader_glsl_get_write_mask_size(mask); diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 1a99d4003fd..573c23c1743 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -2860,40 +2860,8 @@ static void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTE Handled = FALSE; break; case WINED3DTOP_BUMPENVMAPLUMINANCE: - if(GL_SUPPORT(ATI_ENVMAP_BUMPMAP)) { - /* Some apps use BUMPENVMAPLUMINANCE instead of D3DTOP_BUMPENVMAP, although - * they check for the non-luminance cap flag. Well, give them what they asked - * for :-) - */ - WARN("Application uses WINED3DTOP_BUMPENVMAPLUMINANCE\n"); - } else { - Handled = FALSE; - break; - } - /* Fall through */ case WINED3DTOP_BUMPENVMAP: - if(GL_SUPPORT(ATI_ENVMAP_BUMPMAP)) { - TRACE("Using ati bumpmap on stage %d, target %d\n", Stage, Stage + 1); - glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_BUMP_ENVMAP_ATI); - checkGLcall("glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_BUMP_ENVMAP_ATI)"); - glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB + Stage + 1); - checkGLcall("glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB + Stage + 1)"); - glTexEnvi(GL_TEXTURE_ENV, src0_target, src3); - checkGLcall("GL_TEXTURE_ENV, src0_target, src3"); - glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr3); - checkGLcall("GL_TEXTURE_ENV, opr0_target, opr3"); - glTexEnvi(GL_TEXTURE_ENV, src1_target, src1); - checkGLcall("GL_TEXTURE_ENV, src0_target, src1"); - glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr1); - checkGLcall("GL_TEXTURE_ENV, opr1_target, opr1"); - glTexEnvi(GL_TEXTURE_ENV, src2_target, src2); - checkGLcall("GL_TEXTURE_ENV, src0_target, src1"); - glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2); - checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2"); - - Handled = TRUE; - break; - } else if(GL_SUPPORT(NV_TEXTURE_SHADER2)) { + if(GL_SUPPORT(NV_TEXTURE_SHADER2)) { /* Technically texture shader support without register combiners is possible, but not expected to occur * on real world cards, so for now a fixme should be enough */ @@ -3599,24 +3567,6 @@ static void shader_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, W } } -static void tex_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / WINED3D_HIGHEST_TEXTURE_STATE; - float mat[2][2]; - - if(stage >= GL_LIMITS(texture_stages)) { - WARN("Bump env matrix of unsupported stage set\n"); - } else if(GL_SUPPORT(ARB_MULTITEXTURE)) { - GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + stage)); - checkGLcall("GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + stage))"); - } - mat[0][0] = *((float *) &stateblock->textureState[stage][WINED3DTSS_BUMPENVMAT00]); - mat[1][0] = *((float *) &stateblock->textureState[stage][WINED3DTSS_BUMPENVMAT01]); - mat[0][1] = *((float *) &stateblock->textureState[stage][WINED3DTSS_BUMPENVMAT10]); - mat[1][1] = *((float *) &stateblock->textureState[stage][WINED3DTSS_BUMPENVMAT11]); - GL_EXTCALL(glTexBumpParameterfvATI(GL_BUMP_ROT_MATRIX_ATI, (float *) mat)); - checkGLcall("glTexBumpParameterfvATI"); -} - static void transform_world(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { /* This function is called by transform_view below if the view matrix was changed too * @@ -5413,10 +5363,6 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), { STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAARG1), { STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAARG2), { STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, - { STATE_TEXTURESTAGE(0, WINED3DTSS_BUMPENVMAT00), { STATE_TEXTURESTAGE(0, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(0, WINED3DTSS_BUMPENVMAT01), { STATE_TEXTURESTAGE(0, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(0, WINED3DTSS_BUMPENVMAT10), { STATE_TEXTURESTAGE(0, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(0, WINED3DTSS_BUMPENVMAT11), { STATE_TEXTURESTAGE(0, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, { STATE_TEXTURESTAGE(0, WINED3DTSS_COLORARG0), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), tex_colorop }, 0 }, { STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(0, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), tex_colorop }, 0 }, @@ -5427,10 +5373,6 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(1, WINED3DTSS_ALPHAOP), { STATE_TEXTURESTAGE(1, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(1, WINED3DTSS_ALPHAARG1), { STATE_TEXTURESTAGE(1, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(1, WINED3DTSS_ALPHAARG2), { STATE_TEXTURESTAGE(1, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, - { STATE_TEXTURESTAGE(1, WINED3DTSS_BUMPENVMAT00), { STATE_TEXTURESTAGE(1, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(1, WINED3DTSS_BUMPENVMAT01), { STATE_TEXTURESTAGE(1, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(1, WINED3DTSS_BUMPENVMAT10), { STATE_TEXTURESTAGE(1, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(1, WINED3DTSS_BUMPENVMAT11), { STATE_TEXTURESTAGE(1, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, { STATE_TEXTURESTAGE(1, WINED3DTSS_COLORARG0), { STATE_TEXTURESTAGE(1, WINED3DTSS_COLOROP), tex_colorop }, 0 }, { STATE_TEXTURESTAGE(1, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(1, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(1, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(1, WINED3DTSS_COLOROP), tex_colorop }, 0 }, @@ -5441,10 +5383,6 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(2, WINED3DTSS_ALPHAOP), { STATE_TEXTURESTAGE(2, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(2, WINED3DTSS_ALPHAARG1), { STATE_TEXTURESTAGE(2, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(2, WINED3DTSS_ALPHAARG2), { STATE_TEXTURESTAGE(2, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, - { STATE_TEXTURESTAGE(2, WINED3DTSS_BUMPENVMAT00), { STATE_TEXTURESTAGE(2, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(2, WINED3DTSS_BUMPENVMAT01), { STATE_TEXTURESTAGE(2, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(2, WINED3DTSS_BUMPENVMAT10), { STATE_TEXTURESTAGE(2, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(2, WINED3DTSS_BUMPENVMAT11), { STATE_TEXTURESTAGE(2, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, { STATE_TEXTURESTAGE(2, WINED3DTSS_COLORARG0), { STATE_TEXTURESTAGE(2, WINED3DTSS_COLOROP), tex_colorop }, 0 }, { STATE_TEXTURESTAGE(2, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(2, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(2, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(2, WINED3DTSS_COLOROP), tex_colorop }, 0 }, @@ -5455,10 +5393,6 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(3, WINED3DTSS_ALPHAOP), { STATE_TEXTURESTAGE(3, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(3, WINED3DTSS_ALPHAARG1), { STATE_TEXTURESTAGE(3, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(3, WINED3DTSS_ALPHAARG2), { STATE_TEXTURESTAGE(3, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, - { STATE_TEXTURESTAGE(3, WINED3DTSS_BUMPENVMAT00), { STATE_TEXTURESTAGE(3, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(3, WINED3DTSS_BUMPENVMAT01), { STATE_TEXTURESTAGE(3, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(3, WINED3DTSS_BUMPENVMAT10), { STATE_TEXTURESTAGE(3, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(3, WINED3DTSS_BUMPENVMAT11), { STATE_TEXTURESTAGE(3, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, { STATE_TEXTURESTAGE(3, WINED3DTSS_COLORARG0), { STATE_TEXTURESTAGE(3, WINED3DTSS_COLOROP), tex_colorop }, 0 }, { STATE_TEXTURESTAGE(3, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(3, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(3, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(3, WINED3DTSS_COLOROP), tex_colorop }, 0 }, @@ -5469,10 +5403,6 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(4, WINED3DTSS_ALPHAOP), { STATE_TEXTURESTAGE(4, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(4, WINED3DTSS_ALPHAARG1), { STATE_TEXTURESTAGE(4, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(4, WINED3DTSS_ALPHAARG2), { STATE_TEXTURESTAGE(4, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, - { STATE_TEXTURESTAGE(4, WINED3DTSS_BUMPENVMAT00), { STATE_TEXTURESTAGE(4, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(4, WINED3DTSS_BUMPENVMAT01), { STATE_TEXTURESTAGE(4, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(4, WINED3DTSS_BUMPENVMAT10), { STATE_TEXTURESTAGE(4, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(4, WINED3DTSS_BUMPENVMAT11), { STATE_TEXTURESTAGE(4, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, { STATE_TEXTURESTAGE(4, WINED3DTSS_COLORARG0), { STATE_TEXTURESTAGE(4, WINED3DTSS_COLOROP), tex_colorop }, 0 }, { STATE_TEXTURESTAGE(4, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(4, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(4, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(4, WINED3DTSS_COLOROP), tex_colorop }, 0 }, @@ -5483,10 +5413,6 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(5, WINED3DTSS_ALPHAOP), { STATE_TEXTURESTAGE(5, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(5, WINED3DTSS_ALPHAARG1), { STATE_TEXTURESTAGE(5, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(5, WINED3DTSS_ALPHAARG2), { STATE_TEXTURESTAGE(5, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, - { STATE_TEXTURESTAGE(5, WINED3DTSS_BUMPENVMAT00), { STATE_TEXTURESTAGE(5, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(5, WINED3DTSS_BUMPENVMAT01), { STATE_TEXTURESTAGE(5, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(5, WINED3DTSS_BUMPENVMAT10), { STATE_TEXTURESTAGE(5, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(5, WINED3DTSS_BUMPENVMAT11), { STATE_TEXTURESTAGE(5, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, { STATE_TEXTURESTAGE(5, WINED3DTSS_COLORARG0), { STATE_TEXTURESTAGE(5, WINED3DTSS_COLOROP), tex_colorop }, 0 }, { STATE_TEXTURESTAGE(5, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(5, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(5, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(5, WINED3DTSS_COLOROP), tex_colorop }, 0 }, @@ -5497,10 +5423,6 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(6, WINED3DTSS_ALPHAOP), { STATE_TEXTURESTAGE(6, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(6, WINED3DTSS_ALPHAARG1), { STATE_TEXTURESTAGE(6, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(6, WINED3DTSS_ALPHAARG2), { STATE_TEXTURESTAGE(6, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, - { STATE_TEXTURESTAGE(6, WINED3DTSS_BUMPENVMAT00), { STATE_TEXTURESTAGE(6, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(6, WINED3DTSS_BUMPENVMAT01), { STATE_TEXTURESTAGE(6, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(6, WINED3DTSS_BUMPENVMAT10), { STATE_TEXTURESTAGE(6, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(6, WINED3DTSS_BUMPENVMAT11), { STATE_TEXTURESTAGE(6, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, { STATE_TEXTURESTAGE(6, WINED3DTSS_COLORARG0), { STATE_TEXTURESTAGE(6, WINED3DTSS_COLOROP), tex_colorop }, 0 }, { STATE_TEXTURESTAGE(6, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(6, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(6, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(6, WINED3DTSS_COLOROP), tex_colorop }, 0 }, @@ -5511,10 +5433,6 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAOP), { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAARG1), { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAARG2), { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, - { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVMAT00), { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVMAT01), { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVMAT10), { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, - { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVMAT11), { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVMAT00), tex_bumpenvmat }, ATI_ENVMAP_BUMPMAP }, { STATE_TEXTURESTAGE(7, WINED3DTSS_COLORARG0), { STATE_TEXTURESTAGE(7, WINED3DTSS_COLOROP), tex_colorop }, 0 }, { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAOP), tex_alphaop }, 0 }, { STATE_TEXTURESTAGE(7, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(7, WINED3DTSS_COLOROP), tex_colorop }, 0 }, @@ -5570,10 +5488,6 @@ static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_in if (GL_SUPPORT(ARB_TEXTURE_ENV_DOT3)) pCaps->TextureOpCaps |= WINED3DTEXOPCAPS_DOTPRODUCT3; - if(GL_SUPPORT(ATI_ENVMAP_BUMPMAP)) { - pCaps->TextureOpCaps |= WINED3DTEXOPCAPS_BUMPENVMAP; - } - pCaps->MaxTextureBlendStages = GL_LIMITS(texture_stages); pCaps->MaxSimultaneousTextures = GL_LIMITS(textures); } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index b5c9ff9d9a8..1fb27cc72fd 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1639,13 +1639,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_ case WINED3DFMT_V8U8: if(GL_SUPPORT(NV_TEXTURE_SHADER3)) break; - else if(GL_SUPPORT(ATI_ENVMAP_BUMPMAP)) { - *format = GL_DUDV_ATI; - *internal = GL_DU8DV8_ATI; - *type = GL_BYTE; - /* No conversion - Just change the gl type */ - break; - } *convert = CONVERT_V8U8; *format = GL_BGR; *internal = GL_RGB8; @@ -1678,7 +1671,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_ * 4th component, which is returned as alpha */ } else { - /* Not supported by GL_ATI_envmap_bumpmap */ *format = GL_BGRA; *internal = GL_RGB8; *type = GL_UNSIGNED_INT_8_8_8_8_REV; @@ -1692,7 +1684,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_ *internal = GL_RGBA8; *type = GL_UNSIGNED_BYTE; *target_bpp = 4; - /* Not supported by GL_ATI_envmap_bumpmap */ break; case WINED3DFMT_V16U16: @@ -1702,9 +1693,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_ *internal = GL_RGB16_EXT; *type = GL_UNSIGNED_SHORT; *target_bpp = 6; - /* What should I do here about GL_ATI_envmap_bumpmap? - * Convert it or allow data loss by loading it into a 8 bit / channel texture? - */ break; case WINED3DFMT_A4L4: diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 94d862551ea..93cfc41a2f5 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -372,16 +372,12 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info) * an application that needs this because it causes performance problems due to * shader recompiling in some games. */ - if(!GL_SUPPORT(ATI_ENVMAP_BUMPMAP) && !GL_SUPPORT(NV_TEXTURE_SHADER2)) { + if(!GL_SUPPORT(NV_TEXTURE_SHADER2)) { /* signed -> unsigned fixup */ dst = getFmtIdx(WINED3DFMT_V8U8); gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8; dst = getFmtIdx(WINED3DFMT_V16U16); gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8; - } else if(GL_SUPPORT(ATI_ENVMAP_BUMPMAP)) { - /* signed -> unsigned fixup */ - dst = getFmtIdx(WINED3DFMT_V16U16); - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V16U16; } else { /* Blue = 1.0 fixup, disabled for now */ if(0) { diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h index 25159b19be6..603668880fa 100644 --- a/include/wine/wined3d_gl.h +++ b/include/wine/wined3d_gl.h @@ -2843,23 +2843,6 @@ typedef void (WINE_GLAPI * PGLFNFINISHOBJECTAPPLEPROC) (GLenum, GLuint); #define GL_APPLE_client_storage 1 #define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 #endif -/* GL_ATI_envmap_bumpmap */ -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -#endif -typedef void (WINE_GLAPI * PGLFNTEXBUMPPARAMETERIVATIPROC) (GLenum, GLint *); -typedef void (WINE_GLAPI * PGLFNTEXBUMPPARAMETERFVATIPROC) (GLenum, GLfloat *); -typedef void (WINE_GLAPI * PGLFNGETTEXBUMPPARAMETERIVATIPROC) (GLenum, GLint *); -typedef void (WINE_GLAPI * PGLFNGETTEXBUMPPARAMETERFVATIPROC) (GLenum, GLfloat *); - /* GLX_SGI_video_sync */ typedef int (WINE_GLAPI * PGLXFNGETVIDEOSYNCSGIPROC) (unsigned int *); typedef int (WINE_GLAPI * PGLXFNWAITVIDEOSYNCSGIPROC) (int, int, unsigned int *); @@ -3389,7 +3372,6 @@ typedef enum _GL_SupportedExt { ATI_TEXTURE_ENV_COMBINE3, ATI_TEXTURE_MIRROR_ONCE, EXT_VERTEX_SHADER, - ATI_ENVMAP_BUMPMAP, ATI_FRAGMENT_SHADER, ATI_TEXTURE_COMPRESSION_3DC, /* APPLE */ @@ -3691,11 +3673,6 @@ typedef enum _GL_SupportedExt { USE_GL_FUNC(PGLFNISFENCEAPPLEPROC, glIsFenceAPPLE, APPLE_FENCE, NULL )\ USE_GL_FUNC(PGLFNTESTOBJECTAPPLEPROC, glTestObjectAPPLE, APPLE_FENCE, NULL )\ USE_GL_FUNC(PGLFNFINISHOBJECTAPPLEPROC, glFinishObjectAPPLE, APPLE_FENCE, NULL )\ - /* GL_ATI_envmap_bumpmap */ \ - USE_GL_FUNC(PGLFNTEXBUMPPARAMETERIVATIPROC, glTexBumpParameterivATI, ATI_ENVMAP_BUMPMAP, NULL )\ - USE_GL_FUNC(PGLFNTEXBUMPPARAMETERFVATIPROC, glTexBumpParameterfvATI, ATI_ENVMAP_BUMPMAP, NULL )\ - USE_GL_FUNC(PGLFNGETTEXBUMPPARAMETERIVATIPROC, glGetTexBumpParameterivATI, ATI_ENVMAP_BUMPMAP, NULL )\ - USE_GL_FUNC(PGLFNGETTEXBUMPPARAMETERFVATIPROC, glGetTexBumpParameterfvATI, ATI_ENVMAP_BUMPMAP, NULL )\ /* GLX_SGI_video_sync */ \ USE_GL_FUNC(PGLXFNGETVIDEOSYNCSGIPROC, glXGetVideoSyncSGI, SGI_VIDEO_SYNC, NULL )\ USE_GL_FUNC(PGLXFNWAITVIDEOSYNCSGIPROC, glXWaitVideoSyncSGI, SGI_VIDEO_SYNC, NULL )\ -- 2.11.4.GIT