VirtualBox

Changeset 57503 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Aug 23, 2015 5:35:13 PM (9 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA3d-ogl.cpp: @todo cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r57502 r57503  
    140140*********************************************************************************************************************************/
    141141/* Define the default light parameters as specified by MSDN. */
    142 /* @todo move out; fetched from Wine */
     142/** @todo move out; fetched from Wine */
    143143const SVGA3dLightData vmsvga3d_default_light =
    144144{
     
    845845     *
    846846     */
    847     /** @todo: distinguish between vertex and pixel shaders??? */
     847    /** @todo distinguish between vertex and pixel shaders??? */
    848848    if (   vmsvga3dCheckGLExtension(pState, 0.0f, " GL_NV_gpu_program4 ")
    849849        || strstr(pState->pszOtherExtensions, " GL_NV_gpu_program4 "))
     
    10971097    uint32_t result = 0;
    10981098
    1099     /* @todo missing:
     1099    /** @todo missing:
    11001100     *
    11011101     * SVGA3DFORMAT_OP_PIXELSIZE
     
    11231123    }
    11241124
    1125     /* @todo check hardware caps! */
     1125    /** @todo check hardware caps! */
    11261126    switch (idx3dCaps)
    11271127    {
     
    12011201    uint32_t result = 0;
    12021202
    1203     /* @todo test this somehow */
     1203    /** @todo test this somehow */
    12041204    result = SVGA3DFORMAT_OP_ZSTENCIL | SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH;
    12051205
     
    12961296
    12971297    case SVGA3D_DEVCAP_MAX_SHADER_TEXTURES:
    1298         /* @todo ?? */
     1298        /** @todo ?? */
    12991299        rc = VERR_INVALID_PARAMETER;
    13001300        break;
     
    13701370        break;
    13711371
    1372     case SVGA3D_DEVCAP_MAX_RENDER_TARGETS:  /* @todo same thing? */
     1372    case SVGA3D_DEVCAP_MAX_RENDER_TARGETS:  /** @todo same thing? */
    13731373    case SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS:
    13741374        *pu32Val = pState->caps.maxColorAttachments;
     
    18021802        return D3DMULTISAMPLE_NONE;
    18031803
    1804     /* @todo exact same mapping as d3d? */
     1804    /** @todo exact same mapping as d3d? */
    18051805    return (D3DMULTISAMPLE_TYPE)multisampleCount;
    18061806}
     
    18211821    {
    18221822    case SVGA3D_SURFACE_CUBEMAP:
    1823         AssertFailed(); /** @todo */
     1823        AssertFailed(); /** @todo destroy SVGA3D_SURFACE_CUBEMAP */
    18241824        break;
    18251825
     
    20262026    glGenTextures(1, &pSurface->oglId.texture);
    20272027    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    2028     /* @todo Set the mip map generation filter settings. */
     2028    /** @todo Set the mip map generation filter settings. */
    20292029
    20302030    glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
     
    24212421
    24222422    case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
    2423         AssertFailed(); /* @todo */
     2423        AssertFailed(); /** @todo DMA SVGA3D_SURFACE_HINT_DEPTHSTENCIL */
    24242424        break;
    24252425
     
    25022502    }
    25032503
    2504     /* @todo Only screen 0 for now. */
     2504    /** @todo Only screen 0 for now. */
    25052505    AssertReturn(dest == 0, VERR_INTERNAL_ERROR);
    25062506    AssertReturn(src.mipmap == 0 && src.face == 0, VERR_INVALID_PARAMETER);
    2507     /* @todo scaling */
     2507    /** @todo scaling */
    25082508    AssertReturn(destRect.right - destRect.left == srcRect.right - srcRect.left && destRect.bottom - destRect.top == srcRect.bottom - srcRect.top, VERR_INVALID_PARAMETER);
    25092509
     
    25472547        dst.pitch      = pThis->svga.cbScanline;
    25482548
    2549         /* @todo merge into one SurfaceDMA call */
     2549        /** @todo merge into one SurfaceDMA call */
    25502550        for (uint32_t i = 0; i < cRects; i++)
    25512551        {
     
    26042604    else
    26052605    {
    2606         /* @todo new filter */
     2606        /** @todo new filter */
    26072607        AssertFailed();
    26082608    }
     
    26402640    pSurface = pState->papSurfaces[sid];
    26412641
    2642     /* @todo stricter checks for associated context */
     2642    /** @todo stricter checks for associated context */
    26432643    Log(("vmsvga3dCommandPresent: sid=%x cRects=%d\n", sid, cRects));
    26442644    for (uint32_t i=0; i < cRects; i++)
     
    31553155
    31563156    pixelFormat = ChoosePixelFormat(pContext->hdc, &pfd);
    3157     /* @todo is this really necessary?? */
     3157    /** @todo is this really necessary?? */
    31583158    pixelFormat = ChoosePixelFormat(pContext->hdc, &pfd);
    31593159    AssertMsgReturn(pixelFormat != 0, ("ChoosePixelFormat failed with %d\n", GetLastError()), VERR_INTERNAL_ERROR);
     
    32533253    }
    32543254#if 0
    3255     /* @todo move to shader lib!!! */
     3255    /** @todo move to shader lib!!! */
    32563256    /* Clear the screen */
    32573257    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     
    32663266    if (pState->ext.glProvokingVertex)
    32673267        pState->ext.glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);
    3268     /* @todo move to shader lib!!! */
     3268    /** @todo move to shader lib!!! */
    32693269#endif
    32703270    return VINF_SUCCESS;
     
    36153615        return GL_SRC_ALPHA_SATURATE;
    36163616    case SVGA3D_BLENDOP_BLENDFACTOR:
    3617         return GL_CONSTANT_ALPHA;       /* @todo correct?? */
     3617        return GL_CONSTANT_ALPHA;       /** @todo correct?? */
    36183618    case SVGA3D_BLENDOP_INVBLENDFACTOR:
    3619         return GL_ONE_MINUS_CONSTANT_ALPHA;       /* @todo correct?? */
     3619        return GL_ONE_MINUS_CONSTANT_ALPHA;       /** @todo correct?? */
    36203620    default:
    36213621        AssertFailed();
     
    37693769
    37703770        case SVGA3D_RS_POINTSIZE:              /* float */
    3771             /* @todo we need to apply scaling for point sizes below the min or above the max; see Wine) */
     3771            /** @todo we need to apply scaling for point sizes below the min or above the max; see Wine) */
    37723772            if (pRenderState[i].floatValue < pState->caps.flPointSize[0])
    37733773                pRenderState[i].floatValue = pState->caps.flPointSize[0];
     
    38773877            }
    38783878
    3879             /* @todo how to switch between vertex and pixel fog modes??? */
     3879            /** @todo how to switch between vertex and pixel fog modes??? */
    38803880            Assert(mode.s.type == SVGA3D_FOGTYPE_PIXEL);
    38813881#if 0
     
    39643964        case SVGA3D_RS_LINEPATTERN:            /* SVGA3dLinePattern */
    39653965            /* No longer supported by d3d; mesagl comments suggest not all backends support it */
    3966             /* @todo */
     3966            /** @todo */
    39673967            Log(("WARNING: SVGA3D_RS_LINEPATTERN %x not supported!!\n", pRenderState[i].uintValue));
    39683968            /*
     
    42384238        case SVGA3D_RS_CCWSTENCILFUNC:         /* SVGA3dCmpFunc */
    42394239        {
    4240             /* @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
    4241              *       SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
     4240            /** @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
     4241             *        SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
    42424242             */
    42434243            GLint ref;
     
    42584258        case SVGA3D_RS_CCWSTENCILPASS:         /* SVGA3dStencilOp */
    42594259        {
    4260             /* @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
    4261              *       SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
     4260            /** @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
     4261             *        SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
    42624262             */
    42634263            GLint sfail, dpfail, dppass;
     
    42934293
    42944294        case SVGA3D_RS_ZBIAS:                  /* float */
    4295             /* @todo unknown meaning; depth bias is not identical
     4295            /** @todo unknown meaning; depth bias is not identical
    42964296            renderState = D3DRS_DEPTHBIAS;
    42974297            val = pRenderState[i].uintValue;
     
    43044304            GLfloat factor;
    43054305
    4306             /* @todo not sure if the d3d & ogl definitions are identical. */
     4306            /** @todo not sure if the d3d & ogl definitions are identical. */
    43074307
    43084308            /* Do not change the factor part. */
     
    43194319            GLfloat units;
    43204320
    4321             /* @todo not sure if the d3d & ogl definitions are identical. */
     4321            /** @todo not sure if the d3d & ogl definitions are identical. */
    43224322
    43234323            /* Do not change the factor part. */
     
    44164416        case SVGA3D_RS_COORDINATETYPE:         /* SVGA3dCoordinateType */
    44174417            Assert(pRenderState[i].uintValue == SVGA3D_COORDINATE_LEFTHANDED);
    4418             /* @todo setup a view matrix to scale the world space by -1 in the z-direction for right handed coordinates. */
     4418            /** @todo setup a view matrix to scale the world space by -1 in the z-direction for right handed coordinates. */
    44194419            /*
    44204420            renderState = D3DRS_COORDINATETYPE;
     
    46614661            Log(("vmsvga3dSetRenderTarget: WARNING: glCheckFramebufferStatus returned %x\n", status));
    46624662#endif
    4663         /* @todo use glDrawBuffers too? */
     4663        /** @todo use glDrawBuffers too? */
    46644664        break;
    46654665    }
     
    47074707        return D3DTOP_MODULATE4X;
    47084708    case SVGA3D_TC_DSDT:
    4709         AssertFailed(); /* @todo ??? */
     4709        AssertFailed(); /** @todo ??? */
    47104710        return D3DTOP_DISABLE;
    47114711    case SVGA3D_TC_DOTPRODUCT3:
     
    47724772        return D3DTTFF_DISABLE;
    47734773    case SVGA3D_TEX_TRANSFORM_S:
    4774         return D3DTTFF_COUNT1;      /* @todo correct? */
     4774        return D3DTTFF_COUNT1;      /** @todo correct? */
    47754775    case SVGA3D_TEX_TRANSFORM_T:
    4776         return D3DTTFF_COUNT2;      /* @todo correct? */
     4776        return D3DTTFF_COUNT2;      /** @todo correct? */
    47774777    case SVGA3D_TEX_TRANSFORM_R:
    4778         return D3DTTFF_COUNT3;      /* @todo correct? */
     4778        return D3DTTFF_COUNT3;      /** @todo correct? */
    47794779    case SVGA3D_TEX_TRANSFORM_Q:
    4780         return D3DTTFF_COUNT4;      /* @todo correct? */
     4780        return D3DTTFF_COUNT4;      /** @todo correct? */
    47814781    case SVGA3D_TEX_PROJECTED:
    47824782        return D3DTTFF_PROJECTED;
     
    48024802    case SVGA3D_TEX_ADDRESS_MIRRORONCE:
    48034803        AssertFailed();
    4804         return GL_CLAMP_TO_EDGE_SGIS; /* @todo correct? */
     4804        return GL_CLAMP_TO_EDGE_SGIS; /** @todo correct? */
    48054805
    48064806    case SVGA3D_TEX_ADDRESS_EDGE:
     
    48224822        return GL_NEAREST;
    48234823    case SVGA3D_TEX_FILTER_ANISOTROPIC:
    4824         /* @todo */
     4824        /** @todo */
    48254825    case SVGA3D_TEX_FILTER_FLATCUBIC:       // Deprecated, not implemented
    48264826    case SVGA3D_TEX_FILTER_GAUSSIANCUBIC:   // Deprecated, not implemented
     
    49104910        case SVGA3D_TS_ALPHAARG1:                   /* SVGA3dTextureArgData */
    49114911        case SVGA3D_TS_ALPHAARG2:                   /* SVGA3dTextureArgData */
    4912             /* @todo; not used by MesaGL */
     4912            /** @todo not used by MesaGL */
    49134913            Log(("vmsvga3dSetTextureState: colorop/alphaop not yet supported!!\n"));
    49144914            break;
     
    50445044            vmsvgaColor2GLFloatArray(pTextureState[i].value, &color[0], &color[1], &color[2], &color[3]);
    50455045
    5046             glTexParameterfv(GL_TEXTURE_2D /* @todo flexible type */, GL_TEXTURE_BORDER_COLOR, color);   /* Identical; default 0.0 identical too */
     5046            glTexParameterfv(GL_TEXTURE_2D /** @todo flexible type */, GL_TEXTURE_BORDER_COLOR, color);   /* Identical; default 0.0 identical too */
    50475047            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    50485048            break;
     
    50505050
    50515051        case SVGA3D_TS_TEXTURE_LOD_BIAS:            /* float */
    5052             glTexParameterf(GL_TEXTURE_2D /* @todo flexible type */, GL_TEXTURE_LOD_BIAS, pTextureState[i].value);   /* Identical; default 0.0 identical too */
     5052            glTexParameterf(GL_TEXTURE_2D /** @todo flexible type */, GL_TEXTURE_LOD_BIAS, pTextureState[i].value);   /* Identical; default 0.0 identical too */
    50535053            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    50545054            break;
     
    50865086        if (textureType != ~0U)
    50875087        {
    5088             glTexParameteri(GL_TEXTURE_2D /* @todo flexible type */, textureType, val);
     5088            glTexParameteri(GL_TEXTURE_2D /** @todo flexible type */, textureType, val);
    50895089            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    50905090        }
     
    51465146}
    51475147
    5148 /* @todo Move into separate library as we are using logic from Wine here. */
     5148/** @todo Move into separate library as we are using logic from Wine here. */
    51495149int vmsvga3dSetLightData(PVGASTATE pThis, uint32_t cid, uint32_t index, SVGA3dLightData *pData)
    51505150{
     
    52235223        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    52245224
    5225         /* @todo range */
     5225        /** @todo range */
    52265226        break;
    52275227    }
     
    52915291        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    52925292
    5293         /* @todo range */
     5293        /** @todo range */
    52945294        break;
    52955295    }
     
    53855385    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_VIEWPORT;
    53865386
    5387     /* @todo y-inversion for partial viewport coordinates? */
     5387    /** @todo y-inversion for partial viewport coordinates? */
    53885388    glViewport(pRect->x, pRect->y, pRect->w, pRect->h);
    53895389    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     
    55145514    if (clearFlag & SVGA3D_CLEAR_STENCIL)
    55155515    {
    5516         /* @todo possibly the same problem as with glDepthMask */
     5516        /** @todo possibly the same problem as with glDepthMask */
    55175517        glClearStencil(stencil);
    55185518        mask |= GL_STENCIL_BUFFER_BIT;
     
    56265626    case SVGA3D_DECLTYPE_UDEC3:
    56275627        size = 3;
    5628         type = GL_UNSIGNED_INT_2_10_10_10_REV;    /* @todo correct? */
     5628        type = GL_UNSIGNED_INT_2_10_10_10_REV;    /** @todo correct? */
    56295629        break;
    56305630
     
    56325632        normalized = true;
    56335633        size = 3;
    5634         type = GL_INT_2_10_10_10_REV;    /* @todo correct? */
     5634        type = GL_INT_2_10_10_10_REV;    /** @todo correct? */
    56355635        break;
    56365636
     
    57155715
    57165716        Assert(pVertexSurface->fDirty);
    5717         /* @todo rethink usage dynamic/static */
     5717        /** @todo rethink usage dynamic/static */
    57185718        pState->ext.glBufferData(GL_ARRAY_BUFFER, pVertexSurface->pMipmapLevels[0].cbSurface, pVertexSurface->pMipmapLevels[0].pSurfaceData, GL_DYNAMIC_DRAW);
    57195719        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     
    57565756                                              (const GLvoid *)(uintptr_t)pVertexDecl[iVertex].array.offset);
    57575757            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    5758             /* case SVGA3D_DECLUSAGE_COLOR:    @todo color component order not identical!! test GL_BGRA!!  */
     5758            /** @todo case SVGA3D_DECLUSAGE_COLOR: color component order not identical!! test GL_BGRA!!  */
    57595759        }
    57605760        else
     
    58925892            case SVGA3D_DECLUSAGE_POSITIONT:
    58935893                break;
    5894             case SVGA3D_DECLUSAGE_COLOR:    /* @todo color component order not identical!! */
     5894            case SVGA3D_DECLUSAGE_COLOR:    /** @todo color component order not identical!! */
    58955895                glDisableClientState(GL_COLOR_ARRAY);
    58965896                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     
    59275927    AssertReturn(numRanges && numRanges <= SVGA3D_MAX_DRAW_PRIMITIVE_RANGES, VERR_INVALID_PARAMETER);
    59285928    AssertReturn(!cVertexDivisor || cVertexDivisor == numVertexDecls, VERR_INVALID_PARAMETER);
    5929     /* @todo */
     5929    /** @todo Non-zero cVertexDivisor */
    59305930    Assert(!cVertexDivisor);
    59315931
     
    60216021                Assert(pIndexSurface->fDirty);
    60226022
    6023                 /* @todo rethink usage dynamic/static */
     6023                /** @todo rethink usage dynamic/static */
    60246024                pState->ext.glBufferData(GL_ELEMENT_ARRAY_BUFFER, pIndexSurface->pMipmapLevels[0].cbSurface, pIndexSurface->pMipmapLevels[0].pSurfaceData, GL_DYNAMIC_DRAW);
    60256025                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     
    60506050        else
    60516051        {
    6052             Assert(pRange[iPrimitive].indexBias >= 0);  /* @todo */
     6052            Assert(pRange[iPrimitive].indexBias >= 0);  /** @todo  indexBias */
    60536053            Assert(pRange[iPrimitive].indexWidth == pRange[iPrimitive].indexArray.stride);
    60546054
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