VirtualBox

Changeset 50041 in vbox


Ignore:
Timestamp:
Jan 9, 2014 4:13:28 PM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: crOpenGL: 1. workaround point sprite driver bugs; 2. workaround multi-string shader source driver bug; 3. proper GLhandle for OSX; 4. extended dumping; 5. misc fixes

Location:
trunk
Files:
3 added
1 deleted
99 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/doc/manual/en_US/user_Glossary.xml

  • trunk/doc/manual/en_US/user_Introduction.xml

  • trunk/doc/manual/en_US/user_Troubleshooting.xml

  • trunk/include/VBox/vmm/cpumctx-v1_6.h

  • trunk/src/VBox

  • trunk/src/VBox/Additions/WINNT/VBoxMMR

  • trunk/src/VBox/Additions/common/VBoxService

  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_get.py

    r44994 r50041  
    4949
    5050from get_sizes import *
    51 from get_components import *
    5251
    5352easy_swaps = {
     
    206205            print '\tif (pack_spu.swap)'
    207206            print '\t{'
    208             print '\t\tfor (i = 0 ; i < lookupComponents(pname) ; i++)'
     207            print '\t\tfor (i = 0 ; i < crStateHlpComponentsCount(pname) ; i++)'
    209208            print '\t\t{'
    210209            if hard_funcs[func_name] == 'SWAPDOUBLE':
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getshaders.c

    r44529 r50041  
    9999}
    100100
    101 void PACKSPU_APIENTRY packspu_GetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj)
     101void PACKSPU_APIENTRY packspu_GetAttachedObjectsARB(VBoxGLhandleARB containerObj, GLsizei maxCount, GLsizei * count, VBoxGLhandleARB * obj)
    102102{
    103103    GET_THREAD(thread);
     
    107107    if (!obj) return;
    108108
    109     pLocal = (GLsizei*) crAlloc(maxCount*sizeof(GLhandleARB)+sizeof(GLsizei));
     109    pLocal = (GLsizei*) crAlloc(maxCount*sizeof(VBoxGLhandleARB)+sizeof(GLsizei));
    110110    if (!pLocal) return;
    111111
     
    116116
    117117    if (count) *count=*pLocal;
    118     crMemcpy(obj, &pLocal[1], *pLocal*sizeof(GLhandleARB));
     118    crMemcpy(obj, &pLocal[1], *pLocal*sizeof(VBoxGLhandleARB));
    119119    crFree(pLocal);
    120120}
     
    122122AssertCompile(sizeof(GLsizei) == 4);
    123123
    124 void PACKSPU_APIENTRY packspu_GetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
     124void PACKSPU_APIENTRY packspu_GetInfoLogARB(VBoxGLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
    125125{
    126126    GET_THREAD(thread);
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_glsl.c

    r49264 r50041  
    130130}
    131131
    132 void PACK_APIENTRY packspu_DeleteObjectARB(GLhandleARB obj)
     132void PACK_APIENTRY packspu_DeleteObjectARB(VBoxGLhandleARB obj)
    133133{
    134134    GLuint hwid = crStateGetProgramHWID(obj);
  • trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/ReadMe.txt

  • trunk/src/VBox/Devices/PC/DevApic.h

  • trunk/src/VBox/Frontends

  • trunk/src/VBox/Frontends/VBoxHeadless

  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.h

  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h

  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIProcess.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIProcess.h

  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.h

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.h

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.h

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsView.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsView.h

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.h

  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h

  • trunk/src/VBox/GuestHost/OpenGL/LICENSE

  • trunk/src/VBox/GuestHost/OpenGL/Makefile.kmk

    r49643 r50041  
    177177
    178178ifdef VBOX_WITH_CRDUMPER
    179 $(VBOX_PATH_CROGL_GENFILES)/dump_gen.cpp: $(PATH_SUB_CURRENT)/state_tracker/dump_gen.py $(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib/get_sizes.py  $(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib/get_components.py $(addprefix $(PATH_SUB_CURRENT)/state_tracker/, state_isenabled.txt state_extensions_isenabled.txt) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
     179$(VBOX_PATH_CROGL_GENFILES)/dump_gen.cpp: $(PATH_SUB_CURRENT)/state_tracker/dump_gen.py $(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib/get_sizes.py $(addprefix $(PATH_SUB_CURRENT)/state_tracker/, state_isenabled.txt state_extensions_isenabled.txt) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
    180180        $(call MSG_GENERATE,python,$@,$<)
    181181        $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
     
    464464        $(VBOX_PATH_CROGL_GENFILES)/state_line_gen.c \
    465465        $(VBOX_PATH_CROGL_GENFILES)/state_multisample_gen.c \
    466         $(VBOX_PATH_CROGL_GENFILES)/state_point_gen.c \
    467466        $(VBOX_PATH_CROGL_GENFILES)/state_polygon_gen.c \
    468467        $(VBOX_PATH_CROGL_GENFILES)/state_regcombiner_gen.c \
     
    483482        $(VBOX_PATH_CROGL_GENFILES)/state_line_gen.c \
    484483        $(VBOX_PATH_CROGL_GENFILES)/state_multisample_gen.c \
    485         $(VBOX_PATH_CROGL_GENFILES)/state_point_gen.c \
    486484        $(VBOX_PATH_CROGL_GENFILES)/state_polygon_gen.c \
    487485        $(VBOX_PATH_CROGL_GENFILES)/state_regcombiner_gen.c \
     
    571569        $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $(<D)/gendiffcode.py multisample Multisample $(<D)
    572570
    573 $(VBOX_PATH_CROGL_GENFILES)/state_point_gen.c: $(addprefix $(PATH_SUB_CURRENT)/state_tracker/, state_point.txt gendiffcode.py) | $$(dir $$@)
    574         $(call MSG_GENERATE,python,$@,$<)
    575         $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $(<D)/gendiffcode.py point Point $(<D)
    576 
    577571$(VBOX_PATH_CROGL_GENFILES)/state_polygon_gen.c: $(addprefix $(PATH_SUB_CURRENT)/state_tracker/, state_polygon.txt gendiffcode.py) | $$(dir $$@)
    578572        $(call MSG_GENERATE,python,$@,$<)
     
    587581        $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $(<D)/gendiffcode.py viewport Viewport $(<D)
    588582
    589 $(VBOX_PATH_CROGL_GENFILES)/state_get.c: $(addprefix $(PATH_SUB_CURRENT)/state_tracker/, state_get.py state_get.txt state_extensions_get.txt) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
     583$(VBOX_PATH_CROGL_GENFILES)/state_get.c: $(addprefix $(PATH_SUB_CURRENT)/state_tracker/, state_get.py state_get.txt state_extensions_get.txt get_components.py) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
    590584        $(call MSG_GENERATE,python,$@,$<)
    591585        $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $(<D)/state_get.py $(VBOX_PATH_CROGL_GLAPI) $(<D)
  • trunk/src/VBox/GuestHost/OpenGL/glapi_parser/APIspec.txt

    r48999 r50041  
    97559755
    97569756name        GetHandleARB
    9757 return      GLhandleARB
     9757return      VBoxGLhandleARB
    97589758param       pname           GLenum
    97599759paramprop   pname           GL_PROGRAM_OBJECT_ARB
     
    97649764name        DeleteObjectARB
    97659765return      void
    9766 param       obj             GLhandleARB
     9766param       obj             VBoxGLhandleARB
    97679767category    GL_ARB_shader_objects
    97689768props       nolist
     
    97729772alias       DetachShader
    97739773return      void
    9774 param       containerObj    GLhandleARB
    9775 param       attachedObj     GLhandleARB
     9774param       containerObj    VBoxGLhandleARB
     9775param       attachedObj     VBoxGLhandleARB
    97769776category    GL_ARB_shader_objects
    97779777chromium    extpack
     
    97799779name        CreateShaderObjectARB
    97809780alias       CreateShader
    9781 return      GLhandleARB
     9781return      VBoxGLhandleARB
    97829782param       shaderType      GLenum
    97839783paramprop   shaderType      GL_FRAGMENT_SHADER_ARB GL_VERTEX_SHADER_ARB
     
    97899789alias       ShaderSource
    97909790return      void
    9791 param       shaderObj   GLhandleARB
     9791param       shaderObj   VBoxGLhandleARB
    97929792param       count       GLsizei
    97939793param       string      const GLcharARB **
     
    97999799alias       CompileShader
    98009800return      void
    9801 param       shaderObj   GLhandleARB
     9801param       shaderObj   VBoxGLhandleARB
    98029802category    GL_ARB_shader_objects
    98039803chromium    nopack
     
    98059805name        CreateProgramObjectARB
    98069806alias       CreateProgram
    9807 return      GLhandleARB
     9807return      VBoxGLhandleARB
    98089808category    GL_ARB_shader_objects
    98099809props       get
     
    98139813alias       AttachShader
    98149814return      void
    9815 param       containerObj    GLhandleARB
    9816 param       obj             GLhandleARB
     9815param       containerObj    VBoxGLhandleARB
     9816param       obj             VBoxGLhandleARB
    98179817category    GL_ARB_shader_objects
    98189818chromium    extpack
     
    98219821alias       LinkProgram
    98229822return      void
    9823 param       programObj      GLhandleARB
     9823param       programObj      VBoxGLhandleARB
    98249824category    GL_ARB_shader_objects
    98259825chromium    nopack
     
    98289828alias       UseProgram
    98299829return      void
    9830 param       programObj      GLhandleARB
     9830param       programObj      VBoxGLhandleARB
    98319831category    GL_ARB_shader_objects
    98329832chromium    nopack
     
    98359835alias       ValidateProgram
    98369836return      void
    9837 param       programObj      GLhandleARB
     9837param       programObj      VBoxGLhandleARB
    98389838category    GL_ARB_shader_objects
    98399839chromium    nopack
     
    1001910019name        GetObjectParameterfvARB
    1002010020return      void
    10021 param       obj         GLhandleARB
     10021param       obj         VBoxGLhandleARB
    1002210022param       pname       GLenum
    1002310023paramprop   pname       GL_OBJECT_TYPE_ARB GL_OBJECT_SUBTYPE_ARB GL_OBJECT_DELETE_STATUS_ARB GL_OBJECT_COMPILE_STATUS_ARB GL_OBJECT_LINK_STATUS_ARB GL_OBJECT_VALIDATE_STATUS_ARB GL_OBJECT_INFO_LOG_LENGTH_ARB GL_OBJECT_ATTACHED_OBJECTS_ARB GL_OBJECT_ACTIVE_UNIFORMS_ARB GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB GL_OBJECT_SHADER_SOURCE_LENGTH_ARB
     
    1002910029name        GetObjectParameterivARB
    1003010030return      void
    10031 param       obj         GLhandleARB
     10031param       obj         VBoxGLhandleARB
    1003210032param       pname       GLenum
    1003310033paramprop   pname       GL_OBJECT_TYPE_ARB GL_OBJECT_SUBTYPE_ARB GL_OBJECT_DELETE_STATUS_ARB GL_OBJECT_COMPILE_STATUS_ARB GL_OBJECT_LINK_STATUS_ARB GL_OBJECT_VALIDATE_STATUS_ARB GL_OBJECT_INFO_LOG_LENGTH_ARB GL_OBJECT_ATTACHED_OBJECTS_ARB GL_OBJECT_ACTIVE_UNIFORMS_ARB GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB GL_OBJECT_SHADER_SOURCE_LENGTH_ARB
     
    1003910039name        GetInfoLogARB
    1004010040return      void
    10041 param       obj         GLhandleARB
     10041param       obj         VBoxGLhandleARB
    1004210042param       maxLength   GLsizei
    1004310043param       length      GLsizei *
     
    1004910049name        GetAttachedObjectsARB
    1005010050return      void
    10051 param       containerObj    GLhandleARB
     10051param       containerObj    VBoxGLhandleARB
    1005210052param       maxCount        GLsizei
    1005310053param       count           GLsizei *
    10054 param       obj             GLhandleARB *
     10054param       obj             VBoxGLhandleARB *
    1005510055category    GL_ARB_shader_objects
    1005610056props       get
     
    1006010060alias       GetUniformLocation
    1006110061return      GLint
    10062 param       programObj  GLhandleARB
     10062param       programObj  VBoxGLhandleARB
    1006310063param       name        const GLcharARB *
    1006410064category    GL_ARB_shader_objects
     
    1006910069alias       GetActiveUniform
    1007010070return      void
    10071 param       programObj  GLhandleARB
     10071param       programObj  VBoxGLhandleARB
    1007210072param       index       GLuint
    1007310073param       maxLength   GLsizei
     
    1008310083alias       GetShaderSource
    1008410084return      void
    10085 param       obj         GLhandleARB
     10085param       obj         VBoxGLhandleARB
    1008610086param       maxLength   GLsizei
    1008710087param       length      GLsizei *
     
    1009410094alias       GetUniformfv
    1009510095return      void
    10096 param       programObj  GLhandleARB
     10096param       programObj  VBoxGLhandleARB
    1009710097param       location    GLint
    1009810098param       params      GLfloat *
     
    1010410104alias       GetUniformiv
    1010510105return      void
    10106 param       programObj  GLhandleARB
     10106param       programObj  VBoxGLhandleARB
    1010710107param       location    GLint
    1010810108param       params      GLint *
     
    1011610116alias       GetActiveAttrib
    1011710117return      void
    10118 param       programObj  GLhandleARB
     10118param       programObj  VBoxGLhandleARB
    1011910119param       index       GLuint
    1012010120param       maxLength   GLsizei
     
    1013010130alias       GetAttribLocation
    1013110131return      GLint
    10132 param       programObj  GLhandleARB
     10132param       programObj  VBoxGLhandleARB
    1013310133param       name        const GLcharARB *
    1013410134category    GL_ARB_vertex_shader
     
    1013910139alias       BindAttribLocation
    1014010140return      void
    10141 param       programObj  GLhandleARB
     10141param       programObj  VBoxGLhandleARB
    1014210142param       index       GLuint
    1014310143param       name        const GLcharARB *
  • trunk/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py

    r43652 r50041  
    647647        'GLintptrARB': 4,   # XXX or 8 bytes?
    648648        'GLsizeiptrARB': 4, # XXX or 8 bytes?
    649         'GLhandleARB': 4,
     649        'VBoxGLhandleARB': 4,
    650650        'GLcharARB': 1,
    651651        'uintptr_t': 4
  • trunk/src/VBox/GuestHost/OpenGL/include/chromium.h

    r48079 r50041  
    2222
    2323#ifdef IN_RING0
    24 #include <common/VBoxMPUtils.h>
    25 #define WINGDIAPI
     24# include <common/VBoxMPUtils.h>
     25# define WINGDIAPI
    2626#endif
    2727/*
     
    3030
    3131#ifndef GL_GLEXT_PROTOTYPES
    32 #define GL_GLEXT_PROTOTYPES
     32# define GL_GLEXT_PROTOTYPES
    3333#endif
    3434
     
    3737#  error "should not happen!"
    3838# endif
    39 #define WIN32_LEAN_AND_MEAN
    40 #define WGL_APIENTRY __stdcall
    41 #include <windows.h>
     39# define WIN32_LEAN_AND_MEAN
     40# define WGL_APIENTRY __stdcall
     41# include <windows.h>
    4242#elif defined(DARWIN)
    4343/* nothing */
     
    5656
    5757#ifdef GLX
    58 #ifndef GLX_GLXEXT_PROTOTYPES
    59 #define GLX_GLXEXT_PROTOTYPES
    60 #endif
    61 #include <GL/glx.h>
     58# ifndef GLX_GLXEXT_PROTOTYPES
     59#  define GLX_GLXEXT_PROTOTYPES
     60# endif
     61# include <GL/glx.h>
    6262#endif
    6363
    6464#ifdef USE_OSMESA
    65 #include <GL/osmesa.h>
     65# include <GL/osmesa.h>
    6666#endif
    6767
    6868#ifdef DARWIN
    69 #include <stddef.h>
     69# include <stddef.h>
    7070#elif !defined(FreeBSD)
    71 #include <malloc.h>  /* to get ptrdiff_t used below */
    72 #endif
    73 
    74 #include <GL/glext.h>
     71#  include <malloc.h>  /* to get ptrdiff_t used below */
     72#endif
     73
     74#include "cr_glext.h"
    7575
    7676#ifdef __cplusplus
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_dump.h

    r49172 r50041  
    110110} CR_HTML_DUMPER;
    111111
     112DECLEXPORT(bool) crDmpHtmlIsInited(struct CR_HTML_DUMPER * pDumper);
     113DECLEXPORT(void) crDmpHtmlTerm(struct CR_HTML_DUMPER * pDumper);
    112114DECLEXPORT(int) crDmpHtmlInit(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile);
     115DECLEXPORT(int) crDmpHtmlInitV(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile, va_list pArgList);
     116DECLEXPORT(int) crDmpHtmlInitF(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile, ...);
    113117
    114118#ifdef RT_OS_WINDOWS
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h

    r48491 r50041  
    236236DECLEXPORT(void) crStateSwitchContext( CRContext *from, CRContext *to );
    237237
     238DECLEXPORT(unsigned int) crStateHlpComponentsCount( GLenum pname );
     239
    238240typedef struct CRFBDataElement
    239241{
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h

    r49591 r50041  
    7070} CRNetworkPointer;
    7171
    72 #ifdef DEBUG_misha
     72#if 0 //def DEBUG_misha
    7373#define CRDBGPTR_SETZ(_p) crMemset((_p), 0, sizeof (CRNetworkPointer))
    7474#define CRDBGPTR_CHECKZ(_p) do { \
  • trunk/src/VBox/GuestHost/OpenGL/include/state/cr_glsl.h

    r45027 r50041  
    100100DECLEXPORT(GLuint) STATE_APIENTRY crStateCreateShader(GLuint id, GLenum type);
    101101DECLEXPORT(GLuint) STATE_APIENTRY crStateCreateProgram(GLuint id);
    102 DECLEXPORT(GLuint) STATE_APIENTRY crStateDeleteObjectARB( GLhandleARB obj );
     102DECLEXPORT(GLuint) STATE_APIENTRY crStateDeleteObjectARB( VBoxGLhandleARB obj );
    103103
    104104DECLEXPORT(GLboolean) STATE_APIENTRY crStateIsProgramUniformsCached(GLuint program);
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_extensions.c

    r33457 r50041  
    66
    77#include "packer.h"
    8 
    9 #include <GL/glext.h>
    108
    119int __packTexParameterNumParams( GLenum param )
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_shaders.c

    r44529 r50041  
    469469}
    470470
    471 void PACK_APIENTRY crPackGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj, int * writeback)
     471void PACK_APIENTRY crPackGetAttachedObjectsARB(VBoxGLhandleARB containerObj, GLsizei maxCount, GLsizei * count, VBoxGLhandleARB * obj, int * writeback)
    472472{
    473473        CR_GET_PACKER_CONTEXT(pc);
     
    477477        WRITE_DATA(0, GLint, 32);
    478478        WRITE_DATA(4, GLenum, CR_GETATTACHEDOBJECTSARB_EXTEND_OPCODE);
    479         WRITE_DATA(8, GLhandleARB, containerObj);
     479        WRITE_DATA(8, VBoxGLhandleARB, containerObj);
    480480        WRITE_DATA(12, GLsizei, maxCount);
    481481        WRITE_NETWORK_POINTER(16, (void *) count);
     
    485485}
    486486
    487 void PACK_APIENTRY crPackGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog, int * writeback)
     487void PACK_APIENTRY crPackGetInfoLogARB(VBoxGLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog, int * writeback)
    488488{
    489489        CR_GET_PACKER_CONTEXT(pc);
     
    493493        WRITE_DATA(0, GLint, 32);
    494494        WRITE_DATA(4, GLenum, CR_GETINFOLOGARB_EXTEND_OPCODE);
    495         WRITE_DATA(8, GLhandleARB, obj);
     495        WRITE_DATA(8, VBoxGLhandleARB, obj);
    496496        WRITE_DATA(12, GLsizei, maxLength);
    497497        WRITE_NETWORK_POINTER(16, (void *) length);
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/dump.cpp

    r49261 r50041  
    730730    crRecDumpLog(pRec, hwid);
    731731
    732     GLhandleARB *pShaders = (GLhandleARB*)crCalloc(cShaders * sizeof (*pShaders));
     732    VBoxGLhandleARB *pShaders = (VBoxGLhandleARB*)crCalloc(cShaders * sizeof (*pShaders));
    733733    if (!pShaders)
    734734    {
     
    741741    for (GLint i = 0; i < cShaders; ++i)
    742742    {
    743         crRecDumpShader(pRec, ctx, 0, pShaders[i]);
     743        if (pShaders[i])
     744            crRecDumpShader(pRec, ctx, 0, pShaders[i]);
     745        else
     746            crDmpStrF(pRec->pDumper, "WARNING: Shader[%d] is null", i);
    744747    }
    745748
     
    848851    crDmpStrF(pRec->pDumper, "==RECOMPILE PROGRAM ctx(%d) id(%d) hwid(%d) status(%d) shaders(%d)==", ctx->id, id, hwid, linkStatus, cShaders);
    849852
    850     GLhandleARB *pShaders = (GLhandleARB*)crCalloc(cShaders * sizeof (*pShaders));
     853    VBoxGLhandleARB *pShaders = (VBoxGLhandleARB*)crCalloc(cShaders * sizeof (*pShaders));
    851854    if (!pShaders)
    852855    {
     
    16651668}
    16661669
     1670DECLEXPORT(bool) crDmpHtmlIsInited(struct CR_HTML_DUMPER * pDumper)
     1671{
     1672    return !!pDumper->pFile;
     1673}
     1674
     1675DECLEXPORT(void) crDmpHtmlTerm(struct CR_HTML_DUMPER * pDumper)
     1676{
     1677    crDmpHtmlPrintFooter(pDumper);
     1678    fclose (pDumper->pFile);
     1679    pDumper->pFile = NULL;
     1680}
     1681
    16671682DECLEXPORT(int) crDmpHtmlInit(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile)
    16681683{
     
    17071722}
    17081723
     1724DECLEXPORT(int) crDmpHtmlInitV(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile, va_list pArgList)
     1725{
     1726    char szBuffer[4096] = {0};
     1727    vsprintf_s(szBuffer, sizeof (szBuffer), pszFile, pArgList);
     1728    return crDmpHtmlInit(pDumper, pszDir, szBuffer);
     1729}
     1730
     1731DECLEXPORT(int) crDmpHtmlInitF(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile, ...)
     1732{
     1733    int rc;
     1734    va_list pArgList;
     1735    va_start(pArgList, pszFile);
     1736    rc = crDmpHtmlInitV(pDumper, pszDir, pszFile, pArgList);
     1737    va_end(pArgList);
     1738    return rc;
     1739}
     1740
    17091741#endif
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/dump_gen.py

    r46515 r50041  
    128128#endif
    129129"""
    130 
    131 from get_components import *;
    132130
    133131texenv_mappings = {
     
    195193"""
    196194for pname in texparam_names:
    197     print "\tcComponents = lookupComponents(%s);" % pname
     195    print "\tcComponents = crStateHlpComponentsCount(%s);" % pname
    198196    print "\tAssert(cComponents <= RT_ELEMENTS(afBuf));"
    199197    print "\tmemset(afBuf, 0, sizeof (afBuf));"
     
    222220    values = texenv_mappings[target]
    223221    for pname in values:
    224         print "\tcComponents = lookupComponents(%s);" % pname
     222        print "\tcComponents = crStateHlpComponentsCount(%s);" % pname
    225223        print "\tAssert(cComponents <= RT_ELEMENTS(afBuf));"
    226224        print "\tmemset(afBuf, 0, sizeof (afBuf));"
     
    247245    print "\tcrDmpStrF(pRec->pDumper, \"===%s===\");" % coord
    248246    for pname in texgen_names:
    249         print "\tcComponents = lookupComponents(%s);" % pname
     247        print "\tcComponents = crStateHlpComponentsCount(%s);" % pname
    250248        print "\tAssert(cComponents <= RT_ELEMENTS(afBuf));"
    251249        print "\tmemset(afBuf, 0, sizeof (afBuf));"
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_get.py

    r23694 r50041  
    234234        print '\t}'
    235235        print '}'
     236
     237from get_components import *
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_glsl.c

    r48247 r50041  
    259259}
    260260
    261 DECLEXPORT(GLuint) STATE_APIENTRY crStateDeleteObjectARB( GLhandleARB obj )
     261DECLEXPORT(GLuint) STATE_APIENTRY crStateDeleteObjectARB( VBoxGLhandleARB obj )
    262262{
    263263    GLuint hwId = crStateGetProgramHWID(obj);
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_point.c

    r46037 r50041  
    201201        crStatePointParameterfvARB( pname, &f_param );
    202202}
     203
     204void crStatePointDiff(CRPointBits *b, CRbitvalue *bitID,
     205        CRContext *fromCtx, CRContext *toCtx)
     206{
     207    CRPointState *from = &(fromCtx->point);
     208    CRPointState *to = &(toCtx->point);
     209    unsigned int j, i;
     210    CRbitvalue nbitID[CR_MAX_BITARRAY];
     211    Assert(0);
     212    for (j=0;j<CR_MAX_BITARRAY;j++)
     213        nbitID[j] = ~bitID[j];
     214    i = 0; /* silence compiler */
     215    if (CHECKDIRTY(b->enableSmooth, bitID))
     216    {
     217        glAble able[2];
     218        able[0] = diff_api.Disable;
     219        able[1] = diff_api.Enable;
     220        if (from->pointSmooth != to->pointSmooth)
     221        {
     222            able[to->pointSmooth](GL_POINT_SMOOTH);
     223            from->pointSmooth = to->pointSmooth;
     224        }
     225        CLEARDIRTY(b->enableSmooth, nbitID);
     226    }
     227    if (CHECKDIRTY(b->size, bitID))
     228    {
     229        if (from->pointSize != to->pointSize)
     230        {
     231            diff_api.PointSize (to->pointSize);
     232            from->pointSize = to->pointSize;
     233        }
     234        CLEARDIRTY(b->size, nbitID);
     235    }
     236    if (CHECKDIRTY(b->minSize, bitID))
     237    {
     238        if (from->minSize != to->minSize)
     239        {
     240            diff_api.PointParameterfARB (GL_POINT_SIZE_MIN_ARB, to->minSize);
     241            from->minSize = to->minSize;
     242        }
     243        CLEARDIRTY(b->minSize, nbitID);
     244    }
     245    if (CHECKDIRTY(b->maxSize, bitID))
     246    {
     247        if (from->maxSize != to->maxSize)
     248        {
     249            diff_api.PointParameterfARB (GL_POINT_SIZE_MAX_ARB, to->maxSize);
     250            from->maxSize = to->maxSize;
     251        }
     252        CLEARDIRTY(b->maxSize, nbitID);
     253    }
     254    if (CHECKDIRTY(b->fadeThresholdSize, bitID))
     255    {
     256        if (from->fadeThresholdSize != to->fadeThresholdSize)
     257        {
     258            diff_api.PointParameterfARB (GL_POINT_FADE_THRESHOLD_SIZE_ARB, to->fadeThresholdSize);
     259            from->fadeThresholdSize = to->fadeThresholdSize;
     260        }
     261        CLEARDIRTY(b->fadeThresholdSize, nbitID);
     262    }
     263    if (CHECKDIRTY(b->spriteCoordOrigin, bitID))
     264    {
     265        if (from->spriteCoordOrigin != to->spriteCoordOrigin)
     266        {
     267            diff_api.PointParameterfARB (GL_POINT_SPRITE_COORD_ORIGIN, to->spriteCoordOrigin);
     268            from->spriteCoordOrigin = to->spriteCoordOrigin;
     269        }
     270        CLEARDIRTY(b->spriteCoordOrigin, nbitID);
     271    }
     272    if (CHECKDIRTY(b->distanceAttenuation, bitID))
     273    {
     274        if (from->distanceAttenuation[0] != to->distanceAttenuation[0] || from->distanceAttenuation[1] != to->distanceAttenuation[1] || from->distanceAttenuation[2] != to->distanceAttenuation[2]) {
     275            diff_api.PointParameterfvARB (GL_POINT_DISTANCE_ATTENUATION_ARB, to->distanceAttenuation);
     276            from->distanceAttenuation[0] = to->distanceAttenuation[0];
     277            from->distanceAttenuation[1] = to->distanceAttenuation[1];
     278            from->distanceAttenuation[2] = to->distanceAttenuation[2];
     279        }
     280        CLEARDIRTY(b->distanceAttenuation, nbitID);
     281    }
     282    if (CHECKDIRTY(b->enableSprite, bitID))
     283    {
     284        glAble able[2];
     285        able[0] = diff_api.Disable;
     286        able[1] = diff_api.Enable;
     287        if (from->pointSprite != to->pointSprite)
     288        {
     289            able[to->pointSprite](GL_POINT_SPRITE_ARB);
     290            from->pointSprite = to->pointSprite;
     291        }
     292        CLEARDIRTY(b->enableSprite, nbitID);
     293    }
     294    {
     295        unsigned int activeUnit = (unsigned int) -1;
     296        for (i = 0; i < CR_MAX_TEXTURE_UNITS; i++) {
     297            if (CHECKDIRTY(b->coordReplacement[i], bitID))
     298            {
     299                GLint replacement = to->coordReplacement[i];
     300                if (activeUnit != i) {
     301                     diff_api.ActiveTextureARB(i + GL_TEXTURE0_ARB );
     302                     activeUnit = i;
     303                }
     304                diff_api.TexEnviv(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, &replacement);
     305                from->coordReplacement[i] = to->coordReplacement[i];
     306                CLEARDIRTY(b->coordReplacement[i], nbitID);
     307            }
     308        }
     309        if (activeUnit != toCtx->texture.curTextureUnit)
     310           diff_api.ActiveTextureARB(GL_TEXTURE0 + toCtx->texture.curTextureUnit);
     311    }
     312    CLEARDIRTY(b->dirty, nbitID);
     313}
     314
     315void crStatePointSwitch(CRPointBits *b, CRbitvalue *bitID,
     316        CRContext *fromCtx, CRContext *toCtx)
     317{
     318    CRPointState *from = &(fromCtx->point);
     319    CRPointState *to = &(toCtx->point);
     320    unsigned int j, i;
     321    GLboolean fEnabled;
     322    CRbitvalue nbitID[CR_MAX_BITARRAY];
     323    for (j=0;j<CR_MAX_BITARRAY;j++)
     324        nbitID[j] = ~bitID[j];
     325    i = 0; /* silence compiler */
     326    if (CHECKDIRTY(b->enableSmooth, bitID))
     327    {
     328        glAble able[2];
     329        able[0] = diff_api.Disable;
     330        able[1] = diff_api.Enable;
     331        if (from->pointSmooth != to->pointSmooth)
     332        {
     333            able[to->pointSmooth](GL_POINT_SMOOTH);
     334            FILLDIRTY(b->enableSmooth);
     335            FILLDIRTY(b->dirty);
     336        }
     337        CLEARDIRTY(b->enableSmooth, nbitID);
     338    }
     339    if (CHECKDIRTY(b->size, bitID))
     340    {
     341        if (from->pointSize != to->pointSize)
     342        {
     343            diff_api.PointSize (to->pointSize);
     344            FILLDIRTY(b->size);
     345            FILLDIRTY(b->dirty);
     346        }
     347        CLEARDIRTY(b->size, nbitID);
     348    }
     349    if (CHECKDIRTY(b->minSize, bitID))
     350    {
     351        if (from->minSize != to->minSize)
     352        {
     353            diff_api.PointParameterfARB (GL_POINT_SIZE_MIN_ARB, to->minSize);
     354            FILLDIRTY(b->minSize);
     355            FILLDIRTY(b->dirty);
     356        }
     357        CLEARDIRTY(b->minSize, nbitID);
     358    }
     359    if (CHECKDIRTY(b->maxSize, bitID))
     360    {
     361        if (from->maxSize != to->maxSize)
     362        {
     363            diff_api.PointParameterfARB (GL_POINT_SIZE_MAX_ARB, to->maxSize);
     364            FILLDIRTY(b->maxSize);
     365            FILLDIRTY(b->dirty);
     366        }
     367        CLEARDIRTY(b->maxSize, nbitID);
     368    }
     369    if (CHECKDIRTY(b->fadeThresholdSize, bitID))
     370    {
     371        if (from->fadeThresholdSize != to->fadeThresholdSize)
     372        {
     373            diff_api.PointParameterfARB (GL_POINT_FADE_THRESHOLD_SIZE_ARB, to->fadeThresholdSize);
     374            FILLDIRTY(b->fadeThresholdSize);
     375            FILLDIRTY(b->dirty);
     376        }
     377        CLEARDIRTY(b->fadeThresholdSize, nbitID);
     378    }
     379    if (CHECKDIRTY(b->spriteCoordOrigin, bitID))
     380    {
     381        if (from->spriteCoordOrigin != to->spriteCoordOrigin)
     382        {
     383            diff_api.PointParameterfARB (GL_POINT_SPRITE_COORD_ORIGIN, to->spriteCoordOrigin);
     384            FILLDIRTY(b->spriteCoordOrigin);
     385            FILLDIRTY(b->dirty);
     386        }
     387        CLEARDIRTY(b->spriteCoordOrigin, nbitID);
     388    }
     389    if (CHECKDIRTY(b->distanceAttenuation, bitID))
     390    {
     391        if (from->distanceAttenuation[0] != to->distanceAttenuation[0] || from->distanceAttenuation[1] != to->distanceAttenuation[1] || from->distanceAttenuation[2] != to->distanceAttenuation[2]) {
     392            diff_api.PointParameterfvARB (GL_POINT_DISTANCE_ATTENUATION_ARB, to->distanceAttenuation);
     393            FILLDIRTY(b->distanceAttenuation);
     394            FILLDIRTY(b->dirty);
     395        }
     396        CLEARDIRTY(b->distanceAttenuation, nbitID);
     397    }
     398    fEnabled = from->pointSprite;
     399    {
     400        unsigned int activeUnit = (unsigned int) -1;
     401        for (i = 0; i < CR_MAX_TEXTURE_UNITS; i++) {
     402            if (CHECKDIRTY(b->coordReplacement[i], bitID))
     403            {
     404                if (!fEnabled)
     405                {
     406                    diff_api.Enable(GL_POINT_SPRITE_ARB);
     407                    fEnabled = GL_TRUE;
     408                }
     409#if 0
     410                /*don't set coord replacement, it will be set just before drawing points when necessary,
     411                 * to work around gpu driver bugs
     412                 * See crServerDispatch[Begin|End|Draw*] */
     413                GLint replacement = to->coordReplacement[i];
     414                if (activeUnit != i) {
     415                     diff_api.ActiveTextureARB(i + GL_TEXTURE0_ARB );
     416                     activeUnit = i;
     417                }
     418                diff_api.TexEnviv(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, &replacement);
     419#endif
     420                CLEARDIRTY(b->coordReplacement[i], nbitID);
     421            }
     422        }
     423        if (activeUnit != toCtx->texture.curTextureUnit)
     424           diff_api.ActiveTextureARB(GL_TEXTURE0 + toCtx->texture.curTextureUnit);
     425    }
     426    if (CHECKDIRTY(b->enableSprite, bitID))
     427    {
     428        glAble able[2];
     429        able[0] = diff_api.Disable;
     430        able[1] = diff_api.Enable;
     431        if (fEnabled != to->pointSprite)
     432        {
     433            able[to->pointSprite](GL_POINT_SPRITE_ARB);
     434            FILLDIRTY(b->enableSprite);
     435            FILLDIRTY(b->dirty);
     436        }
     437        CLEARDIRTY(b->enableSprite, nbitID);
     438    }
     439    else if (fEnabled != to->pointSprite)
     440    {
     441        glAble able[2];
     442        able[0] = diff_api.Disable;
     443        able[1] = diff_api.Enable;
     444        able[to->pointSprite](GL_POINT_SPRITE_ARB);
     445    }
     446    CLEARDIRTY(b->dirty, nbitID);
     447}
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_texture.c

    r48491 r50041  
    32603260                                                    const GLclampf *priorities)
    32613261{
    3262     UNUSED(n);
    3263     UNUSED(textures);
     3262    CRContext *g = GetCurrentContext();
     3263    CRTextureObj *tobj;
     3264    GLsizei i;
    32643265    UNUSED(priorities);
    3265     /* TODO: */
     3266
     3267    for (i = 0; i < n; ++i)
     3268    {
     3269        GLuint tex = textures[i];
     3270        GET_TOBJ(tobj, g, tex);
     3271        if (!tobj)
     3272        {
     3273            Assert(crHashtableIsKeyUsed(g->shared->textureTable, tex));
     3274            tobj = crStateTextureAllocate_t(g, tex);
     3275        }
     3276
     3277        /* so far the code just ensures the tex object is created to make
     3278         * the crserverlib code be able to pass it to host ogl */
     3279
     3280        /* TODO: store texture priorities in the state data to be able to restore it properly
     3281         * on save state load */
     3282    }
     3283
    32663284    return;
    32673285}
  • trunk/src/VBox/HostServices/SharedOpenGL/LICENSE

  • trunk/src/VBox/HostServices/SharedOpenGL/Makefile.kmk

    r46343 r50041  
    175175        $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
    176176
    177 $(VBOX_PATH_CROGL_GENFILES)/server_get.c: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_get.py server_special get_components.py) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
     177$(VBOX_PATH_CROGL_GENFILES)/server_get.c: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_get.py server_special) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
    178178        $(call MSG_GENERATE,python,$@,$<)
    179179        $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r49697 r50041  
    250250    *pu8Val2 = tmp;
    251251}
     252
     253#ifdef DEBUG
     254# define CR_GLERR_CHECK(_op) do { \
     255        GLenum status; \
     256        while ((status = cr_server.head_spu->dispatch_table.GetError()) != GL_NO_ERROR) {/*Assert(0);*/} \
     257        _op \
     258        while ((status = cr_server.head_spu->dispatch_table.GetError()) != GL_NO_ERROR) {Assert(0);} \
     259    } while (0)
     260#else
     261# define CR_GLERR_CHECK(_op) do { \
     262        _op \
     263    } while (0)
     264#endif
    252265
    253266#ifdef DEBUG_misha
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_get.py

    r31808 r50041  
    109109];
    110110
    111 from get_components import *;
    112 
    113111keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
    114112for func_name in keys:
     
    143141            print '\tcrServerReturnValue( &(%s[0]), %d*sizeof(%s) );' % (local_argname, max_components[func_name], local_argtype );
    144142        else:
    145             print '\tcrServerReturnValue( &(%s[0]), lookupComponents(pname)*sizeof(%s) );' % (local_argname, local_argtype );
     143            print '\tcrServerReturnValue( &(%s[0]), crStateHlpComponentsCount(pname)*sizeof(%s) );' % (local_argname, local_argtype );
    146144        print '}\n'
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c

    r47075 r50041  
    9898}
    9999
    100 void SERVER_DISPATCH_APIENTRY crServerDispatchGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj)
    101 {
    102     GLsizei *pLocal;
    103 
    104     pLocal = (GLsizei*) crAlloc(maxCount*sizeof(GLhandleARB)+sizeof(GLsizei));
    105     if (!pLocal)
    106     {
    107         GLsizei zero=0;
    108         crServerReturnValue(&zero, sizeof(zero));
    109     }
    110     /* initial (fallback )value */
    111     *pLocal = 0;
    112     cr_server.head_spu->dispatch_table.GetAttachedObjectsARB(crStateGetProgramHWID(containerObj), maxCount, pLocal, (GLhandleARB*)&pLocal[1]);
     100void SERVER_DISPATCH_APIENTRY crServerDispatchGetAttachedObjectsARB(VBoxGLhandleARB containerObj, GLsizei maxCount, GLsizei * count, VBoxGLhandleARB * obj)
     101{
     102    GLsizei *pLocal;
     103
     104    pLocal = (GLsizei*) crAlloc(maxCount*sizeof(VBoxGLhandleARB)+sizeof(GLsizei));
     105    if (!pLocal)
     106    {
     107        GLsizei zero=0;
     108        crServerReturnValue(&zero, sizeof(zero));
     109    }
     110    /* initial (fallback )value */
     111    *pLocal = 0;
     112    cr_server.head_spu->dispatch_table.GetAttachedObjectsARB(crStateGetProgramHWID(containerObj), maxCount, pLocal, (VBoxGLhandleARB*)&pLocal[1]);
    113113
    114114    {
     
    120120    }
    121121
    122     crServerReturnValue(pLocal, (*pLocal)*sizeof(GLhandleARB)+sizeof(GLsizei));
     122    crServerReturnValue(pLocal, (*pLocal)*sizeof(VBoxGLhandleARB)+sizeof(GLsizei));
    123123    crFree(pLocal);
    124124}
     
    126126AssertCompile(sizeof(GLsizei) == 4);
    127127
    128 void SERVER_DISPATCH_APIENTRY crServerDispatchGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
     128void SERVER_DISPATCH_APIENTRY crServerDispatchGetInfoLogARB(VBoxGLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
    129129{
    130130    GLsizei *pLocal;
     
    305305}
    306306
    307 void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterfvARB( GLhandleARB obj, GLenum pname, GLfloat * params )
     307void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterfvARB( VBoxGLhandleARB obj, GLenum pname, GLfloat * params )
    308308{
    309309    GLfloat local_params[1];
     
    324324}
    325325
    326 void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterivARB( GLhandleARB obj, GLenum pname, GLint * params )
     326void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterivARB( VBoxGLhandleARB obj, GLenum pname, GLint * params )
    327327{
    328328    GLint local_params[1];
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c

    r48247 r50041  
    112112}
    113113
    114 void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteObjectARB(GLhandleARB obj)
     114void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteObjectARB(VBoxGLhandleARB obj)
    115115{
    116116    GLuint hwid =  crStateDeleteObjectARB(obj);
     
    130130}
    131131
    132 GLhandleARB SERVER_DISPATCH_APIENTRY crServerDispatchGetHandleARB( GLenum pname )
     132VBoxGLhandleARB SERVER_DISPATCH_APIENTRY crServerDispatchGetHandleARB( GLenum pname )
    133133{
    134     GLhandleARB retval;
     134    VBoxGLhandleARB retval;
    135135    retval = cr_server.head_spu->dispatch_table.GetHandleARB(pname);
    136136    if (pname==GL_PROGRAM_OBJECT_ARB)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_lists.c

    r45910 r50041  
    308308    }
    309309
     310    crStatePrioritizeTextures(n, textures, priorities);
     311
    310312    for (i = 0; i < n; i++)
    311313    {
     
    313315    }
    314316
    315     crStatePrioritizeTextures(n, textures, priorities);
    316317    cr_server.head_spu->dispatch_table.PrioritizeTextures(n, newTextures, priorities);
    317318    crFree(newTextures);
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r49591 r50041  
    332332#endif
    333333
    334 //    cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL);
     334    cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL);
    335335
    336336    if (cr_server.bUseMultipleContexts)
     
    396396    crStateDiffAPI( &(cr_server.head_spu->dispatch_table) );
    397397
     398#ifdef VBOX_WITH_CRSERVER_DUMPER
     399    crMemset(&cr_server.Recorder, 0, sizeof (cr_server.Recorder));
     400    crMemset(&cr_server.RecorderBlitter, 0, sizeof (cr_server.RecorderBlitter));
     401    crMemset(&cr_server.DbgPrintDumper, 0, sizeof (cr_server.DbgPrintDumper));
     402    crMemset(&cr_server.HtmlDumper, 0, sizeof (cr_server.HtmlDumper));
     403    cr_server.pDumper = NULL;
     404#endif
     405
    398406    crUnpackSetReturnPointer( &(cr_server.return_ptr) );
    399407    crUnpackSetWritebackPointer( &(cr_server.writeback_ptr) );
     
    432440#endif
    433441
    434 //    cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL);
     442    cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL);
    435443
    436444    if (cr_server.bUseMultipleContexts)
     
    509517    crServerInitTmpCtxDispatch();
    510518    crStateDiffAPI( &(cr_server.head_spu->dispatch_table) );
     519
     520#ifdef VBOX_WITH_CRSERVER_DUMPER
     521    crMemset(&cr_server.Recorder, 0, sizeof (cr_server.Recorder));
     522    crMemset(&cr_server.RecorderBlitter, 0, sizeof (cr_server.RecorderBlitter));
     523    crMemset(&cr_server.DbgPrintDumper, 0, sizeof (cr_server.DbgPrintDumper));
     524    crMemset(&cr_server.HtmlDumper, 0, sizeof (cr_server.HtmlDumper));
     525    cr_server.pDumper = NULL;
     526#endif
    511527
    512528    /*Check for PBO support*/
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c

    r49172 r50041  
    13981398int64_t g_CrDbgDumpPid = 0;
    13991399unsigned long g_CrDbgDumpEnabled = 0;
    1400 unsigned long g_CrDbgDumpDraw = CR_SERVER_DUMP_F_COMPILE_SHADER
     1400unsigned long g_CrDbgDumpDraw = 0
     1401#if 0
     1402        | CR_SERVER_DUMP_F_COMPILE_SHADER
    14011403        | CR_SERVER_DUMP_F_LINK_PROGRAM
     1404#endif
     1405        ;
     1406#if 0
    14021407        | CR_SERVER_DUMP_F_DRAW_BUFF_ENTER
    14031408        | CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE
     
    14101415        | CR_SERVER_DUMP_F_DRAWEL
    14111416        | CR_SERVER_DUMP_F_SHADER_SOURCE
    1412         ; //CR_SERVER_DUMP_F_DRAW_BUFF_ENTER | CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE;
     1417        ;
     1418#endif
    14131419unsigned long g_CrDbgDumpDrawFramesSettings = CR_SERVER_DUMP_F_DRAW_BUFF_ENTER
    14141420        | CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE
     
    14221428unsigned long g_CrDbgDumpDrawFramesCount = 0;
    14231429
     1430uint32_t g_CrDbgDumpDrawCount = 0;
     1431uint32_t g_CrDbgDumpDumpOnCount = 10;
     1432uint32_t g_CrDbgDumpDumpOnCountEnabled = 0;
     1433uint32_t g_CrDbgDumpDumpOnCountPerform = 0;
     1434uint32_t g_CrDbgDumpDrawFlags = CR_SERVER_DUMP_F_COMPILE_SHADER
     1435        | CR_SERVER_DUMP_F_SHADER_SOURCE
     1436        | CR_SERVER_DUMP_F_COMPILE_SHADER
     1437        | CR_SERVER_DUMP_F_LINK_PROGRAM
     1438        | CR_SERVER_DUMP_F_DRAW_BUFF_ENTER
     1439        | CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE
     1440        | CR_SERVER_DUMP_F_DRAW_TEX_ENTER
     1441        | CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER
     1442        | CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER
     1443        | CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER
     1444        | CR_SERVER_DUMP_F_DRAW_STATE_ENTER
     1445        | CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER
     1446        | CR_SERVER_DUMP_F_DRAWEL
     1447        | CR_SERVER_DUMP_F_TEXPRESENT;
     1448
    14241449void crServerDumpCheckTerm()
    14251450{
     
    14371462    CRMuralInfo *pBlitterMural;
    14381463
    1439     if (CrBltIsInitialized(&cr_server.RecorderBlitter))
    1440         return VINF_SUCCESS;
    1441 
    1442     pBlitterMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.visualBits);
    1443     if (!pBlitterMural)
    1444     {
    1445         crWarning("crServerGetDummyMural failed");
    1446         return VERR_GENERAL_FAILURE;
    1447     }
    1448 
    1449     crServerVBoxBlitterWinInit(&BltWin, pBlitterMural);
    1450     crServerVBoxBlitterCtxInit(&BltCtx, &cr_server.MainContextInfo);
    1451 
    1452     rc = CrBltInit(&cr_server.RecorderBlitter, &BltCtx, true, true, NULL, &cr_server.TmpCtxDispatch);
    1453     if (!RT_SUCCESS(rc))
    1454     {
    1455         crWarning("CrBltInit failed rc %d", rc);
    1456         return rc;
    1457     }
    1458 
    1459     rc = CrBltMuralSetCurrent(&cr_server.RecorderBlitter, &BltWin);
    1460     if (!RT_SUCCESS(rc))
    1461     {
    1462         crWarning("CrBltMuralSetCurrent failed rc %d", rc);
    1463         return rc;
     1464    if (!CrBltIsInitialized(&cr_server.RecorderBlitter))
     1465    {
     1466        pBlitterMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.visualBits);
     1467        if (!pBlitterMural)
     1468        {
     1469            crWarning("crServerGetDummyMural failed");
     1470            return VERR_GENERAL_FAILURE;
     1471        }
     1472
     1473        crServerVBoxBlitterWinInit(&BltWin, pBlitterMural);
     1474        crServerVBoxBlitterCtxInit(&BltCtx, &cr_server.MainContextInfo);
     1475
     1476        rc = CrBltInit(&cr_server.RecorderBlitter, &BltCtx, true, true, NULL, &cr_server.TmpCtxDispatch);
     1477        if (!RT_SUCCESS(rc))
     1478        {
     1479            crWarning("CrBltInit failed rc %d", rc);
     1480            return rc;
     1481        }
     1482
     1483        rc = CrBltMuralSetCurrent(&cr_server.RecorderBlitter, &BltWin);
     1484        if (!RT_SUCCESS(rc))
     1485        {
     1486            crWarning("CrBltMuralSetCurrent failed rc %d", rc);
     1487            return rc;
     1488        }
    14641489    }
    14651490
     
    14681493    cr_server.pDumper = &cr_server.DbgPrintDumper.Base;
    14691494#else
    1470     crDmpHtmlInit(&cr_server.HtmlDumper, "S:\\projects\\virtualbox\\3d\\dumps\\1", "index.html");
    1471     cr_server.pDumper = &cr_server.HtmlDumper.Base;
     1495    if (!crDmpHtmlIsInited(&cr_server.HtmlDumper))
     1496    {
     1497        static int cCounter = 0;
     1498//    crDmpHtmlInit(&cr_server.HtmlDumper, "S:\\projects\\virtualbox\\3d\\dumps\\1", "index.html");
     1499        crDmpHtmlInitF(&cr_server.HtmlDumper, "/Users/oracle-mac/vbox/dump/1", "index%d.html", cCounter);
     1500        cr_server.pDumper = &cr_server.HtmlDumper.Base;
     1501        ++cCounter;
     1502    }
    14721503#endif
    14731504
     
    16301661void crServerDumpFilterOpLeave(unsigned long event, CR_DUMPER *pDumper)
    16311662{
     1663    if (CR_SERVER_DUMP_F_DRAW_LEAVE_ALL & event)
     1664    {
     1665        g_CrDbgDumpDumpOnCountPerform = 0;
     1666    }
    16321667}
    16331668
    16341669bool crServerDumpFilterOpEnter(unsigned long event, CR_DUMPER *pDumper)
    16351670{
     1671    if ((CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER & event)
     1672            || (CR_SERVER_DUMP_F_TEXPRESENT & event))
     1673    {
     1674        if (g_CrDbgDumpDumpOnCountEnabled == 1)
     1675            g_CrDbgDumpDumpOnCountEnabled = 2;
     1676        else if (g_CrDbgDumpDumpOnCountEnabled)
     1677        {
     1678            g_CrDbgDumpDumpOnCountEnabled = 0;
     1679            if (cr_server.pDumper == &cr_server.HtmlDumper.Base)
     1680            {
     1681                crDmpHtmlTerm(&cr_server.HtmlDumper);
     1682                cr_server.pDumper = NULL;
     1683            }
     1684        }
     1685
     1686        g_CrDbgDumpDrawCount = 0;
     1687    }
     1688    else if (CR_SERVER_DUMP_F_DRAW_ENTER_ALL & event)
     1689    {
     1690        if (g_CrDbgDumpDumpOnCountEnabled == 2)
     1691        {
     1692            if (g_CrDbgDumpDumpOnCount == g_CrDbgDumpDrawCount)
     1693            {
     1694                g_CrDbgDumpDumpOnCountPerform = 1;
     1695            }
     1696            ++g_CrDbgDumpDrawCount;
     1697        }
     1698    }
     1699    if (g_CrDbgDumpDumpOnCountPerform)
     1700    {
     1701        if (g_CrDbgDumpDrawFlags & event)
     1702            return true;
     1703    }
    16361704    return CR_SERVER_DUMP_DEFAULT_FILTER_OP(event);
    16371705}
     
    16391707bool crServerDumpFilterDmp(unsigned long event, CR_DUMPER *pDumper)
    16401708{
     1709    if (g_CrDbgDumpDumpOnCountPerform)
     1710    {
     1711        if (g_CrDbgDumpDrawFlags & event)
     1712            return true;
     1713    }
    16411714    return CR_SERVER_DUMP_DEFAULT_FILTER_DMP(event);
    16421715}
     
    16731746}
    16741747#endif
    1675 /* */
     1748
     1749GLvoid crServerSpriteCoordReplEnable(GLboolean fEnable)
     1750{
     1751    CRContext *g = crStateGetCurrent();
     1752    CRTextureState *t = &(g->texture);
     1753    GLuint curTextureUnit = t->curTextureUnit;
     1754    GLuint curTextureUnitRestore = curTextureUnit;
     1755    GLuint i;
     1756
     1757    for (i = 0; i < g->limits.maxTextureUnits; ++i)
     1758    {
     1759        if (g->point.coordReplacement[i])
     1760        {
     1761            if (i != curTextureUnit)
     1762            {
     1763                curTextureUnit = i;
     1764                cr_server.head_spu->dispatch_table.ActiveTextureARB( i + GL_TEXTURE0_ARB );
     1765            }
     1766
     1767            cr_server.head_spu->dispatch_table.TexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, (GLint)fEnable);
     1768        }
     1769    }
     1770
     1771    if (curTextureUnit != curTextureUnitRestore)
     1772    {
     1773        cr_server.head_spu->dispatch_table.ActiveTextureARB( curTextureUnitRestore + GL_TEXTURE0_ARB );
     1774    }
     1775}
     1776
     1777GLvoid SERVER_DISPATCH_APIENTRY crServerDispatchDrawArrays(GLenum mode, GLint first, GLsizei count)
     1778{
     1779#ifdef DEBUG
     1780    GLenum status = cr_server.head_spu->dispatch_table.CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER_EXT);
     1781    Assert(GL_FRAMEBUFFER_COMPLETE == status);
     1782#endif
     1783    if (mode == GL_POINTS)
     1784        crServerSpriteCoordReplEnable(GL_TRUE);
     1785    CR_SERVER_DUMP_DRAW_ENTER();
     1786    CR_GLERR_CHECK(cr_server.head_spu->dispatch_table.DrawArrays(mode, first, count););
     1787    CR_SERVER_DUMP_DRAW_LEAVE();
     1788    if (mode == GL_POINTS)
     1789        crServerSpriteCoordReplEnable(GL_FALSE);
     1790}
     1791
     1792GLvoid SERVER_DISPATCH_APIENTRY crServerDispatchDrawElements(GLenum mode,  GLsizei count,  GLenum type,  const GLvoid * indices)
     1793{
     1794#ifdef DEBUG
     1795    GLenum status = cr_server.head_spu->dispatch_table.CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER_EXT);
     1796    Assert(GL_FRAMEBUFFER_COMPLETE == status);
     1797#endif
     1798    if (mode == GL_POINTS)
     1799        crServerSpriteCoordReplEnable(GL_TRUE);
     1800    CR_SERVER_DUMP_DRAW_ENTER();
     1801    CR_GLERR_CHECK(cr_server.head_spu->dispatch_table.DrawElements(mode, count, type, indices););
     1802    CR_SERVER_DUMP_DRAW_LEAVE();
     1803    if (mode == GL_POINTS)
     1804        crServerSpriteCoordReplEnable(GL_FALSE);
     1805}
     1806
     1807void SERVER_DISPATCH_APIENTRY crServerDispatchEnd( void )
     1808{
     1809    CRContext *g = crStateGetCurrent();
     1810    GLenum mode = g->current.mode;
     1811
     1812    crStateEnd();
     1813    cr_server.head_spu->dispatch_table.End();
     1814
     1815    CR_SERVER_DUMP_DRAW_LEAVE();
     1816
     1817    if (mode == GL_POINTS)
     1818        crServerSpriteCoordReplEnable(GL_FALSE);
     1819}
     1820
     1821#ifdef DEBUG
     1822extern GLuint g_VBoxTstNumVa;
     1823#endif
     1824
     1825void SERVER_DISPATCH_APIENTRY crServerDispatchBegin(GLenum mode)
     1826{
     1827#ifdef DEBUG
     1828    CRContext *ctx = crStateGetCurrent();
     1829    SPUDispatchTable *gl = &cr_server.head_spu->dispatch_table;
     1830
     1831    g_VBoxTstNumVa = 0;
     1832
     1833    if (ctx->program.vpProgramBinding)
     1834    {
     1835        AssertRelease(ctx->program.currentVertexProgram);
     1836
     1837        if (ctx->program.currentVertexProgram->isARBprogram)
     1838        {
     1839            GLint pid=-1;
     1840            gl->GetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_BINDING_ARB, &pid);
     1841
     1842            if (pid != ctx->program.currentVertexProgram->id)
     1843            {
     1844                crWarning("pid(%d) != ctx->program.currentVertexProgram->id(%d)", pid, ctx->program.currentVertexProgram->id);
     1845            }
     1846            AssertRelease(pid == ctx->program.currentVertexProgram->id);
     1847        }
     1848        else
     1849        {
     1850            GLint pid=-1;
     1851
     1852            gl->GetIntegerv(GL_VERTEX_PROGRAM_BINDING_NV, &pid);
     1853            if (pid != ctx->program.currentVertexProgram->id)
     1854            {
     1855                crWarning("pid(%d) != ctx->program.currentVertexProgram->id(%d)", pid, ctx->program.currentVertexProgram->id);
     1856            }
     1857            AssertRelease(pid == ctx->program.currentVertexProgram->id);
     1858        }
     1859    }
     1860    else if (ctx->glsl.activeProgram)
     1861    {
     1862        GLint pid=-1;
     1863
     1864        gl->GetIntegerv(GL_CURRENT_PROGRAM, &pid);
     1865        crDebug("pid %i, state: id %i, hwid %i", pid, ctx->glsl.activeProgram->id, ctx->glsl.activeProgram->hwid);
     1866        if (pid != ctx->glsl.activeProgram->hwid)
     1867        {
     1868            crWarning("pid(%d) != ctx->glsl.activeProgram->hwid(%d)", pid, ctx->glsl.activeProgram->hwid);
     1869        }
     1870        AssertRelease(pid == ctx->glsl.activeProgram->hwid);
     1871    }
     1872#endif
     1873
     1874    if (mode == GL_POINTS)
     1875        crServerSpriteCoordReplEnable(GL_TRUE);
     1876
     1877    CR_SERVER_DUMP_DRAW_ENTER();
     1878
     1879    crStateBegin(mode);
     1880    cr_server.head_spu->dispatch_table.Begin(mode);
     1881}
     1882
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_special

    r48247 r50041  
    254254GetProgramiv
    255255GetShaderiv
     256Begin
     257DrawArrays
     258DrawElements
     259End
     260TexEnvf
     261TexEnvfv
     262TexEnvi
     263TexEnviv
     264GetTexEnvfv
     265GetTexEnviv
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_texture.c

    r29857 r50041  
    137137    (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels),
    138138    (target, level, internalFormat, width, height, depth, border, format, type, realptr), pixels)
     139
     140
     141void SERVER_DISPATCH_APIENTRY crServerDispatchTexEnvf( GLenum target, GLenum pname, GLfloat param )
     142{
     143    crStateTexEnvf( target, pname, param );
     144    if (GL_POINT_SPRITE != target && pname != GL_COORD_REPLACE)
     145        CR_GLERR_CHECK(cr_server.head_spu->dispatch_table.TexEnvf( target, pname, param ););
     146}
     147
     148void SERVER_DISPATCH_APIENTRY crServerDispatchTexEnvfv( GLenum target, GLenum pname, const GLfloat * params )
     149{
     150    crStateTexEnvfv( target, pname, params );
     151    if (GL_POINT_SPRITE != target && pname != GL_COORD_REPLACE)
     152        CR_GLERR_CHECK(cr_server.head_spu->dispatch_table.TexEnvfv( target, pname, params ););
     153}
     154
     155void SERVER_DISPATCH_APIENTRY crServerDispatchTexEnvi( GLenum target, GLenum pname, GLint param )
     156{
     157    crStateTexEnvi( target, pname, param );
     158    if (GL_POINT_SPRITE != target && pname != GL_COORD_REPLACE)
     159        CR_GLERR_CHECK(cr_server.head_spu->dispatch_table.TexEnvi( target, pname, param ););
     160}
     161
     162void SERVER_DISPATCH_APIENTRY crServerDispatchTexEnviv( GLenum target, GLenum pname, const GLint * params )
     163{
     164    crStateTexEnviv( target, pname, params );
     165    if (GL_POINT_SPRITE != target && pname != GL_COORD_REPLACE)
     166        CR_GLERR_CHECK(cr_server.head_spu->dispatch_table.TexEnviv( target, pname, params ););
     167}
     168
     169void SERVER_DISPATCH_APIENTRY crServerDispatchGetTexEnvfv( GLenum target, GLenum pname, GLfloat * params )
     170{
     171    GLfloat local_params[4];
     172    (void) params;
     173    if (GL_POINT_SPRITE != target && pname != GL_COORD_REPLACE)
     174        cr_server.head_spu->dispatch_table.GetTexEnvfv( target, pname, local_params );
     175    else
     176        crStateGetTexEnvfv( target, pname, local_params );
     177
     178    crServerReturnValue( &(local_params[0]), crStateHlpComponentsCount(pname)*sizeof (GLfloat) );
     179}
     180
     181void SERVER_DISPATCH_APIENTRY crServerDispatchGetTexEnviv( GLenum target, GLenum pname, GLint * params )
     182{
     183    GLint local_params[4];
     184    (void) params;
     185    if (GL_POINT_SPRITE != target && pname != GL_COORD_REPLACE)
     186        cr_server.head_spu->dispatch_table.GetTexEnviv( target, pname, local_params );
     187    else
     188        crStateGetTexEnviv( target, pname, local_params );
     189
     190    crServerReturnValue( &(local_params[0]), crStateHlpComponentsCount(pname)*sizeof (GLint) );
     191}
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r48726 r50041  
    18161816    FILLIN( "GetString", renderspuGetString );
    18171817    FILLIN( "VBoxPresentComposition", renderspuVBoxPresentComposition );
    1818 
    18191818    return i;
    18201819}
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r48291 r50041  
    210210#endif
    211211
     212#ifdef RT_OS_DARWIN
     213typedef void (*PFNDELETE_OBJECT)(GLhandleARB obj);
     214typedef void (*PFNGET_ATTACHED_OBJECTS)( GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj );
     215typedef GLhandleARB (*PFNGET_HANDLE)(GLenum pname);
     216typedef void (*PFNGET_INFO_LOG)( GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog );
     217typedef void (*PFNGET_OBJECT_PARAMETERFV)( GLhandleARB obj, GLenum pname, GLfloat * params );
     218typedef void (*PFNGET_OBJECT_PARAMETERIV)( GLhandleARB obj, GLenum pname, GLint * params );
     219#endif
     220
    212221/**
    213222 * Renderspu state info
     
    311320#ifdef RT_OS_DARWIN
    312321# ifdef VBOX_WITH_COCOA_QT
     322    PFNDELETE_OBJECT pfnDeleteObject;
     323    PFNGET_ATTACHED_OBJECTS pfnGetAttachedObjects;
     324    PFNGET_HANDLE pfnGetHandle;
     325    PFNGET_INFO_LOG pfnGetInfoLog;
     326    PFNGET_OBJECT_PARAMETERFV pfnGetObjectParameterfv;
     327    PFNGET_OBJECT_PARAMETERIV pfnGetObjectParameteriv;
     328
    313329    CR_GLSL_CACHE GlobalShaders;
    314330# else
     
    391407extern void renderspu_SystemReparentWindow(WindowInfo *window);
    392408extern void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry );
     409uint32_t renderspu_SystemPostprocessFunctions(SPUNamedFunctionTable *aFunctions, uint32_t cFunctions, uint32_t cTable);
    393410extern void renderspu_GCWindow(void);
    394411extern int renderspuCreateFunctions( SPUNamedFunctionTable table[] );
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c

    r48291 r50041  
    2222#include <iprt/path.h>
    2323
     24#include <cr_string.h>
     25#include <cr_mem.h>
     26
    2427GLboolean renderspu_SystemInitVisual(VisualInfo *pVisInfo)
    2528{
     
    197200    CrGlslTerm(&render_spu.GlobalShaders);
    198201    return VINF_SUCCESS;
     202}
     203
     204static SPUNamedFunctionTable * renderspuFindEntry(SPUNamedFunctionTable *aFunctions, const char *pcszName)
     205{
     206    SPUNamedFunctionTable *pCur;
     207
     208    for (pCur = aFunctions ; pCur->name != NULL ; pCur++)
     209    {
     210        if (!crStrcmp( pcszName, pCur->name ) )
     211        {
     212            return pCur;
     213        }
     214    }
     215
     216    AssertFailed();
     217
     218    return NULL;
    199219}
    200220
     
    290310    }
    291311}
     312
     313AssertCompile(sizeof (GLhandleARB) == sizeof (void*));
     314
     315static VBoxGLhandleARB crHndlSearchVBox(GLhandleARB hNative)
     316{
     317    CRASSERT(!(((uintptr_t)hNative) >> 32));
     318    return (VBoxGLhandleARB)((uintptr_t)hNative);
     319}
     320
     321static GLhandleARB crHndlSearchNative(VBoxGLhandleARB hVBox)
     322{
     323    return (GLhandleARB)((uintptr_t)hVBox);
     324}
     325
     326static VBoxGLhandleARB crHndlAcquireVBox(GLhandleARB hNative)
     327{
     328    CRASSERT(!(((uintptr_t)hNative) >> 32));
     329    return (VBoxGLhandleARB)((uintptr_t)hNative);
     330}
     331
     332static GLhandleARB crHndlReleaseVBox(VBoxGLhandleARB hVBox)
     333{
     334    return (GLhandleARB)((uintptr_t)hVBox);
     335}
     336
     337static void SPU_APIENTRY renderspu_SystemDeleteObjectARB(VBoxGLhandleARB obj)
     338{
     339    GLhandleARB hNative = crHndlReleaseVBox(obj);
     340    if (!hNative)
     341    {
     342        crWarning("no native for %d", obj);
     343        return;
     344    }
     345
     346    render_spu.pfnDeleteObject(hNative);
     347}
     348
     349static void SPU_APIENTRY renderspu_SystemGetAttachedObjectsARB( VBoxGLhandleARB containerObj, GLsizei maxCount, GLsizei * pCount, VBoxGLhandleARB * obj )
     350{
     351    GLhandleARB *paAttachments;
     352    GLhandleARB hNative = crHndlSearchNative(containerObj);
     353    GLsizei count, i;
     354
     355    if (pCount)
     356        *pCount = 0;
     357
     358    if (!hNative)
     359    {
     360        crWarning("no native for %d", obj);
     361        return;
     362    }
     363
     364    paAttachments = crCalloc(maxCount * sizeof (*paAttachments));
     365    if (!paAttachments)
     366    {
     367        crWarning("crCalloc failed");
     368        return;
     369    }
     370
     371    render_spu.pfnGetAttachedObjects(hNative, maxCount, &count, paAttachments);
     372    if (pCount)
     373        *pCount = count;
     374    if (count > maxCount)
     375    {
     376        crWarning("count too big");
     377        count = maxCount;
     378    }
     379
     380    for (i = 0; i < count; ++i)
     381    {
     382        obj[i] = crHndlSearchVBox(paAttachments[i]);
     383        CRASSERT(obj[i]);
     384    }
     385
     386    crFree(paAttachments);
     387}
     388
     389static VBoxGLhandleARB SPU_APIENTRY renderspu_SystemGetHandleARB(GLenum pname)
     390{
     391    GLhandleARB hNative = render_spu.pfnGetHandle(pname);
     392    VBoxGLhandleARB hVBox;
     393    if (!hNative)
     394    {
     395        crWarning("pfnGetHandle failed");
     396        return 0;
     397    }
     398    hVBox = crHndlAcquireVBox(hNative);
     399    CRASSERT(hVBox);
     400    return hVBox;
     401}
     402
     403static void SPU_APIENTRY renderspu_SystemGetInfoLogARB( VBoxGLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog )
     404{
     405    GLhandleARB hNative = crHndlSearchNative(obj);
     406    if (!hNative)
     407    {
     408        crWarning("invalid handle!");
     409        return;
     410    }
     411
     412    render_spu.pfnGetInfoLog(hNative, maxLength, length, infoLog);
     413}
     414
     415static void SPU_APIENTRY renderspu_SystemGetObjectParameterfvARB( VBoxGLhandleARB obj, GLenum pname, GLfloat * params )
     416{
     417    GLhandleARB hNative = crHndlSearchNative(obj);
     418    if (!hNative)
     419    {
     420        crWarning("invalid handle!");
     421        return;
     422    }
     423
     424    render_spu.pfnGetObjectParameterfv(hNative, pname, params);
     425}
     426
     427static void SPU_APIENTRY renderspu_SystemGetObjectParameterivARB( VBoxGLhandleARB obj, GLenum pname, GLint * params )
     428{
     429    GLhandleARB hNative = crHndlSearchNative(obj);
     430    if (!hNative)
     431    {
     432        crWarning("invalid handle!");
     433        return;
     434    }
     435
     436    render_spu.pfnGetObjectParameteriv(hNative, pname, params);
     437}
     438
     439uint32_t renderspu_SystemPostprocessFunctions(SPUNamedFunctionTable *aFunctions, uint32_t cFunctions, uint32_t cTable)
     440{
     441    SPUNamedFunctionTable * pEntry;
     442
     443    pEntry = renderspuFindEntry(aFunctions, "DeleteObjectARB");
     444    if (pEntry)
     445    {
     446        render_spu.pfnDeleteObject = (PFNDELETE_OBJECT)pEntry->fn;
     447        pEntry->fn = (SPUGenericFunction)renderspu_SystemDeleteObjectARB;
     448    }
     449
     450    pEntry = renderspuFindEntry(aFunctions, "GetAttachedObjectsARB");
     451    if (pEntry)
     452    {
     453        render_spu.pfnGetAttachedObjects = (PFNGET_ATTACHED_OBJECTS)pEntry->fn;
     454        pEntry->fn = (SPUGenericFunction)renderspu_SystemGetAttachedObjectsARB;
     455    }
     456
     457    pEntry = renderspuFindEntry(aFunctions, "GetHandleARB");
     458    if (pEntry)
     459    {
     460        render_spu.pfnGetHandle = (PFNGET_HANDLE)pEntry->fn;
     461        pEntry->fn = (SPUGenericFunction)renderspu_SystemGetHandleARB;
     462    }
     463
     464    pEntry = renderspuFindEntry(aFunctions, "GetInfoLogARB");
     465    if (pEntry)
     466    {
     467        render_spu.pfnGetInfoLog = (PFNGET_INFO_LOG)pEntry->fn;
     468        pEntry->fn = (SPUGenericFunction)renderspu_SystemGetInfoLogARB;
     469    }
     470
     471    pEntry = renderspuFindEntry(aFunctions, "GetObjectParameterfvARB");
     472    if (pEntry)
     473    {
     474        render_spu.pfnGetObjectParameterfv = (PFNGET_OBJECT_PARAMETERFV)pEntry->fn;
     475        pEntry->fn = (SPUGenericFunction)renderspu_SystemGetObjectParameterfvARB;
     476    }
     477
     478    pEntry = renderspuFindEntry(aFunctions, "GetObjectParameterivARB");
     479    if (pEntry)
     480    {
     481        render_spu.pfnGetObjectParameteriv = (PFNGET_OBJECT_PARAMETERIV)pEntry->fn;
     482        pEntry->fn = (SPUGenericFunction)renderspu_SystemGetObjectParameterivARB;
     483    }
     484
     485    return cFunctions;
     486}
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c

    r48487 r50041  
    20802080
    20812081}
     2082
     2083uint32_t renderspu_SystemPostprocessFunctions(SPUNamedFunctionTable *aFunctions, uint32_t cFunctions, uint32_t cTable)
     2084{
     2085    return cFunctions;
     2086}
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c

    r48291 r50041  
    374374    render_spu.gather_conns = NULL;
    375375
     376    numFuncs = renderspu_SystemPostprocessFunctions(_cr_render_table, numFuncs, RT_ELEMENTS(_cr_render_table));
     377
    376378    crDebug("Render SPU: ---------- End of Init -------------");
    377379
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c

    r49011 r50041  
    16881688
    16891689}
     1690
     1691uint32_t renderspu_SystemPostprocessFunctions(SPUNamedFunctionTable *aFunctions, uint32_t cFunctions, uint32_t cTable)
     1692{
     1693    return cFunctions;
     1694}
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c

    r44529 r50041  
    4040    GLint hasNonLocalLen = READ_DATA(16, GLsizei);
    4141    GLint *pLocalLength = DATA_POINTER(20, GLint);
    42     const char **ppStrings = NULL;
    43     GLsizei i;
     42    char **ppStrings = NULL;
     43    GLsizei i, j, jUpTo;
    4444    int pos=20+count*sizeof(*pLocalLength);
    4545
     
    6161            pLocalLength[i] -= 1;
    6262        }
     63
     64        Assert(pLocalLength[i] > 0);
     65        jUpTo = i == count -1 ? pLocalLength[i] - 1 : pLocalLength[i];
     66        for (j = 0; j < jUpTo; ++j)
     67        {
     68            char *pString = ppStrings[i];
     69
     70            if (pString[j] == '\0')
     71            {
     72                Assert(j == jUpTo - 1);
     73                pString[j] = '\n';
     74            }
     75        }
    6376    }
    6477
    65     cr_unpackDispatch.ShaderSource(shader, count, ppStrings, length ? length : pLocalLength);
     78//    cr_unpackDispatch.ShaderSource(shader, count, ppStrings, length ? length : pLocalLength);
     79    cr_unpackDispatch.ShaderSource(shader, 1, ppStrings, 0);
     80
    6681    crFree(ppStrings);
    6782}
     
    250265void crUnpackExtendGetAttachedObjectsARB(void)
    251266{
    252         GLhandleARB containerObj = READ_DATA(8, GLhandleARB);
     267        VBoxGLhandleARB containerObj = READ_DATA(8, VBoxGLhandleARB);
    253268        GLsizei maxCount = READ_DATA(12, GLsizei);
    254269        SET_RETURN_PTR(16);
     
    259274void crUnpackExtendGetInfoLogARB(void)
    260275{
    261         GLhandleARB obj = READ_DATA(8, GLhandleARB);
     276        VBoxGLhandleARB obj = READ_DATA(8, VBoxGLhandleARB);
    262277        GLsizei maxLength = READ_DATA(12, GLsizei);
    263278        SET_RETURN_PTR(16);
  • trunk/src/VBox/Installer/darwin/DiskImage/DS_Store

  • trunk/src/VBox/Main/glue/tests

  • trunk/src/VBox/Main/glue/tests/Makefile

  • trunk/src/VBox/Main/include/MediumLock.h

  • trunk/src/VBox/Main/src-client/EbmlWriter.cpp

  • trunk/src/VBox/Main/src-client/EbmlWriter.h

  • trunk/src/VBox/Main/src-client/VideoRec.cpp

  • trunk/src/VBox/Main/src-client/VideoRec.h

  • trunk/src/VBox/Main/testcase/tstMouseImpl.cpp

  • trunk/src/VBox/Runtime/testcase/tstRTMemEf.cpp

  • trunk/src/libs/libxml2-2.6.31

  • trunk/src/libs/xpcom18a4

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