VirtualBox

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


Ignore:
Timestamp:
Jan 5, 2015 11:08:23 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97523
Message:

VMSVGA3d: Reworked the 3.2 core GL profile specific code, putting it inside VBOX_VMSVGA3D_USE_OPENGL_CORE checks instead of RT_OS_DARWIN and always try get a value before falling in back on alternatives.

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

Legend:

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

    r53737 r53741  
    8888#include <float.h>
    8989
     90#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
     91# define VBOX_D3D9CAPS_ONLY_DEFINES
     92# include "shaderlib/wine/include/d3d9caps.h" /* For some capability constants. */
     93#endif
     94
    9095
    9196/* Generated by VBoxDef2LazyLoad from the VBoxSVGA3D.def file. */
     
    205210#endif
    206211
    207 /** Macro wrapping glGetIntegerv for use during initialization.
    208  * This will release log errors.  */
     212
     213/**
     214 * Macro wrapping glGetIntegerv for use during initialization.
     215 * Uses AssertLogRelMsg.
     216 */
    209217#define VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(a_enmGlValue, a_pDest) \
    210218    do \
     
    212220        glGetIntegerv(a_enmGlValue, a_pDest); \
    213221        GLenum iGlError = glGetError(); \
    214         if (RT_UNLIKELY(iGlError != GL_NO_ERROR)) \
    215             LogRel(("VMSVGA3d: glGetIntegerv(" #a_enmGlValue " (%#x),) -> %#x\n", (int)a_enmGlValue, iGlError)); \
     222        AssertLogRelMsg(iGlError == GL_NO_ERROR, \
     223                        ("VMSVGA3d: glGetIntegerv(" #a_enmGlValue " (%#x),) -> %#x\n", (int)a_enmGlValue, iGlError)); \
    216224    } while (0)
    217225
    218 /** Macro for doing something and then checking for errors during initialization. */
     226/**
     227 * Macro for doing something and then checking for errors during initialization.
     228 * Uses AssertLogRelMsg.
     229 */
    219230#define VMSVGA3D_INIT_CHECKED(a_Expr) \
    220231    do \
     
    222233        a_Expr; \
    223234        GLenum iGlError = glGetError(); \
    224         if (RT_UNLIKELY(iGlError != GL_NO_ERROR)) \
    225             LogRel(("VMSVGA3d: " #a_Expr " -> %#x\n", iGlError)); \
     235        AssertLogRelMsg(iGlError == GL_NO_ERROR, ("VMSVGA3d: %s -> %#x\n", #a_Expr, iGlError)); \
    226236    } while (0)
    227237
     
    654664    bool fRet = false;
    655665
    656 #if defined(RT_OS_DARWIN)
     666#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    657667    /*
    658668     * OpenGL 3.2+ core profile (glGetString(GL_EXTENSIONS) returns NULL).
     
    782792
    783793    /* Temporarily.  Later start if (fMinGLVersion != 0.0 && fActualGLVersion >= fMinGLVersion) return true; */
     794#if defined(VBOX_VMSVGA3D_USE_OPENGL_CORE) || !defined(RT_OS_DARWIN)
    784795    AssertMsg(fMinGLVersion == 0.0 || fRet == (fActualGLVersion >= fMinGLVersion),
    785796              ("%s actual:%d min:%d\n", pszWantedExtension, (int)(fActualGLVersion * 10), (int)(fMinGLVersion * 10) ));
     797#endif
    786798    return fRet;
    787799}
     
    793805static void vmsvga3dLogRelExtensions(void)
    794806{
    795 #if defined(RT_OS_DARWIN)
     807#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    796808    /* OpenGL 3.0 interface (glGetString(GL_EXTENSIONS) return NULL). */
    797809    PFNGLGETSTRINGIPROC pfnGlGetStringi = (PFNGLGETSTRINGIPROC)OGLGETPROCADDRESS("glGetStringi");
     
    981993
    982994    /* Extension support */
    983 #ifdef RT_OS_DARWIN
     995#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    984996    /** @todo OpenGL version history suggest this, verify...  */
    985997    pState->ext.fEXT_stencil_two_side = vmsvga3dCheckGLExtension(pState->fGLVersion, 2.0, "GL_EXT_stencil_two_side");
     
    10021014
    10031015    /* Query capabilities */
     1016#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
     1017    glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights);
     1018    if (glGetError() != GL_NO_ERROR)
     1019        pState->caps.maxActiveLights = 1;
     1020#else
    10041021    VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_LIGHTS, &pState->caps.maxActiveLights);
     1022#endif
    10051023    VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_BUFFER_SIZE, &pState->caps.maxTextureBufferSize);
     1024#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
     1025    glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights);
     1026    if (glGetError() != GL_NO_ERROR)
     1027        VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_IMAGE_UNITS, &pState->caps.maxTextures);
     1028#else
    10061029    VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_UNITS_ARB, &pState->caps.maxTextures);
     1030#endif
    10071031    VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_CLIP_DISTANCES, &pState->caps.maxClipDistances);
    10081032    VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_COLOR_ATTACHMENTS, &pState->caps.maxColorAttachments);
    10091033    VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_RECTANGLE_TEXTURE_SIZE, &pState->caps.maxRectangleTextureSize);
    10101034    VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &pState->caps.maxTextureAnisotropy);
     1035#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
     1036    glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize);
     1037    if (glGetError() != GL_NO_ERROR)
     1038    {
     1039        pState->caps.flPointSize[0] = 1;
     1040        pState->caps.flPointSize[1] = 1;
     1041    }
     1042#else
    10111043    VMSVGA3D_INIT_CHECKED(glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize));
     1044#endif
    10121045
    10131046    if (pState->ext.glGetProgramivARB)
    10141047    {
     1048#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
     1049        pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB,
     1050                                      &pState->caps.maxFragmentShaderTemps);
     1051        if (glGetError() != GL_NO_ERROR)
     1052            pState->caps.maxFragmentShaderTemps = D3DVS20_MAX_NUMTEMPS;
     1053        pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB,
     1054                                      &pState->caps.maxFragmentShaderInstructions);
     1055        if (glGetError() != GL_NO_ERROR)
     1056            pState->caps.maxFragmentShaderInstructions = 0;
     1057
     1058        pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB,
     1059                                      &pState->caps.maxVertexShaderTemps);
     1060        if (glGetError() != GL_NO_ERROR)
     1061            pState->caps.maxVertexShaderTemps = D3DVS20_MAX_NUMTEMPS;
     1062        pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB,
     1063                                      &pState->caps.maxVertexShaderInstructions);
     1064        if (glGetError() != GL_NO_ERROR)
     1065            pState->caps.maxVertexShaderInstructions = 0;
     1066
     1067#else
    10151068        VMSVGA3D_INIT_CHECKED(pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB,
    10161069                                                            &pState->caps.maxFragmentShaderTemps));
     
    10211074        VMSVGA3D_INIT_CHECKED(pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB,
    10221075                                                            &pState->caps.maxVertexShaderInstructions));
     1076#endif
    10231077    }
    10241078    pState->caps.fS3TCSupported = vmsvga3dCheckGLExtension(pState->fGLVersion, 0.0, "GL_EXT_texture_compression_s3tc");
     
    11581212    AssertRC(rc);
    11591213
    1160 #ifndef RT_OS_DARWIN
     1214#if !defined(RT_OS_DARWIN) || defined(VBOX_VMSVGA3D_USE_OPENGL_CORE)
    11611215    /* on the Mac, OpenGL 3 came very late so we have a capable 2.1 implementation */
    11621216    if (pState->fGLVersion < 3.0)
  • trunk/src/VBox/Devices/Graphics/shaderlib/directx.c

    r53731 r53741  
    19081908#endif
    19091909
    1910 #if defined(RT_OS_DARWIN)
     1910#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    19111911/** Checks if @a pszExtension is one of the extensions we're looking for and
    19121912 *  updates @a pGlInfo->supported accordingly. */
     
    19301930    struct wined3d_driver_info *driver_info = &adapter->driver_info;
    19311931    struct wined3d_gl_info *gl_info = &adapter->gl_info;
    1932 #if !defined(RT_OS_DARWIN)
     1932#ifndef VBOX_VMSVGA3D_USE_OPENGL_CORE
    19331933    const char *GL_Extensions    = NULL;
    19341934    const char *WGL_Extensions   = NULL;
     
    19511951    ENTER_GL();
    19521952
    1953     gl_renderer_str = (const char *)glGetString(GL_RENDERER);
     1953    VBOX_CHECK_GL_CALL(gl_renderer_str = (const char *)glGetString(GL_RENDERER));
    19541954    TRACE_(d3d_caps)("GL_RENDERER: %s.\n", debugstr_a(gl_renderer_str));
    19551955    if (!gl_renderer_str)
     
    19601960    }
    19611961
    1962     gl_vendor_str = (const char *)glGetString(GL_VENDOR);
     1962    VBOX_CHECK_GL_CALL(gl_vendor_str = (const char *)glGetString(GL_VENDOR));
    19631963    TRACE_(d3d_caps)("GL_VENDOR: %s.\n", debugstr_a(gl_vendor_str));
    19641964    if (!gl_vendor_str)
     
    19701970
    19711971    /* Parse the GL_VERSION field into major and minor information */
    1972     gl_version_str = (const char *)glGetString(GL_VERSION);
     1972    VBOX_CHECK_GL_CALL(gl_version_str = (const char *)glGetString(GL_VERSION));
    19731973    TRACE_(d3d_caps)("GL_VERSION: %s.\n", debugstr_a(gl_version_str));
    19741974    if (!gl_version_str)
     
    20042004
    20052005    /* Retrieve opengl defaults */
    2006     glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_max);
     2006    VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_max));
    20072007    gl_info->limits.clipplanes = min(WINED3DMAXUSERCLIPPLANES, gl_max);
    20082008    TRACE_(d3d_caps)("ClipPlanes support - num Planes=%d\n", gl_max);
    20092009
     2010#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    20102011    glGetIntegerv(GL_MAX_LIGHTS, &gl_max);
     2012    if (glGetError() != GL_NO_ERROR)
     2013        gl_max = 0;
     2014#else
     2015    VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_LIGHTS, &gl_max));
     2016#endif
    20112017    gl_info->limits.lights = gl_max;
    20122018    TRACE_(d3d_caps)("Lights support - max lights=%d\n", gl_max);
    20132019
    2014     glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max);
     2020    VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max));
    20152021    gl_info->limits.texture_size = gl_max;
    20162022    TRACE_(d3d_caps)("Maximum texture size support - max texture size=%d\n", gl_max);
    20172023
     2024#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    20182025    glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, gl_floatv);
     2026    if (glGetError() != GL_NO_ERROR)
     2027    {
     2028        gl_floatv[0] = 1;
     2029        gl_floatv[1] = 1;
     2030    }
     2031#else
     2032    VBOX_CHECK_GL_CALL(glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, gl_floatv));
     2033#endif
    20192034    gl_info->limits.pointsize_min = gl_floatv[0];
    20202035    gl_info->limits.pointsize_max = gl_floatv[1];
     
    20222037
    20232038    /* Parse the gl supported features, in theory enabling parts of our code appropriately. */
    2024 #if !defined(RT_OS_DARWIN)
    2025     GL_Extensions = (const char *)glGetString(GL_EXTENSIONS);
     2039#ifndef VBOX_VMSVGA3D_USE_OPENGL_CORE
     2040    VBOX_CHECK_GL_CALL(GL_Extensions = (const char *)glGetString(GL_EXTENSIONS));
    20262041    if (!GL_Extensions)
    20272042    {
     
    20402055    gl_info->supported[VBOX_SHARED_CONTEXTS] = TRUE;
    20412056
    2042 #if defined(RT_OS_DARWIN)
     2057#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    20432058    {
    20442059        /* We work with OpenGL 3.2+ on darwin, so we need to handle extensions differently. */
    20452060        GLint idxExt;
    20462061        GLint cExtensions = 1024;
    2047         float fGLVersion = atof((const char *)glGetString(GL_VERSION));
     2062        float fGLVersion;
     2063        VBOX_CHECK_GL_CALL(fGLVersion = atof((const char *)glGetString(GL_VERSION)));
    20482064
    20492065# define GL_NUM_EXTENSIONS 0x821D /// FIXME
    20502066        extern const GLubyte * glGetStringi(GLenum name, GLuint index); /// FIXME
    20512067
    2052         glGetIntegerv(GL_NUM_EXTENSIONS, &cExtensions);
     2068        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_NUM_EXTENSIONS, &cExtensions));
    20532069        for (idxExt = 0; idxExt < cExtensions; idxExt++)
    2054             check_gl_extension(gl_info, (const char *)glGetStringi(GL_EXTENSIONS, idxExt));
     2070        {
     2071            const char *pszExt;
     2072            VBOX_CHECK_GL_CALL((const char *)glGetStringi(GL_EXTENSIONS, idxExt));
     2073            check_gl_extension(gl_info, pszExt);
     2074        }
    20552075
    20562076        if (fGLVersion >= 1.1)
     
    23292349    if (gl_info->supported[NV_REGISTER_COMBINERS])
    23302350    {
    2331         glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &gl_max);
     2351        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &gl_max));
    23322352        gl_info->limits.general_combiners = gl_max;
    23332353        TRACE_(d3d_caps)("Max general combiners: %d.\n", gl_max);
     
    23352355    if (gl_info->supported[ARB_DRAW_BUFFERS])
    23362356    {
    2337         glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &gl_max);
     2357        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &gl_max));
    23382358        gl_info->limits.buffers = gl_max;
    23392359        TRACE_(d3d_caps)("Max draw buffers: %u.\n", gl_max);
     
    23412361    if (gl_info->supported[ARB_MULTITEXTURE])
    23422362    {
     2363#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    23432364        glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_max);
     2365        if (glGetError() != GL_NO_ERROR)
     2366            VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &gl_max));
     2367#else
     2368        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_max));
     2369#endif
    23442370        gl_info->limits.textures = min(MAX_TEXTURES, gl_max);
    23452371        TRACE_(d3d_caps)("Max textures: %d.\n", gl_info->limits.textures);
     
    23482374        {
    23492375            GLint tmp;
    2350             glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &tmp);
     2376            VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &tmp));
    23512377            gl_info->limits.fragment_samplers = min(MAX_FRAGMENT_SAMPLERS, tmp);
    23522378        }
     
    23602386        {
    23612387            GLint tmp;
    2362             glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &tmp);
     2388            VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &tmp));
    23632389            gl_info->limits.vertex_samplers = tmp;
    2364             glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, &tmp);
     2390            VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, &tmp));
    23652391            gl_info->limits.combined_samplers = tmp;
    23662392
     
    24002426    if (gl_info->supported[ARB_VERTEX_BLEND])
    24012427    {
    2402         glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max);
     2428        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max));
    24032429        gl_info->limits.blends = gl_max;
    24042430        TRACE_(d3d_caps)("Max blends: %u.\n", gl_info->limits.blends);
     
    24062432    if (gl_info->supported[EXT_TEXTURE3D])
    24072433    {
    2408         glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE_EXT, &gl_max);
     2434        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE_EXT, &gl_max));
    24092435        gl_info->limits.texture3d_size = gl_max;
    24102436        TRACE_(d3d_caps)("Max texture3D size: %d.\n", gl_info->limits.texture3d_size);
     
    24122438    if (gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC])
    24132439    {
    2414         glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max);
     2440        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max));
    24152441        gl_info->limits.anisotropy = gl_max;
    24162442        TRACE_(d3d_caps)("Max anisotropy: %d.\n", gl_info->limits.anisotropy);
     
    24182444    if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
    24192445    {
    2420         GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max));
     2446        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max)));
    24212447        gl_info->limits.arb_ps_float_constants = gl_max;
    24222448        TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM float constants: %d.\n", gl_info->limits.arb_ps_float_constants);
    2423         GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, &gl_max));
     2449        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, &gl_max)));
    24242450        gl_info->limits.arb_ps_native_constants = gl_max;
    24252451        TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM native float constants: %d.\n",
    24262452                gl_info->limits.arb_ps_native_constants);
    2427         GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &gl_max));
     2453        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &gl_max)));
    24282454        gl_info->limits.arb_ps_temps = gl_max;
    24292455        TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM native temporaries: %d.\n", gl_info->limits.arb_ps_temps);
    2430         GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &gl_max));
     2456        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &gl_max)));
    24312457        gl_info->limits.arb_ps_instructions = gl_max;
    24322458        TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM native instructions: %d.\n", gl_info->limits.arb_ps_instructions);
    2433         GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, &gl_max));
     2459        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, &gl_max)));
    24342460        gl_info->limits.arb_ps_local_constants = gl_max;
    24352461        TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM local parameters: %d.\n", gl_info->limits.arb_ps_instructions);
     
    24372463    if (gl_info->supported[ARB_VERTEX_PROGRAM])
    24382464    {
    2439         GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max));
     2465        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max)));
    24402466        gl_info->limits.arb_vs_float_constants = gl_max;
    24412467        TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM float constants: %d.\n", gl_info->limits.arb_vs_float_constants);
    2442         GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, &gl_max));
     2468        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, &gl_max)));
    24432469        gl_info->limits.arb_vs_native_constants = gl_max;
    24442470        TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM native float constants: %d.\n",
    24452471                gl_info->limits.arb_vs_native_constants);
    2446         GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &gl_max));
     2472        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &gl_max)));
    24472473        gl_info->limits.arb_vs_temps = gl_max;
    24482474        TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM native temporaries: %d.\n", gl_info->limits.arb_vs_temps);
    2449         GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &gl_max));
     2475        VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &gl_max)));
    24502476        gl_info->limits.arb_vs_instructions = gl_max;
    24512477        TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM native instructions: %d.\n", gl_info->limits.arb_vs_instructions);
     
    24562482    if (gl_info->supported[ARB_VERTEX_SHADER])
    24572483    {
    2458         glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &gl_max);
     2484        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &gl_max));
    24592485        gl_info->limits.glsl_vs_float_constants = gl_max / 4;
    24602486#ifdef VBOX_WITH_WDDM
     
    24832509    if (gl_info->supported[ARB_FRAGMENT_SHADER])
    24842510    {
    2485         glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max);
     2511        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max));
    24862512        gl_info->limits.glsl_ps_float_constants = gl_max / 4;
    24872513#ifdef VBOX_WITH_WDDM
     
    25072533#endif
    25082534        TRACE_(d3d_caps)("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants);
     2535#ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE
    25092536        glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max);
     2537        if (glGetError() != GL_NO_ERROR)
     2538            gl_max = 60;
     2539#else
     2540        VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max));
     2541#endif
    25102542        gl_info->limits.glsl_varyings = gl_max;
    25112543        TRACE_(d3d_caps)("Max GLSL varyings: %u (%u 4 component varyings).\n", gl_max, gl_max / 4);
     
    25242556    if (gl_info->supported[NV_LIGHT_MAX_EXPONENT])
    25252557    {
    2526         glGetFloatv(GL_MAX_SHININESS_NV, &gl_info->limits.shininess);
     2558        VBOX_CHECK_GL_CALL(glGetFloatv(GL_MAX_SHININESS_NV, &gl_info->limits.shininess));
    25272559    }
    25282560    else
  • trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9caps.h

    r53206 r53741  
    292292#define D3DMAX30SHADERINSTRUCTIONS          32768
    293293
     294#ifndef VBOX_D3D9CAPS_ONLY_DEFINES
    294295
    295296typedef struct _D3DVSHADERCAPS2_0 {
     
    402403} D3DCAPS9;
    403404
     405#endif /* !VBOX_D3D9CAPS_ONLY_DEFINES */
     406
    404407#endif
  • trunk/src/VBox/Devices/Graphics/shaderlib/wined3d_private.h

    r53735 r53741  
    34383438#endif
    34393439
    3440 #endif
     3440/** @def VBOX_CHECK_GL_CALL
     3441 * Performs OpenGL call @a a_Expr and check glGetError.
     3442 * Errors will be asserted in strict builds and hit the release log in
     3443 * non-strict builds.
     3444 * @param   a_Expr  The OpenGL call expression.  Always executed!
     3445 */
     3446#ifdef VBOX_WITH_VMSVGA
     3447# define VBOX_CHECK_GL_CALL(a_Expr) \
     3448        do { \
     3449            GLint rcCheckCall; \
     3450            a_Expr; \
     3451            rcCheckCall = glGetError(); \
     3452            AssertLogRelMsg(rcCheckCall == GL_NO_ERROR, ("%s -> %#x\n", #a_Expr, rcCheckCall)); \
     3453        } while (0)
     3454#else
     3455# define VBOX_CHECK_GL_CALL(a_Expr) do { a_Expr; } while (0)
     3456#endif
     3457
     3458#endif
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