VirtualBox

Changeset 37550 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jun 20, 2011 9:00:06 AM (13 years ago)
Author:
vboxsync
Message:

wddm/3d: fix random black lines with projected textures

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

Legend:

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

    r37394 r37550  
    18551855    {
    18561856        DWORD flags = 0;
     1857        struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
     1858
    18571859        if(reg_sampler_code < MAX_TEXTURES) {
    1858             flags = deviceImpl->stateBlock->textureState[reg_sampler_code][WINED3DTSS_TEXTURETRANSFORMFLAGS];
    1859         }
    1860         if (flags & WINED3DTTFF_PROJECTED) {
     1860            flags = priv->cur_ps_args->super.tex_transform >> (reg_sampler_code*WINED3D_PSARGS_TEXTRANSFORM_SHIFT);
     1861        }
     1862        if (flags & WINED3D_PSARGS_PROJECTED) {
    18611863            myflags |= TEX_PROJ;
    18621864        }
     
    19101912     IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
    19111913     IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *)shader->baseShader.device;
    1912      DWORD flags;
     1914     DWORD flags=0;
    19131915
    19141916     DWORD reg1 = ins->dst[0].reg.idx;
     
    19221924     shader_addline(buffer, "MOV TA.y, %s.x;\n", src_str);
    19231925     shader_addline(buffer, "MOV TA.x, %s.w;\n", src_str);
    1924      flags = reg1 < MAX_TEXTURES ? deviceImpl->stateBlock->textureState[reg1][WINED3DTSS_TEXTURETRANSFORMFLAGS] : 0;
    1925      shader_hw_sample(ins, reg1, dst_str, "TA", flags & WINED3DTTFF_PROJECTED ? TEX_PROJ : 0, NULL, NULL);
     1926
     1927     if (reg1 < MAX_TEXTURES)
     1928     {
     1929         struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
     1930         flags = priv->cur_ps_args->super.tex_transform >> (reg1 * WINED3D_PSARGS_TEXTRANSFORM_SHIFT);
     1931     }
     1932
     1933     shader_hw_sample(ins, reg1, dst_str, "TA", flags & WINED3D_PSARGS_PROJECTED ? TEX_PROJ : 0, NULL, NULL);
    19261934}
    19271935
     
    19601968    const struct wined3d_shader_dst_param *dst = &ins->dst[0];
    19611969    struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
     1970    struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
    19621971    char reg_coord[40], dst_reg[50], src_reg[50];
    19631972    DWORD reg_dest_code;
     1973    DWORD flags;
    19641974
    19651975    /* All versions have a destination register. The Tx where the texture coordinates come
     
    19891999     * so we can't let the GL handle this.
    19902000     */
    1991     if (device->stateBlock->textureState[reg_dest_code][WINED3DTSS_TEXTURETRANSFORMFLAGS] & WINED3DTTFF_PROJECTED)
     2001    flags = priv->cur_ps_args->super.tex_transform >> (reg_dest_code * WINED3D_PSARGS_TEXTRANSFORM_SHIFT);
     2002    if (flags & WINED3D_PSARGS_PROJECTED)
    19922003    {
    19932004        shader_addline(buffer, "RCP TB.w, %s.w;\n", reg_coord);
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c

    r35825 r37550  
    29872987    if (shader_version < WINED3D_SHADER_VERSION(1,4))
    29882988    {
    2989         DWORD flags = deviceImpl->stateBlock->textureState[sampler_idx][WINED3DTSS_TEXTURETRANSFORMFLAGS];
     2989        const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
     2990        DWORD flags = (priv->cur_ps_args->tex_transform >> (sampler_idx * WINED3D_PSARGS_TEXTRANSFORM_SHIFT))
     2991                      & WINED3D_PSARGS_TEXTRANSFORM_MASK;
    29902992
    29912993        /* Projected cube textures don't make a lot of sense, the resulting coordinates stay the same. */
    2992         if (flags & WINED3DTTFF_PROJECTED && sampler_type != WINED3DSTT_CUBE) {
     2994        if (flags & WINED3D_PSARGS_PROJECTED && sampler_type != WINED3DSTT_CUBE) {
    29932995            sample_flags |= WINED3D_GLSL_SAMPLE_PROJECTED;
    2994             switch (flags & ~WINED3DTTFF_PROJECTED) {
     2996            switch (flags & ~WINED3D_PSARGS_PROJECTED) {
    29952997                case WINED3DTTFF_COUNT1: FIXME("WINED3DTTFF_PROJECTED with WINED3DTTFF_COUNT1?\n"); break;
    29962998                case WINED3DTTFF_COUNT2: mask = WINED3DSP_WRITEMASK_1; break;
     
    34393441    IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *)shader->baseShader.device;
    34403442    const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
     3443    const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
    34413444    glsl_sample_function_t sample_function;
    34423445    glsl_src_param_t coord_param;
     
    34483451
    34493452    sampler_idx = ins->dst[0].reg.idx;
    3450     flags = deviceImpl->stateBlock->textureState[sampler_idx][WINED3DTSS_TEXTURETRANSFORMFLAGS];
     3453    flags = (priv->cur_ps_args->tex_transform >> (sampler_idx * WINED3D_PSARGS_TEXTRANSFORM_SHIFT))
     3454            & WINED3D_PSARGS_TEXTRANSFORM_MASK;
    34513455
    34523456    sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx];
     
    34603464         * so we can't let the GL handle this.
    34613465         */
    3462     if (flags & WINED3DTTFF_PROJECTED) {
     3466    if (flags & WINED3D_PSARGS_PROJECTED) {
    34633467        DWORD div_mask=0;
    34643468        char coord_div_mask[3];
    3465         switch (flags & ~WINED3DTTFF_PROJECTED) {
     3469        switch (flags & ~WINED3D_PSARGS_PROJECTED) {
    34663470            case WINED3DTTFF_COUNT1: FIXME("WINED3DTTFF_PROJECTED with WINED3DTTFF_COUNT1?\n"); break;
    34673471            case WINED3DTTFF_COUNT2: div_mask = WINED3DSP_WRITEMASK_1; break;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/shader.c

    r33656 r37550  
    20222022    args->t_mirror = 0;
    20232023
     2024    if (shader->baseShader.reg_maps.shader_version.major==1
     2025        && shader->baseShader.reg_maps.shader_version.minor<=3)
     2026    {
     2027        for (i=0; i<4; ++i)
     2028        {
     2029            DWORD flags = stateblock->textureState[i][WINED3DTSS_TEXTURETRANSFORMFLAGS];
     2030            DWORD tex_transform = flags & ~WINED3DTTFF_PROJECTED;
     2031            if (flags & WINED3DTTFF_PROJECTED)
     2032            {
     2033                tex_transform |= WINED3D_PSARGS_PROJECTED;
     2034            }
     2035            args->tex_transform |= tex_transform << (i*WINED3D_PSARGS_TEXTRANSFORM_SHIFT);
     2036        }
     2037    }
     2038
    20242039    for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i)
    20252040    {
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h

    r35825 r37550  
    711711struct wined3d_context;
    712712
     713#define WINED3D_PSARGS_PROJECTED          (1<<3)
     714#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT 4
     715#define WINED3D_PSARGS_TEXTRANSFORM_MASK  0xF
     716
    713717/* Stateblock dependent parameters which have to be hardcoded
    714718 * into the shader code
     
    719723    enum fogmode                fog;
    720724    /* Projected textures(ps 1.0-1.3) */
     725    WORD                        tex_transform;
    721726    /* Texture types(2D, Cube, 3D) in ps 1.x */
    722     BOOL                        srgb_correction;
     727    WORD                        srgb_correction;
    723728    WORD                        np2_fixup;
    724729    /* Bitmap for NP2 texcoord fixups (16 samplers max currently).
Note: See TracChangeset for help on using the changeset viewer.

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