VirtualBox

Changeset 35263 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Dec 20, 2010 6:12:36 PM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: fix crashes in libnux-0.9 gpu tests

Location:
trunk/src/VBox/Additions/common/crOpenGL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/fakedri_drv.c

    r35039 r35263  
    105105extern const __DRIextension * __driDriverExtensions[];
    106106
    107 #define GLAPI_ENTRY(Func) SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("gl"#Func), cr_gl##Func);
     107#define VBOX_SET_MESA_FUNC(table, name, func) \
     108    if (_glapi_get_proc_offset(name)>=0) SET_by_offset(table, _glapi_get_proc_offset(name), func); \
     109    else crWarning("%s not found in mesa table", name)
     110
     111#define GLAPI_ENTRY(Func) VBOX_SET_MESA_FUNC(vbox_glapi_table, "gl"#Func, cr_gl##Func);
     112
     113static void
     114vboxPatchMesaExport(const char* psFuncName, const void *pStart, const void *pEnd);
    108115
    109116static void
     
    122129    #include "fakedri_glfuncsList.h"
    123130
    124     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glBlendEquationSeparateEXT"), cr_glBlendEquationSeparate);
    125     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glSampleMaskSGIS"), cr_glSampleMaskEXT);
    126     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glSamplePatternSGIS"), cr_glSamplePatternEXT);
    127     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos2dMESA"), cr_glWindowPos2d);
    128     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos2dvMESA"), cr_glWindowPos2dv);
    129     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos2fMESA"), cr_glWindowPos2f);
    130     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos2fvMESA"), cr_glWindowPos2fv);
    131     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos2iMESA"), cr_glWindowPos2i);
    132     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos2ivMESA"), cr_glWindowPos2iv);
    133     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos2sMESA"), cr_glWindowPos2s);
    134     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos2svMESA"), cr_glWindowPos2sv);
    135     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos3dMESA"), cr_glWindowPos3d);
    136     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos3dvMESA"), cr_glWindowPos3dv);
    137     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos3fMESA"), cr_glWindowPos3f);
    138     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos3fvMESA"), cr_glWindowPos3fv);
    139     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos3iMESA"), cr_glWindowPos3i);
    140     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos3ivMESA"), cr_glWindowPos3iv);
    141     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos3sMESA"), cr_glWindowPos3s);
    142     SET_by_offset(vbox_glapi_table, _glapi_get_proc_offset("glWindowPos3svMESA"), cr_glWindowPos3sv);
     131    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glBlendEquationSeparateEXT", cr_glBlendEquationSeparate);
     132    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glSampleMaskSGIS", cr_glSampleMaskEXT);
     133    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glSamplePatternSGIS", cr_glSamplePatternEXT);
     134    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2dMESA", cr_glWindowPos2d);
     135    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2dvMESA", cr_glWindowPos2dv);
     136    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2fMESA", cr_glWindowPos2f);
     137    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2fvMESA", cr_glWindowPos2fv);
     138    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2iMESA", cr_glWindowPos2i);
     139    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2ivMESA", cr_glWindowPos2iv);
     140    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2sMESA", cr_glWindowPos2s);
     141    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2svMESA", cr_glWindowPos2sv);
     142    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3dMESA", cr_glWindowPos3d);
     143    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3dvMESA", cr_glWindowPos3dv);
     144    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3fMESA", cr_glWindowPos3f);
     145    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3fvMESA", cr_glWindowPos3fv);
     146    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3iMESA", cr_glWindowPos3i);
     147    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3ivMESA", cr_glWindowPos3iv);
     148    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3sMESA", cr_glWindowPos3s);
     149    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3svMESA", cr_glWindowPos3sv);
    143150
    144151    _glapi_set_dispatch(vbox_glapi_table);
     
    230237        if (!rv || !sym1)
    231238        {
    232             crError("Failed to get size for %p", pStart);
     239            crError("Failed to get size for vbox %p", pStart);
    233240            return;
    234241        }
  • trunk/src/VBox/Additions/common/crOpenGL/glx.c

    r35007 r35263  
    400400
    401401            case GLX_DEPTH_SIZE:
    402                 if (attrib[1] > 16)
     402                if (attrib[1] > 24)
    403403                    goto err_exit;
    404404                attrib++;
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_pixel.c

    r27410 r35263  
    2424        && format!=GL_LUMINANCE
    2525        && format!=GL_LUMINANCE_ALPHA
    26         && format!=GL_DEPTH_COMPONENT)
     26        && format!=GL_DEPTH_COMPONENT
     27        && format!=GL_DEPTH_STENCIL)
    2728    {
    2829        /*crWarning("crPackCheckTexImageFormat FAILED format 0x%x isn't valid", format);*/
     
    5455        && type!=GL_UNSIGNED_INT_8_8_8_8_REV
    5556        && type!=GL_UNSIGNED_INT_10_10_10_2
    56         && type!=GL_UNSIGNED_INT_2_10_10_10_REV)
     57        && type!=GL_UNSIGNED_INT_2_10_10_10_REV
     58        && type!=GL_UNSIGNED_INT_24_8)
    5759    {
    5860        /*crWarning("crPackCheckTexImageType FAILED type 0x%x isn't valid", type);*/
     
    8486        && internalformat!=GL_DEPTH_COMPONENT24
    8587        && internalformat!=GL_DEPTH_COMPONENT32
     88        && internalformat!=GL_DEPTH24_STENCIL8
    8689        && internalformat!=GL_LUMINANCE
    8790        && internalformat!=GL_LUMINANCE4
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