コード例 #1
0
static void crBltBlitTexBuf(PCR_BLITTER pBlitter, const VBOXVR_TEXTURE *pSrc, const RTRECT *paSrcRects, GLenum enmDstBuff, const RTRECTSIZE *pDstSize, const RTRECT *paDstRects, uint32_t cRects, uint32_t fFlags)
{
    pBlitter->pDispatch->DrawBuffer(enmDstBuff);

    crBltCheckSetupViewport(pBlitter, pDstSize, enmDstBuff == GL_DRAW_FRAMEBUFFER);

    if (!(fFlags & CRBLT_F_NOALPHA))
        pBlitter->pfnBlt(pBlitter, pSrc, paSrcRects, pDstSize, paDstRects, cRects, fFlags);
    else
    {
        int rc = pBlitter->Flags.ShadersGloal ?
                CrGlslProgUseNoAlpha(pBlitter->pGlslCache, pSrc->target)
                :
                CrGlslProgUseGenNoAlpha(&pBlitter->LocalGlslCache, pSrc->target);

        if (!RT_SUCCESS(rc))
        {
            crWarning("Failed to use no-alpha program rc %d!, falling back to default blit", rc);
            pBlitter->pfnBlt(pBlitter, pSrc, paSrcRects, pDstSize, paDstRects, cRects, fFlags);
            return;
        }

        /* since we use shaders, we need to use draw commands rather than framebuffer blits.
         * force using draw-based blitting */
        crBltBlitTexBufImplDraw2D(pBlitter, pSrc, paSrcRects, pDstSize, paDstRects, cRects, fFlags);

        Assert(pBlitter->Flags.ShadersGloal || &pBlitter->LocalGlslCache == pBlitter->pGlslCache);

        CrGlslProgClear(pBlitter->pGlslCache);
    }
}
コード例 #2
0
static void crBltBlitTexBuf(PCR_BLITTER pBlitter, const VBOXVR_TEXTURE *pSrc, const RTRECT *paSrcRects, GLenum enmDstBuff, const RTRECTSIZE *pDstSize, const RTRECT *paDstRects, uint32_t cRects, uint32_t fFlags)
{
    pBlitter->pDispatch->DrawBuffer(enmDstBuff);

    crBltCheckSetupViewport(pBlitter, pDstSize, enmDstBuff == GL_DRAW_FRAMEBUFFER);

    pBlitter->pfnBlt(pBlitter, pSrc, paSrcRects, pDstSize, paDstRects, cRects, fFlags);
}
コード例 #3
0
void CrBltCheckUpdateViewport(PCR_BLITTER pBlitter)
{
    RTRECTSIZE DstSize = {pBlitter->CurrentMural.width, pBlitter->CurrentMural.height};
    crBltCheckSetupViewport(pBlitter, &DstSize, false);
}