VirtualBox

Changeset 76246 in vbox for trunk


Ignore:
Timestamp:
Dec 15, 2018 6:33:25 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
127516
Message:

DevVGA-SVGA3d: dynamic loading of opengl (not enabled)

Location:
trunk/src/VBox/Devices
Files:
4 edited

Legend:

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

    r76234 r76246  
    40494049                    VMSVGAFIFO_GET_MORE_CMD_BUFFER_BREAK(pHdr, SVGA3dCmdHeader, cbCmd);
    40504050
     4051                    if (RT_LIKELY(pThis->svga.f3DEnabled))
     4052                    { /* likely */ }
     4053                    else
     4054                    {
     4055                        LogRelMax(8, ("VMSVGA3d: 3D disabled, command %d skipped\n", enmCmdId));
     4056                        break;
     4057                    }
     4058
    40514059/**
    40524060 * Check that the 3D command has at least a_cbMin of payload bytes after the
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h

    r76181 r76246  
    3838*********************************************************************************************************************************/
    3939#include "DevVGA-SVGA3d.h"
     40
     41#if defined(VMSVGA3D_DYNAMIC_LOAD) && defined(VMSVGA3D_OPENGL)
     42#include "DevVGA-SVGA3d-glLdr.h"
     43#endif
    4044
    4145#ifdef RT_OS_WINDOWS
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r76237 r76246  
    6464#endif
    6565
     66#ifdef VMSVGA3D_DYNAMIC_LOAD
     67# define OGLGETPROCADDRESS glLdrGetProcAddress
     68#else
    6669#ifdef RT_OS_WINDOWS
    6770# define OGLGETPROCADDRESS      MyWinGetProcAddress
     
    8992#else
    9093# define OGLGETPROCADDRESS(x)   glXGetProcAddress((const GLubyte *)x)
     94#endif
    9195#endif
    9296
     
    582586int vmsvga3dInit(PVGASTATE pThis)
    583587{
     588    int rc;
     589
    584590    AssertCompile(GL_TRUE == 1);
    585591    AssertCompile(GL_FALSE == 0);
     592
     593#ifdef VMSVGA3D_DYNAMIC_LOAD
     594    rc = glLdrInit();
     595    if (RT_FAILURE(rc))
     596    {
     597        LogRel(("VMSVGA3d: Error loading OpenGL library and resolving necessary functions: %Rrc\n", rc));
     598        return rc;
     599    }
     600#endif
    586601
    587602    /*
     
    589604     */
    590605    RTERRINFOSTATIC ErrInfo;
    591     int rc = ExplicitlyLoadVBoxSVGA3D(true /*fResolveAllImports*/, RTErrInfoInitStatic(&ErrInfo));
     606    rc = ExplicitlyLoadVBoxSVGA3D(true /*fResolveAllImports*/, RTErrInfoInitStatic(&ErrInfo));
    592607    if (RT_FAILURE(rc))
    593608    {
     
    794809    pContext = pState->papContexts[1];
    795810    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     811
     812#ifdef VMSVGA3D_DYNAMIC_LOAD
     813    /* Context is set and it is possible now to resolve extension functions. */
     814    rc = glLdrGetExtFunctions();
     815    if (RT_FAILURE(rc))
     816    {
     817        LogRel(("VMSVGA3d: Error resolving extension functions: %Rrc\n", rc));
     818        return rc;
     819    }
     820#endif
    796821
    797822    LogRel(("VMSVGA3d: OpenGL version: %s\n"
  • trunk/src/VBox/Devices/Makefile.kmk

    r75587 r76246  
    278278 endif
    279279 ifdef VBOX_WITH_VMSVGA3D
     280  #VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1
    280281  VBoxDD_DEFS           += VBOX_WITH_VMSVGA3D
    281282  VBoxDD_SOURCES        += \
     
    306307        $(VBOX_DEF_2_LAZY_LOAD) --explicit-load-function --library VBoxSVGA3DObjC --output "$@" $(filter %.def, $^)
    307308
    308    VBoxDD_LIBS.linux    += GL X11
     309   VBoxDD_LIBS.linux    += X11
     310   ifdef VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD
     311   VBoxDD_DEFS          += VMSVGA3D_DYNAMIC_LOAD
     312   VBoxDD_SOURCES       += \
     313        Graphics/DevVGA-SVGA3d-glLdr.cpp
     314   else
     315   VBoxDD_LIBS.linux    += GL
    309316   VBoxDD_LIBS.win      += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib
     317   endif
    310318   VBoxDD_LDFLAGS.darwin += -framework OpenGL
    311319   VBoxDD_DEFS.darwin    += VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette