VirtualBox

Changeset 79768 in vbox for trunk/src/VBox/Additions/3D/mesa


Ignore:
Timestamp:
Jul 14, 2019 4:55:44 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132134
Message:

VBox/Additions/3D/mesa: Deal with the coordinate system differences between the D3D state tracker and the SVGA driver. bugref:8893

Location:
trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/drivers/svga/svga_pipe_blit.c

    r75443 r79768  
    609609   svga_toggle_render_condition(svga, blit.render_condition_enable, FALSE);
    610610
    611 #ifdef VBOX_WITH_MESA3D_SVGA_HALFZ
    612    if (svga->curr.rast && svga->curr.rast->templ.clip_halfz)
    613    {
    614        /* Flip Y because the state tracker uses D3D texture coords:
    615         * top,left=0,0; bottom,right = 1,1.
    616         * While the blit draws a quad using the source as texture and sets
    617         * texcoords for destination vertices using OpenGL coordinates:
    618         * bottom,left = 0,0; top,right = 1,1.
    619         */
    620        blit.dst.box.y = dst->height0 - blit.dst.box.y;
    621        blit.dst.box.height = -blit.dst.box.height;
    622    }
    623 #endif
    624 
    625611   util_blitter_blit(svga->blitter, &blit);
    626612
  • trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/state_trackers/nine/nine_state.c

    r75443 r79768  
    26842684    (void) src;
    26852685
     2686#ifdef VBOX_WITH_MESA3D_NINE_SVGA
     2687    /* Flip Y because the state tracker uses D3D texture coords:
     2688     * top,left=0,0; bottom,right = 1,1.
     2689     * While the blit draws a quad using the source as texture and sets
     2690     * texcoords for destination vertices using OpenGL coordinates:
     2691     * bottom,left = 0,0; top,right = 1,1.
     2692     */
     2693    {
     2694        struct pipe_blit_info b = *blit;
     2695
     2696        b.dst.box.y = b.dst.resource->height0 - b.dst.box.y - b.dst.box.height;
     2697
     2698        b.src.box.y = b.src.resource->height0 - b.src.box.y;
     2699        b.src.box.height = -b.src.box.height;
     2700
     2701        context->pipe->blit(context->pipe, &b);
     2702    }
     2703#else
    26862704    context->pipe->blit(context->pipe, blit);
     2705#endif
    26872706}
    26882707
     
    27012720    d3dcolor_to_pipe_color_union(&rgba, color);
    27022721    surf = NineSurface9_GetSurface(surface, 0);
     2722#ifdef VBOX_WITH_MESA3D_NINE_SVGA
     2723    /* Flip Y because the nine state tracker uses D3D coords:
     2724     * top,left=0,0; bottom,right = 1,1.
     2725     * While the clear_render_target draws a quad sets texcoords
     2726     * for destination vertices using OpenGL coordinates:
     2727     * bottom,left = 0,0; top,right = 1,1.
     2728     */
     2729    /** @todo Figure out how to avoid such mismatches in a generic way. */
     2730    y = surf->height - y - height;
     2731#endif
    27032732    context->pipe->clear_render_target(context->pipe, surf, &rgba, x, y, width, height, false);
    27042733}
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