VirtualBox

Changeset 41971 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jun 29, 2012 12:31:04 PM (13 years ago)
Author:
vboxsync
Message:

crOpenGL: report visual bits superset to avoid host context recreation misbehave

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

Legend:

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

    r40267 r41971  
    3939} };
    4040
     41/* Currently host part will misbehave re-creating context with proper visual bits
     42 * if contexts with alternative visual bits is requested.
     43 * For now we just report a superset of all visual bits to avoid that.
     44 * Better to it on the host side as well?
     45 * We could also implement properly multiple pixel formats,
     46 * which should be done by implementing offscreen rendering or multiple host contexts.
     47 * */
     48#define VBOX_CROGL_USE_VBITS_SUPERSET
     49
     50#ifdef VBOX_CROGL_USE_VBITS_SUPERSET
     51static GLuint desiredVisual = CR_RGB_BIT | CR_ALPHA_BIT | CR_DEPTH_BIT | CR_STENCIL_BIT | CR_ACCUM_BIT | CR_DOUBLE_BIT;
     52#else
    4153static GLuint desiredVisual = CR_RGB_BIT;
    42 
     54#endif
     55
     56#ifndef VBOX_CROGL_USE_VBITS_SUPERSET
    4357/**
    4458 * Compute a mask of CR_*_BIT flags which reflects the attributes of
     
    7286    return b;
    7387}
     88#endif
    7489
    7590void APIENTRY DrvReleaseContext(HGLRC hglrc)
     
    144159
    145160    sprintf(dpyName, "%d", hdc);
     161#ifndef VBOX_CROGL_USE_VBITS_SUPERSET
    146162    if (stub.haveNativeOpenGL)
    147163        desiredVisual |= ComputeVisBits( hdc );
     164#endif
    148165
    149166    context = stubNewContext(dpyName, desiredVisual, UNDECIDED, 0);
  • trunk/src/VBox/Additions/common/crOpenGL/wgl.c

    r40267 r41971  
    1717#include <stdio.h>
    1818
     19/* Currently host part will misbehave re-creating context with proper visual bits
     20 * if contexts with alternative visual bits is requested.
     21 * For now we just report a superset of all visual bits to avoid that.
     22 * Better to it on the host side as well?
     23 * We could also implement properly multiple pixel formats,
     24 * which should be done by implementing offscreen rendering or multiple host contexts.
     25 * */
     26#define VBOX_CROGL_USE_VBITS_SUPERSET
     27
     28#ifdef VBOX_CROGL_USE_VBITS_SUPERSET
     29static GLuint desiredVisual = CR_RGB_BIT | CR_ALPHA_BIT | CR_DEPTH_BIT | CR_STENCIL_BIT | CR_ACCUM_BIT | CR_DOUBLE_BIT;
     30#else
    1931static GLuint desiredVisual = CR_RGB_BIT;
    20 
    21 
     32#endif
     33
     34#ifndef VBOX_CROGL_USE_VBITS_SUPERSET
    2235/**
    2336 * Compute a mask of CR_*_BIT flags which reflects the attributes of
     
    5164    return b;
    5265}
     66#endif
    5367
    5468int WINAPI wglChoosePixelFormat_prox( HDC hdc, CONST PIXELFORMATDESCRIPTOR *pfd )
     
    121135    }
    122136
    123     /* @todo: although this is not needed by VSG Open Inventor interop,
    124      * still it does not make any sense actually since reporting this
    125      * as well as choosing a pixel format with this cap would not do anything
    126      * since ICD stuff has its own pixelformat state var */
    127 //    if ( pfd->cAccumBits > 0 )
    128 //        desiredVisual |= CR_ACCUM_BIT;
     137    if ( pfd->cAccumBits > 0 )
     138        desiredVisual |= CR_ACCUM_BIT;
    129139
    130140    if ( pfd->cDepthBits > 32 ) {
     
    297307
    298308    sprintf(dpyName, "%d", hdc);
     309#ifndef VBOX_CROGL_USE_VBITS_SUPERSET
    299310    if (stub.haveNativeOpenGL)
    300311        desiredVisual |= ComputeVisBits( hdc );
     312#endif
    301313
    302314    context = stubNewContext(dpyName, desiredVisual, UNDECIDED, 0);
     
    494506            case WGL_ACCUM_BLUE_BITS_EXT:
    495507                if (pi[1] > 0)
    496                 {
    497                     /* @todo: although this is not needed by VSG Open Inventor interop,
    498                      * still it does not make any sense actually since reporting this
    499                      * as well as choosing a pixel format with this cap would not do anything
    500                      * since ICD stuff has its own pixelformat state var */
    501                     crWarning("WGL_ACCUM_XXX not supporteed!");
    502                     return 0;
    503 //                    desiredVisual |= CR_ACCUM_BIT;
    504                 }
     508                    desiredVisual |= CR_ACCUM_BIT;
    505509                pi++;
    506510                break;
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