VirtualBox

Changeset 33046 in vbox for trunk/src


Ignore:
Timestamp:
Oct 11, 2010 5:28:33 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66570
Message:

crOpenGL/wddm: some texture mirroring code

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/basetexture.c

    r32622 r33046  
    6767    texture->baseTexture.is_srgb = FALSE;
    6868    texture->baseTexture.pow2Matrix_identity = TRUE;
     69#if defined(VBOX_WITH_WDDM) && defined(DEBUG_leo)
     70    texture->baseTexture.t_mirror = TRUE;
     71#else
     72    texture->baseTexture.t_mirror = FALSE;
     73#endif
    6974
    7075    if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING)
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c

    r32622 r33046  
    19421942    struct color_fixup_desc fixup;
    19431943    BOOL np2_fixup = FALSE;
     1944    BOOL tmirror_tmp_reg = FALSE;
    19441945    va_list args;
    19451946
     
    19521953        sampler_base = "Psampler";
    19531954
    1954         if(priv->cur_ps_args->np2_fixup & (1 << sampler)) {
     1955        if (priv->cur_ps_args->np2_fixup & (1 << sampler)) {
    19551956            if(bias) {
    19561957                FIXME("Biased sampling from NP2 textures is unsupported\n");
     
    19591960            }
    19601961        }
     1962
     1963        if (priv->cur_ps_args->t_mirror & (1 << sampler))
     1964        {
     1965            if (ins->ctx->reg_maps->sampler_type[sampler]==WINED3DSTT_2D)
     1966            {
     1967                if (sample_function->coord_mask & WINED3DSP_WRITEMASK_1)
     1968                {
     1969                    glsl_src_param_t coord_param;
     1970                    shader_glsl_add_src_param(ins, &ins->src[0], sample_function->coord_mask, &coord_param);
     1971
     1972                    if (ins->src[0].reg.type != WINED3DSPR_INPUT)
     1973                    {
     1974                        shader_addline(ins->ctx->buffer, "%s.y=1.0-%s.y;\n",
     1975                                       coord_param.reg_name, coord_param.reg_name);
     1976                    }
     1977                    else
     1978                    {
     1979                        tmirror_tmp_reg = TRUE;
     1980                        shader_addline(ins->ctx->buffer, "tmp0.xy=vec2(%s.x, 1.0-%s.y).xy;\n",
     1981                                       coord_param.reg_name, coord_param.reg_name);
     1982                    }
     1983                }
     1984                else
     1985                {
     1986                    DebugBreak();
     1987                    FIXME("Unexpected coord_mask with t_mirror\n");
     1988                }
     1989            }
     1990        }
    19611991    } else {
    19621992        sampler_base = "Vsampler";
     
    19681998    shader_addline(ins->ctx->buffer, "%s(%s%u, ", sample_function->name, sampler_base, sampler);
    19691999
    1970     va_start(args, coord_reg_fmt);
    1971     shader_vaddline(ins->ctx->buffer, coord_reg_fmt, args);
    1972     va_end(args);
     2000    if (tmirror_tmp_reg)
     2001    {
     2002        shader_addline(ins->ctx->buffer, "%s", "tmp0.xy");
     2003    }
     2004    else
     2005    {
     2006        va_start(args, coord_reg_fmt);
     2007        shader_vaddline(ins->ctx->buffer, coord_reg_fmt, args);
     2008        va_end(args);
     2009    }
    19732010
    19742011    if(bias) {
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/shader.c

    r28475 r33046  
    20202020    args->srgb_correction = stateblock->renderState[WINED3DRS_SRGBWRITEENABLE] ? 1 : 0;
    20212021    args->np2_fixup = 0;
     2022    args->t_mirror = 0;
    20222023
    20232024    for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i)
     
    20362037        {
    20372038            args->np2_fixup |= (1 << i);
     2039        }
     2040
     2041        if (texture->baseTexture.t_mirror)
     2042        {
     2043            args->t_mirror |= (1 << i);
    20382044        }
    20392045    }
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/state.c

    r28475 r33046  
    45334533        {
    45344534            GLfloat yoffset = -(63.0f / 64.0f) / stateblock->viewport.Height;
     4535#if !defined(VBOX_WITH_WDDM) || !defined(DEBUG_leo)
    45354536            device->posFixup[1] = context->render_offscreen ? -1.0f : 1.0f;
     4537#else
     4538            device->posFixup[1] = context->render_offscreen ? 1.0f : -1.0f;
     4539#endif
    45364540            device->posFixup[3] = device->posFixup[1] * yoffset;
    45374541        }
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h

    r32622 r33046  
    716716       D3D9 has a limit of 16 samplers and the fixup is superfluous
    717717       in D3D10 (unconditional NP2 support mandatory). */
     718    WORD                        t_mirror;
    718719};
    719720
     
    19071908    BOOL                    is_srgb;
    19081909    BOOL                    pow2Matrix_identity;
     1910    BOOL                    t_mirror;
    19091911    const struct min_lookup *minMipLookup;
    19101912    const GLenum            *magLookup;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette