Changeset 26407 in vbox
- Timestamp:
- Feb 10, 2010 12:10:01 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
-
Additions/common/crOpenGL/pack/packspu_pixel.c (modified) (6 diffs)
-
Additions/common/crOpenGL/pack/packspu_special (modified) (1 diff)
-
Additions/common/crOpenGL/pack/packspu_texture.c (modified) (1 diff)
-
GuestHost/OpenGL/include/state/cr_limits.h (modified) (2 diffs)
-
GuestHost/OpenGL/state_tracker/state_buffer.c (modified) (2 diffs)
-
GuestHost/OpenGL/state_tracker/state_client.c (modified) (3 diffs)
-
HostServices/SharedOpenGL/crserver/crservice.cpp (modified) (1 diff)
-
HostServices/SharedOpenGL/crserverlib/server_simpleget.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_pixel.c
r20083 r26407 11 11 #include "packspu_proto.h" 12 12 13 static GLboolean packspu_CheckTexImageFormat(GLenum format) 14 { 15 if (format!=GL_COLOR_INDEX 16 && format!=GL_RED 17 && format!=GL_GREEN 18 && format!=GL_BLUE 19 && format!=GL_ALPHA 20 && format!=GL_RGB 21 && format!=GL_BGR 22 && format!=GL_RGBA 23 && format!=GL_BGRA 24 && format!=GL_LUMINANCE 25 && format!=GL_LUMINANCE_ALPHA 26 && format!=GL_DEPTH_COMPONENT) 27 { 28 /*crWarning("crPackCheckTexImageFormat FAILED format 0x%x isn't valid", format);*/ 29 return GL_FALSE; 30 } 31 32 return GL_TRUE; 33 } 34 35 static GLboolean packspu_CheckTexImageType(GLenum type) 36 { 37 if (type!=GL_UNSIGNED_BYTE 38 && type!=GL_BYTE 39 && type!=GL_BITMAP 40 && type!=GL_UNSIGNED_SHORT 41 && type!=GL_SHORT 42 && type!=GL_UNSIGNED_INT 43 && type!=GL_INT 44 && type!=GL_FLOAT 45 && type!=GL_UNSIGNED_BYTE_3_3_2 46 && type!=GL_UNSIGNED_BYTE_2_3_3_REV 47 && type!=GL_UNSIGNED_SHORT_5_6_5 48 && type!=GL_UNSIGNED_SHORT_5_6_5_REV 49 && type!=GL_UNSIGNED_SHORT_4_4_4_4 50 && type!=GL_UNSIGNED_SHORT_4_4_4_4_REV 51 && type!=GL_UNSIGNED_SHORT_5_5_5_1 52 && type!=GL_UNSIGNED_SHORT_1_5_5_5_REV 53 && type!=GL_UNSIGNED_INT_8_8_8_8 54 && type!=GL_UNSIGNED_INT_8_8_8_8_REV 55 && type!=GL_UNSIGNED_INT_10_10_10_2 56 && type!=GL_UNSIGNED_INT_2_10_10_10_REV) 57 { 58 /*crWarning("crPackCheckTexImageType FAILED type 0x%x isn't valid", type);*/ 59 return GL_FALSE; 60 } 61 62 return GL_TRUE; 63 } 64 65 static GLboolean packspu_CheckTexImageInternalFormat(GLint internalformat) 66 { 67 if (internalformat!=1 68 && internalformat!=2 69 && internalformat!=3 70 && internalformat!=4 71 && internalformat!=GL_ALPHA 72 && internalformat!=GL_ALPHA4 73 && internalformat!=GL_ALPHA8 74 && internalformat!=GL_ALPHA12 75 && internalformat!=GL_ALPHA16 76 && internalformat!=GL_COMPRESSED_ALPHA 77 && internalformat!=GL_COMPRESSED_LUMINANCE 78 && internalformat!=GL_COMPRESSED_LUMINANCE_ALPHA 79 && internalformat!=GL_COMPRESSED_INTENSITY 80 && internalformat!=GL_COMPRESSED_RGB 81 && internalformat!=GL_COMPRESSED_RGBA 82 && internalformat!=GL_DEPTH_COMPONENT 83 && internalformat!=GL_DEPTH_COMPONENT16 84 && internalformat!=GL_DEPTH_COMPONENT24 85 && internalformat!=GL_DEPTH_COMPONENT32 86 && internalformat!=GL_LUMINANCE 87 && internalformat!=GL_LUMINANCE4 88 && internalformat!=GL_LUMINANCE8 89 && internalformat!=GL_LUMINANCE12 90 && internalformat!=GL_LUMINANCE16 91 && internalformat!=GL_LUMINANCE_ALPHA 92 && internalformat!=GL_LUMINANCE4_ALPHA4 93 && internalformat!=GL_LUMINANCE6_ALPHA2 94 && internalformat!=GL_LUMINANCE8_ALPHA8 95 && internalformat!=GL_LUMINANCE12_ALPHA4 96 && internalformat!=GL_LUMINANCE12_ALPHA12 97 && internalformat!=GL_LUMINANCE16_ALPHA16 98 && internalformat!=GL_INTENSITY 99 && internalformat!=GL_INTENSITY4 100 && internalformat!=GL_INTENSITY8 101 && internalformat!=GL_INTENSITY12 102 && internalformat!=GL_INTENSITY16 103 && internalformat!=GL_R3_G3_B2 104 && internalformat!=GL_RGB 105 && internalformat!=GL_RGB4 106 && internalformat!=GL_RGB5 107 && internalformat!=GL_RGB8 108 && internalformat!=GL_RGB10 109 && internalformat!=GL_RGB12 110 && internalformat!=GL_RGB16 111 && internalformat!=GL_RGBA 112 && internalformat!=GL_RGBA2 113 && internalformat!=GL_RGBA4 114 && internalformat!=GL_RGB5_A1 115 && internalformat!=GL_RGBA8 116 && internalformat!=GL_RGB10_A2 117 && internalformat!=GL_RGBA12 118 && internalformat!=GL_RGBA16 119 && internalformat!=GL_SLUMINANCE 120 && internalformat!=GL_SLUMINANCE8 121 && internalformat!=GL_SLUMINANCE_ALPHA 122 && internalformat!=GL_SLUMINANCE8_ALPHA8 123 && internalformat!=GL_SRGB 124 && internalformat!=GL_SRGB8 125 && internalformat!=GL_SRGB_ALPHA 126 && internalformat!=GL_SRGB8_ALPHA8 127 #ifdef CR_EXT_texture_compression_s3tc 128 && internalformat!=GL_COMPRESSED_RGB_S3TC_DXT1_EXT 129 && internalformat!=GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 130 && internalformat!=GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 131 && internalformat!=GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 132 #endif 133 ) 134 { 135 /*crWarning("crPackCheckTexImageInternalFormat FAILED internalformat 0x%x isn't valid", internalformat);*/ 136 return GL_FALSE; 137 } 138 139 return GL_TRUE; 140 } 141 142 static GLboolean packspu_CheckTexImageParams(GLint internalformat, GLenum format, GLenum type) 143 { 144 return packspu_CheckTexImageFormat(format) 145 && packspu_CheckTexImageType(type) 146 && packspu_CheckTexImageInternalFormat(internalformat); 147 } 148 149 static GLboolean packspu_CheckTexImageFormatType(GLenum format, GLenum type) 150 { 151 return packspu_CheckTexImageFormat(format) 152 && packspu_CheckTexImageType(type); 153 } 154 13 155 void PACKSPU_APIENTRY packspu_PixelStoref( GLenum pname, GLfloat param ) 14 156 { … … 80 222 GET_CONTEXT(ctx); 81 223 CRClientState *clientState = &(ctx->clientState->client); 224 225 if (!packspu_CheckTexImageParams(internalformat, format, type)) 226 { 227 if (pixels) 228 { 229 crWarning("packspu_TexImage1D invalid internalFormat(%x)/format(%x)/type(%x)", internalformat, format, type); 230 return; 231 } 232 internalformat = packspu_CheckTexImageInternalFormat(internalformat) ? internalformat:GL_RGBA; 233 format = packspu_CheckTexImageFormat(format) ? format:GL_RGBA; 234 type = packspu_CheckTexImageType(type) ? type:GL_UNSIGNED_BYTE; 235 } 236 82 237 if (pack_spu.swap) 83 238 crPackTexImage1DSWAP( target, level, internalformat, width, border, format, type, pixels, &(clientState->unpack) ); … … 90 245 GET_CONTEXT(ctx); 91 246 CRClientState *clientState = &(ctx->clientState->client); 247 248 if (!packspu_CheckTexImageParams(internalformat, format, type)) 249 { 250 if (pixels) 251 { 252 crWarning("packspu_TexImage2D invalid internalFormat(%x)/format(%x)/type(%x)", internalformat, format, type); 253 return; 254 } 255 internalformat = packspu_CheckTexImageInternalFormat(internalformat) ? internalformat:GL_RGBA; 256 format = packspu_CheckTexImageFormat(format) ? format:GL_RGBA; 257 type = packspu_CheckTexImageType(type) ? type:GL_UNSIGNED_BYTE; 258 } 259 92 260 if (pack_spu.swap) 93 261 crPackTexImage2DSWAP( target, level, internalformat, width, height, border, format, type, pixels, &(clientState->unpack) ); … … 101 269 GET_CONTEXT(ctx); 102 270 CRClientState *clientState = &(ctx->clientState->client); 271 103 272 if (pack_spu.swap) 104 273 crPackTexImage3DEXTSWAP( target, level, internalformat, width, height, depth, border, format, type, pixels, &(clientState->unpack) ); … … 124 293 GET_CONTEXT(ctx); 125 294 CRClientState *clientState = &(ctx->clientState->client); 295 296 if (!packspu_CheckTexImageFormatType(format, type)) 297 { 298 crWarning("packspu_TexSubImage1D invalid format(%x)/type(%x)", format, type); 299 return; 300 } 301 126 302 if (pack_spu.swap) 127 303 crPackTexSubImage1DSWAP( target, level, xoffset, width, format, type, pixels, &(clientState->unpack) ); … … 134 310 GET_CONTEXT(ctx); 135 311 CRClientState *clientState = &(ctx->clientState->client); 312 313 if (!packspu_CheckTexImageFormatType(format, type)) 314 { 315 crWarning("packspu_TexSubImage2D invalid format(%x)/type(%x)", format, type); 316 return; 317 } 318 136 319 if (pack_spu.swap) 137 320 crPackTexSubImage2DSWAP( target, level, xoffset, yoffset, width, height, format, type, pixels, &(clientState->unpack) ); -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special
r26048 r26407 95 95 CheckFramebufferStatusEXT 96 96 BindTexture 97 DeleteTextures -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_texture.c
r26048 r26407 37 37 crPackBindTexture(target, texture); 38 38 } 39 40 void PACKSPU_APIENTRY packspu_DeleteTextures(GLsizei n, const GLuint * textures) 41 { 42 crStateDeleteTextures(n, textures); 43 crPackDeleteTextures(n, textures); 44 } -
trunk/src/VBox/GuestHost/OpenGL/include/state/cr_limits.h
r24783 r26407 23 23 24 24 25 #define CR_MAX_TEXTURE_UNITS 825 #define CR_MAX_TEXTURE_UNITS 16 26 26 #define CR_MAX_GENERAL_COMBINERS 8 27 27 #define CR_MAX_TEXTURE_SIZE 8192 … … 70 70 #define CR_MAX_FRAGMENT_PROGRAM_INSTRUCTIONS 72 71 71 #define CR_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMS 24 72 #define CR_MAX_FRAGMENT_PROGRAM_ENV_PARAMS 2 472 #define CR_MAX_FRAGMENT_PROGRAM_ENV_PARAMS 256 73 73 #define CR_MAX_FRAGMENT_PROGRAM_TEMPS 16 74 74 #define CR_MAX_FRAGMENT_PROGRAM_ATTRIBS 10 -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_buffer.c
r23694 r26407 492 492 if (g->framebufferobject.drawFB) 493 493 { 494 crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "glDrawBuffer inval ud mode while fbo is active");494 crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "glDrawBuffer invalid mode while fbo is active"); 495 495 return; 496 496 } … … 501 501 if (!g->framebufferobject.drawFB) 502 502 { 503 crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "glDrawBuffer inval ud mode while fbo is inactive");503 crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "glDrawBuffer invalid mode while fbo is inactive"); 504 504 return; 505 505 } -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_client.c
r25303 r26407 250 250 for (i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++) { 251 251 c->array.a[i].enabled = GL_FALSE; 252 c->array.a[i].type = 0;253 c->array.a[i].size = 0;252 c->array.a[i].type = GL_FLOAT; 253 c->array.a[i].size = 4; 254 254 c->array.a[i].stride = 0; 255 255 #ifdef CR_ARB_vertex_buffer_object … … 1798 1798 for (i = 0; (unsigned int)i < toCtx->limits.maxVertexProgramAttribs; i++) { 1799 1799 if (from->array.a[i].enabled != to->array.a[i].enabled) { 1800 able[to->array.a[i].enabled](GL_VERTEX_ATTRIB_ARRAY0_NV + i); 1800 if (to->array.a[i].enabled) 1801 diff_api.EnableVertexAttribArrayARB(i); 1802 else 1803 diff_api.DisableVertexAttribArrayARB(i); 1801 1804 from->array.a[i].enabled = to->array.a[i].enabled; 1802 1805 } … … 1982 1985 for (i = 0; (unsigned int)i < toCtx->limits.maxVertexProgramAttribs; i++) { 1983 1986 if (from->array.a[i].enabled != to->array.a[i].enabled) { 1984 able[to->array.a[i].enabled](GL_VERTEX_ATTRIB_ARRAY0_NV + i); 1987 if (to->array.a[i].enabled) 1988 diff_api.EnableVertexAttribArrayARB(i); 1989 else 1990 diff_api.DisableVertexAttribArrayARB(i); 1985 1991 FILLDIRTY(cb->enableClientState); 1986 1992 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r25216 r26407 71 71 72 72 static const char* gszVBoxOGLSSMMagic = "***OpenGL state data***"; 73 #define SHCROGL_SSM_VERSION 1 373 #define SHCROGL_SSM_VERSION 14 74 74 75 75 typedef struct -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_simpleget.py
r23274 r26407 61 61 CRASSERT(tablesize/sizeof(%s)==1); 62 62 texid = (GLuint) *get_values; 63 *get_values = (%s) (texid - cr_server.curClient->number * 100000); 63 if (texid) 64 { 65 *get_values = (%s) (texid - cr_server.curClient->number * 100000); 66 } 64 67 } 65 68 else if (GL_CURRENT_PROGRAM==pname)
Note:
See TracChangeset
for help on using the changeset viewer.

