Changeset 21308 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jul 7, 2009 10:49:52 AM (16 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/get_sizes.py
r20916 r21308 403 403 return temp->num_values; 404 404 } 405 cr Warning( "Invalid pname to __numValues: 0x%x\\n", (int) pname );405 crDebug( "Invalid pname to __numValues: 0x%x\\n", (int) pname ); 406 406 return 0; 407 407 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_simpleget.py
r21033 r21308 49 49 print '\t(void) params;' 50 50 print '\tget_values = (%s *) crAlloc( tablesize );' % types[index] 51 print '\tif (tablesize>0)' 51 52 print '\tcr_server.head_spu->dispatch_table.%s( pname, get_values );' % func_name 52 53 print """ -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py
r15532 r21308 28 28 29 29 static void crUnpackExtend(void); 30 static void crUnpackExtendDbg(void); 31 32 /*#define CR_UNPACK_DEBUG_OPCODES*/ 33 /*#define CR_UNPACK_DEBUG_LAST_OPCODES*/ 30 34 """ 31 35 32 36 nodebug_opcodes = [ 37 "CR_MULTITEXCOORD2FARB_OPCODE", 38 "CR_VERTEX3F_OPCODE", 39 "CR_NORMAL3F_OPCODE", 40 "CR_COLOR4UB_OPCODE", 41 "CR_LOADIDENTITY_OPCODE", 42 "CR_MATRIXMODE_OPCODE", 43 "CR_LOADMATRIXF_OPCODE", 44 "CR_DISABLE_OPCODE", 45 "CR_COLOR4F_OPCODE", 46 "CR_ENABLE_OPCODE", 47 "CR_BEGIN_OPCODE", 48 "CR_END_OPCODE", 49 "CR_SECONDARYCOLOR3FEXT_OPCODE" 50 ] 51 52 nodebug_extopcodes = [ 53 "CR_ACTIVETEXTUREARB_EXTEND_OPCODE" 54 ] 33 55 34 56 # … … 199 221 cr_unpackData = (const unsigned char *)data; 200 222 223 crDebug("crUnpack: %d opcodes", num_opcodes); 224 201 225 for (i = 0 ; i < num_opcodes ; i++) 202 226 { … … 211 235 if "pack" in apiutil.ChromiumProps(func_name): 212 236 print '\t\t\tcase %s:' % apiutil.OpcodeName( func_name ) 213 # print '\t\t\t\tcrDebug("Unpack: %s");' % apiutil.OpcodeName( func_name ) 237 if not apiutil.OpcodeName(func_name) in nodebug_opcodes: 238 print """ 239 #ifdef CR_UNPACK_DEBUG_LAST_OPCODES 240 if (i==(num_opcodes-1)) 241 #endif 242 #if defined(CR_UNPACK_DEBUG_OPCODES) || defined(CR_UNPACK_DEBUG_LAST_OPCODES) 243 crDebug("Unpack: %s"); 244 #endif """ % apiutil.OpcodeName(func_name) 214 245 print '\t\t\t\tcrUnpack%s(); \n\t\t\t\tbreak;' % func_name 215 246 216 247 print """ 217 case CR_EXTEND_OPCODE: crUnpackExtend(); break; 248 case CR_EXTEND_OPCODE: 249 #ifdef CR_UNPACK_DEBUG_OPCODES 250 crUnpackExtendDbg(); 251 #else 252 # ifdef CR_UNPACK_DEBUG_LAST_OPCODES 253 if (i==(num_opcodes-1)) crUnpackExtendDbg(); 254 else 255 # endif 256 crUnpackExtend(); 257 #endif 258 break; 218 259 default: 219 260 crError( "Unknown opcode: %d", *unpack_opcodes ); … … 263 304 INCR_VAR_PTR(); 264 305 }""" 306 307 print 'static void crUnpackExtendDbg(void)' 308 print '{' 309 print '\tGLenum extend_opcode = %s;' % ReadData( 4, 'GLenum' ); 310 print '' 311 print '\t/*crDebug(\"Unpacking extended opcode \%d", extend_opcode);*/' 312 print '\tswitch( extend_opcode )' 313 print '\t{' 314 315 316 # 317 # Emit switch statement for extended opcodes 318 # 319 for func_name in keys: 320 if "extpack" in apiutil.ChromiumProps(func_name): 321 print '\t\tcase %s:' % apiutil.ExtendedOpcodeName( func_name ) 322 if not apiutil.ExtendedOpcodeName(func_name) in nodebug_extopcodes: 323 print '\t\t\tcrDebug("Unpack: %s");' % apiutil.ExtendedOpcodeName( func_name ) 324 print '\t\t\tcrUnpackExtend%s( );' % func_name 325 print '\t\t\tbreak;' 326 327 print """ default: 328 crError( "Unknown extended opcode: %d", (int) extend_opcode ); 329 break; 330 } 331 INCR_VAR_PTR(); 332 }""" -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_arrays.c
r21306 r21308 117 117 void crUnpackExtendDrawElements(void) 118 118 { 119 GLenum mode = READ_DATA( 8, GLenum );120 GLsizei count = READ_DATA( 12, GLsizei );121 GLenum type = READ_DATA( 16, GLenum );119 GLenum mode = READ_DATA( 8, GLenum ); 120 GLsizei count = READ_DATA( 12, GLsizei ); 121 GLenum type = READ_DATA( 16, GLenum ); 122 122 GLintptrARB indices = READ_DATA( 20, GLintptrARB ); 123 cr_unpackDispatch.DrawElements( mode, count, type, (void *) indices); 123 void * indexptr; 124 #ifdef CR_ARB_vertex_buffer_object 125 GLboolean hasidxdata = READ_DATA(24, GLboolean); 126 indexptr = hasidxdata ? DATA_POINTER(24+sizeof(GLboolean), void) : (void*)indices; 127 #else 128 indexptr = DATA_POINTER(24, void); 129 #endif 130 /*crDebug("DrawElements: count=%i, indexptr=%p, hasidx=%p", count, indexptr, hasidxdata);*/ 131 cr_unpackDispatch.DrawElements(mode, count, type, indexptr); 124 132 } 125 133 126 134 void crUnpackExtendDrawRangeElements(void) 127 135 { 128 GLenum mode = READ_DATA( 8, GLenum );129 GLuint start = READ_DATA( 12, GLuint );130 GLuint end = READ_DATA( 16, GLuint );131 GLsizei count = READ_DATA( 20, GLsizei );132 GLenum type = READ_DATA( 24, GLenum );136 GLenum mode = READ_DATA( 8, GLenum ); 137 GLuint start = READ_DATA( 12, GLuint ); 138 GLuint end = READ_DATA( 16, GLuint ); 139 GLsizei count = READ_DATA( 20, GLsizei ); 140 GLenum type = READ_DATA( 24, GLenum ); 133 141 GLintptrARB indices = READ_DATA( 28, GLintptrARB ); 134 cr_unpackDispatch.DrawRangeElements( mode, start, end, count, type, (void *) indices); 142 void * indexptr; 143 #ifdef CR_ARB_vertex_buffer_object 144 GLboolean hasidxdata = READ_DATA(32, GLboolean); 145 indexptr = hasidxdata ? DATA_POINTER(32+sizeof(GLboolean), void) : (void*)indices; 146 #else 147 indexptr = DATA_POINTER(32, void); 148 #endif 149 cr_unpackDispatch.DrawRangeElements(mode, start, end, count, type, indexptr); 135 150 } 136 151 -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_bufferobject.c
r21306 r21308 32 32 void crUnpackExtendBufferDataARB( void ) 33 33 { 34 GLenum target = READ_DATA( sizeof(int) + 4, GLenum ); 35 GLsizeiptrARB size = READ_DATA( sizeof(int) + 8, GLsizeiptrARB ); 36 GLenum usage = READ_DATA( sizeof(int) + 12, GLenum ); 37 GLvoid *data = DATA_POINTER( sizeof(int) + 16, GLvoid ); 34 GLenum target = READ_DATA(sizeof(int) + 4, GLenum); 35 GLsizeiptrARB size = READ_DATA(sizeof(int) + 8, GLsizeiptrARB); 36 GLenum usage = READ_DATA(sizeof(int) + 12, GLenum); 37 GLboolean hasdata = READ_DATA(sizeof(int) + 16, GLboolean); 38 GLvoid *data = DATA_POINTER(sizeof(int) + 16 + sizeof(GLboolean), GLvoid); 38 39 39 40 CRASSERT(sizeof(GLsizeiptrARB) == 4); 40 CRASSERT(usage == GL_STATIC_DRAW_ARB); 41 /*@todo, why?*/ 42 /*CRASSERT(usage == GL_STATIC_DRAW_ARB);*/ 41 43 42 cr_unpackDispatch.BufferDataARB( target, size, data, usage);44 cr_unpackDispatch.BufferDataARB(target, size, hasdata ? data:NULL, usage); 43 45 } 44 46 -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpacker.h
r15532 r21308 13 13 #define DLLDATA(type) DECLEXPORT(type) 14 14 15 #include "cr_version.h" 15 16 #include "cr_unpack.h" 16 17 #include "unpack_extend.h"
Note:
See TracChangeset
for help on using the changeset viewer.