VirtualBox

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


Ignore:
Timestamp:
Apr 22, 2009 9:13:20 AM (16 years ago)
Author:
vboxsync
Message:

crOpenGL: fix multicontext crashes (public bug #3762)

Location:
trunk/src/VBox/Additions/common/crOpenGL
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/Makefile.kmk

    r18885 r19099  
    398398        feedback/feedbackspu_config.c \
    399399        feedback/feedbackspu_init.c \
     400        feedback/feedback_context.c \
    400401        $(VBOX_PATH_CROGL_GENFILES)/feedbackspu.c \
    401402        $(VBOX_PATH_CROGL_GENFILES)/feedbackspu_state.c
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_state.py

    r17269 r19099  
    1616#include "feedbackspu_proto.h"
    1717"""
     18custom = ["CreateContext", "MakeCurrent", "DestroyContext"]
    1819
    1920keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
    2021
    2122for func_name in keys:
    22         if apiutil.FindSpecial( "feedback_state", func_name ):
    23                 return_type = apiutil.ReturnType(func_name)
    24                 params = apiutil.Parameters(func_name)
    25                 print '%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))
    26                 print '{'
    27                 print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))
    28                 print ''
    29                 print '\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))
    30                 print '}'
     23    if apiutil.FindSpecial( "feedback_state", func_name ):
     24        if func_name in custom:
     25            continue
     26        return_type = apiutil.ReturnType(func_name)
     27        params = apiutil.Parameters(func_name)
     28        print '%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))
     29        print '{'
     30        print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))
     31        print ''
     32        print '\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))
     33        print '}'
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_state_special

    r17269 r19099  
    5959RasterPos4s
    6060RasterPos4sv
     61CreateContext
     62MakeCurrent
     63DestroyContext
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu.h

    r17269 r19099  
    1818#include "cr_glstate.h"
    1919
     20typedef struct context_info_t ContextInfo;
     21
     22struct context_info_t {
     23    CRContext *clientState;  /* used to store client-side GL state */
     24    GLint clientCtx;         /* client context ID */
     25};
     26
    2027typedef struct {
    2128        int id;
     
    2835
    2936        CRCurrentStatePointers current;
     37
     38    CRContext *defaultctx;
     39    int numContexts;
     40    ContextInfo context[CR_MAX_CONTEXTS];
     41
     42#ifdef CHROMIUM_THREADSAFE
     43    CRmutex mutex;
     44#endif
    3045} feedbackSPU;
    3146
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_init.c

    r17269 r19099  
    3333        (void) num_contexts;
    3434
     35#ifdef CHROMIUM_THREADSAFE
     36    crInitMutex(&feedback_spu.mutex);
     37#endif
     38
    3539        feedback_spu.id = id;
    3640        feedback_spu.has_child = 0;
     
    4751        /* create/init default state tracker */
    4852        crStateInit();
    49         ctx = crStateGetCurrent();
    50         CRASSERT(ctx);
    51         crStateSetCurrentPointers(ctx, &feedback_spu.current);
     53
     54    feedback_spu.defaultctx = crStateCreateContext(NULL, 0, NULL);
     55    crStateSetCurrent(feedback_spu.defaultctx);
     56
     57    feedback_spu.numContexts = 0;
     58    crMemZero(feedback_spu.context, CR_MAX_CONTEXTS * sizeof(ContextInfo));
    5259
    5360        return &feedback_functions;
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