VirtualBox

Changeset 46037 in vbox for trunk


Ignore:
Timestamp:
May 13, 2013 5:29:18 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: 1. missing 2.1 bits: glPointParameter GL_POINT_SPRITE_COORD_ORIGIN support; 2. Proper GL_NONE for buffers; 3. etc.

Location:
trunk/src/VBox/GuestHost/OpenGL
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_version.h

    r45616 r46037  
    3131#define SHCROGL_SSM_VERSION_WITH_SINGLE_DEPTH_STENCIL               36
    3232#define SHCROGL_SSM_VERSION_WITH_PRESENT_STATE                      37
    33 #define SHCROGL_SSM_VERSION                                         37
     33/* older state did not have glPointParameter ( GL_POINT_SPRITE_COORD_ORIGIN ) implementation */
     34#define SHCROGL_SSM_VERSION_WITH_SPRITE_COORD_ORIGIN                38
     35/* dirty bits are not needed for now, remove */
     36#define SHCROGL_SSM_VERSION_WITHOUT_DIRTY_BITS                      38
     37#define SHCROGL_SSM_VERSION                                         38
    3438
    3539/* These define the Chromium release number.
  • trunk/src/VBox/GuestHost/OpenGL/include/state/cr_point.h

    r15532 r46037  
    2929        CRbitvalue coordReplacement[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
    3030#endif
     31        CRbitvalue spriteCoordOrigin[CR_MAX_BITARRAY];
    3132        CRbitvalue dirty[CR_MAX_BITARRAY];
    3233} CRPointBits;
     
    4445        GLboolean coordReplacement[CR_MAX_TEXTURE_UNITS];
    4546#endif
     47    GLfloat spriteCoordOrigin;
     48    GLfloat reserved; /* added to make sure alignment of sttructures following CRPointState in CRContext does not change */
    4649} CRPointState;
    4750
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_bits_globalop.h

    r44326 r46037  
    231231}
    232232#endif
     233#if CRSTATE_BITS_OP_VERSION >= SHCROGL_SSM_VERSION_WITH_SPRITE_COORD_ORIGIN
     234_CRSTATE_BITS_OP_SIZEOF(point.spriteCoordOrigin);
     235#endif
    233236
    234237_CRSTATE_BITS_OP_SIZEOF(polygon.dirty);
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_buffer.c

    r37613 r46037  
    484484    {
    485485        case GL_NONE:
     486            break;
    486487        case GL_FRONT_LEFT:
    487488        case GL_FRONT_RIGHT:
     
    549550    {
    550551        case GL_NONE:
     552            break;
    551553        case GL_FRONT_LEFT:
    552554        case GL_FRONT_RIGHT:
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_get.txt

    r44326 r46037  
    8181GLfloat   GL_POINT_SIZE_MAX_ARB       g->point.maxSize
    8282GLfloat   GL_POINT_FADE_THRESHOLD_SIZE_ARB g->point.fadeThresholdSize
     83GLfloat   GL_POINT_SPRITE_COORD_ORIGIN g->point.spriteCoordOrigin
    8384GLfloat   GL_POINT_DISTANCE_ATTENUATION_ARB g->point.distanceAttenuation[0] g->point.distanceAttenuation[1] g->point.distanceAttenuation[2]
    8485GLboolean GL_NORMALIZE                g->transform.normalize
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_point.c

    r15532 r46037  
    4141#endif
    4242
     43        p->spriteCoordOrigin = (GLfloat)GL_UPPER_LEFT;
     44        RESET(pb->spriteCoordOrigin, ctx->bitid);
     45
    4346        RESET(pb->dirty, ctx->bitid);
    4447
     
    168171                }
    169172                break;
     173        case GL_POINT_SPRITE_COORD_ORIGIN:
     174        {
     175            GLenum enmVal = (GLenum)params[0];
     176        if (enmVal != GL_LOWER_LEFT && enmVal != GL_UPPER_LEFT) {
     177            crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glPointParameterfvARB invalid GL_POINT_SPRITE_COORD_ORIGIN value: %f", params[0]);
     178            return;
     179        }
     180        p->spriteCoordOrigin = params[0];
     181        DIRTY(pb->spriteCoordOrigin, g->neg_bitid);
     182            break;
     183        }
    170184        default:
    171185                crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glPointParameterfvARB invalid enum: %f", pname);
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_point.txt

    r15532 r46037  
    88:maxSize:maxSize:PointParameterfARB,GL_POINT_SIZE_MAX_ARB
    99:fadeThresholdSize:fadeThresholdSize:PointParameterfARB,GL_POINT_FADE_THRESHOLD_SIZE_ARB
     10:spriteCoordOrigin:spriteCoordOrigin:PointParameterfARB,GL_POINT_SPRITE_COORD_ORIGIN
    1011#:distanceAttenuation:distanceAttenuation:PointParameterfvARB,GL_POINT_DISTANCE_ATTENUATION_ARB
    1112-:distanceAttenuation:*if (from->distanceAttenuation[0] != to->distanceAttenuation[0] || from->distanceAttenuation[1] != to->distanceAttenuation[1] || from->distanceAttenuation[2] != to->distanceAttenuation[2]) {
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_snapshot.c

    r44937 r46037  
    149149    SHCROGL_CUT_TAIL_ALIGNMENT(CRTextureUnit, SHCROGL_INTERNAL_LAST_FIELD);
    150150#undef SHCROGL_INTERNAL_LAST_FIELD
     151    return rc;
     152}
     153
     154static int crStateLoadStencilPoint_v_37(CRPointState *pPoint, PSSMHANDLE pSSM)
     155{
     156    int rc = VINF_SUCCESS;
     157    SHCROGL_GET_STRUCT_HEAD(pPoint, CRPointState, spriteCoordOrigin);
     158    pPoint->spriteCoordOrigin = (GLfloat)GL_UPPER_LEFT;
    151159    return rc;
    152160}
     
    17121720int32_t crStateSaveGlobals(PSSMHANDLE pSSM)
    17131721{
     1722    /* don't need that for now */
     1723#if 0
    17141724    CRStateBits *pBits;
    17151725    int rc;
     
    17251735#include "state_bits_globalop.h"
    17261736#undef CRSTATE_BITS_OP
     1737#endif
    17271738    return VINF_SUCCESS;
    17281739}
     
    17541765#undef CRSTATE_BITS_OP_STENCIL_OP_V_33
    17551766        }
     1767        else if (u32Version < SHCROGL_SSM_VERSION_WITH_SPRITE_COORD_ORIGIN)
     1768        {
     1769#define CRSTATE_BITS_OP_VERSION (SHCROGL_SSM_VERSION_WITH_SPRITE_COORD_ORIGIN - 1)
     1770#include "state_bits_globalop.h"
     1771#undef CRSTATE_BITS_OP_VERSION
     1772        }
    17561773        else
    17571774        {
    1758 #include "state_bits_globalop.h"
     1775            /* we do not put dirty bits to state anymore,
     1776             * nop */
     1777//#include "state_bits_globalop.h"
    17591778        }
    17601779#undef CRSTATE_BITS_OP
     
    18531872            AssertRCReturn(rc, rc);
    18541873            SHCROGL_CUT_FIELD_ALIGNMENT(CRContext, attrib, buffer);
    1855             SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, buffer, stencil);
     1874            SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, buffer, point);
     1875            rc = crStateLoadStencilPoint_v_37(&pTmpContext->point, pSSM);
     1876            AssertRCReturn(rc, rc);
     1877            SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, polygon, stencil);
    18561878            rc = crStateLoadStencilState_v_33(&pTmpContext->stencil, pSSM);
    18571879            AssertRCReturn(rc, rc);
     
    18681890            AssertRCReturn(rc, rc);
    18691891            SHCROGL_CUT_FIELD_ALIGNMENT(CRContext, attrib, buffer);
    1870             SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, buffer, stencil);
     1892            SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, buffer, point);
     1893            rc = crStateLoadStencilPoint_v_37(&pTmpContext->point, pSSM);
     1894            AssertRCReturn(rc, rc);
     1895            SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, polygon, stencil);
    18711896            rc = crStateLoadStencilState_v_33(&pTmpContext->stencil, pSSM);
    18721897            AssertRCReturn(rc, rc);
     
    18841909        AssertRCReturn(rc, rc);
    18851910        SHCROGL_CUT_FIELD_ALIGNMENT(CRContext, attrib, buffer);
    1886         SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, buffer, stencil);
     1911        SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, buffer, point);
     1912        rc = crStateLoadStencilPoint_v_37(&pTmpContext->point, pSSM);
     1913        AssertRCReturn(rc, rc);
     1914        SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, polygon, stencil);
    18871915        rc = crStateLoadStencilState_v_33(&pTmpContext->stencil, pSSM);
    18881916        AssertRCReturn(rc, rc);
    18891917        SHCROGL_CUT_FOR_OLD_TYPE_TO_ENSURE_ALIGNMENT(CRContext, stencil, CRStencilState_v_33, sizeof (void*));
    18901918        SHCROGL_GET_STRUCT_TAIL(pTmpContext, CRContext, texture);
     1919    }
     1920    else if (u32Version < SHCROGL_SSM_VERSION_WITH_SPRITE_COORD_ORIGIN)
     1921    {
     1922        SHCROGL_GET_STRUCT_HEAD(pTmpContext, CRContext, point);
     1923        crStateLoadStencilPoint_v_37(&pTmpContext->point, pSSM);
     1924        SHCROGL_GET_STRUCT_TAIL(pTmpContext, CRContext, polygon);
    18911925    }
    18921926    else
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