VirtualBox

Changeset 25423 in vbox


Ignore:
Timestamp:
Dec 16, 2009 10:21:40 AM (15 years ago)
Author:
vboxsync
Message:

2d: more FBO support

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGL2D.h

    r25385 r25423  
    159159typedef GLboolean (APIENTRY *PFNVBOXVHWA_UNMAP_BUFFER)(GLenum target);
    160160
     161/* GL_EXT_framebuffer_object */
     162#ifndef GL_FRAMEBUFFER
     163# define GL_FRAMEBUFFER                0x8D40
     164#endif
     165#ifndef GL_COLOR_ATTACHMENT0
     166# define GL_COLOR_ATTACHMENT0          0x8CE0
     167#endif
     168
     169typedef GLboolean (APIENTRY *PFNVBOXVHWA_IS_FRAMEBUFFER)(GLuint framebuffer);
     170typedef GLvoid (APIENTRY *PFNVBOXVHWA_BIND_FRAMEBUFFER)(GLenum target, GLuint framebuffer);
     171typedef GLvoid (APIENTRY *PFNVBOXVHWA_DELETE_FRAMEBUFFERS)(GLsizei n, const GLuint *framebuffers);
     172typedef GLvoid (APIENTRY *PFNVBOXVHWA_GEN_FRAMEBUFFERS)(GLsizei n, GLuint *framebuffers);
     173typedef GLenum (APIENTRY *PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS)(GLenum target);
     174typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
     175typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
     176typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
     177typedef GLvoid (APIENTRY *PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
     178
    161179
    162180/*****************/
     
    209227extern PFNVBOXVHWA_MAP_BUFFER vboxglMapBuffer;
    210228extern PFNVBOXVHWA_UNMAP_BUFFER vboxglUnmapBuffer;
     229
     230extern PFNVBOXVHWA_IS_FRAMEBUFFER vboxglIsFramebuffer;
     231extern PFNVBOXVHWA_BIND_FRAMEBUFFER vboxglBindFramebuffer;
     232extern PFNVBOXVHWA_DELETE_FRAMEBUFFERS vboxglDeleteFramebuffers;
     233extern PFNVBOXVHWA_GEN_FRAMEBUFFERS vboxglGenFramebuffers;
     234extern PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS vboxglCheckFramebufferStatus;
     235extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D vboxglFramebufferTexture1D;
     236extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D vboxglFramebufferTexture2D;
     237extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D vboxglFramebufferTexture3D;
     238extern PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV vboxglGetFramebufferAttachmentParameteriv;
     239
    211240
    212241class VBoxGLInfo
     
    219248        mTextureNP2Supported(false),
    220249        mPBOSupported(false),
     250        mFBOSupported(false),
    221251        mMultiTexNumSupported(1), /* 1 would mean it is not supported */
    222252        m_GL_ARB_multitexture(false),
     
    228258        m_GL_NV_texture_rectangle(false),
    229259        m_GL_ARB_texture_non_power_of_two(false),
     260        m_GL_EXT_framebuffer_object(false),
    230261        mInitialized(false)
    231262    {}
     
    240271    bool isTextureNP2Supported() const { return mTextureNP2Supported; }
    241272    bool isPBOSupported() const { return mPBOSupported; }
     273    bool isFBOSupported() const { return mFBOSupported; }
    242274    /* 1 would mean it is not supported */
    243275    int getMultiTexNumSupported() const { return mMultiTexNumSupported; }
     
    252284    bool mTextureNP2Supported;
    253285    bool mPBOSupported;
     286    bool mFBOSupported;
    254287    int mMultiTexNumSupported; /* 1 would mean it is not supported */
    255288
     
    262295    bool m_GL_NV_texture_rectangle;
    263296    bool m_GL_ARB_texture_non_power_of_two;
     297    bool m_GL_EXT_framebuffer_object;
    264298
    265299    bool mInitialized;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h

    r25385 r25423  
    2929//#define VBOXVHWADBG_RENDERCHECK
    3030
     31//#define VBOXVHWA_NEW_PBO
     32
    3133#include "COMDefs.h"
    3234#include <QGLWidget>
     
    653655    uchar* mAddress;
    654656};
    655 #if 0
     657
    656658class VBoxVHWAFBO
    657659{
     
    665667        if(mFBO)
    666668        {
    667             vboxglDeleteFramebuffers(1, mFBO);
     669            vboxglDeleteFramebuffers(1, &mFBO);
    668670        }
    669671    }
     
    688690    GLuint mFBO;
    689691};
    690 #endif
    691692
    692693class VBoxVHWAHandleTable
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGLSupportInfo.cpp

    r24788 r25423  
    8686PFNVBOXVHWA_UNMAP_BUFFER vboxglUnmapBuffer = NULL;
    8787
    88 #if 0
    89 #if defined Q_WS_WIN
    90 #define VBOXVHWA_GETPROCADDRESS(_t, _n) (_t)wglGetProcAddress(_n)
    91 #elif defined Q_WS_X11
    92 #include <GL/glx.h>
    93 #define VBOXVHWA_GETPROCADDRESS(_t, _n) (_t)glXGetProcAddress((const GLubyte *)(_n))
    94 #else
    95 #error "Port me!!!"
    96 #endif
    97 #endif
     88PFNVBOXVHWA_IS_FRAMEBUFFER vboxglIsFramebuffer = NULL;
     89PFNVBOXVHWA_BIND_FRAMEBUFFER vboxglBindFramebuffer = NULL;
     90PFNVBOXVHWA_DELETE_FRAMEBUFFERS vboxglDeleteFramebuffers = NULL;
     91PFNVBOXVHWA_GEN_FRAMEBUFFERS vboxglGenFramebuffers = NULL;
     92PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS vboxglCheckFramebufferStatus = NULL;
     93PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D vboxglFramebufferTexture1D = NULL;
     94PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D vboxglFramebufferTexture2D = NULL;
     95PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D vboxglFramebufferTexture3D = NULL;
     96PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV vboxglGetFramebufferAttachmentParameteriv = NULL;
    9897
    9998#define VBOXVHWA_GETPROCADDRESS(_c, _t, _n) ((_t)(uintptr_t)(_c).getProcAddress(QString(_n)))
     
    103102        if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v)) == NULL) \
    104103        { \
    105             VBOXQGLLOG(("ERROR: '%s' function not found\n", "gl"#_v));\
     104            VBOXQGLLOGREL(("ERROR: '%s' function not found\n", "gl"#_v));\
    106105            AssertBreakpoint(); \
    107106            if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"ARB")) == NULL) \
    108107            { \
    109                 VBOXQGLLOG(("ERROR: '%s' function not found\n", "gl"#_v"ARB"));\
     108                VBOXQGLLOGREL(("ERROR: '%s' function not found\n", "gl"#_v"ARB"));\
    110109                AssertBreakpoint(); \
    111110                if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"EXT")) == NULL) \
    112111                { \
    113                     VBOXQGLLOG(("ERROR: '%s' function not found\n", "gl"#_v"EXT"));\
     112                    VBOXQGLLOGREL(("ERROR: '%s' function not found\n", "gl"#_v"EXT"));\
    114113                    AssertBreakpoint(); \
    115114                    (_rc)++; \
     
    123122        if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_f)) == NULL) \
    124123        { \
    125             VBOXQGLLOG(("ERROR: '%s' function is not found\n", "gl"#_f));\
     124            VBOXQGLLOGREL(("ERROR: '%s' function is not found\n", "gl"#_f));\
    126125            AssertBreakpoint(); \
    127126            (_rc)++; \
     
    129128    }while(0)
    130129
    131 //#define VBOXVHWA_PFNINIT_OBJECT_ARB(_t, _v, _rc) VBOXVHWA_PFNINIT(_t, _v, #_v"ObjectARB" ,_rc)
    132130#define VBOXVHWA_PFNINIT_OBJECT_ARB(_c, _t, _v, _rc) \
    133131        do { \
    134132            if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"ObjectARB")) == NULL) \
    135133            { \
    136                 VBOXQGLLOG(("ERROR: '%s' function is not found\n", "gl"#_v"ObjectARB"));\
     134                VBOXQGLLOGREL(("ERROR: '%s' function is not found\n", "gl"#_v"ObjectARB"));\
    137135                AssertBreakpoint(); \
    138136                (_rc)++; \
     
    140138        }while(0)
    141139
    142 //#define VBOXVHWA_PFNINIT_ARB(_t, _v, _rc) VBOXVHWA_PFNINIT(_t, _v, #_v"ARB" ,_rc)
    143140#define VBOXVHWA_PFNINIT_ARB(_c, _t, _v, _rc) \
    144141        do { \
    145142            if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"ARB")) == NULL) \
    146143            { \
    147                 VBOXQGLLOG(("ERROR: '%s' function is not found\n", "gl"#_v"ARB"));\
     144                VBOXQGLLOGREL(("ERROR: '%s' function is not found\n", "gl"#_v"ARB"));\
     145                AssertBreakpoint(); \
     146                (_rc)++; \
     147            } \
     148        }while(0)
     149
     150#define VBOXVHWA_PFNINIT_EXT(_c, _t, _v, _rc) \
     151        do { \
     152            if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"EXT")) == NULL) \
     153            { \
     154                VBOXQGLLOGREL(("ERROR: '%s' function is not found\n", "gl"#_v"EXT"));\
    148155                AssertBreakpoint(); \
    149156                (_rc)++; \
     
    311318            VBOXQGLLOGREL (("GL_ARB_texture_non_power_of_two: %d\n", m_GL_ARB_texture_non_power_of_two));
    312319
     320            pos = strstr((const char *)str, "GL_EXT_framebuffer_object");
     321            m_GL_EXT_framebuffer_object = pos != NULL;
     322            VBOXQGLLOGREL (("GL_EXT_framebuffer_object: %d\n", m_GL_EXT_framebuffer_object));
     323
     324
    313325            initExtSupport(*pContext);
    314326        }
     
    474486
    475487        mFragmentShaderSupported = true;
     488    } while(0);
     489
     490    do
     491    {
     492        rc = 0;
     493        mFBOSupported = false;
     494
     495        if(m_GL_EXT_framebuffer_object)
     496        {
     497            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_IS_FRAMEBUFFER, IsFramebuffer, rc);
     498            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_BIND_FRAMEBUFFER, BindFramebuffer, rc);
     499            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_DELETE_FRAMEBUFFERS, DeleteFramebuffers, rc);
     500            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_GEN_FRAMEBUFFERS, GenFramebuffers, rc);
     501            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS, CheckFramebufferStatus, rc);
     502            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D, FramebufferTexture1D, rc);
     503            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D, FramebufferTexture2D, rc);
     504            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D, FramebufferTexture3D, rc);
     505            VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV, GetFramebufferAttachmentParameteriv, rc);
     506        }
     507        else
     508        {
     509            break;
     510        }
     511
     512        if(RT_FAILURE(rc))
     513            break;
     514
     515        mFBOSupported = true;
    476516    } while(0);
    477517
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