/shark/trunk/ports/mesa/src/trace/tr_error.c |
---|
0,0 → 1,40 |
#ifdef MESA_TRACE |
#include "tr_context.h" |
#include "tr_error.h" |
#include "tr_write.h" |
/* Have a Begin/End flag, skip checks if in-between. */ |
/** |
* Some GL implementations cache errors internally, |
* thus we have to loop until we do not get |
* any errors. |
*/ |
void trError( void ) { |
int sanity = 0; /* Bail out on endless loops. */ |
GLenum err; |
if( !(trCtx()->check_errors) ) |
return; |
while ( (err=trGetDispatch()->GetError())!=GL_NO_ERROR ) { |
trWriteEnum(err); |
sanity++; |
if (sanity > TR_MAX_QUEUED_ERRORS ) { |
/* Too many errors */ |
return; |
} |
} |
} |
#else |
extern void tr_error_dummy_func(void); |
void tr_error_dummy_func(void) |
{ |
} |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_context.h |
---|
0,0 → 1,80 |
#ifndef TR_CONTEXT_H |
#define TR_CONTEXT_H |
#include "glheader.h" |
#include "glapitable.h" |
#define TR_MAX_QUEUED_ERRORS 8 |
/** |
* State Variables. |
* To make this thread-safe we'd maintain such |
* a set per thread/context. |
*/ |
typedef struct t_t{ |
GLboolean traceEnabled; |
/* The current log file pointer. */ |
FILE * logFP; |
char * traceName; |
/* What frame we're currently on. */ |
GLint framecounter; |
/* Not yet used. This field will control which attributes should be logged. */ |
GLbitfield traceAttribLogBits; |
GLbitfield traceEnableLogBits; |
/* Used to short-circuit writing to the file, if the disk is full */ |
GLboolean trDoPrint; |
/* Used to toggle whether the gl command should |
* actually be executed. For now this will always be true. |
*/ |
GLboolean doExec; |
/* Verify GL_NO_ERROR wherever possible. */ |
GLboolean check_errors; |
/* Loop over all GL errors. |
* TODO: We have to make sure the application gets |
* the exact same errors despite our checking. |
* That basically means we have to queue all |
* errors from our internal checks. |
*/ |
GLint head_errors; |
GLint tail_errors; |
GLenum cached_errors[TR_MAX_QUEUED_ERRORS]; |
/* Not yet used. The 1st of many state flags used to |
* track the current state of the GL state machine. |
*/ |
GLboolean betweenBeginEnd; |
#if 0 |
GLboolean doAsserts; |
GLboolean clientStateValid; |
#endif |
} trace_context_t; |
extern void trInitContext( trace_context_t * tr_context ); |
extern trace_context_t* trCtx( void ); |
extern struct _glapi_table* trGetDispatch( void ); |
extern void trSetTraceDispatch( void ); |
extern void trSetOriginalDispatch( void ); |
extern GLboolean trDoErrorCheck( void ); |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_write.c |
---|
0,0 → 1,238 |
#ifdef MESA_TRACE |
#include "glheader.h" |
#include <time.h> /* XXX move into glheader.h */ |
#include "tr_write.h" |
#include "tr_context.h" |
#define PATH_MAX 4098 |
static void trWriteFile( const void * buf, GLint recsize, GLint numrecs, const char * funcname ) { |
GLint recswritten; |
if( !(trCtx()->trDoPrint) ) { |
return; |
} |
recswritten = fwrite( buf, recsize, numrecs, trCtx()->logFP ); |
if( recswritten != numrecs ) { |
fprintf( stderr, "Error writing to file in %s\n", funcname ); |
fprintf( stderr, "Perhaps the disk is full?\n" ); |
/* Should we abort ? */ |
trCtx()->trDoPrint = GL_FALSE; |
} |
} |
static void (*trWrite)( const void *, GLint, GLint, const char *) = trWriteFile; |
void trWriteCMD( GLint cmd ) { |
trWrite( (void*)&cmd, sizeof(GLint), 1, "trWriteCMD" ); |
} |
void trWriteb( GLbyte b ) { |
trWrite( (void*)&b, sizeof(GLbyte), 1, "trWriteb" ); |
} |
void trWrited( GLdouble d ) { |
trWrite( (void*)&d, sizeof(GLdouble), 1, "trWrited" ); |
} |
void trWriteClampd( GLclampd cd ) { |
trWrite( (void*)&cd, sizeof(GLclampd), 1, "trWriteClampd" ); |
} |
void trWritef( GLfloat f ) { |
trWrite( (void*)&f, sizeof(GLfloat), 1, "trWritef" ); |
} |
void trWriteClampf( GLclampf cf ) { |
trWrite( (void*)&cf, sizeof(GLclampf), 1, "trWriteClampf" ); |
} |
void trWritei( GLint i ) { |
trWrite( (void*)&i, sizeof(GLint), 1, "trWritei" ); |
} |
void trWrites( GLshort s ) { |
trWrite( (void*)&s, sizeof(GLshort), 1, "trWrites" ); |
} |
void trWriteub( GLubyte ub ) { |
trWrite( (void*)&ub, sizeof(GLubyte), 1, "trWriteub" ); |
} |
void trWriteui( GLuint ui ) { |
trWrite( (void*)&ui, sizeof(GLuint), 1, "trWriteui" ); |
} |
void trWriteus( GLushort us ) { |
trWrite( (void*)&us, sizeof(GLushort), 1, "trWriteus" ); |
} |
void trWriteBool( GLboolean b ) { |
trWrite( (void*)&b, sizeof(GLboolean), 1, "trWriteBool" ); |
} |
void trWriteBits( GLbitfield bf ) { |
trWrite( (void*)&bf, sizeof(GLbitfield), 1, "trWriteBits" ); |
} |
void trWriteEnum( GLenum en ) { |
trWrite( (void*)&en, sizeof(GLenum), 1, "trWriteEnum" ); |
} |
void trWriteSizei( GLsizei si ) { |
trWrite( (void*)&si, sizeof(GLsizei), 1, "trWriteSizei" ); |
} |
void trWritePointer( const void * p ) { |
trWrite( (void*)&p, sizeof(void *), 1, "trWritePointer" ); |
} |
void trWriteArrayb( GLsizei n, const GLbyte * b ) { |
trWrite( (void *)b, sizeof(GLbyte), n, "trWriteArrayb" ); |
} |
void trWriteArrayub( GLsizei n, const GLubyte * ub ) { |
trWrite( (void *)ub, sizeof(GLubyte), n, "trWriteArrayub" ); |
} |
void trWriteArrays( GLsizei n, const GLshort * s ) { |
trWrite( (void *)s, sizeof(GLshort), n, "trWriteArrays" ); |
} |
void trWriteArrayus( GLsizei n, const GLushort * us ) { |
trWrite( (void *)us, sizeof(GLushort), n, "trWriteArrayus" ); |
} |
void trWriteArrayi( GLsizei n, const GLint * i ) { |
trWrite( (void *)i, sizeof(GLint), n, "trWriteArrayi" ); |
} |
void trWriteArrayui( GLsizei n, const GLuint * ui ) { |
trWrite( (void *)ui, sizeof(GLuint), n, "trWriteArrayui" ); |
} |
void trWriteArrayBool( GLsizei n, const GLboolean * b ) { |
trWrite( (void *)b, sizeof(GLboolean), n, "trWriteArrayBool" ); |
} |
void trWriteArrayf( GLsizei n, const GLfloat * f ) { |
trWrite( (void *)f, sizeof(GLfloat), n, "trWriteArrayf" ); |
} |
void trWriteArrayd( GLsizei n, const GLdouble * d ) { |
trWrite( (void *)d, sizeof(GLdouble), n, "trWriteArrayd" ); |
} |
void trWriteString( const char * str ) { |
GLuint length = strlen(str); |
trWriteui( length ); |
trWrite( (void *)str, sizeof(GLubyte), length, "trWriteString" ); |
} |
void trFileFlush( void ) { |
fflush( trCtx()->logFP ); |
} |
static void trWriteTypeInformation( void ) { |
trWriteub( sizeof(GLint) ); |
trWriteub( sizeof(GLshort) ); |
trWriteub( sizeof(GLfloat) ); |
trWriteub( sizeof(GLdouble) ); |
trWriteub( sizeof(GLboolean) ); |
trWriteub( sizeof(GLenum) ); |
trWriteub( sizeof(GLsizei) ); |
trWriteub( sizeof(GLbitfield) ); |
trWriteub( sizeof(GLclampf) ); |
trWriteub( sizeof(GLclampd) ); |
trWriteub( sizeof(GLvoid *) ); |
} |
static void trWriteHeader( void ) { |
struct tm *newtime; |
time_t aclock; |
char timestring[256]; |
trWriteString( "0.0.1" ); |
trWriteString( trCtx()->traceName ); |
trWritei( trCtx()->framecounter ); |
/* Always print this! */ |
time( &aclock ); |
newtime = localtime( &aclock ); |
asctime( newtime ); |
snprintf( timestring, sizeof(timestring), "Time: %s", asctime( newtime ) ); |
trWriteString( timestring ); |
} |
static void trWriteGLState( void ) { |
/* |
* This function will write all the queryable GL state at |
* the time the trace is started. |
*/ |
} |
void trOpenLogFile( void ) { |
GLint numchars; |
char buffer[PATH_MAX]; |
numchars = snprintf( buffer, sizeof(buffer), "%s-gl.log.%d", |
trCtx()->traceName, trCtx()->framecounter ); |
if( numchars > -1 && numchars < sizeof(buffer) ) { |
trCtx()->logFP = fopen( buffer, "wb" ); |
/* This information is needed before we can extract _anything_ */ |
trWriteTypeInformation(); |
trWriteHeader(); |
trWriteGLState(); |
(trCtx()->framecounter)++; |
} else if( numchars > -1 ) { |
fprintf( stderr, "buffer needs to be %d bytes long for logging to work.\n", |
numchars + 1 ); |
exit( -1 ); |
} else { |
fprintf( stderr, "buffer needs to grow for logging to work. Try %d bytes.\n", |
sizeof(buffer) * 2 ); |
exit( -1 ); |
} |
} |
void trCloseLogFile( void ) { |
if( trCtx()->logFP != NULL ) { |
fclose(trCtx()->logFP); |
} |
trCtx()->logFP = NULL; |
} |
#else |
extern void tr_write_dummy_func(void); |
void tr_write_dummy_func(void) |
{ |
} |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_support.c |
---|
0,0 → 1,584 |
#ifdef MESA_TRACE |
#include "GL/gl.h" |
#include "tr_context.h" |
#include "tr_support.h" |
#include "tr_write.h" |
#if 0 |
static void trQueryConvolutionState( void ) { |
if( trCtx()->trConvolutionWidth == -1 ) { |
/* Query it */ |
trWriteCMD( VAR_OOBBEGIN ); |
trGetDispatch()->GetConvolutionParameteriv( GL_SEPARABLE_2D, GL_CONVOLUTION_WIDTH, |
&(trCtx()->trConvolutionWidth) ); |
trWriteCMD( VAR_OOBEND ); |
} |
if( trCtx()->trConvolutionHeight == -1 ) { |
/* Query it */ |
trWriteCMD( VAR_OOBBEGIN ); |
trGetDispatch()->GetConvolutionParameteriv( GL_SEPARABLE_2D, GL_CONVOLUTION_HEIGHT, |
&(trCtx()->trConvolutionHeight) ); |
trWriteCMD( VAR_OOBEND ); |
} |
} |
#endif |
void trZeroGetterData( GLenum pname, GLsizei typesize, GLvoid * params ) { |
switch( pname ) { |
case GL_COLOR_MATRIX: |
case GL_MODELVIEW_MATRIX: |
case GL_PROJECTION_MATRIX: |
case GL_TEXTURE_MATRIX: |
memset( params, 0, typesize * 16 ); |
break; |
case GL_ACCUM_CLEAR_VALUE: |
case GL_BLEND_COLOR: |
case GL_COLOR_CLEAR_VALUE: |
case GL_COLOR_WRITEMASK: |
case GL_CURRENT_COLOR: |
case GL_CURRENT_RASTER_COLOR: |
case GL_CURRENT_RASTER_POSITION: |
case GL_CURRENT_RASTER_TEXTURE_COORDS: |
case GL_CURRENT_TEXTURE_COORDS: |
case GL_LIGHT_MODEL_AMBIENT: |
case GL_MAP2_GRID_DOMAIN: |
case GL_SCISSOR_BOX: |
case GL_VIEWPORT: |
memset( params, 0, typesize * 4 ); |
break; |
case GL_CURRENT_NORMAL: |
memset( params, 0, typesize * 3 ); |
break; |
case GL_ALIASED_POINT_SIZE_RANGE: |
case GL_ALIASED_LINE_WIDTH_RANGE: |
case GL_DEPTH_RANGE: |
case GL_MAP1_GRID_DOMAIN: |
case GL_MAP2_GRID_SEGMENTS: |
case GL_MAX_VIEWPORT_DIMS: |
case GL_POLYGON_MODE: |
case GL_SMOOTH_LINE_WIDTH_RANGE: |
case GL_SMOOTH_POINT_SIZE_RANGE: |
memset( params, 0, typesize * 2 ); |
break; |
case GL_ACCUM_ALPHA_BITS: |
case GL_ACCUM_BLUE_BITS: |
case GL_ACCUM_GREEN_BITS: |
case GL_ACCUM_RED_BITS: |
case GL_ACTIVE_TEXTURE_ARB: |
case GL_ALPHA_BIAS: |
case GL_ALPHA_BITS: |
case GL_ALPHA_SCALE: |
case GL_ALPHA_TEST: |
case GL_ALPHA_TEST_FUNC: |
case GL_ALPHA_TEST_REF: |
case GL_ATTRIB_STACK_DEPTH: |
case GL_AUTO_NORMAL: |
case GL_AUX_BUFFERS: |
case GL_BLEND: |
case GL_BLEND_SRC: |
case GL_BLUE_BIAS: |
case GL_BLUE_BITS: |
case GL_BLUE_SCALE: |
case GL_CLIENT_ACTIVE_TEXTURE_ARB: |
case GL_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_CLIP_PLANE0: |
case GL_CLIP_PLANE1: |
case GL_CLIP_PLANE2: |
case GL_CLIP_PLANE3: |
case GL_CLIP_PLANE4: |
case GL_CLIP_PLANE5: |
case GL_COLOR_ARRAY: |
case GL_COLOR_ARRAY_SIZE: |
case GL_COLOR_ARRAY_STRIDE: |
case GL_COLOR_ARRAY_TYPE: |
case GL_COLOR_LOGIC_OP: |
case GL_COLOR_MATERIAL: |
case GL_COLOR_MATERIAL_FACE: |
case GL_COLOR_MATERIAL_PARAMETER: |
case GL_COLOR_MATRIX_STACK_DEPTH: |
case GL_COLOR_TABLE: |
case GL_CONVOLUTION_1D: |
case GL_CONVOLUTION_2D: |
case GL_CULL_FACE: |
case GL_CULL_FACE_MODE: |
case GL_CURRENT_INDEX: |
case GL_CURRENT_RASTER_DISTANCE: |
case GL_CURRENT_RASTER_INDEX: |
case GL_CURRENT_RASTER_POSITION_VALID: |
case GL_DEPTH_BIAS: |
case GL_DEPTH_CLEAR_VALUE: |
case GL_DEPTH_FUNC: |
case GL_DEPTH_SCALE: |
case GL_DEPTH_TEST: |
case GL_DEPTH_WRITEMASK: |
case GL_DITHER: |
case GL_DOUBLEBUFFER: |
case GL_DRAW_BUFFER: |
case GL_EDGE_FLAG: |
case GL_EDGE_FLAG_ARRAY: |
case GL_EDGE_FLAG_ARRAY_STRIDE: |
case GL_FEEDBACK_BUFFER_SIZE: |
case GL_FEEDBACK_BUFFER_TYPE: |
case GL_FOG: |
case GL_FOG_DENSITY: |
case GL_FOG_END: |
case GL_FOG_HINT: |
case GL_FOG_INDEX: |
case GL_FOG_MODE: |
case GL_FOG_START: |
case GL_FRONT_FACE: |
case GL_GREEN_BIAS: |
case GL_GREEN_BITS: |
case GL_GREEN_SCALE: |
case GL_HISTOGRAM: |
case GL_INDEX_ARRAY: |
case GL_INDEX_ARRAY_STRIDE: |
case GL_INDEX_ARRAY_TYPE: |
case GL_INDEX_BITS: |
case GL_INDEX_CLEAR_VALUE: |
case GL_INDEX_LOGIC_OP: |
case GL_INDEX_MODE: |
case GL_INDEX_OFFSET: |
case GL_INDEX_SHIFT: |
case GL_INDEX_WRITEMASK: |
case GL_LIGHT0: |
case GL_LIGHT1: |
case GL_LIGHT2: |
case GL_LIGHT3: |
case GL_LIGHT4: |
case GL_LIGHT5: |
case GL_LIGHT6: |
case GL_LIGHT7: |
case GL_LIGHTING: |
case GL_LIGHT_MODEL_COLOR_CONTROL: |
case GL_LIGHT_MODEL_LOCAL_VIEWER: |
case GL_LIGHT_MODEL_TWO_SIDE: |
case GL_LINE_SMOOTH: |
case GL_LINE_SMOOTH_HINT: |
case GL_LINE_STIPPLE: |
case GL_LINE_STIPPLE_PATTERN: |
case GL_LINE_STIPPLE_REPEAT: |
case GL_LINE_WIDTH: |
case GL_LIST_BASE: |
case GL_LIST_INDEX: |
case GL_LIST_MODE: |
case GL_LOGIC_OP_MODE: |
case GL_MAP1_COLOR_4: |
case GL_MAP1_GRID_SEGMENTS: |
case GL_MAP1_INDEX: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_1: |
case GL_MAP1_TEXTURE_COORD_2: |
case GL_MAP1_TEXTURE_COORD_3: |
case GL_MAP1_TEXTURE_COORD_4: |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_VERTEX_4: |
case GL_MAP2_COLOR_4: |
case GL_MAP2_INDEX: |
case GL_MAP2_NORMAL: |
case GL_MAP2_TEXTURE_COORD_1: |
case GL_MAP2_TEXTURE_COORD_2: |
case GL_MAP2_TEXTURE_COORD_3: |
case GL_MAP2_TEXTURE_COORD_4: |
case GL_MAP2_VERTEX_3: |
case GL_MAP2_VERTEX_4: |
case GL_MAP_COLOR: |
case GL_MAP_STENCIL: |
case GL_MATRIX_MODE: |
case GL_MAX_3D_TEXTURE_SIZE: |
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_MAX_ATTRIB_STACK_DEPTH: |
case GL_MAX_CLIP_PLANES: |
case GL_MAX_COLOR_MATRIX_STACK_DEPTH: |
case GL_MAX_ELEMENTS_VERTICES: |
case GL_MAX_EVAL_ORDER: |
case GL_MAX_LIGHTS: |
case GL_MAX_LIST_NESTING: |
case GL_MAX_MODELVIEW_STACK_DEPTH: |
case GL_MAX_NAME_STACK_DEPTH: |
case GL_MAX_PIXEL_MAP_TABLE: |
case GL_MAX_PROJECTION_STACK_DEPTH: |
case GL_MAX_TEXTURE_SIZE: |
case GL_MAX_TEXTURE_STACK_DEPTH: |
case GL_MAX_TEXTURE_UNITS_ARB: |
case GL_MINMAX: |
case GL_MODELVIEW_STACK_DEPTH: |
case GL_NAME_STACK_DEPTH: |
case GL_NORMAL_ARRAY: |
case GL_NORMAL_ARRAY_STRIDE: |
case GL_NORMAL_ARRAY_TYPE: |
case GL_NORMALIZE: |
case GL_PACK_ALIGNMENT: |
case GL_PACK_IMAGE_HEIGHT: |
case GL_PACK_LSB_FIRST: |
case GL_PACK_ROW_LENGTH: |
case GL_PACK_SKIP_IMAGES: |
case GL_PACK_SKIP_PIXELS: |
case GL_PACK_SKIP_ROWS: |
case GL_PACK_SWAP_BYTES: |
case GL_PERSPECTIVE_CORRECTION_HINT: |
case GL_PIXEL_MAP_A_TO_A_SIZE: |
case GL_PIXEL_MAP_B_TO_B_SIZE: |
case GL_PIXEL_MAP_G_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_A_SIZE: |
case GL_PIXEL_MAP_I_TO_B_SIZE: |
case GL_PIXEL_MAP_I_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_I_SIZE: |
case GL_PIXEL_MAP_I_TO_R_SIZE: |
case GL_PIXEL_MAP_R_TO_R_SIZE: |
case GL_PIXEL_MAP_S_TO_S_SIZE: |
case GL_POINT_SIZE: |
case GL_POINT_SMOOTH: |
case GL_POINT_SMOOTH_HINT: |
case GL_POLYGON_OFFSET_FACTOR: |
case GL_POLYGON_OFFSET_UNITS: |
case GL_POLYGON_OFFSET_FILL: |
case GL_POLYGON_OFFSET_LINE: |
case GL_POLYGON_OFFSET_POINT: |
case GL_POLYGON_SMOOTH: |
case GL_POLYGON_SMOOTH_HINT: |
case GL_POLYGON_STIPPLE: |
case GL_POST_COLOR_MATRIX_COLOR_TABLE: |
case GL_POST_COLOR_MATRIX_RED_BIAS: |
case GL_POST_COLOR_MATRIX_GREEN_BIAS: |
case GL_POST_COLOR_MATRIX_BLUE_BIAS: |
case GL_POST_COLOR_MATRIX_ALPHA_BIAS: |
case GL_POST_COLOR_MATRIX_RED_SCALE: |
case GL_POST_COLOR_MATRIX_GREEN_SCALE: |
case GL_POST_COLOR_MATRIX_BLUE_SCALE: |
case GL_POST_COLOR_MATRIX_ALPHA_SCALE: |
case GL_POST_CONVOLUTION_COLOR_TABLE: |
case GL_POST_CONVOLUTION_RED_BIAS: |
case GL_POST_CONVOLUTION_GREEN_BIAS: |
case GL_POST_CONVOLUTION_BLUE_BIAS: |
case GL_POST_CONVOLUTION_ALPHA_BIAS: |
case GL_POST_CONVOLUTION_RED_SCALE: |
case GL_POST_CONVOLUTION_GREEN_SCALE: |
case GL_POST_CONVOLUTION_BLUE_SCALE: |
case GL_POST_CONVOLUTION_ALPHA_SCALE: |
case GL_PROJECTION_STACK_DEPTH: |
case GL_READ_BUFFER: |
case GL_RED_BIAS: |
case GL_RED_BITS: |
case GL_RED_SCALE: |
case GL_RENDER_MODE: |
case GL_RESCALE_NORMAL: |
case GL_RGBA_MODE: |
case GL_SCISSOR_TEST: |
case GL_SELECTION_BUFFER_SIZE: |
case GL_SEPARABLE_2D: |
case GL_SHADE_MODEL: |
case GL_SMOOTH_LINE_WIDTH_GRANULARITY: |
case GL_SMOOTH_POINT_SIZE_GRANULARITY: |
case GL_STENCIL_BITS: |
case GL_STENCIL_CLEAR_VALUE: |
case GL_STENCIL_FAIL: |
case GL_STENCIL_FUNC: |
case GL_STENCIL_PASS_DEPTH_FAIL: |
case GL_STENCIL_PASS_DEPTH_PASS: |
case GL_STENCIL_REF: |
case GL_STENCIL_TEST: |
case GL_STENCIL_VALUE_MASK: |
case GL_STENCIL_WRITEMASK: |
case GL_STEREO: |
case GL_SUBPIXEL_BITS: |
case GL_TEXTURE_1D: |
case GL_TEXTURE_BINDING_1D: |
case GL_TEXTURE_2D: |
case GL_TEXTURE_BINDING_2D: |
case GL_TEXTURE_3D: |
case GL_TEXTURE_BINDING_3D: |
case GL_TEXTURE_COORD_ARRAY: |
case GL_TEXTURE_COORD_ARRAY_SIZE: |
case GL_TEXTURE_COORD_ARRAY_STRIDE: |
case GL_TEXTURE_COORD_ARRAY_TYPE: |
case GL_TEXTURE_GEN_Q: |
case GL_TEXTURE_GEN_R: |
case GL_TEXTURE_GEN_S: |
case GL_TEXTURE_GEN_T: |
case GL_TEXTURE_STACK_DEPTH: |
case GL_UNPACK_ALIGNMENT: |
case GL_UNPACK_IMAGE_HEIGHT: |
case GL_UNPACK_LSB_FIRST: |
case GL_UNPACK_ROW_LENGTH: |
case GL_UNPACK_SKIP_IMAGES: |
case GL_UNPACK_SKIP_PIXELS: |
case GL_UNPACK_SKIP_ROWS: |
case GL_UNPACK_SWAP_BYTES: |
case GL_VERTEX_ARRAY: |
case GL_VERTEX_ARRAY_SIZE: |
case GL_VERTEX_ARRAY_STRIDE: |
case GL_VERTEX_ARRAY_TYPE: |
case GL_ZOOM_X: |
case GL_ZOOM_Y: |
memset( params, 0, typesize ); |
break; |
default: |
/* Bad enum. What should we do? */ |
break; |
} |
} |
void trPrintColorTableData( GLenum pname, GLenum type, GLvoid * params ) { |
if( !(trCtx()->doExec) ) { |
switch( pname ) { |
case GL_COLOR_TABLE_SCALE: |
case GL_COLOR_TABLE_BIAS: |
if( type == GL_FLOAT ) { |
memset( params, 0, 4 * sizeof(GLfloat) ); |
} else { |
memset( params, 0, 4 * sizeof(GLint) ); |
} |
break; |
case GL_COLOR_TABLE_FORMAT: |
case GL_COLOR_TABLE_WIDTH: |
case GL_COLOR_TABLE_RED_SIZE: |
case GL_COLOR_TABLE_GREEN_SIZE: |
case GL_COLOR_TABLE_BLUE_SIZE: |
case GL_COLOR_TABLE_ALPHA_SIZE: |
case GL_COLOR_TABLE_LUMINANCE_SIZE: |
case GL_COLOR_TABLE_INTENSITY_SIZE: |
if( type == GL_FLOAT ) { |
((GLfloat *)params)[0] = 0.0; |
} else { |
((GLint *)params)[0] = 0; |
} |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
switch( pname ) { |
case GL_COLOR_TABLE_SCALE: |
case GL_COLOR_TABLE_BIAS: |
if( type == GL_FLOAT ) { |
trWriteArrayf( 4, (GLfloat *)params ); |
} else { |
trWriteArrayi( 4, (GLint *)params ); |
} |
break; |
case GL_COLOR_TABLE_FORMAT: |
case GL_COLOR_TABLE_WIDTH: |
case GL_COLOR_TABLE_RED_SIZE: |
case GL_COLOR_TABLE_GREEN_SIZE: |
case GL_COLOR_TABLE_BLUE_SIZE: |
case GL_COLOR_TABLE_ALPHA_SIZE: |
case GL_COLOR_TABLE_LUMINANCE_SIZE: |
case GL_COLOR_TABLE_INTENSITY_SIZE: |
if( type == GL_FLOAT ) { |
trWritef( ((GLfloat *)params)[0] ); |
} else { |
trWritei( ((GLint *)params)[0] ); |
} |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
void trWriteTypeArray( GLenum type, GLsizei width, GLsizei pixelsize, GLint start, const GLvoid * ptr ) { |
switch( type ) { |
case GL_BYTE: |
{ |
GLbyte * p = (GLbyte *)ptr + start * pixelsize; |
trWriteArrayb( width * pixelsize, p ); |
} |
break; |
case GL_UNSIGNED_BYTE: |
case GL_UNSIGNED_BYTE_3_3_2: |
case GL_UNSIGNED_BYTE_2_3_3_REV: |
{ |
GLubyte * p = (GLubyte *)ptr + start * pixelsize; |
trWriteArrayub( width * pixelsize, p ); |
} |
break; |
case GL_SHORT: |
{ |
GLshort * p = (GLshort *)ptr + start * pixelsize; |
trWriteArrays( width * pixelsize, p ); |
} |
break; |
case GL_UNSIGNED_SHORT: |
case GL_UNSIGNED_SHORT_5_6_5: |
case GL_UNSIGNED_SHORT_5_6_5_REV: |
case GL_UNSIGNED_SHORT_4_4_4_4: |
case GL_UNSIGNED_SHORT_4_4_4_4_REV: |
case GL_UNSIGNED_SHORT_5_5_5_1: |
case GL_UNSIGNED_SHORT_1_5_5_5_REV: |
{ |
GLushort * p = (GLushort *)ptr + start * pixelsize; |
trWriteArrayus( width * pixelsize, p ); |
} |
break; |
case GL_INT: |
{ |
GLint * p = (GLint *)ptr + start * pixelsize; |
trWriteArrayi( width * pixelsize, p ); |
} |
break; |
case GL_UNSIGNED_INT: |
case GL_UNSIGNED_INT_8_8_8_8: |
case GL_UNSIGNED_INT_8_8_8_8_REV: |
case GL_UNSIGNED_INT_10_10_10_2: |
case GL_UNSIGNED_INT_2_10_10_10_REV: |
{ |
GLuint * p = (GLuint *)ptr + start * pixelsize; |
trWriteArrayui( width * pixelsize, p ); |
} |
break; |
case GL_FLOAT: |
{ |
GLfloat * p = (GLfloat *)ptr + start * pixelsize; |
trWriteArrayf( width * pixelsize, p ); |
} |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
} |
static GLint trGetFormatSize( GLenum format ) { |
GLint pixelsize; |
switch( format ) { |
case GL_RED: |
case GL_GREEN: |
case GL_BLUE: |
case GL_ALPHA: |
case GL_LUMINANCE: |
case GL_INTENSITY: |
case GL_COLOR_INDEX: |
case GL_STENCIL_INDEX: |
case GL_DEPTH_COMPONENT: |
pixelsize = 1; |
break; |
case GL_LUMINANCE_ALPHA: |
pixelsize = 2; |
break; |
case GL_RGB: |
case GL_BGR: |
pixelsize = 3; |
break; |
case GL_RGBA: |
case GL_BGRA: |
pixelsize = 4; |
break; |
default: |
/* The 2nd pass should catch this. */ |
pixelsize = 0; |
break; |
} |
return pixelsize; |
} |
GLint trGetPixelSize( GLenum format, GLenum type ) { |
GLint retval; |
GLint formatsize = trGetFormatSize( format ); |
switch( type ) { |
case GL_BYTE: |
case GL_UNSIGNED_BYTE: |
retval = formatsize * sizeof(GLubyte); |
break; |
case GL_UNSIGNED_BYTE_3_3_2: |
case GL_UNSIGNED_BYTE_2_3_3_REV: |
if( (type == GL_RGB) || (type == GL_BGR) ) { |
retval = sizeof(GLubyte); |
} else { |
retval = -1; |
} |
break; |
case GL_SHORT: |
case GL_UNSIGNED_SHORT: |
retval = sizeof(GLushort); |
break; |
case GL_UNSIGNED_SHORT_5_6_5: |
case GL_UNSIGNED_SHORT_5_6_5_REV: |
if( (type == GL_RGB) || (type == GL_BGR) ) { |
retval = sizeof(GLushort); |
} else { |
retval = -1; |
} |
break; |
case GL_UNSIGNED_SHORT_4_4_4_4: |
case GL_UNSIGNED_SHORT_4_4_4_4_REV: |
case GL_UNSIGNED_SHORT_5_5_5_1: |
case GL_UNSIGNED_SHORT_1_5_5_5_REV: |
if( (type == GL_RGBA) || (type == GL_BGRA) ) { |
retval = sizeof(GLushort); |
} else { |
retval = -1; |
} |
break; |
case GL_INT: |
case GL_UNSIGNED_INT: |
retval = sizeof(GLuint); |
break; |
case GL_UNSIGNED_INT_8_8_8_8: |
case GL_UNSIGNED_INT_8_8_8_8_REV: |
case GL_UNSIGNED_INT_10_10_10_2: |
case GL_UNSIGNED_INT_2_10_10_10_REV: |
if( (type == GL_RGBA) || (type == GL_BGRA) ) { |
retval = sizeof(GLuint); |
} else { |
retval = -1; |
} |
break; |
case GL_FLOAT: |
retval = sizeof(GLfloat); |
break; |
default: |
retval = -1; |
break; |
} |
return retval; |
} |
#else |
extern void tr_support_dummy_func(void); |
void tr_support_dummy_func(void) |
{ |
} |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_error.h |
---|
0,0 → 1,7 |
#ifndef TR_ERROR_H |
#define TR_ERROR_H |
extern void trError( void ); |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_write.h |
---|
0,0 → 1,68 |
/* This may look like C code, but it is really -*- C++ -*- */ |
/* $Id: tr_write.h,v 1.1 2003-02-28 11:54:36 pj Exp $ */ |
/* |
* DebugGL |
* Version: 1.0 |
* |
* Copyright (C) 1999-2000 Loki Entertainment |
* All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
*/ |
#ifndef __TR_WRITE_H |
#define __TR_WRITE_H |
#include "GL/gl.h" |
void trWriteCMD( GLint opcode ); |
void trWriteb( GLbyte byte ); |
void trWriteub( GLubyte ub ); |
void trWrited( GLdouble d ); |
void trWritef( GLfloat f ); |
void trWritei( GLint i ); |
void trWriteui( GLuint ui ); |
void trWrites( GLshort s ); |
void trWriteus( GLushort us ); |
void trWriteBool( GLboolean b ); |
void trWriteBits( GLbitfield bf ); |
void trWriteEnum( GLenum en ); |
void trWriteSizei( GLsizei si ); |
void trWriteClampf( GLclampf cf ); |
void trWriteClampd( GLclampd cd ); |
void trWritePointer( const void * p ); |
void trWriteArrayb( GLsizei n, const GLbyte * b ); |
void trWriteArrayub( GLsizei n, const GLubyte * ub ); |
void trWriteArrays( GLsizei n, const GLshort * s ); |
void trWriteArrayus( GLsizei n, const GLushort * us ); |
void trWriteArrayi( GLsizei n, const GLint * i ); |
void trWriteArrayui( GLsizei n, const GLuint * ui ); |
void trWriteArrayBool( GLsizei n, const GLboolean * b ); |
void trWriteArrayf( GLsizei n, const GLfloat * f ); |
void trWriteArrayd( GLsizei n, const GLdouble * d ); |
void trWriteString( const char * str ); |
void trFileFlush( void ); |
void trOpenLogFile( void ); |
void trCloseLogFile( void ); |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_wrapper.c |
---|
0,0 → 1,9311 |
#ifdef MESA_TRACE |
#include "glheader.h" |
#include "glapitable.h" |
#include "tr_write.h" |
#include "tr_error.h" |
#include "tr_context.h" |
#include "tr_commands.h" |
#include "tr_support.h" |
#include "tr_wrapper.h" |
#ifdef GLAPI |
#undef GLAPI |
#endif |
#define GLAPI static |
#ifdef GLAPIENTRY |
#undef GLAPIENTRY |
#endif |
#define GLAPIENTRY |
GLAPI void GLAPIENTRY trAccum( GLenum op, GLfloat value ) { |
trWriteCMD( CMD_ACCUM ); |
trWriteEnum( op ); |
trWritef( value ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Accum( op, value ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trActiveTextureARB( GLenum texture) { |
trWriteCMD( CMD_ACTIVETEXTUREARB ); |
trWriteEnum( texture ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ActiveTextureARB( texture ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trAlphaFunc( GLenum func, GLclampf ref ) { |
trWriteCMD( CMD_ALPHAFUNC ); |
trWriteEnum( func ); |
trWriteClampf( ref ); |
if( trCtx()->doExec ) { |
trGetDispatch()->AlphaFunc( func, ref ); |
trError(); |
} |
} |
GLAPI GLboolean GLAPIENTRY trAreTexturesResident( GLsizei n, const GLuint *textures, GLboolean *residences ) { |
GLboolean retval; |
trWriteCMD( CMD_ARETEXTURESRESIDENT ); |
trWriteSizei( n ); |
trWritePointer( (void *)textures ); |
trFileFlush(); |
trWriteArrayui( n, textures ); |
trWritePointer( (void *)residences ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->AreTexturesResident( n, textures, residences ); |
trError(); |
} else { |
memset( residences, 0, n * sizeof(GLboolean) ); |
retval = GL_NO_ERROR; |
} |
trWriteBool( retval ); |
trWriteArrayBool( n, residences ); |
return retval; |
} |
GLAPI GLboolean GLAPIENTRY trAreTexturesResidentEXT( GLsizei n, const GLuint *textures, GLboolean *residences ) { |
GLboolean retval; |
trWriteCMD( CMD_ARETEXTURESRESIDENTEXT ); |
trWriteSizei( n ); |
trWritePointer( (void *)textures ); |
trFileFlush(); |
trWriteArrayui( n, textures ); |
trWritePointer( (void *)residences ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->AreTexturesResidentEXT( n, textures, residences ); |
trError(); |
} else { |
memset( residences, 0, n * sizeof(GLboolean) ); |
retval = GL_NO_ERROR; |
} |
trWriteBool( retval ); |
trWriteArrayBool( n, residences ); |
return retval; |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trArrayElementEXT( GLint i ) { |
trWriteCMD( CMD_ARRAYELEMENTEXT ); |
trWritei( i ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ArrayElementEXT( i ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trArrayElement( GLint i ) { |
trace_context_t * tctx; |
trWriteCMD( CMD_ARRAYELEMENT ); |
trWritei( i ); |
tctx = trCtx(); |
if( tctx->doExec ) { |
trGetDispatch()->ArrayElement( i ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trBegin( GLenum mode ) { |
trWriteCMD( CMD_BEGIN ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Begin( mode ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trBindTextureEXT( GLenum target, GLuint texture ) { |
trWriteCMD( CMD_BINDTEXTUREEXT ); |
trWriteEnum( target ); |
trWriteui( texture ); |
if( trCtx()->doExec ) { |
trGetDispatch()->BindTextureEXT( target, texture ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trBindTexture( GLenum target, GLuint texture ) { |
trWriteCMD( CMD_BINDTEXTURE ); |
trWriteEnum( target ); |
trWriteui( texture ); |
if( trCtx()->doExec ) { |
trGetDispatch()->BindTexture( target, texture ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trBitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) { |
trWriteCMD( CMD_BITMAP ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWritef( xorig ); |
trWritef( yorig ); |
trWritef( xmove ); |
trWritef( ymove ); |
trWritePointer( (void *)bitmap ); |
trFileFlush(); |
trWriteArrayub( width * height / 8, bitmap ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Bitmap( width, height, xorig, yorig, xmove, ymove, bitmap ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trBlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) { |
trWriteCMD( CMD_BLENDCOLOREXT ); |
trWriteClampf( red ); |
trWriteClampf( green ); |
trWriteClampf( blue ); |
trWriteClampf( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->BlendColorEXT( red, green, blue, alpha ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trBlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) { |
trWriteCMD( CMD_BLENDCOLOR ); |
trWriteClampf( red ); |
trWriteClampf( green ); |
trWriteClampf( blue ); |
trWriteClampf( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->BlendColor( red, green, blue, alpha ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trBlendEquationEXT( GLenum mode ) { |
trWriteCMD( CMD_BLENDEQUATIONEXT ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->BlendEquationEXT( mode ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trBlendEquation( GLenum mode ) { |
trWriteCMD( CMD_BLENDEQUATION ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->BlendEquation( mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trBlendFunc( GLenum sfactor, GLenum dfactor ) { |
trWriteCMD( CMD_BLENDFUNC ); |
trWriteEnum( sfactor ); |
trWriteEnum( dfactor ); |
if( trCtx()->doExec ) { |
trGetDispatch()->BlendFunc( sfactor, dfactor ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCallList( GLuint list ) { |
trWriteCMD( CMD_CALLLIST ); |
trWriteui( list ); |
if( trCtx()->doExec ) { |
trSetOriginalDispatch(); |
trGetDispatch()->CallList( list ); |
trSetTraceDispatch(); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCallLists( GLsizei n, GLenum type, const GLvoid *lists ) { |
trWriteCMD( CMD_CALLLISTS ); |
trWriteSizei( n ); |
trWriteEnum( type ); |
trWritePointer( (void *)lists ); |
trFileFlush(); |
switch( type ) { |
case GL_2_BYTES: |
trWriteTypeArray( GL_UNSIGNED_BYTE, n, 2, 0, lists ); |
break; |
case GL_3_BYTES: |
trWriteTypeArray( GL_UNSIGNED_BYTE, n, 3, 0, lists ); |
break; |
case GL_4_BYTES: |
trWriteTypeArray( GL_UNSIGNED_BYTE, n, 4, 0, lists ); |
break; |
default: |
trWriteTypeArray( type, n, 1, 0, lists ); |
break; |
} |
if( trCtx()->doExec ) { |
trSetOriginalDispatch(); |
trGetDispatch()->CallLists( n, type, lists ); |
trSetTraceDispatch(); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) { |
trWriteCMD( CMD_CLEARACCUM ); |
trWritef( red ); |
trWritef( green ); |
trWritef( blue ); |
trWritef( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ClearAccum( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) { |
trWriteCMD( CMD_CLEARCOLOR ); |
trWriteClampf( red ); |
trWriteClampf( green ); |
trWriteClampf( blue ); |
trWriteClampf( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ClearColor( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trClearDepth( GLclampd depth ) { |
trWriteCMD( CMD_CLEARDEPTH ); |
trWriteClampd( depth ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ClearDepth( depth ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trClear( GLbitfield mask ) { |
trWriteCMD( CMD_CLEAR ); |
trWriteBits( mask ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Clear( mask ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trClearIndex( GLfloat c ) { |
trWriteCMD( CMD_CLEARINDEX ); |
trWritef( c ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ClearIndex( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trClearStencil( GLint s ) { |
trWriteCMD( CMD_CLEARSTENCIL ); |
trWritei( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ClearStencil( s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trClientActiveTextureARB( GLenum texture) { |
trWriteCMD( CMD_CLIENTACTIVETEXTUREARB ); |
trWriteEnum( texture ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ClientActiveTextureARB( texture ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trClipPlane( GLenum plane, const GLdouble *equation ) { |
trWriteCMD( CMD_CLIPPLANE ); |
trWriteEnum( plane ); |
trWritePointer( (void *)equation ); |
trFileFlush(); |
trWriteArrayd( 4, equation ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ClipPlane( plane, equation ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3b( GLbyte red, GLbyte green, GLbyte blue ) { |
trWriteCMD( CMD_COLOR3B ); |
trWriteb( red ); |
trWriteb( green ); |
trWriteb( blue ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3b( red, green, blue ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3bv( const GLbyte *v ) { |
trWriteCMD( CMD_COLOR3BV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayb( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3bv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3d( GLdouble red, GLdouble green, GLdouble blue ) { |
trWriteCMD( CMD_COLOR3D ); |
trWrited( red ); |
trWrited( green ); |
trWrited( blue ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3d( red, green, blue ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3dv( const GLdouble *v ) { |
trWriteCMD( CMD_COLOR3DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3f( GLfloat red, GLfloat green, GLfloat blue ) { |
trWriteCMD( CMD_COLOR3F ); |
trWritef( red ); |
trWritef( green ); |
trWritef( blue ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3f( red, green, blue ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3fv( const GLfloat *v ) { |
trWriteCMD( CMD_COLOR3FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3i( GLint red, GLint green, GLint blue ) { |
trWriteCMD( CMD_COLOR3I ); |
trWritei( red ); |
trWritei( green ); |
trWritei( blue ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3i( red, green, blue ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3iv( const GLint *v ) { |
trWriteCMD( CMD_COLOR3IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3s( GLshort red, GLshort green, GLshort blue ) { |
trWriteCMD( CMD_COLOR3S ); |
trWrites( red ); |
trWrites( green ); |
trWrites( blue ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3s( red, green, blue ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3sv( const GLshort *v ) { |
trWriteCMD( CMD_COLOR3SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3ub( GLubyte red, GLubyte green, GLubyte blue ) { |
trWriteCMD( CMD_COLOR3UB ); |
trWriteub( red ); |
trWriteub( green ); |
trWriteub( blue ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3ub( red, green, blue ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3ubv( const GLubyte *v ) { |
trWriteCMD( CMD_COLOR3UBV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayub( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3ubv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3ui( GLuint red, GLuint green, GLuint blue ) { |
trWriteCMD( CMD_COLOR3UI ); |
trWriteui( red ); |
trWriteui( green ); |
trWriteui( blue ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3ui( red, green, blue ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3uiv( const GLuint *v ) { |
trWriteCMD( CMD_COLOR3UIV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayui( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3uiv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3us( GLushort red, GLushort green, GLushort blue ) { |
trWriteCMD( CMD_COLOR3US ); |
trWriteus( red ); |
trWriteus( green ); |
trWriteus( blue ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3us( red, green, blue ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor3usv( const GLushort *v ) { |
trWriteCMD( CMD_COLOR3USV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayus( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color3usv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4b( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha ) { |
trWriteCMD( CMD_COLOR4B ); |
trWriteb( red ); |
trWriteb( green ); |
trWriteb( blue ); |
trWriteb( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4b( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4bv( const GLbyte *v ) { |
trWriteCMD( CMD_COLOR4BV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayb( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4bv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4d( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha ) { |
trWriteCMD( CMD_COLOR4D ); |
trWrited( red ); |
trWrited( green ); |
trWrited( blue ); |
trWrited( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4d( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4dv( const GLdouble *v ) { |
trWriteCMD( CMD_COLOR4DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) { |
trWriteCMD( CMD_COLOR4F ); |
trWritef( red ); |
trWritef( green ); |
trWritef( blue ); |
trWritef( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4f( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4fv( const GLfloat *v ) { |
trWriteCMD( CMD_COLOR4FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4i( GLint red, GLint green, GLint blue, GLint alpha ) { |
trWriteCMD( CMD_COLOR4I ); |
trWritei( red ); |
trWritei( green ); |
trWritei( blue ); |
trWritei( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4i( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4iv( const GLint *v ) { |
trWriteCMD( CMD_COLOR4IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4s( GLshort red, GLshort green, GLshort blue, GLshort alpha ) { |
trWriteCMD( CMD_COLOR4S ); |
trWrites( red ); |
trWrites( green ); |
trWrites( blue ); |
trWrites( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4s( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4sv( const GLshort *v ) { |
trWriteCMD( CMD_COLOR4SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) { |
trWriteCMD( CMD_COLOR4UB ); |
trWriteub( red ); |
trWriteub( green ); |
trWriteub( blue ); |
trWriteub( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4ub( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4ubv( const GLubyte *v ) { |
trWriteCMD( CMD_COLOR4UBV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayub( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4ubv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4ui( GLuint red, GLuint green, GLuint blue, GLuint alpha ) { |
trWriteCMD( CMD_COLOR4UI ); |
trWriteui( red ); |
trWriteui( green ); |
trWriteui( blue ); |
trWriteui( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4ui( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4uiv( const GLuint *v ) { |
trWriteCMD( CMD_COLOR4UIV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayui( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4uiv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4us( GLushort red, GLushort green, GLushort blue, GLushort alpha ) { |
trWriteCMD( CMD_COLOR4US ); |
trWriteus( red ); |
trWriteus( green ); |
trWriteus( blue ); |
trWriteus( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4us( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColor4usv( const GLushort *v ) { |
trWriteCMD( CMD_COLOR4USV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayus( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Color4usv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) { |
trWriteCMD( CMD_COLORMASK ); |
trWriteBool( red ); |
trWriteBool( green ); |
trWriteBool( blue ); |
trWriteBool( alpha ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorMask( red, green, blue, alpha ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColorMaterial( GLenum face, GLenum mode ) { |
trWriteCMD( CMD_COLORMATERIAL ); |
trWriteEnum( face ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorMaterial( face, mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColorPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ) { /* TODO */ |
trWriteCMD( CMD_COLORPOINTEREXT ); |
trWritei( size ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWriteSizei( count ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorPointerEXT( size, type, stride, count, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ) { |
trace_context_t * tctx; |
trWriteCMD( CMD_COLORPOINTER ); |
trWritei( size ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( tctx->doExec ) { |
trGetDispatch()->ColorPointer( size, type, stride, ptr ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trColorSubTableEXT( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data ) { |
GLint pixelsize; |
trWriteCMD( CMD_COLORSUBTABLEEXT ); |
trWriteEnum( target ); |
trWriteSizei( start ); |
trWriteSizei( count ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)data ); |
trFileFlush(); |
pixelsize = trGetPixelSize( format, type ); |
trWriteTypeArray( type, count, pixelsize, start, data ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorSubTableEXT( target, start, count, format, type, data ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trColorSubTable( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data ) { |
GLint pixelsize; |
trWriteCMD( CMD_COLORSUBTABLE ); |
trWriteEnum( target ); |
trWriteSizei( start ); |
trWriteSizei( count ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)data ); |
trFileFlush(); |
pixelsize = trGetPixelSize( format, type ); |
trWriteTypeArray( type, count, pixelsize, start, data ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorSubTable( target, start, count, format, type, data ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trColorTableEXT( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ) { |
GLint pixelsize; |
trWriteCMD( CMD_COLORTABLEEXT ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWriteSizei( width ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)table ); |
trFileFlush(); |
pixelsize = trGetPixelSize( format, type ); |
trWriteTypeArray( type, width, pixelsize, 0, table ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorTableEXT( target, internalformat, width, format, type, table ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trColorTable( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_COLORTABLE ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWriteSizei( width ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)table ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorTable( target, internalformat, width, format, type, table ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColorTableParameterfv( GLenum target, GLenum pname, const GLfloat *params) { |
trWriteCMD( CMD_COLORTABLEPARAMETERFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
trWriteArrayf( 4, params ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorTableParameterfv( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trColorTableParameteriv( GLenum target, GLenum pname, const GLint *params) { |
trWriteCMD( CMD_COLORTABLEPARAMETERIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
trWriteArrayi( 4, params ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ColorTableParameteriv( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trConvolutionFilter1D( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image ) { |
GLint pixelsize; |
trWriteCMD( CMD_CONVOLUTIONFILTER1D ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWriteSizei( width ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)image ); |
trFileFlush(); |
pixelsize = trGetPixelSize( format, type ); |
trWriteTypeArray( type, width, pixelsize, 0, image ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ConvolutionFilter1D( target, internalformat, width, format, type, image ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trConvolutionFilter2D( GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image ) { |
GLint i; |
GLint pixelsize; |
trWriteCMD( CMD_CONVOLUTIONFILTER2D ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)image ); |
trFileFlush(); |
/* p76 of GL spec says this isn't subject to unpack_row_width... */ |
pixelsize = trGetPixelSize( format, type ); |
for( i = 0; i < height; i++ ) { |
trWriteTypeArray( type, width, pixelsize, i * width, image ); |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->ConvolutionFilter2D( target, internalformat, width, height, format, type, image ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trConvolutionParameterf( GLenum target, GLenum pname, GLfloat params ) { |
trWriteCMD( CMD_CONVOLUTIONPARAMETERF ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritef( params ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ConvolutionParameterf( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trConvolutionParameterfv( GLenum target, GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_CONVOLUTIONPARAMETERFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_CONVOLUTION_BORDER_MODE: |
trWritef( params[0] ); |
break; |
case GL_CONVOLUTION_BORDER_COLOR: |
trWriteArrayf( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->ConvolutionParameterfv( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trConvolutionParameteri( GLenum target, GLenum pname, GLint params ) { |
trWriteCMD( CMD_CONVOLUTIONPARAMETERI ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritei( params ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ConvolutionParameteri( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trConvolutionParameteriv( GLenum target, GLenum pname, const GLint *params ) { |
trWriteCMD( CMD_CONVOLUTIONPARAMETERIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_CONVOLUTION_BORDER_MODE: |
trWritei( params[0] ); |
break; |
case GL_CONVOLUTION_BORDER_COLOR: |
trWriteArrayi( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->ConvolutionParameteriv( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyColorSubTable( GLenum target, GLsizei start, GLint x, GLint y, GLsizei width ) { |
trWriteCMD( CMD_COPYCOLORSUBTABLE ); |
trWriteEnum( target ); |
trWriteSizei( start ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyColorSubTable( target, start, x, y, width ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyColorTable( GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width ) { |
trWriteCMD( CMD_COPYCOLORTABLE ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyColorTable( target, internalformat, x, y, width ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyConvolutionFilter1D( GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width ) { |
trWriteCMD( CMD_COPYCONVOLUTIONFILTER1D ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyConvolutionFilter1D( target, internalformat, x, y, width ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyConvolutionFilter2D( GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) { |
trWriteCMD( CMD_COPYCONVOLUTIONFILTER2D ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyConvolutionFilter2D( target, internalformat, x, y, width, height ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type ) { |
trWriteCMD( CMD_COPYPIXELS ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteEnum( type ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyPixels( x, y, width, height, type ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyTexImage1D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border ) { |
trWriteCMD( CMD_COPYTEXIMAGE1D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWriteEnum( internalformat ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWritei( border ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyTexImage1D( target, level, internalformat, x, y, width, border ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) { |
trWriteCMD( CMD_COPYTEXIMAGE2D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWriteEnum( internalformat ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWritei( border ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyTexImage2D( target, level, internalformat, x, y, width, height, border ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ) { |
trWriteCMD( CMD_COPYTEXSUBIMAGE1D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( xoffset ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyTexSubImage1D( target, level, xoffset, x, y, width ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { |
trWriteCMD( CMD_COPYTEXSUBIMAGE2D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( xoffset ); |
trWritei( yoffset ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trCopyTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { |
trWriteCMD( CMD_COPYTEXSUBIMAGE3DEXT ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( xoffset ); |
trWritei( yoffset ); |
trWritei( zoffset ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyTexSubImage3DEXT( target, level, xoffset, yoffset, zoffset, x, y, width, height ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trCopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { |
trWriteCMD( CMD_COPYTEXSUBIMAGE3D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( xoffset ); |
trWritei( yoffset ); |
trWritei( zoffset ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CopyTexSubImage3D( target, level, xoffset, yoffset, zoffset, x, y, width, height ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trCullFace( GLenum mode ) { |
trWriteCMD( CMD_CULLFACE ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->CullFace( mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDeleteLists( GLuint list, GLsizei range ) { |
trWriteCMD( CMD_DELETELISTS ); |
trWriteui( list ); |
trWriteSizei( range ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DeleteLists( list, range ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trDeleteTexturesEXT( GLsizei n, const GLuint *textures) { |
trWriteCMD( CMD_DELETETEXTURESEXT ); |
trWriteSizei( n ); |
trWritePointer( (void *)textures ); |
trFileFlush(); |
trWriteArrayui( n, textures ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DeleteTexturesEXT( n, textures ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trDeleteTextures( GLsizei n, const GLuint *textures) { |
trWriteCMD( CMD_DELETETEXTURES ); |
trWriteSizei( n ); |
trWritePointer( (void *)textures ); |
trFileFlush(); |
trWriteArrayui( n, textures ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DeleteTextures( n, textures ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDepthFunc( GLenum func ) { |
trWriteCMD( CMD_DEPTHFUNC ); |
trWriteEnum( func ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DepthFunc( func ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDepthMask( GLboolean flag ) { |
trWriteCMD( CMD_DEPTHMASK ); |
trWriteBool( flag ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DepthMask( flag ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDepthRange( GLclampd near_val, GLclampd far_val ) { |
trWriteCMD( CMD_DEPTHRANGE ); |
trWriteClampd( near_val ); |
trWriteClampd( far_val ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DepthRange( near_val, far_val ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDisableClientState( GLenum cap ) { |
trace_context_t * tctx; |
trWriteCMD( CMD_DISABLECLIENTSTATE ); |
trWriteEnum( cap ); |
tctx = trCtx(); |
if( tctx->doExec ) { |
trGetDispatch()->DisableClientState( cap ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDisable( GLenum cap ) { |
trWriteCMD( CMD_DISABLE ); |
trWriteEnum( cap ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Disable( cap ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trDrawArraysEXT( GLenum mode, GLint first, GLsizei count ) { |
trWriteCMD( CMD_DRAWARRAYSEXT ); |
trWriteEnum( mode ); |
trWritei( first ); |
trWriteSizei( count ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DrawArraysEXT( mode, first, count ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trDrawArrays( GLenum mode, GLint first, GLsizei count ) { |
trWriteCMD( CMD_DRAWARRAYS ); |
trWriteEnum( mode ); |
trWritei( first ); |
trWriteSizei( count ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DrawArrays( mode, first, count ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDrawBuffer( GLenum mode ) { |
trWriteCMD( CMD_DRAWBUFFER ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->DrawBuffer( mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) { |
trace_context_t * tctx; |
trWriteCMD( CMD_DRAWELEMENTS ); |
trWriteEnum( mode ); |
trWriteSizei( count ); |
trWriteEnum( type ); |
trWritePointer( (void *)indices ); |
trFileFlush(); |
/* Why isn't the indices a GLint * ? */ |
trWriteArrayi( count, (GLint *)indices ); |
tctx = trCtx(); |
if( tctx->doExec ) { |
trGetDispatch()->DrawElements( mode, count, type, indices ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_DRAWPIXELS ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->DrawPixels( width, height, format, type, pixels ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trDrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) { |
trace_context_t * tctx; |
trWriteCMD( CMD_DRAWRANGEELEMENTS ); |
trWriteEnum( mode ); |
trWriteui( start ); |
trWriteui( end ); |
trWriteSizei( count ); |
trWriteEnum( type ); |
trWritePointer( (void *)indices ); |
trFileFlush(); |
switch( type ) { |
case GL_UNSIGNED_BYTE: |
trWriteArrayub( count, (GLubyte *)indices ); |
break; |
case GL_UNSIGNED_SHORT: |
trWriteArrayus( count, (GLushort *)indices ); |
break; |
case GL_UNSIGNED_INT: |
trWriteArrayui( count, (GLuint *)indices ); |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
tctx = trCtx(); |
if( trCtx()->doExec ) { |
trGetDispatch()->DrawRangeElements( mode, start, end, count, type, indices ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEdgeFlag( GLboolean flag ) { |
trWriteCMD( CMD_EDGEFLAG ); |
trWriteBool( flag ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EdgeFlag( flag ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEdgeFlagPointerEXT( GLsizei stride, GLsizei count, const GLboolean *ptr ) { /* TODO */ |
trWriteCMD( CMD_EDGEFLAGPOINTEREXT ); |
trWriteSizei( stride ); |
trWriteSizei( count ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->EdgeFlagPointerEXT( stride, count, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ) { /* TODO */ |
trace_context_t * tctx; |
trWriteCMD( CMD_EDGEFLAGPOINTER ); |
trWriteSizei( stride ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
tctx = trCtx(); |
if( tctx->doExec ) { |
trGetDispatch()->EdgeFlagPointer( stride, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEdgeFlagv( const GLboolean *flag ) { |
trWriteCMD( CMD_EDGEFLAGV ); |
trWritePointer( (void *)flag ); |
trFileFlush(); |
trWriteBool( flag[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EdgeFlagv( flag ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEnableClientState( GLenum cap ) { |
trace_context_t * tctx; |
trWriteCMD( CMD_ENABLECLIENTSTATE ); |
trWriteEnum( cap ); |
tctx = trCtx(); |
if( tctx->doExec ) { |
trGetDispatch()->EnableClientState( cap ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEnable( GLenum cap ) { |
trWriteCMD( CMD_ENABLE ); |
trWriteEnum( cap ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Enable( cap ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEndList( void ) { |
trWriteCMD( CMD_ENDLIST ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EndList( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEnd( void ) { |
trWriteCMD( CMD_END ); |
if( trCtx()->doExec ) { |
trGetDispatch()->End( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalCoord1d( GLdouble u ) { |
trWriteCMD( CMD_EVALCOORD1D ); |
trWrited( u ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalCoord1d( u ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalCoord1dv( const GLdouble *u ) { |
trWriteCMD( CMD_EVALCOORD1DV ); |
trWritePointer( (void *)u ); |
trFileFlush(); |
trWrited( u[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalCoord1dv( u ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalCoord1f( GLfloat u ) { |
trWriteCMD( CMD_EVALCOORD1F ); |
trWritef( u ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalCoord1f( u ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalCoord1fv( const GLfloat *u ) { |
trWriteCMD( CMD_EVALCOORD1FV ); |
trWritePointer( (void *)u ); |
trFileFlush(); |
trWritef( u[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalCoord1fv( u ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalCoord2d( GLdouble u, GLdouble v ) { |
trWriteCMD( CMD_EVALCOORD2D ); |
trWrited( u ); |
trWrited( v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalCoord2d( u, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalCoord2dv( const GLdouble *u ) { |
trWriteCMD( CMD_EVALCOORD2DV ); |
trWritePointer( (void *)u ); |
trFileFlush(); |
trWriteArrayd( 2, u ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalCoord2dv( u ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalCoord2f( GLfloat u, GLfloat v ) { |
trWriteCMD( CMD_EVALCOORD2F ); |
trWritef( u ); |
trWritef( v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalCoord2f( u, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalCoord2fv( const GLfloat *u ) { |
trWriteCMD( CMD_EVALCOORD2FV ); |
trWritePointer( (void *)u ); |
trFileFlush(); |
trWriteArrayf( 2, u ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalCoord2fv( u ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalMesh1( GLenum mode, GLint i1, GLint i2 ) { |
trWriteCMD( CMD_EVALMESH1 ); |
trWriteEnum( mode ); |
trWritei( i1 ); |
trWritei( i2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalMesh1( mode, i1, i2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) { |
trWriteCMD( CMD_EVALMESH2 ); |
trWriteEnum( mode ); |
trWritei( i1 ); |
trWritei( i2 ); |
trWritei( j1 ); |
trWritei( j2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalMesh2( mode, i1, i2, j1, j2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalPoint1( GLint i ) { |
trWriteCMD( CMD_EVALPOINT1 ); |
trWritei( i ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalPoint1( i ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trEvalPoint2( GLint i, GLint j ) { |
trWriteCMD( CMD_EVALPOINT2 ); |
trWritei( i ); |
trWritei( j ); |
if( trCtx()->doExec ) { |
trGetDispatch()->EvalPoint2( i, j ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) { |
trWriteCMD( CMD_FEEDBACKBUFFER ); |
trWriteSizei( size ); |
trWriteEnum( type ); |
trWritePointer( (void *)buffer ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->FeedbackBuffer( size, type, buffer ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFinish( void ) { |
trWriteCMD( CMD_FINISH ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Finish( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFlush( void ) { |
trWriteCMD( CMD_FLUSH ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Flush( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFogf( GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_FOGF ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Fogf( pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFogfv( GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_FOGFV ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_FOG_MODE: |
case GL_FOG_DENSITY: |
case GL_FOG_START: |
case GL_FOG_END: |
case GL_FOG_INDEX: |
trWritef( params[0] ); |
break; |
case GL_FOG_COLOR: |
trWriteArrayf( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Fogfv( pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFogi( GLenum pname, GLint param ) { |
trWriteCMD( CMD_FOGI ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Fogi( pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFogiv( GLenum pname, const GLint *params ) { |
trWriteCMD( CMD_FOGIV ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_FOG_MODE: |
case GL_FOG_DENSITY: |
case GL_FOG_START: |
case GL_FOG_END: |
case GL_FOG_INDEX: |
trWritei( params[0] ); |
break; |
case GL_FOG_COLOR: |
trWriteArrayi( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Fogiv( pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFrontFace( GLenum mode ) { |
trWriteCMD( CMD_FRONTFACE ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->FrontFace( mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trFrustum( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ) { |
trWriteCMD( CMD_FRUSTUM ); |
trWrited( left ); |
trWrited( right ); |
trWrited( bottom ); |
trWrited( top ); |
trWrited( near_val ); |
trWrited( far_val ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Frustum( left, right, bottom, top, near_val, far_val ); |
trError(); |
} |
} |
GLAPI GLuint GLAPIENTRY trGenLists( GLsizei range ) { |
GLuint retval; |
trWriteCMD( CMD_GENLISTS ); |
trWriteSizei( range ); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->GenLists( range ); |
trError(); |
} else { |
retval = 0; |
} |
trWriteui( retval ); |
return retval; |
} |
GLAPI void GLAPIENTRY trGenTexturesEXT( GLsizei n, GLuint *textures ) { |
trWriteCMD( CMD_GENTEXTURESEXT ); |
trWriteSizei( n ); |
trWritePointer( (void *)textures ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GenTexturesEXT( n, textures ); |
trError(); |
} |
if( !(trCtx()->doExec) ) { |
memset( textures, 0, n * sizeof(GLuint) ); |
} |
trWriteArrayui( n, textures ); |
} |
GLAPI void GLAPIENTRY trGenTextures( GLsizei n, GLuint *textures ) { |
trWriteCMD( CMD_GENTEXTURES ); |
trWriteSizei( n ); |
trWritePointer( (void *)textures ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GenTextures( n, textures ); |
trError(); |
} |
if( !(trCtx()->doExec) ) { |
memset( textures, 0, n * sizeof(GLuint) ); |
} |
trWriteArrayui( n, textures ); |
} |
GLAPI void GLAPIENTRY trGetBooleanv( GLenum pname, GLboolean *params ) { /* TODO */ |
trWriteCMD( CMD_GETBOOLEANV ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_COLOR_MATRIX: |
case GL_MODELVIEW_MATRIX: |
case GL_PROJECTION_MATRIX: |
case GL_TEXTURE_MATRIX: |
trWriteArrayBool( 16, params ); |
break; |
case GL_ACCUM_CLEAR_VALUE: |
case GL_BLEND_COLOR: |
case GL_COLOR_CLEAR_VALUE: |
case GL_COLOR_WRITEMASK: |
case GL_CURRENT_COLOR: |
case GL_CURRENT_RASTER_COLOR: |
case GL_CURRENT_RASTER_POSITION: |
case GL_CURRENT_RASTER_TEXTURE_COORDS: |
case GL_CURRENT_TEXTURE_COORDS: |
case GL_LIGHT_MODEL_AMBIENT: |
case GL_MAP2_GRID_DOMAIN: |
case GL_SCISSOR_BOX: |
case GL_VIEWPORT: |
trWriteArrayBool( 4, params ); |
break; |
case GL_CURRENT_NORMAL: |
trWriteArrayBool( 3, params ); |
break; |
case GL_ALIASED_POINT_SIZE_RANGE: |
case GL_ALIASED_LINE_WIDTH_RANGE: |
case GL_DEPTH_RANGE: |
case GL_MAP1_GRID_DOMAIN: |
case GL_MAP2_GRID_SEGMENTS: |
case GL_MAX_VIEWPORT_DIMS: |
case GL_POLYGON_MODE: |
case GL_SMOOTH_LINE_WIDTH_RANGE: |
case GL_SMOOTH_POINT_SIZE_RANGE: |
trWriteArrayBool( 2, params ); |
break; |
case GL_ACCUM_ALPHA_BITS: |
case GL_ACCUM_BLUE_BITS: |
case GL_ACCUM_GREEN_BITS: |
case GL_ACCUM_RED_BITS: |
case GL_ACTIVE_TEXTURE_ARB: |
case GL_ALPHA_BIAS: |
case GL_ALPHA_BITS: |
case GL_ALPHA_SCALE: |
case GL_ALPHA_TEST: |
case GL_ALPHA_TEST_FUNC: |
case GL_ALPHA_TEST_REF: |
case GL_ATTRIB_STACK_DEPTH: |
case GL_AUTO_NORMAL: |
case GL_AUX_BUFFERS: |
case GL_BLEND: |
case GL_BLEND_SRC: |
case GL_BLUE_BIAS: |
case GL_BLUE_BITS: |
case GL_BLUE_SCALE: |
case GL_CLIENT_ACTIVE_TEXTURE_ARB: |
case GL_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_CLIP_PLANE0: |
case GL_CLIP_PLANE1: |
case GL_CLIP_PLANE2: |
case GL_CLIP_PLANE3: |
case GL_CLIP_PLANE4: |
case GL_CLIP_PLANE5: |
case GL_COLOR_ARRAY: |
case GL_COLOR_ARRAY_SIZE: |
case GL_COLOR_ARRAY_STRIDE: |
case GL_COLOR_ARRAY_TYPE: |
case GL_COLOR_LOGIC_OP: |
case GL_COLOR_MATERIAL: |
case GL_COLOR_MATERIAL_FACE: |
case GL_COLOR_MATERIAL_PARAMETER: |
case GL_COLOR_MATRIX_STACK_DEPTH: |
case GL_COLOR_TABLE: |
case GL_CONVOLUTION_1D: |
case GL_CONVOLUTION_2D: |
case GL_CULL_FACE: |
case GL_CULL_FACE_MODE: |
case GL_CURRENT_INDEX: |
case GL_CURRENT_RASTER_DISTANCE: |
case GL_CURRENT_RASTER_INDEX: |
case GL_CURRENT_RASTER_POSITION_VALID: |
case GL_DEPTH_BIAS: |
case GL_DEPTH_CLEAR_VALUE: |
case GL_DEPTH_FUNC: |
case GL_DEPTH_SCALE: |
case GL_DEPTH_TEST: |
case GL_DEPTH_WRITEMASK: |
case GL_DITHER: |
case GL_DOUBLEBUFFER: |
case GL_DRAW_BUFFER: |
case GL_EDGE_FLAG: |
case GL_EDGE_FLAG_ARRAY: |
case GL_EDGE_FLAG_ARRAY_STRIDE: |
case GL_FEEDBACK_BUFFER_SIZE: |
case GL_FEEDBACK_BUFFER_TYPE: |
case GL_FOG: |
case GL_FOG_DENSITY: |
case GL_FOG_END: |
case GL_FOG_HINT: |
case GL_FOG_INDEX: |
case GL_FOG_MODE: |
case GL_FOG_START: |
case GL_FRONT_FACE: |
case GL_GREEN_BIAS: |
case GL_GREEN_BITS: |
case GL_GREEN_SCALE: |
case GL_HISTOGRAM: |
case GL_INDEX_ARRAY: |
case GL_INDEX_ARRAY_STRIDE: |
case GL_INDEX_ARRAY_TYPE: |
case GL_INDEX_BITS: |
case GL_INDEX_CLEAR_VALUE: |
case GL_INDEX_LOGIC_OP: |
case GL_INDEX_MODE: |
case GL_INDEX_OFFSET: |
case GL_INDEX_SHIFT: |
case GL_INDEX_WRITEMASK: |
case GL_LIGHT0: |
case GL_LIGHT1: |
case GL_LIGHT2: |
case GL_LIGHT3: |
case GL_LIGHT4: |
case GL_LIGHT5: |
case GL_LIGHT6: |
case GL_LIGHT7: |
case GL_LIGHTING: |
case GL_LIGHT_MODEL_COLOR_CONTROL: |
case GL_LIGHT_MODEL_LOCAL_VIEWER: |
case GL_LIGHT_MODEL_TWO_SIDE: |
case GL_LINE_SMOOTH: |
case GL_LINE_SMOOTH_HINT: |
case GL_LINE_STIPPLE: |
case GL_LINE_STIPPLE_PATTERN: |
case GL_LINE_STIPPLE_REPEAT: |
case GL_LINE_WIDTH: |
case GL_LIST_BASE: |
case GL_LIST_INDEX: |
case GL_LIST_MODE: |
case GL_LOGIC_OP_MODE: |
case GL_MAP1_COLOR_4: |
case GL_MAP1_GRID_SEGMENTS: |
case GL_MAP1_INDEX: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_1: |
case GL_MAP1_TEXTURE_COORD_2: |
case GL_MAP1_TEXTURE_COORD_3: |
case GL_MAP1_TEXTURE_COORD_4: |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_VERTEX_4: |
case GL_MAP2_COLOR_4: |
case GL_MAP2_INDEX: |
case GL_MAP2_NORMAL: |
case GL_MAP2_TEXTURE_COORD_1: |
case GL_MAP2_TEXTURE_COORD_2: |
case GL_MAP2_TEXTURE_COORD_3: |
case GL_MAP2_TEXTURE_COORD_4: |
case GL_MAP2_VERTEX_3: |
case GL_MAP2_VERTEX_4: |
case GL_MAP_COLOR: |
case GL_MAP_STENCIL: |
case GL_MATRIX_MODE: |
case GL_MAX_3D_TEXTURE_SIZE: |
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_MAX_ATTRIB_STACK_DEPTH: |
case GL_MAX_CLIP_PLANES: |
case GL_MAX_COLOR_MATRIX_STACK_DEPTH: |
case GL_MAX_ELEMENTS_VERTICES: |
case GL_MAX_EVAL_ORDER: |
case GL_MAX_LIGHTS: |
case GL_MAX_LIST_NESTING: |
case GL_MAX_MODELVIEW_STACK_DEPTH: |
case GL_MAX_NAME_STACK_DEPTH: |
case GL_MAX_PIXEL_MAP_TABLE: |
case GL_MAX_PROJECTION_STACK_DEPTH: |
case GL_MAX_TEXTURE_SIZE: |
case GL_MAX_TEXTURE_STACK_DEPTH: |
case GL_MAX_TEXTURE_UNITS_ARB: |
case GL_MINMAX: |
case GL_MODELVIEW_STACK_DEPTH: |
case GL_NAME_STACK_DEPTH: |
case GL_NORMAL_ARRAY: |
case GL_NORMAL_ARRAY_STRIDE: |
case GL_NORMAL_ARRAY_TYPE: |
case GL_NORMALIZE: |
case GL_PACK_ALIGNMENT: |
case GL_PACK_IMAGE_HEIGHT: |
case GL_PACK_LSB_FIRST: |
case GL_PACK_ROW_LENGTH: |
case GL_PACK_SKIP_IMAGES: |
case GL_PACK_SKIP_PIXELS: |
case GL_PACK_SKIP_ROWS: |
case GL_PACK_SWAP_BYTES: |
case GL_PERSPECTIVE_CORRECTION_HINT: |
case GL_PIXEL_MAP_A_TO_A_SIZE: |
case GL_PIXEL_MAP_B_TO_B_SIZE: |
case GL_PIXEL_MAP_G_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_A_SIZE: |
case GL_PIXEL_MAP_I_TO_B_SIZE: |
case GL_PIXEL_MAP_I_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_I_SIZE: |
case GL_PIXEL_MAP_I_TO_R_SIZE: |
case GL_PIXEL_MAP_R_TO_R_SIZE: |
case GL_PIXEL_MAP_S_TO_S_SIZE: |
case GL_POINT_SIZE: |
case GL_POINT_SMOOTH: |
case GL_POINT_SMOOTH_HINT: |
case GL_POLYGON_OFFSET_FACTOR: |
case GL_POLYGON_OFFSET_UNITS: |
case GL_POLYGON_OFFSET_FILL: |
case GL_POLYGON_OFFSET_LINE: |
case GL_POLYGON_OFFSET_POINT: |
case GL_POLYGON_SMOOTH: |
case GL_POLYGON_SMOOTH_HINT: |
case GL_POLYGON_STIPPLE: |
case GL_POST_COLOR_MATRIX_COLOR_TABLE: |
case GL_POST_COLOR_MATRIX_RED_BIAS: |
case GL_POST_COLOR_MATRIX_GREEN_BIAS: |
case GL_POST_COLOR_MATRIX_BLUE_BIAS: |
case GL_POST_COLOR_MATRIX_ALPHA_BIAS: |
case GL_POST_COLOR_MATRIX_RED_SCALE: |
case GL_POST_COLOR_MATRIX_GREEN_SCALE: |
case GL_POST_COLOR_MATRIX_BLUE_SCALE: |
case GL_POST_COLOR_MATRIX_ALPHA_SCALE: |
case GL_POST_CONVOLUTION_COLOR_TABLE: |
case GL_POST_CONVOLUTION_RED_BIAS: |
case GL_POST_CONVOLUTION_GREEN_BIAS: |
case GL_POST_CONVOLUTION_BLUE_BIAS: |
case GL_POST_CONVOLUTION_ALPHA_BIAS: |
case GL_POST_CONVOLUTION_RED_SCALE: |
case GL_POST_CONVOLUTION_GREEN_SCALE: |
case GL_POST_CONVOLUTION_BLUE_SCALE: |
case GL_POST_CONVOLUTION_ALPHA_SCALE: |
case GL_PROJECTION_STACK_DEPTH: |
case GL_READ_BUFFER: |
case GL_RED_BIAS: |
case GL_RED_BITS: |
case GL_RED_SCALE: |
case GL_RENDER_MODE: |
case GL_RESCALE_NORMAL: |
case GL_RGBA_MODE: |
case GL_SCISSOR_TEST: |
case GL_SELECTION_BUFFER_SIZE: |
case GL_SEPARABLE_2D: |
case GL_SHADE_MODEL: |
case GL_SMOOTH_LINE_WIDTH_GRANULARITY: |
case GL_SMOOTH_POINT_SIZE_GRANULARITY: |
case GL_STENCIL_BITS: |
case GL_STENCIL_CLEAR_VALUE: |
case GL_STENCIL_FAIL: |
case GL_STENCIL_FUNC: |
case GL_STENCIL_PASS_DEPTH_FAIL: |
case GL_STENCIL_PASS_DEPTH_PASS: |
case GL_STENCIL_REF: |
case GL_STENCIL_TEST: |
case GL_STENCIL_VALUE_MASK: |
case GL_STENCIL_WRITEMASK: |
case GL_STEREO: |
case GL_SUBPIXEL_BITS: |
case GL_TEXTURE_1D: |
case GL_TEXTURE_BINDING_1D: |
case GL_TEXTURE_2D: |
case GL_TEXTURE_BINDING_2D: |
case GL_TEXTURE_3D: |
case GL_TEXTURE_BINDING_3D: |
case GL_TEXTURE_COORD_ARRAY: |
case GL_TEXTURE_COORD_ARRAY_SIZE: |
case GL_TEXTURE_COORD_ARRAY_STRIDE: |
case GL_TEXTURE_COORD_ARRAY_TYPE: |
case GL_TEXTURE_GEN_Q: |
case GL_TEXTURE_GEN_R: |
case GL_TEXTURE_GEN_S: |
case GL_TEXTURE_GEN_T: |
case GL_TEXTURE_STACK_DEPTH: |
case GL_UNPACK_ALIGNMENT: |
case GL_UNPACK_IMAGE_HEIGHT: |
case GL_UNPACK_LSB_FIRST: |
case GL_UNPACK_ROW_LENGTH: |
case GL_UNPACK_SKIP_IMAGES: |
case GL_UNPACK_SKIP_PIXELS: |
case GL_UNPACK_SKIP_ROWS: |
case GL_UNPACK_SWAP_BYTES: |
case GL_VERTEX_ARRAY: |
case GL_VERTEX_ARRAY_SIZE: |
case GL_VERTEX_ARRAY_STRIDE: |
case GL_VERTEX_ARRAY_TYPE: |
case GL_ZOOM_X: |
case GL_ZOOM_Y: |
trWriteBool( params[0] ); |
break; |
default: |
/* Bad enum. What should we do? */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->GetBooleanv( pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetClipPlane( GLenum plane, GLdouble *equation ) { |
trWriteCMD( CMD_GETCLIPPLANE ); |
trWriteEnum( plane ); |
trWritePointer( (void *)equation ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetClipPlane( plane, equation ); |
trError(); |
} |
if( !(trCtx()->doExec) ) { |
memset( equation, 0, sizeof(GLdouble) ); |
} |
trWriteArrayd( 4, equation ); |
} |
GLAPI void GLAPIENTRY trGetColorTableEXT( GLenum target, GLenum format, GLenum type, GLvoid *table ) { /* TODO */ |
trWriteCMD( CMD_GETCOLORTABLEEXT ); |
trWriteEnum( target ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)table ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetColorTableEXT( target, format, type, table ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *table ) { /* TODO */ |
trWriteCMD( CMD_GETCOLORTABLE ); |
trWriteEnum( target ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)table ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetColorTable( target, format, type, table ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetColorTableParameterfvEXT( GLenum target, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETCOLORTABLEPARAMETERFVEXT ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetColorTableParameterfvEXT( target, pname, params ); |
trError(); |
} else { |
if( pname == GL_COLOR_TABLE_BIAS || pname == GL_COLOR_TABLE_SCALE ) { |
memset( params, 0, sizeof(GLfloat) * 4 ); |
} else { |
params[0] = 0.0; |
} |
} |
if( pname == GL_COLOR_TABLE_BIAS || pname == GL_COLOR_TABLE_SCALE ) { |
trWriteArrayf( 4, params ); |
} else { |
trWritef( params[0] ); |
} |
} |
GLAPI void GLAPIENTRY trGetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETCOLORTABLEPARAMETERFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetColorTableParameterfv( target, pname, params ); |
trError(); |
} else { |
if( pname == GL_COLOR_TABLE_BIAS || pname == GL_COLOR_TABLE_SCALE ) { |
memset( params, 0, sizeof(GLfloat) * 4 ); |
} else { |
params[0] = 0.0; |
} |
} |
if( pname == GL_COLOR_TABLE_BIAS || pname == GL_COLOR_TABLE_SCALE ) { |
trWriteArrayf( 4, params ); |
} else { |
trWritef( params[0] ); |
} |
} |
GLAPI void GLAPIENTRY trGetColorTableParameterivEXT( GLenum target, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETCOLORTABLEPARAMETERIVEXT ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetColorTableParameterivEXT( target, pname, params ); |
trError(); |
} else { |
if( pname == GL_COLOR_TABLE_BIAS || pname == GL_COLOR_TABLE_SCALE ) { |
memset( params, 0, sizeof(GLint) * 4 ); |
} else { |
params[0] = 0; |
} |
} |
if( pname == GL_COLOR_TABLE_BIAS || pname == GL_COLOR_TABLE_SCALE ) { |
trWriteArrayi( 4, params ); |
} else { |
trWritei( params[0] ); |
} |
} |
GLAPI void GLAPIENTRY trGetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETCOLORTABLEPARAMETERIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetColorTableParameteriv( target, pname, params ); |
trError(); |
} else { |
if( pname == GL_COLOR_TABLE_BIAS || pname == GL_COLOR_TABLE_SCALE ) { |
memset( params, 0, sizeof(GLint) * 4 ); |
} else { |
params[0] = 0; |
} |
} |
if( pname == GL_COLOR_TABLE_BIAS || pname == GL_COLOR_TABLE_SCALE ) { |
trWriteArrayi( 4, params ); |
} else { |
trWritei( params[0] ); |
} |
} |
GLAPI void GLAPIENTRY trGetConvolutionFilter( GLenum target, GLenum format, GLenum type, GLvoid *image ) { |
trace_context_t * tctx; |
trWriteCMD( CMD_GETCONVOLUTIONFILTER ); |
trWriteEnum( target ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)image ); |
trFileFlush(); |
if( tctx->doExec ) { |
trGetDispatch()->GetConvolutionFilter( target, format, type, image ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetConvolutionParameterfv( GLenum target, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETCONVOLUTIONPARAMETERFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetConvolutionParameterfv( target, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_CONVOLUTION_FILTER_SCALE: |
case GL_CONVOLUTION_FILTER_BIAS: |
memset( params, 0, 4 * sizeof(GLfloat) ); |
break; |
case GL_CONVOLUTION_BORDER_MODE: |
case GL_CONVOLUTION_BORDER_COLOR: |
case GL_CONVOLUTION_FORMAT: |
case GL_CONVOLUTION_WIDTH: |
case GL_CONVOLUTION_HEIGHT: |
case GL_MAX_CONVOLUTION_WIDTH: |
case GL_MAX_CONVOLUTION_HEIGHT: |
params[0] = 0; |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
switch( pname ) { |
case GL_CONVOLUTION_FILTER_SCALE: |
case GL_CONVOLUTION_FILTER_BIAS: |
trWriteArrayf( 4, params ); |
break; |
case GL_CONVOLUTION_BORDER_MODE: |
case GL_CONVOLUTION_BORDER_COLOR: |
case GL_CONVOLUTION_FORMAT: |
case GL_CONVOLUTION_WIDTH: |
case GL_CONVOLUTION_HEIGHT: |
case GL_MAX_CONVOLUTION_WIDTH: |
case GL_MAX_CONVOLUTION_HEIGHT: |
trWritef( params[0] ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetConvolutionParameteriv( GLenum target, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETCONVOLUTIONPARAMETERIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetConvolutionParameteriv( target, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_CONVOLUTION_FILTER_SCALE: |
case GL_CONVOLUTION_FILTER_BIAS: |
memset( params, 0, 4 * sizeof(GLint) ); |
break; |
case GL_CONVOLUTION_BORDER_MODE: |
case GL_CONVOLUTION_BORDER_COLOR: |
case GL_CONVOLUTION_FORMAT: |
case GL_CONVOLUTION_WIDTH: |
case GL_CONVOLUTION_HEIGHT: |
case GL_MAX_CONVOLUTION_WIDTH: |
case GL_MAX_CONVOLUTION_HEIGHT: |
params[0] = 0; |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
switch( pname ) { |
case GL_CONVOLUTION_FILTER_SCALE: |
case GL_CONVOLUTION_FILTER_BIAS: |
trWriteArrayi( 4, params ); |
break; |
case GL_CONVOLUTION_BORDER_MODE: |
case GL_CONVOLUTION_BORDER_COLOR: |
case GL_CONVOLUTION_FORMAT: |
case GL_CONVOLUTION_WIDTH: |
case GL_CONVOLUTION_HEIGHT: |
case GL_MAX_CONVOLUTION_WIDTH: |
case GL_MAX_CONVOLUTION_HEIGHT: |
trWritei( params[0] ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetDoublev( GLenum pname, GLdouble *params ) { |
trWriteCMD( CMD_GETDOUBLEV ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetDoublev( pname, params ); |
trError(); |
} else { |
trZeroGetterData( pname, sizeof(GLdouble), params ); |
} |
switch( pname ) { |
case GL_COLOR_MATRIX: |
case GL_MODELVIEW_MATRIX: |
case GL_PROJECTION_MATRIX: |
case GL_TEXTURE_MATRIX: |
trWriteArrayd( 16, params ); |
break; |
case GL_ACCUM_CLEAR_VALUE: |
case GL_BLEND_COLOR: |
case GL_COLOR_CLEAR_VALUE: |
case GL_COLOR_WRITEMASK: |
case GL_CURRENT_COLOR: |
case GL_CURRENT_RASTER_COLOR: |
case GL_CURRENT_RASTER_POSITION: |
case GL_CURRENT_RASTER_TEXTURE_COORDS: |
case GL_CURRENT_TEXTURE_COORDS: |
case GL_LIGHT_MODEL_AMBIENT: |
case GL_MAP2_GRID_DOMAIN: |
case GL_SCISSOR_BOX: |
case GL_VIEWPORT: |
trWriteArrayd( 4, params ); |
break; |
case GL_CURRENT_NORMAL: |
trWriteArrayd( 3, params ); |
break; |
case GL_ALIASED_POINT_SIZE_RANGE: |
case GL_ALIASED_LINE_WIDTH_RANGE: |
case GL_DEPTH_RANGE: |
case GL_MAP1_GRID_DOMAIN: |
case GL_MAP2_GRID_SEGMENTS: |
case GL_MAX_VIEWPORT_DIMS: |
case GL_POLYGON_MODE: |
case GL_SMOOTH_LINE_WIDTH_RANGE: |
case GL_SMOOTH_POINT_SIZE_RANGE: |
trWriteArrayd( 2, params ); |
break; |
case GL_ACCUM_ALPHA_BITS: |
case GL_ACCUM_BLUE_BITS: |
case GL_ACCUM_GREEN_BITS: |
case GL_ACCUM_RED_BITS: |
case GL_ACTIVE_TEXTURE_ARB: |
case GL_ALPHA_BIAS: |
case GL_ALPHA_BITS: |
case GL_ALPHA_SCALE: |
case GL_ALPHA_TEST: |
case GL_ALPHA_TEST_FUNC: |
case GL_ALPHA_TEST_REF: |
case GL_ATTRIB_STACK_DEPTH: |
case GL_AUTO_NORMAL: |
case GL_AUX_BUFFERS: |
case GL_BLEND: |
case GL_BLEND_SRC: |
case GL_BLUE_BIAS: |
case GL_BLUE_BITS: |
case GL_BLUE_SCALE: |
case GL_CLIENT_ACTIVE_TEXTURE_ARB: |
case GL_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_CLIP_PLANE0: |
case GL_CLIP_PLANE1: |
case GL_CLIP_PLANE2: |
case GL_CLIP_PLANE3: |
case GL_CLIP_PLANE4: |
case GL_CLIP_PLANE5: |
case GL_COLOR_ARRAY: |
case GL_COLOR_ARRAY_SIZE: |
case GL_COLOR_ARRAY_STRIDE: |
case GL_COLOR_ARRAY_TYPE: |
case GL_COLOR_LOGIC_OP: |
case GL_COLOR_MATERIAL: |
case GL_COLOR_MATERIAL_FACE: |
case GL_COLOR_MATERIAL_PARAMETER: |
case GL_COLOR_MATRIX_STACK_DEPTH: |
case GL_COLOR_TABLE: |
case GL_CONVOLUTION_1D: |
case GL_CONVOLUTION_2D: |
case GL_CULL_FACE: |
case GL_CULL_FACE_MODE: |
case GL_CURRENT_INDEX: |
case GL_CURRENT_RASTER_DISTANCE: |
case GL_CURRENT_RASTER_INDEX: |
case GL_CURRENT_RASTER_POSITION_VALID: |
case GL_DEPTH_BIAS: |
case GL_DEPTH_CLEAR_VALUE: |
case GL_DEPTH_FUNC: |
case GL_DEPTH_SCALE: |
case GL_DEPTH_TEST: |
case GL_DEPTH_WRITEMASK: |
case GL_DITHER: |
case GL_DOUBLEBUFFER: |
case GL_DRAW_BUFFER: |
case GL_EDGE_FLAG: |
case GL_EDGE_FLAG_ARRAY: |
case GL_EDGE_FLAG_ARRAY_STRIDE: |
case GL_FEEDBACK_BUFFER_SIZE: |
case GL_FEEDBACK_BUFFER_TYPE: |
case GL_FOG: |
case GL_FOG_DENSITY: |
case GL_FOG_END: |
case GL_FOG_HINT: |
case GL_FOG_INDEX: |
case GL_FOG_MODE: |
case GL_FOG_START: |
case GL_FRONT_FACE: |
case GL_GREEN_BIAS: |
case GL_GREEN_BITS: |
case GL_GREEN_SCALE: |
case GL_HISTOGRAM: |
case GL_INDEX_ARRAY: |
case GL_INDEX_ARRAY_STRIDE: |
case GL_INDEX_ARRAY_TYPE: |
case GL_INDEX_BITS: |
case GL_INDEX_CLEAR_VALUE: |
case GL_INDEX_LOGIC_OP: |
case GL_INDEX_MODE: |
case GL_INDEX_OFFSET: |
case GL_INDEX_SHIFT: |
case GL_INDEX_WRITEMASK: |
case GL_LIGHT0: |
case GL_LIGHT1: |
case GL_LIGHT2: |
case GL_LIGHT3: |
case GL_LIGHT4: |
case GL_LIGHT5: |
case GL_LIGHT6: |
case GL_LIGHT7: |
case GL_LIGHTING: |
case GL_LIGHT_MODEL_COLOR_CONTROL: |
case GL_LIGHT_MODEL_LOCAL_VIEWER: |
case GL_LIGHT_MODEL_TWO_SIDE: |
case GL_LINE_SMOOTH: |
case GL_LINE_SMOOTH_HINT: |
case GL_LINE_STIPPLE: |
case GL_LINE_STIPPLE_PATTERN: |
case GL_LINE_STIPPLE_REPEAT: |
case GL_LINE_WIDTH: |
case GL_LIST_BASE: |
case GL_LIST_INDEX: |
case GL_LIST_MODE: |
case GL_LOGIC_OP_MODE: |
case GL_MAP1_COLOR_4: |
case GL_MAP1_GRID_SEGMENTS: |
case GL_MAP1_INDEX: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_1: |
case GL_MAP1_TEXTURE_COORD_2: |
case GL_MAP1_TEXTURE_COORD_3: |
case GL_MAP1_TEXTURE_COORD_4: |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_VERTEX_4: |
case GL_MAP2_COLOR_4: |
case GL_MAP2_INDEX: |
case GL_MAP2_NORMAL: |
case GL_MAP2_TEXTURE_COORD_1: |
case GL_MAP2_TEXTURE_COORD_2: |
case GL_MAP2_TEXTURE_COORD_3: |
case GL_MAP2_TEXTURE_COORD_4: |
case GL_MAP2_VERTEX_3: |
case GL_MAP2_VERTEX_4: |
case GL_MAP_COLOR: |
case GL_MAP_STENCIL: |
case GL_MATRIX_MODE: |
case GL_MAX_3D_TEXTURE_SIZE: |
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_MAX_ATTRIB_STACK_DEPTH: |
case GL_MAX_CLIP_PLANES: |
case GL_MAX_COLOR_MATRIX_STACK_DEPTH: |
case GL_MAX_ELEMENTS_VERTICES: |
case GL_MAX_EVAL_ORDER: |
case GL_MAX_LIGHTS: |
case GL_MAX_LIST_NESTING: |
case GL_MAX_MODELVIEW_STACK_DEPTH: |
case GL_MAX_NAME_STACK_DEPTH: |
case GL_MAX_PIXEL_MAP_TABLE: |
case GL_MAX_PROJECTION_STACK_DEPTH: |
case GL_MAX_TEXTURE_SIZE: |
case GL_MAX_TEXTURE_STACK_DEPTH: |
case GL_MAX_TEXTURE_UNITS_ARB: |
case GL_MINMAX: |
case GL_MODELVIEW_STACK_DEPTH: |
case GL_NAME_STACK_DEPTH: |
case GL_NORMAL_ARRAY: |
case GL_NORMAL_ARRAY_STRIDE: |
case GL_NORMAL_ARRAY_TYPE: |
case GL_NORMALIZE: |
case GL_PACK_ALIGNMENT: |
case GL_PACK_IMAGE_HEIGHT: |
case GL_PACK_LSB_FIRST: |
case GL_PACK_ROW_LENGTH: |
case GL_PACK_SKIP_IMAGES: |
case GL_PACK_SKIP_PIXELS: |
case GL_PACK_SKIP_ROWS: |
case GL_PACK_SWAP_BYTES: |
case GL_PERSPECTIVE_CORRECTION_HINT: |
case GL_PIXEL_MAP_A_TO_A_SIZE: |
case GL_PIXEL_MAP_B_TO_B_SIZE: |
case GL_PIXEL_MAP_G_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_A_SIZE: |
case GL_PIXEL_MAP_I_TO_B_SIZE: |
case GL_PIXEL_MAP_I_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_I_SIZE: |
case GL_PIXEL_MAP_I_TO_R_SIZE: |
case GL_PIXEL_MAP_R_TO_R_SIZE: |
case GL_PIXEL_MAP_S_TO_S_SIZE: |
case GL_POINT_SIZE: |
case GL_POINT_SMOOTH: |
case GL_POINT_SMOOTH_HINT: |
case GL_POLYGON_OFFSET_FACTOR: |
case GL_POLYGON_OFFSET_UNITS: |
case GL_POLYGON_OFFSET_FILL: |
case GL_POLYGON_OFFSET_LINE: |
case GL_POLYGON_OFFSET_POINT: |
case GL_POLYGON_SMOOTH: |
case GL_POLYGON_SMOOTH_HINT: |
case GL_POLYGON_STIPPLE: |
case GL_POST_COLOR_MATRIX_COLOR_TABLE: |
case GL_POST_COLOR_MATRIX_RED_BIAS: |
case GL_POST_COLOR_MATRIX_GREEN_BIAS: |
case GL_POST_COLOR_MATRIX_BLUE_BIAS: |
case GL_POST_COLOR_MATRIX_ALPHA_BIAS: |
case GL_POST_COLOR_MATRIX_RED_SCALE: |
case GL_POST_COLOR_MATRIX_GREEN_SCALE: |
case GL_POST_COLOR_MATRIX_BLUE_SCALE: |
case GL_POST_COLOR_MATRIX_ALPHA_SCALE: |
case GL_POST_CONVOLUTION_COLOR_TABLE: |
case GL_POST_CONVOLUTION_RED_BIAS: |
case GL_POST_CONVOLUTION_GREEN_BIAS: |
case GL_POST_CONVOLUTION_BLUE_BIAS: |
case GL_POST_CONVOLUTION_ALPHA_BIAS: |
case GL_POST_CONVOLUTION_RED_SCALE: |
case GL_POST_CONVOLUTION_GREEN_SCALE: |
case GL_POST_CONVOLUTION_BLUE_SCALE: |
case GL_POST_CONVOLUTION_ALPHA_SCALE: |
case GL_PROJECTION_STACK_DEPTH: |
case GL_READ_BUFFER: |
case GL_RED_BIAS: |
case GL_RED_BITS: |
case GL_RED_SCALE: |
case GL_RENDER_MODE: |
case GL_RESCALE_NORMAL: |
case GL_RGBA_MODE: |
case GL_SCISSOR_TEST: |
case GL_SELECTION_BUFFER_SIZE: |
case GL_SEPARABLE_2D: |
case GL_SHADE_MODEL: |
case GL_SMOOTH_LINE_WIDTH_GRANULARITY: |
case GL_SMOOTH_POINT_SIZE_GRANULARITY: |
case GL_STENCIL_BITS: |
case GL_STENCIL_CLEAR_VALUE: |
case GL_STENCIL_FAIL: |
case GL_STENCIL_FUNC: |
case GL_STENCIL_PASS_DEPTH_FAIL: |
case GL_STENCIL_PASS_DEPTH_PASS: |
case GL_STENCIL_REF: |
case GL_STENCIL_TEST: |
case GL_STENCIL_VALUE_MASK: |
case GL_STENCIL_WRITEMASK: |
case GL_STEREO: |
case GL_SUBPIXEL_BITS: |
case GL_TEXTURE_1D: |
case GL_TEXTURE_BINDING_1D: |
case GL_TEXTURE_2D: |
case GL_TEXTURE_BINDING_2D: |
case GL_TEXTURE_3D: |
case GL_TEXTURE_BINDING_3D: |
case GL_TEXTURE_COORD_ARRAY: |
case GL_TEXTURE_COORD_ARRAY_SIZE: |
case GL_TEXTURE_COORD_ARRAY_STRIDE: |
case GL_TEXTURE_COORD_ARRAY_TYPE: |
case GL_TEXTURE_GEN_Q: |
case GL_TEXTURE_GEN_R: |
case GL_TEXTURE_GEN_S: |
case GL_TEXTURE_GEN_T: |
case GL_TEXTURE_STACK_DEPTH: |
case GL_UNPACK_ALIGNMENT: |
case GL_UNPACK_IMAGE_HEIGHT: |
case GL_UNPACK_LSB_FIRST: |
case GL_UNPACK_ROW_LENGTH: |
case GL_UNPACK_SKIP_IMAGES: |
case GL_UNPACK_SKIP_PIXELS: |
case GL_UNPACK_SKIP_ROWS: |
case GL_UNPACK_SWAP_BYTES: |
case GL_VERTEX_ARRAY: |
case GL_VERTEX_ARRAY_SIZE: |
case GL_VERTEX_ARRAY_STRIDE: |
case GL_VERTEX_ARRAY_TYPE: |
case GL_ZOOM_X: |
case GL_ZOOM_Y: |
trWrited( params[0] ); |
break; |
default: |
/* Bad enum. What should we do? */ |
break; |
} |
} |
GLAPI GLenum GLAPIENTRY trGetError( void ) { |
GLenum retval; |
trWriteCMD( CMD_GETERROR ); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->GetError( ); |
trError(); |
} else { |
retval = GL_NO_ERROR; |
} |
trWriteEnum( retval ); |
return retval; |
} |
GLAPI void GLAPIENTRY trGetFloatv( GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETFLOATV ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetFloatv( pname, params ); |
trError(); |
} else { |
trZeroGetterData( pname, sizeof(GLfloat), params ); |
} |
switch( pname ) { |
case GL_COLOR_MATRIX: |
case GL_MODELVIEW_MATRIX: |
case GL_PROJECTION_MATRIX: |
case GL_TEXTURE_MATRIX: |
trWriteArrayf( 16, params ); |
break; |
case GL_ACCUM_CLEAR_VALUE: |
case GL_BLEND_COLOR: |
case GL_COLOR_CLEAR_VALUE: |
case GL_COLOR_WRITEMASK: |
case GL_CURRENT_COLOR: |
case GL_CURRENT_RASTER_COLOR: |
case GL_CURRENT_RASTER_POSITION: |
case GL_CURRENT_RASTER_TEXTURE_COORDS: |
case GL_CURRENT_TEXTURE_COORDS: |
case GL_LIGHT_MODEL_AMBIENT: |
case GL_MAP2_GRID_DOMAIN: |
case GL_SCISSOR_BOX: |
case GL_VIEWPORT: |
trWriteArrayf( 4, params ); |
break; |
case GL_CURRENT_NORMAL: |
trWriteArrayf( 3, params ); |
break; |
case GL_ALIASED_POINT_SIZE_RANGE: |
case GL_ALIASED_LINE_WIDTH_RANGE: |
case GL_DEPTH_RANGE: |
case GL_MAP1_GRID_DOMAIN: |
case GL_MAP2_GRID_SEGMENTS: |
case GL_MAX_VIEWPORT_DIMS: |
case GL_POLYGON_MODE: |
case GL_SMOOTH_LINE_WIDTH_RANGE: |
case GL_SMOOTH_POINT_SIZE_RANGE: |
trWriteArrayf( 2, params ); |
break; |
case GL_ACCUM_ALPHA_BITS: |
case GL_ACCUM_BLUE_BITS: |
case GL_ACCUM_GREEN_BITS: |
case GL_ACCUM_RED_BITS: |
case GL_ACTIVE_TEXTURE_ARB: |
case GL_ALPHA_BIAS: |
case GL_ALPHA_BITS: |
case GL_ALPHA_SCALE: |
case GL_ALPHA_TEST: |
case GL_ALPHA_TEST_FUNC: |
case GL_ALPHA_TEST_REF: |
case GL_ATTRIB_STACK_DEPTH: |
case GL_AUTO_NORMAL: |
case GL_AUX_BUFFERS: |
case GL_BLEND: |
case GL_BLEND_SRC: |
case GL_BLUE_BIAS: |
case GL_BLUE_BITS: |
case GL_BLUE_SCALE: |
case GL_CLIENT_ACTIVE_TEXTURE_ARB: |
case GL_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_CLIP_PLANE0: |
case GL_CLIP_PLANE1: |
case GL_CLIP_PLANE2: |
case GL_CLIP_PLANE3: |
case GL_CLIP_PLANE4: |
case GL_CLIP_PLANE5: |
case GL_COLOR_ARRAY: |
case GL_COLOR_ARRAY_SIZE: |
case GL_COLOR_ARRAY_STRIDE: |
case GL_COLOR_ARRAY_TYPE: |
case GL_COLOR_LOGIC_OP: |
case GL_COLOR_MATERIAL: |
case GL_COLOR_MATERIAL_FACE: |
case GL_COLOR_MATERIAL_PARAMETER: |
case GL_COLOR_MATRIX_STACK_DEPTH: |
case GL_COLOR_TABLE: |
case GL_CONVOLUTION_1D: |
case GL_CONVOLUTION_2D: |
case GL_CULL_FACE: |
case GL_CULL_FACE_MODE: |
case GL_CURRENT_INDEX: |
case GL_CURRENT_RASTER_DISTANCE: |
case GL_CURRENT_RASTER_INDEX: |
case GL_CURRENT_RASTER_POSITION_VALID: |
case GL_DEPTH_BIAS: |
case GL_DEPTH_CLEAR_VALUE: |
case GL_DEPTH_FUNC: |
case GL_DEPTH_SCALE: |
case GL_DEPTH_TEST: |
case GL_DEPTH_WRITEMASK: |
case GL_DITHER: |
case GL_DOUBLEBUFFER: |
case GL_DRAW_BUFFER: |
case GL_EDGE_FLAG: |
case GL_EDGE_FLAG_ARRAY: |
case GL_EDGE_FLAG_ARRAY_STRIDE: |
case GL_FEEDBACK_BUFFER_SIZE: |
case GL_FEEDBACK_BUFFER_TYPE: |
case GL_FOG: |
case GL_FOG_DENSITY: |
case GL_FOG_END: |
case GL_FOG_HINT: |
case GL_FOG_INDEX: |
case GL_FOG_MODE: |
case GL_FOG_START: |
case GL_FRONT_FACE: |
case GL_GREEN_BIAS: |
case GL_GREEN_BITS: |
case GL_GREEN_SCALE: |
case GL_HISTOGRAM: |
case GL_INDEX_ARRAY: |
case GL_INDEX_ARRAY_STRIDE: |
case GL_INDEX_ARRAY_TYPE: |
case GL_INDEX_BITS: |
case GL_INDEX_CLEAR_VALUE: |
case GL_INDEX_LOGIC_OP: |
case GL_INDEX_MODE: |
case GL_INDEX_OFFSET: |
case GL_INDEX_SHIFT: |
case GL_INDEX_WRITEMASK: |
case GL_LIGHT0: |
case GL_LIGHT1: |
case GL_LIGHT2: |
case GL_LIGHT3: |
case GL_LIGHT4: |
case GL_LIGHT5: |
case GL_LIGHT6: |
case GL_LIGHT7: |
case GL_LIGHTING: |
case GL_LIGHT_MODEL_COLOR_CONTROL: |
case GL_LIGHT_MODEL_LOCAL_VIEWER: |
case GL_LIGHT_MODEL_TWO_SIDE: |
case GL_LINE_SMOOTH: |
case GL_LINE_SMOOTH_HINT: |
case GL_LINE_STIPPLE: |
case GL_LINE_STIPPLE_PATTERN: |
case GL_LINE_STIPPLE_REPEAT: |
case GL_LINE_WIDTH: |
case GL_LIST_BASE: |
case GL_LIST_INDEX: |
case GL_LIST_MODE: |
case GL_LOGIC_OP_MODE: |
case GL_MAP1_COLOR_4: |
case GL_MAP1_GRID_SEGMENTS: |
case GL_MAP1_INDEX: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_1: |
case GL_MAP1_TEXTURE_COORD_2: |
case GL_MAP1_TEXTURE_COORD_3: |
case GL_MAP1_TEXTURE_COORD_4: |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_VERTEX_4: |
case GL_MAP2_COLOR_4: |
case GL_MAP2_INDEX: |
case GL_MAP2_NORMAL: |
case GL_MAP2_TEXTURE_COORD_1: |
case GL_MAP2_TEXTURE_COORD_2: |
case GL_MAP2_TEXTURE_COORD_3: |
case GL_MAP2_TEXTURE_COORD_4: |
case GL_MAP2_VERTEX_3: |
case GL_MAP2_VERTEX_4: |
case GL_MAP_COLOR: |
case GL_MAP_STENCIL: |
case GL_MATRIX_MODE: |
case GL_MAX_3D_TEXTURE_SIZE: |
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_MAX_ATTRIB_STACK_DEPTH: |
case GL_MAX_CLIP_PLANES: |
case GL_MAX_COLOR_MATRIX_STACK_DEPTH: |
case GL_MAX_ELEMENTS_VERTICES: |
case GL_MAX_EVAL_ORDER: |
case GL_MAX_LIGHTS: |
case GL_MAX_LIST_NESTING: |
case GL_MAX_MODELVIEW_STACK_DEPTH: |
case GL_MAX_NAME_STACK_DEPTH: |
case GL_MAX_PIXEL_MAP_TABLE: |
case GL_MAX_PROJECTION_STACK_DEPTH: |
case GL_MAX_TEXTURE_SIZE: |
case GL_MAX_TEXTURE_STACK_DEPTH: |
case GL_MAX_TEXTURE_UNITS_ARB: |
case GL_MINMAX: |
case GL_MODELVIEW_STACK_DEPTH: |
case GL_NAME_STACK_DEPTH: |
case GL_NORMAL_ARRAY: |
case GL_NORMAL_ARRAY_STRIDE: |
case GL_NORMAL_ARRAY_TYPE: |
case GL_NORMALIZE: |
case GL_PACK_ALIGNMENT: |
case GL_PACK_IMAGE_HEIGHT: |
case GL_PACK_LSB_FIRST: |
case GL_PACK_ROW_LENGTH: |
case GL_PACK_SKIP_IMAGES: |
case GL_PACK_SKIP_PIXELS: |
case GL_PACK_SKIP_ROWS: |
case GL_PACK_SWAP_BYTES: |
case GL_PERSPECTIVE_CORRECTION_HINT: |
case GL_PIXEL_MAP_A_TO_A_SIZE: |
case GL_PIXEL_MAP_B_TO_B_SIZE: |
case GL_PIXEL_MAP_G_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_A_SIZE: |
case GL_PIXEL_MAP_I_TO_B_SIZE: |
case GL_PIXEL_MAP_I_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_I_SIZE: |
case GL_PIXEL_MAP_I_TO_R_SIZE: |
case GL_PIXEL_MAP_R_TO_R_SIZE: |
case GL_PIXEL_MAP_S_TO_S_SIZE: |
case GL_POINT_SIZE: |
case GL_POINT_SMOOTH: |
case GL_POINT_SMOOTH_HINT: |
case GL_POLYGON_OFFSET_FACTOR: |
case GL_POLYGON_OFFSET_UNITS: |
case GL_POLYGON_OFFSET_FILL: |
case GL_POLYGON_OFFSET_LINE: |
case GL_POLYGON_OFFSET_POINT: |
case GL_POLYGON_SMOOTH: |
case GL_POLYGON_SMOOTH_HINT: |
case GL_POLYGON_STIPPLE: |
case GL_POST_COLOR_MATRIX_COLOR_TABLE: |
case GL_POST_COLOR_MATRIX_RED_BIAS: |
case GL_POST_COLOR_MATRIX_GREEN_BIAS: |
case GL_POST_COLOR_MATRIX_BLUE_BIAS: |
case GL_POST_COLOR_MATRIX_ALPHA_BIAS: |
case GL_POST_COLOR_MATRIX_RED_SCALE: |
case GL_POST_COLOR_MATRIX_GREEN_SCALE: |
case GL_POST_COLOR_MATRIX_BLUE_SCALE: |
case GL_POST_COLOR_MATRIX_ALPHA_SCALE: |
case GL_POST_CONVOLUTION_COLOR_TABLE: |
case GL_POST_CONVOLUTION_RED_BIAS: |
case GL_POST_CONVOLUTION_GREEN_BIAS: |
case GL_POST_CONVOLUTION_BLUE_BIAS: |
case GL_POST_CONVOLUTION_ALPHA_BIAS: |
case GL_POST_CONVOLUTION_RED_SCALE: |
case GL_POST_CONVOLUTION_GREEN_SCALE: |
case GL_POST_CONVOLUTION_BLUE_SCALE: |
case GL_POST_CONVOLUTION_ALPHA_SCALE: |
case GL_PROJECTION_STACK_DEPTH: |
case GL_READ_BUFFER: |
case GL_RED_BIAS: |
case GL_RED_BITS: |
case GL_RED_SCALE: |
case GL_RENDER_MODE: |
case GL_RESCALE_NORMAL: |
case GL_RGBA_MODE: |
case GL_SCISSOR_TEST: |
case GL_SELECTION_BUFFER_SIZE: |
case GL_SEPARABLE_2D: |
case GL_SHADE_MODEL: |
case GL_SMOOTH_LINE_WIDTH_GRANULARITY: |
case GL_SMOOTH_POINT_SIZE_GRANULARITY: |
case GL_STENCIL_BITS: |
case GL_STENCIL_CLEAR_VALUE: |
case GL_STENCIL_FAIL: |
case GL_STENCIL_FUNC: |
case GL_STENCIL_PASS_DEPTH_FAIL: |
case GL_STENCIL_PASS_DEPTH_PASS: |
case GL_STENCIL_REF: |
case GL_STENCIL_TEST: |
case GL_STENCIL_VALUE_MASK: |
case GL_STENCIL_WRITEMASK: |
case GL_STEREO: |
case GL_SUBPIXEL_BITS: |
case GL_TEXTURE_1D: |
case GL_TEXTURE_BINDING_1D: |
case GL_TEXTURE_2D: |
case GL_TEXTURE_BINDING_2D: |
case GL_TEXTURE_3D: |
case GL_TEXTURE_BINDING_3D: |
case GL_TEXTURE_COORD_ARRAY: |
case GL_TEXTURE_COORD_ARRAY_SIZE: |
case GL_TEXTURE_COORD_ARRAY_STRIDE: |
case GL_TEXTURE_COORD_ARRAY_TYPE: |
case GL_TEXTURE_GEN_Q: |
case GL_TEXTURE_GEN_R: |
case GL_TEXTURE_GEN_S: |
case GL_TEXTURE_GEN_T: |
case GL_TEXTURE_STACK_DEPTH: |
case GL_UNPACK_ALIGNMENT: |
case GL_UNPACK_IMAGE_HEIGHT: |
case GL_UNPACK_LSB_FIRST: |
case GL_UNPACK_ROW_LENGTH: |
case GL_UNPACK_SKIP_IMAGES: |
case GL_UNPACK_SKIP_PIXELS: |
case GL_UNPACK_SKIP_ROWS: |
case GL_UNPACK_SWAP_BYTES: |
case GL_VERTEX_ARRAY: |
case GL_VERTEX_ARRAY_SIZE: |
case GL_VERTEX_ARRAY_STRIDE: |
case GL_VERTEX_ARRAY_TYPE: |
case GL_ZOOM_X: |
case GL_ZOOM_Y: |
trWritef( params[0] ); |
break; |
default: |
/* Bad enum. What should we do? */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetHistogram( GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values ) { /* TODO */ |
trWriteCMD( CMD_GETHISTOGRAM ); |
trWriteEnum( target ); |
trWriteBool( reset ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)values ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetHistogram( target, reset, format, type, values ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetHistogramParameterfv( GLenum target, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETHISTOGRAMPARAMETERFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetHistogramParameterfv( target, pname, params ); |
trError(); |
} else { |
params[0] = 0; |
} |
trWritef( params[0] ); |
} |
GLAPI void GLAPIENTRY trGetHistogramParameteriv( GLenum target, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETHISTOGRAMPARAMETERIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetHistogramParameteriv( target, pname, params ); |
trError(); |
} else { |
params[0] = 0; |
} |
trWritei( params[0] ); |
} |
GLAPI void GLAPIENTRY trGetIntegerv( GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETINTEGERV ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetIntegerv( pname, params ); |
trError(); |
} else { |
trZeroGetterData( pname, sizeof(GLint), params ); |
} |
switch( pname ) { |
case GL_COLOR_MATRIX: |
case GL_MODELVIEW_MATRIX: |
case GL_PROJECTION_MATRIX: |
case GL_TEXTURE_MATRIX: |
trWriteArrayi( 16, params ); |
break; |
case GL_ACCUM_CLEAR_VALUE: |
case GL_BLEND_COLOR: |
case GL_COLOR_CLEAR_VALUE: |
case GL_COLOR_WRITEMASK: |
case GL_CURRENT_COLOR: |
case GL_CURRENT_RASTER_COLOR: |
case GL_CURRENT_RASTER_POSITION: |
case GL_CURRENT_RASTER_TEXTURE_COORDS: |
case GL_CURRENT_TEXTURE_COORDS: |
case GL_LIGHT_MODEL_AMBIENT: |
case GL_MAP2_GRID_DOMAIN: |
case GL_SCISSOR_BOX: |
case GL_VIEWPORT: |
trWriteArrayi( 4, params ); |
break; |
case GL_CURRENT_NORMAL: |
trWriteArrayi( 3, params ); |
break; |
case GL_ALIASED_POINT_SIZE_RANGE: |
case GL_ALIASED_LINE_WIDTH_RANGE: |
case GL_DEPTH_RANGE: |
case GL_MAP1_GRID_DOMAIN: |
case GL_MAP2_GRID_SEGMENTS: |
case GL_MAX_VIEWPORT_DIMS: |
case GL_POLYGON_MODE: |
case GL_SMOOTH_LINE_WIDTH_RANGE: |
case GL_SMOOTH_POINT_SIZE_RANGE: |
trWriteArrayi( 2, params ); |
break; |
case GL_ACCUM_ALPHA_BITS: |
case GL_ACCUM_BLUE_BITS: |
case GL_ACCUM_GREEN_BITS: |
case GL_ACCUM_RED_BITS: |
case GL_ACTIVE_TEXTURE_ARB: |
case GL_ALPHA_BIAS: |
case GL_ALPHA_BITS: |
case GL_ALPHA_SCALE: |
case GL_ALPHA_TEST: |
case GL_ALPHA_TEST_FUNC: |
case GL_ALPHA_TEST_REF: |
case GL_ATTRIB_STACK_DEPTH: |
case GL_AUTO_NORMAL: |
case GL_AUX_BUFFERS: |
case GL_BLEND: |
case GL_BLEND_SRC: |
case GL_BLUE_BIAS: |
case GL_BLUE_BITS: |
case GL_BLUE_SCALE: |
case GL_CLIENT_ACTIVE_TEXTURE_ARB: |
case GL_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_CLIP_PLANE0: |
case GL_CLIP_PLANE1: |
case GL_CLIP_PLANE2: |
case GL_CLIP_PLANE3: |
case GL_CLIP_PLANE4: |
case GL_CLIP_PLANE5: |
case GL_COLOR_ARRAY: |
case GL_COLOR_ARRAY_SIZE: |
case GL_COLOR_ARRAY_STRIDE: |
case GL_COLOR_ARRAY_TYPE: |
case GL_COLOR_LOGIC_OP: |
case GL_COLOR_MATERIAL: |
case GL_COLOR_MATERIAL_FACE: |
case GL_COLOR_MATERIAL_PARAMETER: |
case GL_COLOR_MATRIX_STACK_DEPTH: |
case GL_COLOR_TABLE: |
case GL_CONVOLUTION_1D: |
case GL_CONVOLUTION_2D: |
case GL_CULL_FACE: |
case GL_CULL_FACE_MODE: |
case GL_CURRENT_INDEX: |
case GL_CURRENT_RASTER_DISTANCE: |
case GL_CURRENT_RASTER_INDEX: |
case GL_CURRENT_RASTER_POSITION_VALID: |
case GL_DEPTH_BIAS: |
case GL_DEPTH_CLEAR_VALUE: |
case GL_DEPTH_FUNC: |
case GL_DEPTH_SCALE: |
case GL_DEPTH_TEST: |
case GL_DEPTH_WRITEMASK: |
case GL_DITHER: |
case GL_DOUBLEBUFFER: |
case GL_DRAW_BUFFER: |
case GL_EDGE_FLAG: |
case GL_EDGE_FLAG_ARRAY: |
case GL_EDGE_FLAG_ARRAY_STRIDE: |
case GL_FEEDBACK_BUFFER_SIZE: |
case GL_FEEDBACK_BUFFER_TYPE: |
case GL_FOG: |
case GL_FOG_DENSITY: |
case GL_FOG_END: |
case GL_FOG_HINT: |
case GL_FOG_INDEX: |
case GL_FOG_MODE: |
case GL_FOG_START: |
case GL_FRONT_FACE: |
case GL_GREEN_BIAS: |
case GL_GREEN_BITS: |
case GL_GREEN_SCALE: |
case GL_HISTOGRAM: |
case GL_INDEX_ARRAY: |
case GL_INDEX_ARRAY_STRIDE: |
case GL_INDEX_ARRAY_TYPE: |
case GL_INDEX_BITS: |
case GL_INDEX_CLEAR_VALUE: |
case GL_INDEX_LOGIC_OP: |
case GL_INDEX_MODE: |
case GL_INDEX_OFFSET: |
case GL_INDEX_SHIFT: |
case GL_INDEX_WRITEMASK: |
case GL_LIGHT0: |
case GL_LIGHT1: |
case GL_LIGHT2: |
case GL_LIGHT3: |
case GL_LIGHT4: |
case GL_LIGHT5: |
case GL_LIGHT6: |
case GL_LIGHT7: |
case GL_LIGHTING: |
case GL_LIGHT_MODEL_COLOR_CONTROL: |
case GL_LIGHT_MODEL_LOCAL_VIEWER: |
case GL_LIGHT_MODEL_TWO_SIDE: |
case GL_LINE_SMOOTH: |
case GL_LINE_SMOOTH_HINT: |
case GL_LINE_STIPPLE: |
case GL_LINE_STIPPLE_PATTERN: |
case GL_LINE_STIPPLE_REPEAT: |
case GL_LINE_WIDTH: |
case GL_LIST_BASE: |
case GL_LIST_INDEX: |
case GL_LIST_MODE: |
case GL_LOGIC_OP_MODE: |
case GL_MAP1_COLOR_4: |
case GL_MAP1_GRID_SEGMENTS: |
case GL_MAP1_INDEX: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_1: |
case GL_MAP1_TEXTURE_COORD_2: |
case GL_MAP1_TEXTURE_COORD_3: |
case GL_MAP1_TEXTURE_COORD_4: |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_VERTEX_4: |
case GL_MAP2_COLOR_4: |
case GL_MAP2_INDEX: |
case GL_MAP2_NORMAL: |
case GL_MAP2_TEXTURE_COORD_1: |
case GL_MAP2_TEXTURE_COORD_2: |
case GL_MAP2_TEXTURE_COORD_3: |
case GL_MAP2_TEXTURE_COORD_4: |
case GL_MAP2_VERTEX_3: |
case GL_MAP2_VERTEX_4: |
case GL_MAP_COLOR: |
case GL_MAP_STENCIL: |
case GL_MATRIX_MODE: |
case GL_MAX_3D_TEXTURE_SIZE: |
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: |
case GL_MAX_ATTRIB_STACK_DEPTH: |
case GL_MAX_CLIP_PLANES: |
case GL_MAX_COLOR_MATRIX_STACK_DEPTH: |
case GL_MAX_ELEMENTS_VERTICES: |
case GL_MAX_EVAL_ORDER: |
case GL_MAX_LIGHTS: |
case GL_MAX_LIST_NESTING: |
case GL_MAX_MODELVIEW_STACK_DEPTH: |
case GL_MAX_NAME_STACK_DEPTH: |
case GL_MAX_PIXEL_MAP_TABLE: |
case GL_MAX_PROJECTION_STACK_DEPTH: |
case GL_MAX_TEXTURE_SIZE: |
case GL_MAX_TEXTURE_STACK_DEPTH: |
case GL_MAX_TEXTURE_UNITS_ARB: |
case GL_MINMAX: |
case GL_MODELVIEW_STACK_DEPTH: |
case GL_NAME_STACK_DEPTH: |
case GL_NORMAL_ARRAY: |
case GL_NORMAL_ARRAY_STRIDE: |
case GL_NORMAL_ARRAY_TYPE: |
case GL_NORMALIZE: |
case GL_PACK_ALIGNMENT: |
case GL_PACK_IMAGE_HEIGHT: |
case GL_PACK_LSB_FIRST: |
case GL_PACK_ROW_LENGTH: |
case GL_PACK_SKIP_IMAGES: |
case GL_PACK_SKIP_PIXELS: |
case GL_PACK_SKIP_ROWS: |
case GL_PACK_SWAP_BYTES: |
case GL_PERSPECTIVE_CORRECTION_HINT: |
case GL_PIXEL_MAP_A_TO_A_SIZE: |
case GL_PIXEL_MAP_B_TO_B_SIZE: |
case GL_PIXEL_MAP_G_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_A_SIZE: |
case GL_PIXEL_MAP_I_TO_B_SIZE: |
case GL_PIXEL_MAP_I_TO_G_SIZE: |
case GL_PIXEL_MAP_I_TO_I_SIZE: |
case GL_PIXEL_MAP_I_TO_R_SIZE: |
case GL_PIXEL_MAP_R_TO_R_SIZE: |
case GL_PIXEL_MAP_S_TO_S_SIZE: |
case GL_POINT_SIZE: |
case GL_POINT_SMOOTH: |
case GL_POINT_SMOOTH_HINT: |
case GL_POLYGON_OFFSET_FACTOR: |
case GL_POLYGON_OFFSET_UNITS: |
case GL_POLYGON_OFFSET_FILL: |
case GL_POLYGON_OFFSET_LINE: |
case GL_POLYGON_OFFSET_POINT: |
case GL_POLYGON_SMOOTH: |
case GL_POLYGON_SMOOTH_HINT: |
case GL_POLYGON_STIPPLE: |
case GL_POST_COLOR_MATRIX_COLOR_TABLE: |
case GL_POST_COLOR_MATRIX_RED_BIAS: |
case GL_POST_COLOR_MATRIX_GREEN_BIAS: |
case GL_POST_COLOR_MATRIX_BLUE_BIAS: |
case GL_POST_COLOR_MATRIX_ALPHA_BIAS: |
case GL_POST_COLOR_MATRIX_RED_SCALE: |
case GL_POST_COLOR_MATRIX_GREEN_SCALE: |
case GL_POST_COLOR_MATRIX_BLUE_SCALE: |
case GL_POST_COLOR_MATRIX_ALPHA_SCALE: |
case GL_POST_CONVOLUTION_COLOR_TABLE: |
case GL_POST_CONVOLUTION_RED_BIAS: |
case GL_POST_CONVOLUTION_GREEN_BIAS: |
case GL_POST_CONVOLUTION_BLUE_BIAS: |
case GL_POST_CONVOLUTION_ALPHA_BIAS: |
case GL_POST_CONVOLUTION_RED_SCALE: |
case GL_POST_CONVOLUTION_GREEN_SCALE: |
case GL_POST_CONVOLUTION_BLUE_SCALE: |
case GL_POST_CONVOLUTION_ALPHA_SCALE: |
case GL_PROJECTION_STACK_DEPTH: |
case GL_READ_BUFFER: |
case GL_RED_BIAS: |
case GL_RED_BITS: |
case GL_RED_SCALE: |
case GL_RENDER_MODE: |
case GL_RESCALE_NORMAL: |
case GL_RGBA_MODE: |
case GL_SCISSOR_TEST: |
case GL_SELECTION_BUFFER_SIZE: |
case GL_SEPARABLE_2D: |
case GL_SHADE_MODEL: |
case GL_SMOOTH_LINE_WIDTH_GRANULARITY: |
case GL_SMOOTH_POINT_SIZE_GRANULARITY: |
case GL_STENCIL_BITS: |
case GL_STENCIL_CLEAR_VALUE: |
case GL_STENCIL_FAIL: |
case GL_STENCIL_FUNC: |
case GL_STENCIL_PASS_DEPTH_FAIL: |
case GL_STENCIL_PASS_DEPTH_PASS: |
case GL_STENCIL_REF: |
case GL_STENCIL_TEST: |
case GL_STENCIL_VALUE_MASK: |
case GL_STENCIL_WRITEMASK: |
case GL_STEREO: |
case GL_SUBPIXEL_BITS: |
case GL_TEXTURE_1D: |
case GL_TEXTURE_BINDING_1D: |
case GL_TEXTURE_2D: |
case GL_TEXTURE_BINDING_2D: |
case GL_TEXTURE_3D: |
case GL_TEXTURE_BINDING_3D: |
case GL_TEXTURE_COORD_ARRAY: |
case GL_TEXTURE_COORD_ARRAY_SIZE: |
case GL_TEXTURE_COORD_ARRAY_STRIDE: |
case GL_TEXTURE_COORD_ARRAY_TYPE: |
case GL_TEXTURE_GEN_Q: |
case GL_TEXTURE_GEN_R: |
case GL_TEXTURE_GEN_S: |
case GL_TEXTURE_GEN_T: |
case GL_TEXTURE_STACK_DEPTH: |
case GL_UNPACK_ALIGNMENT: |
case GL_UNPACK_IMAGE_HEIGHT: |
case GL_UNPACK_LSB_FIRST: |
case GL_UNPACK_ROW_LENGTH: |
case GL_UNPACK_SKIP_IMAGES: |
case GL_UNPACK_SKIP_PIXELS: |
case GL_UNPACK_SKIP_ROWS: |
case GL_UNPACK_SWAP_BYTES: |
case GL_VERTEX_ARRAY: |
case GL_VERTEX_ARRAY_SIZE: |
case GL_VERTEX_ARRAY_STRIDE: |
case GL_VERTEX_ARRAY_TYPE: |
case GL_ZOOM_X: |
case GL_ZOOM_Y: |
trWritei( params[0] ); |
break; |
default: |
/* Bad enum. What should we do? */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetLightfv( GLenum light, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETLIGHTFV ); |
trWriteEnum( light ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetLightfv( light, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_POSITION: |
memset( params, 0, 4 * sizeof(GLfloat) ); |
break; |
case GL_SPOT_DIRECTION: |
memset( params, 0, 3 * sizeof(GLfloat) ); |
break; |
case GL_SPOT_EXPONENT: |
case GL_SPOT_CUTOFF: |
case GL_CONSTANT_ATTENUATION: |
case GL_LINEAR_ATTENUATION: |
case GL_QUADRATIC_ATTENUATION: |
params[0] = 0; |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_POSITION: |
trWriteArrayf( 4, params ); |
break; |
case GL_SPOT_DIRECTION: |
trWriteArrayf( 3, params ); |
break; |
case GL_SPOT_EXPONENT: |
case GL_SPOT_CUTOFF: |
case GL_CONSTANT_ATTENUATION: |
case GL_LINEAR_ATTENUATION: |
case GL_QUADRATIC_ATTENUATION: |
trWritef( params[0] ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetLightiv( GLenum light, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETLIGHTIV ); |
trWriteEnum( light ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetLightiv( light, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_POSITION: |
memset( params, 0, 4 * sizeof(GLint) ); |
break; |
case GL_SPOT_DIRECTION: |
memset( params, 0, 3 * sizeof(GLint) ); |
break; |
case GL_SPOT_EXPONENT: |
case GL_SPOT_CUTOFF: |
case GL_CONSTANT_ATTENUATION: |
case GL_LINEAR_ATTENUATION: |
case GL_QUADRATIC_ATTENUATION: |
params[0] = 0; |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_POSITION: |
trWriteArrayi( 4, params ); |
break; |
case GL_SPOT_DIRECTION: |
trWriteArrayi( 3, params ); |
break; |
case GL_SPOT_EXPONENT: |
case GL_SPOT_CUTOFF: |
case GL_CONSTANT_ATTENUATION: |
case GL_LINEAR_ATTENUATION: |
case GL_QUADRATIC_ATTENUATION: |
trWritei( params[0] ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetMapdv( GLenum target, GLenum query, GLdouble *v ) { /* TODO */ |
trWriteCMD( CMD_GETMAPDV ); |
trWriteEnum( target ); |
trWriteEnum( query ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetMapdv( target, query, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetMapfv( GLenum target, GLenum query, GLfloat *v ) { /* TODO */ |
trWriteCMD( CMD_GETMAPFV ); |
trWriteEnum( target ); |
trWriteEnum( query ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetMapfv( target, query, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetMapiv( GLenum target, GLenum query, GLint *v ) { /* TODO */ |
trWriteCMD( CMD_GETMAPIV ); |
trWriteEnum( target ); |
trWriteEnum( query ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetMapiv( target, query, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETMATERIALFV ); |
trWriteEnum( face ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetMaterialfv( face, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_EMISSION: |
memset( params, 0, 4 * sizeof(GLfloat) ); |
break; |
case GL_COLOR_INDEXES: |
memset( params, 0, 3 * sizeof(GLfloat) ); |
break; |
case GL_SHININESS: |
params[0] = 0; |
break; |
default: |
/* The 2nd pass will pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_EMISSION: |
trWriteArrayf( 4, params ); |
break; |
case GL_COLOR_INDEXES: |
trWriteArrayf( 3, params ); |
break; |
case GL_SHININESS: |
trWritef( params[0] ); |
break; |
default: |
/* The 2nd pass will pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetMaterialiv( GLenum face, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETMATERIALIV ); |
trWriteEnum( face ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetMaterialiv( face, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_EMISSION: |
memset( params, 0, 4 * sizeof(GLint) ); |
break; |
case GL_COLOR_INDEXES: |
memset( params, 0, 3 * sizeof(GLint) ); |
break; |
case GL_SHININESS: |
params[0] = 0; |
break; |
default: |
/* The 2nd pass will pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_EMISSION: |
trWriteArrayi( 4, params ); |
break; |
case GL_COLOR_INDEXES: |
trWriteArrayi( 3, params ); |
break; |
case GL_SHININESS: |
trWritei( params[0] ); |
break; |
default: |
/* The 2nd pass will pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetMinmax( GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values ) { |
GLint pixelsize; |
trWriteCMD( CMD_GETMINMAX ); |
trWriteEnum( target ); |
trWriteBool( reset ); |
trWriteEnum( format ); |
trWriteEnum( types ); |
trWritePointer( (void *)values ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetMinmax( target, reset, format, types, values ); |
trError(); |
} else { |
switch( types ) { |
case GL_BYTE: |
((GLbyte *)values)[0] = 0; |
((GLbyte *)values)[1] = 0; |
break; |
case GL_UNSIGNED_BYTE: |
case GL_UNSIGNED_BYTE_3_3_2: |
case GL_UNSIGNED_BYTE_2_3_3_REV: |
((GLubyte *)values)[0] = 0; |
((GLubyte *)values)[1] = 0; |
break; |
case GL_SHORT: |
((GLshort *)values)[0] = 0; |
((GLshort *)values)[1] = 0; |
break; |
case GL_UNSIGNED_SHORT: |
case GL_UNSIGNED_SHORT_5_6_5: |
case GL_UNSIGNED_SHORT_5_6_5_REV: |
case GL_UNSIGNED_SHORT_4_4_4_4: |
case GL_UNSIGNED_SHORT_4_4_4_4_REV: |
case GL_UNSIGNED_SHORT_5_5_5_1: |
case GL_UNSIGNED_SHORT_1_5_5_5_REV: |
((GLshort *)values)[0] = 0; |
((GLshort *)values)[1] = 0; |
break; |
case GL_INT: |
((GLint *)values)[0] = 0; |
((GLint *)values)[1] = 0; |
break; |
case GL_UNSIGNED_INT: |
case GL_UNSIGNED_INT_8_8_8_8: |
case GL_UNSIGNED_INT_8_8_8_8_REV: |
case GL_UNSIGNED_INT_10_10_10_2: |
case GL_UNSIGNED_INT_2_10_10_10_REV: |
((GLuint *)values)[0] = 0; |
((GLuint *)values)[1] = 0; |
break; |
case GL_FLOAT: |
((GLfloat *)values)[0] = 0.0; |
((GLfloat *)values)[1] = 0.0; |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
} |
pixelsize = trGetPixelSize( format, types ); |
trWriteTypeArray( types, 2, pixelsize, 0, values ); |
} |
GLAPI void GLAPIENTRY trGetMinmaxParameterfv( GLenum target, GLenum pname, GLfloat *params ) { /* TODO */ |
trWriteCMD( CMD_GETMINMAXPARAMETERFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetMinmaxParameterfv( target, pname, params ); |
trError(); |
} else { |
params[0] = 0.0; |
} |
trWritef( params[0] ); |
} |
GLAPI void GLAPIENTRY trGetMinmaxParameteriv( GLenum target, GLenum pname, GLint *params ) { /* TODO */ |
trWriteCMD( CMD_GETMINMAXPARAMETERIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetMinmaxParameteriv( target, pname, params ); |
trError(); |
} else { |
params[0] = 0; |
} |
trWritei( params[0] ); |
} |
GLAPI void GLAPIENTRY trGetPixelMapfv( GLenum map, GLfloat *values ) { /* TODO */ |
trWriteCMD( CMD_GETPIXELMAPFV ); |
trWriteEnum( map ); |
trWritePointer( (void *)values ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetPixelMapfv( map, values ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetPixelMapuiv( GLenum map, GLuint *values ) { /* TODO */ |
trWriteCMD( CMD_GETPIXELMAPUIV ); |
trWriteEnum( map ); |
trWritePointer( (void *)values ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetPixelMapuiv( map, values ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetPixelMapusv( GLenum map, GLushort *values ) { /* TODO */ |
trWriteCMD( CMD_GETPIXELMAPUSV ); |
trWriteEnum( map ); |
trWritePointer( (void *)values ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetPixelMapusv( map, values ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trGetPointervEXT( GLenum pname, void **params ) { |
trWriteCMD( CMD_GETPOINTERVEXT ); |
trWriteEnum( pname ); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetPointervEXT( pname, params ); |
trError(); |
} else { |
*params = NULL; |
} |
trWritePointer( (void *)(*params) ); |
} |
#endif |
GLAPI void GLAPIENTRY trGetPointerv( GLenum pname, void **params ) { |
trWriteCMD( CMD_GETPOINTERV ); |
trWriteEnum( pname ); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetPointerv( pname, params ); |
trError(); |
} else { |
*params = NULL; |
} |
trWritePointer( (void *)(*params) ); |
} |
GLAPI void GLAPIENTRY trGetPolygonStipple( GLubyte *mask ) { |
GLint i; |
trWriteCMD( CMD_GETPOLYGONSTIPPLE ); |
trWritePointer( (void *)mask ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetPolygonStipple( mask ); |
trError(); |
} else { |
for( i = 0; i < 8 * 8; i++ ) { |
mask[i] = 0x0; |
} |
} |
for( i = 0; i < 8 * 8; i++ ) { |
trWriteub( mask[i] ); |
} |
} |
GLAPI void GLAPIENTRY trGetSeparableFilter( GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ) { |
trWriteCMD( CMD_GETSEPARABLEFILTER ); |
trWriteEnum( target ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)row ); |
trFileFlush(); |
trWritePointer( (void *)column ); |
trFileFlush(); |
trWritePointer( (void *)span ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetSeparableFilter( target, format, type, row, column, span ); |
trError(); |
} |
} |
GLAPI const GLubyte* GLAPIENTRY trGetString( GLenum name ) { |
const GLubyte * tmpstring; |
trWriteCMD( CMD_GETSTRING ); |
trWriteEnum( name ); |
if( trCtx()->doExec ) { |
tmpstring = trGetDispatch()->GetString( name ); |
trError(); |
} else { |
tmpstring = NULL; |
} |
trWriteString( (char *)tmpstring ); |
return tmpstring; |
} |
GLAPI void GLAPIENTRY trGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETTEXENVFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexEnvfv( target, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_TEXTURE_ENV_MODE: |
params[0] = 0.0; |
break; |
case GL_TEXTURE_ENV_COLOR: |
memset( params, 0, 4 * sizeof(GLfloat) ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_TEXTURE_ENV_MODE: |
trWritef( params[0] ); |
break; |
case GL_TEXTURE_ENV_COLOR: |
trWriteArrayf( 4, params ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetTexEnviv( GLenum target, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETTEXENVIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexEnviv( target, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_TEXTURE_ENV_MODE: |
params[0] = 0; |
break; |
case GL_TEXTURE_ENV_COLOR: |
memset( params, 0, 4 * sizeof(GLint) ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_TEXTURE_ENV_MODE: |
trWritei( params[0] ); |
break; |
case GL_TEXTURE_ENV_COLOR: |
trWriteArrayi( 4, params ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) { |
trWriteCMD( CMD_GETTEXGENDV ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexGendv( coord, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
params[0] = 0.0; |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
memset( params, 0, 4 * sizeof(GLdouble) ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
trWrited( params[0] ); |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
trWriteArrayd( 4, params ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETTEXGENFV ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexGenfv( coord, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
params[0] = 0.0; |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
memset( params, 0, 4 * sizeof(GLfloat) ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
trWritef( params[0] ); |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
trWriteArrayf( 4, params ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetTexGeniv( GLenum coord, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETTEXGENIV ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexGeniv( coord, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
params[0] = 0; |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
memset( params, 0, 4 * sizeof(GLint) ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
trWritei( params[0] ); |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
trWriteArrayi( 4, params ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetTexImage( GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels ) { /* TODO */ |
trWriteCMD( CMD_GETTEXIMAGE ); |
trWriteEnum( target ); |
trWritei( level ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexImage( target, level, format, type, pixels ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trGetTexLevelParameterfv( GLenum target, GLint level, GLenum pname, GLfloat *params ) { |
trWriteCMD( CMD_GETTEXLEVELPARAMETERFV ); |
trWriteEnum( target ); |
trWritei( level ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexLevelParameterfv( target, level, pname, params ); |
trError(); |
} else { |
params[0] = 0.0; |
} |
trWritef( params[0] ); |
} |
GLAPI void GLAPIENTRY trGetTexLevelParameteriv( GLenum target, GLint level, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETTEXLEVELPARAMETERIV ); |
trWriteEnum( target ); |
trWritei( level ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexLevelParameteriv( target, level, pname, params ); |
trError(); |
} else { |
params[0] = 0; |
} |
trWritei( params[0] ); |
} |
GLAPI void GLAPIENTRY trGetTexParameterfv( GLenum target, GLenum pname, GLfloat *params) { |
trWriteCMD( CMD_GETTEXPARAMETERFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexParameterfv( target, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_TEXTURE_MAG_FILTER: |
case GL_TEXTURE_MIN_FILTER: |
case GL_TEXTURE_MIN_LOD: |
case GL_TEXTURE_MAX_LOD: |
case GL_TEXTURE_BASE_LEVEL: |
case GL_TEXTURE_MAX_LEVEL: |
case GL_TEXTURE_WRAP_S: |
case GL_TEXTURE_WRAP_T: |
case GL_TEXTURE_WRAP_R: |
case GL_TEXTURE_PRIORITY: |
case GL_TEXTURE_RESIDENT: |
params[0] = 0.0; |
break; |
case GL_TEXTURE_BORDER_COLOR: |
memset( params, 0, 4 * sizeof(GLfloat) ); |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_TEXTURE_MAG_FILTER: |
case GL_TEXTURE_MIN_FILTER: |
case GL_TEXTURE_MIN_LOD: |
case GL_TEXTURE_MAX_LOD: |
case GL_TEXTURE_BASE_LEVEL: |
case GL_TEXTURE_MAX_LEVEL: |
case GL_TEXTURE_WRAP_S: |
case GL_TEXTURE_WRAP_T: |
case GL_TEXTURE_WRAP_R: |
case GL_TEXTURE_PRIORITY: |
case GL_TEXTURE_RESIDENT: |
trWritef( params[0] ); |
break; |
case GL_TEXTURE_BORDER_COLOR: |
trWriteArrayf( 4, params ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trGetTexParameteriv( GLenum target, GLenum pname, GLint *params ) { |
trWriteCMD( CMD_GETTEXPARAMETERIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->GetTexParameteriv( target, pname, params ); |
trError(); |
} else { |
switch( pname ) { |
case GL_TEXTURE_MAG_FILTER: |
case GL_TEXTURE_MIN_FILTER: |
case GL_TEXTURE_MIN_LOD: |
case GL_TEXTURE_MAX_LOD: |
case GL_TEXTURE_BASE_LEVEL: |
case GL_TEXTURE_MAX_LEVEL: |
case GL_TEXTURE_WRAP_S: |
case GL_TEXTURE_WRAP_T: |
case GL_TEXTURE_WRAP_R: |
case GL_TEXTURE_PRIORITY: |
case GL_TEXTURE_RESIDENT: |
params[0] = 0; |
break; |
case GL_TEXTURE_BORDER_COLOR: |
memset( params, 0, 4 * sizeof(GLint) ); |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
switch( pname ) { |
case GL_TEXTURE_MAG_FILTER: |
case GL_TEXTURE_MIN_FILTER: |
case GL_TEXTURE_MIN_LOD: |
case GL_TEXTURE_MAX_LOD: |
case GL_TEXTURE_BASE_LEVEL: |
case GL_TEXTURE_MAX_LEVEL: |
case GL_TEXTURE_WRAP_S: |
case GL_TEXTURE_WRAP_T: |
case GL_TEXTURE_WRAP_R: |
case GL_TEXTURE_PRIORITY: |
case GL_TEXTURE_RESIDENT: |
trWritei( params[0] ); |
break; |
case GL_TEXTURE_BORDER_COLOR: |
trWriteArrayi( 4, params ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
} |
GLAPI void GLAPIENTRY trHint( GLenum target, GLenum mode ) { |
trWriteCMD( CMD_HINT ); |
trWriteEnum( target ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Hint( target, mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trHistogram( GLenum target, GLsizei width, GLenum internalformat, GLboolean sink ) { |
trWriteCMD( CMD_HISTOGRAM ); |
trWriteEnum( target ); |
trWriteSizei( width ); |
trWriteEnum( internalformat ); |
trWriteBool( sink ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Histogram( target, width, internalformat, sink ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexd( GLdouble c ) { |
trWriteCMD( CMD_INDEXD ); |
trWrited( c ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexd( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexdv( const GLdouble *c ) { |
trWriteCMD( CMD_INDEXDV ); |
trWritePointer( (void *)c ); |
trFileFlush(); |
trWrited( c[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexdv( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexf( GLfloat c ) { |
trWriteCMD( CMD_INDEXF ); |
trWritef( c ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexf( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexfv( const GLfloat *c ) { |
trWriteCMD( CMD_INDEXFV ); |
trWritePointer( (void *)c ); |
trFileFlush(); |
trWritef( c[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexfv( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexi( GLint c ) { |
trWriteCMD( CMD_INDEXI ); |
trWritei( c ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexi( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexiv( const GLint *c ) { |
trWriteCMD( CMD_INDEXIV ); |
trWritePointer( (void *)c ); |
trFileFlush(); |
trWritei( c[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexiv( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexMask( GLuint mask ) { |
trWriteCMD( CMD_INDEXMASK ); |
trWriteui( mask ); |
if( trCtx()->doExec ) { |
trGetDispatch()->IndexMask( mask ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ) { /* TODO */ |
trWriteCMD( CMD_INDEXPOINTEREXT ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWriteSizei( count ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->IndexPointerEXT( type, stride, count, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexPointer( GLenum type, GLsizei stride, const GLvoid *ptr ) { /* TODO */ |
trace_context_t * tctx; |
trWriteCMD( CMD_INDEXPOINTER ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
tctx = trCtx(); |
if( tctx->doExec ) { |
trGetDispatch()->IndexPointer( type, stride, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexs( GLshort c ) { |
trWriteCMD( CMD_INDEXS ); |
trWrites( c ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexs( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexsv( const GLshort *c ) { |
trWriteCMD( CMD_INDEXSV ); |
trWritePointer( (void *)c ); |
trFileFlush(); |
trWrites( c[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexsv( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexub( GLubyte c ) { |
trWriteCMD( CMD_INDEXUB ); |
trWriteub( c ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexub( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trIndexubv( const GLubyte *c ) { |
trWriteCMD( CMD_INDEXUBV ); |
trWritePointer( (void *)c ); |
trFileFlush(); |
trWriteub( c[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Indexubv( c ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trInitNames( void ) { |
trWriteCMD( CMD_INITNAMES ); |
if( trCtx()->doExec ) { |
trGetDispatch()->InitNames( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trInterleavedArrays( GLenum format, GLsizei stride, const GLvoid *pointer ) { /* TODO */ |
trace_context_t * tctx = trCtx(); |
trWriteCMD( CMD_INTERLEAVEDARRAYS ); |
trWriteEnum( format ); |
trWriteSizei( stride ); |
trWritePointer( (void *)pointer ); |
trFileFlush(); |
if( tctx->doExec ) { |
trSetOriginalDispatch(); |
trGetDispatch()->InterleavedArrays( format, stride, pointer ); |
trSetTraceDispatch(); |
trError(); |
} |
} |
GLAPI GLboolean GLAPIENTRY trIsEnabled( GLenum cap ) { |
GLboolean retval; |
trWriteCMD( CMD_ISENABLED ); |
trWriteEnum( cap ); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->IsEnabled( cap ); |
trError(); |
} else { |
retval = GL_FALSE; |
} |
trWriteBool( retval ); |
return retval; |
} |
GLAPI GLboolean GLAPIENTRY trIsList( GLuint list ) { |
GLboolean retval; |
trWriteCMD( CMD_ISLIST ); |
trWriteui( list ); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->IsList( list ); |
trError(); |
} else { |
retval = GL_FALSE; |
} |
trWriteBool( retval ); |
return retval; |
} |
GLAPI GLboolean GLAPIENTRY trIsTexture( GLuint texture ) { |
GLboolean retval; |
trWriteCMD( CMD_ISTEXTURE ); |
trWriteui( texture ); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->IsTexture( texture ); |
trError(); |
} else { |
retval = GL_FALSE; |
} |
trWriteBool( retval ); |
return retval; |
} |
GLAPI GLboolean GLAPIENTRY trIsTextureEXT( GLuint texture ) { |
GLboolean retval; |
trWriteCMD( CMD_ISTEXTUREEXT ); |
trWriteui( texture ); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->IsTextureEXT( texture ); |
trError(); |
} else { |
retval = GL_FALSE; |
} |
trWriteBool( retval ); |
return retval; |
} |
GLAPI void GLAPIENTRY trLightf( GLenum light, GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_LIGHTF ); |
trWriteEnum( light ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Lightf( light, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLightfv( GLenum light, GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_LIGHTFV ); |
trWriteEnum( light ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_POSITION: |
trWriteArrayf( 4, params ); |
break; |
case GL_SPOT_DIRECTION: |
trWriteArrayf( 3, params ); |
break; |
case GL_SPOT_EXPONENT: |
case GL_SPOT_CUTOFF: |
case GL_CONSTANT_ATTENUATION: |
case GL_LINEAR_ATTENUATION: |
case GL_QUADRATIC_ATTENUATION: |
trWritef( params[0] ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Lightfv( light, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLighti( GLenum light, GLenum pname, GLint param ) { |
trWriteCMD( CMD_LIGHTI ); |
trWriteEnum( light ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Lighti( light, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLightiv( GLenum light, GLenum pname, const GLint *params ) { |
trWriteCMD( CMD_LIGHTIV ); |
trWriteEnum( light ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_SPECULAR: |
case GL_POSITION: |
trWriteArrayi( 4, params ); |
break; |
case GL_SPOT_DIRECTION: |
trWriteArrayi( 3, params ); |
break; |
case GL_SPOT_EXPONENT: |
case GL_SPOT_CUTOFF: |
case GL_CONSTANT_ATTENUATION: |
case GL_LINEAR_ATTENUATION: |
case GL_QUADRATIC_ATTENUATION: |
trWritei( params[0] ); |
break; |
default: |
/* The 2nd pass should pick this up. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Lightiv( light, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLightModelf( GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_LIGHTMODELF ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LightModelf( pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLightModelfv( GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_LIGHTMODELFV ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_LIGHT_MODEL_AMBIENT: |
trWriteArrayf( 4, params ); |
break; |
case GL_LIGHT_MODEL_COLOR_CONTROL: |
case GL_LIGHT_MODEL_LOCAL_VIEWER: |
case GL_LIGHT_MODEL_TWO_SIDE: |
trWritef( params[0] ); |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->LightModelfv( pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLightModeli( GLenum pname, GLint param ) { |
trWriteCMD( CMD_LIGHTMODELI ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LightModeli( pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLightModeliv( GLenum pname, const GLint *params ) { |
trWriteCMD( CMD_LIGHTMODELIV ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_LIGHT_MODEL_AMBIENT: |
trWriteArrayi( 4, params ); |
break; |
case GL_LIGHT_MODEL_COLOR_CONTROL: |
case GL_LIGHT_MODEL_LOCAL_VIEWER: |
case GL_LIGHT_MODEL_TWO_SIDE: |
trWritei( params[0] ); |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->LightModeliv( pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLineStipple( GLint factor, GLushort pattern ) { |
trWriteCMD( CMD_LINESTIPPLE ); |
trWritei( factor ); |
trWriteus( pattern ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LineStipple( factor, pattern ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLineWidth( GLfloat width ) { |
trWriteCMD( CMD_LINEWIDTH ); |
trWritef( width ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LineWidth( width ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trListBase( GLuint base ) { |
trWriteCMD( CMD_LISTBASE ); |
trWriteui( base ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ListBase( base ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLoadIdentity( void ) { |
trWriteCMD( CMD_LOADIDENTITY ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LoadIdentity( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLoadMatrixd( const GLdouble *m ) { |
trWriteCMD( CMD_LOADMATRIXD ); |
trWritePointer( (void *)m ); |
trFileFlush(); |
trWriteArrayd( 16, m ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LoadMatrixd( m ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLoadMatrixf( const GLfloat *m ) { |
trWriteCMD( CMD_LOADMATRIXF ); |
trWritePointer( (void *)m ); |
trFileFlush(); |
trWriteArrayf( 16, m ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LoadMatrixf( m ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLoadName( GLuint name ) { |
trWriteCMD( CMD_LOADNAME ); |
trWriteui( name ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LoadName( name ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLockArraysEXT( GLint first, GLsizei count ) { |
trWriteCMD( CMD_LOCKARRAYSEXT ); |
trWritei( first ); |
trWriteSizei( count ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LockArraysEXT( first, count ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trLogicOp( GLenum opcode ) { |
trWriteCMD( CMD_LOGICOP ); |
trWriteEnum( opcode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->LogicOp( opcode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMap1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ) { |
GLint i; |
trWriteCMD( CMD_MAP1D ); |
trWriteEnum( target ); |
trWrited( u1 ); |
trWrited( u2 ); |
trWritei( stride ); |
trWritei( order ); |
trWritePointer( (void *)points ); |
trFileFlush(); |
switch( target ) { |
case GL_MAP1_INDEX: |
case GL_MAP1_TEXTURE_COORD_1: |
for( i = 0; i < stride * order; i += stride ) { |
trWrited( points[i] ); |
} |
break; |
case GL_MAP1_TEXTURE_COORD_2: |
for( i = 0; i < stride * order; i += stride ) { |
trWrited( points[i] ); |
trWrited( points[i + 1] ); |
} |
break; |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_3: |
for( i = 0; i < stride * order; i += stride ) { |
trWrited( points[i] ); |
trWrited( points[i + 1] ); |
trWrited( points[i + 2] ); |
} |
break; |
case GL_MAP1_VERTEX_4: |
case GL_MAP1_TEXTURE_COORD_4: |
for( i = 0; i < stride * order; i += stride ) { |
trWrited( points[i] ); |
trWrited( points[i + 1] ); |
trWrited( points[i + 2] ); |
trWrited( points[i + 3] ); |
} |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Map1d( target, u1, u2, stride, order, points ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMap1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points ) { |
GLint i; |
trWriteCMD( CMD_MAP1F ); |
trWriteEnum( target ); |
trWritef( u1 ); |
trWritef( u2 ); |
trWritei( stride ); |
trWritei( order ); |
trWritePointer( (void *)points ); |
trFileFlush(); |
switch( target ) { |
case GL_MAP1_INDEX: |
case GL_MAP1_TEXTURE_COORD_1: |
for( i = 0; i < stride * order; i += stride ) { |
trWritef( points[i] ); |
} |
break; |
case GL_MAP1_TEXTURE_COORD_2: |
for( i = 0; i < stride * order; i += stride ) { |
trWritef( points[i] ); |
trWritef( points[i + 1] ); |
} |
break; |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_3: |
for( i = 0; i < stride * order; i += stride ) { |
trWritef( points[i] ); |
trWritef( points[i + 1] ); |
trWritef( points[i + 2] ); |
} |
break; |
case GL_MAP1_VERTEX_4: |
case GL_MAP1_TEXTURE_COORD_4: |
for( i = 0; i < stride * order; i += stride ) { |
trWritef( points[i] ); |
trWritef( points[i + 1] ); |
trWritef( points[i + 2] ); |
trWritef( points[i + 3] ); |
} |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Map1f( target, u1, u2, stride, order, points ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMap2d( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points ) { |
GLint i; |
GLint j; |
trWriteCMD( CMD_MAP2D ); |
trWriteEnum( target ); |
trWrited( u1 ); |
trWrited( u2 ); |
trWritei( ustride ); |
trWritei( uorder ); |
trWrited( v1 ); |
trWrited( v2 ); |
trWritei( vstride ); |
trWritei( vorder ); |
trWritePointer( (void *)points ); |
trFileFlush(); |
switch( target ) { |
case GL_MAP1_INDEX: |
case GL_MAP1_TEXTURE_COORD_1: |
for( j = 0; j < vstride * vorder; j += vstride ) { |
for( i = 0; i < ustride * uorder; i += ustride ) { |
trWrited( points[i + j] ); |
} |
} |
break; |
case GL_MAP1_TEXTURE_COORD_2: |
for( j = 0; j < vstride * vorder; j += vstride ) { |
for( i = 0; i < ustride * uorder; i += ustride ) { |
trWrited( points[i + j] ); |
trWrited( points[i + j + 1] ); |
} |
} |
break; |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_3: |
for( j = 0; j < vstride * vorder; j += vstride ) { |
for( i = 0; i < ustride * uorder; i += ustride ) { |
trWrited( points[i + j] ); |
trWrited( points[i + j + 1] ); |
trWrited( points[i + j + 2] ); |
} |
} |
break; |
case GL_MAP1_VERTEX_4: |
case GL_MAP1_TEXTURE_COORD_4: |
for( j = 0; j < vstride * vorder; j += vstride ) { |
for( i = 0; i < ustride * uorder; i += ustride ) { |
trWrited( points[i + j] ); |
trWrited( points[i + j + 1] ); |
trWrited( points[i + j + 2] ); |
trWrited( points[i + j + 3] ); |
} |
} |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Map2d( target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMap2f( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points ) { |
GLint i; |
GLint j; |
trWriteCMD( CMD_MAP2F ); |
trWriteEnum( target ); |
trWritef( u1 ); |
trWritef( u2 ); |
trWritei( ustride ); |
trWritei( uorder ); |
trWritef( v1 ); |
trWritef( v2 ); |
trWritei( vstride ); |
trWritei( vorder ); |
trWritePointer( (void *)points ); |
trFileFlush(); |
switch( target ) { |
case GL_MAP1_INDEX: |
case GL_MAP1_TEXTURE_COORD_1: |
for( j = 0; j < vstride * vorder; j += vstride ) { |
for( i = 0; i < ustride * uorder; i += ustride ) { |
trWritef( points[i + j] ); |
} |
} |
break; |
case GL_MAP1_TEXTURE_COORD_2: |
for( j = 0; j < vstride * vorder; j += vstride ) { |
for( i = 0; i < ustride * uorder; i += ustride ) { |
trWritef( points[i + j] ); |
trWritef( points[i + j + 1] ); |
} |
} |
break; |
case GL_MAP1_VERTEX_3: |
case GL_MAP1_NORMAL: |
case GL_MAP1_TEXTURE_COORD_3: |
for( j = 0; j < vstride * vorder; j += vstride ) { |
for( i = 0; i < ustride * uorder; i += ustride ) { |
trWritef( points[i + j] ); |
trWritef( points[i + j + 1] ); |
trWritef( points[i + j + 2] ); |
} |
} |
break; |
case GL_MAP1_VERTEX_4: |
case GL_MAP1_TEXTURE_COORD_4: |
for( j = 0; j < vstride * vorder; j += vstride ) { |
for( i = 0; i < ustride * uorder; i += ustride ) { |
trWritef( points[i + j] ); |
trWritef( points[i + j + 1] ); |
trWritef( points[i + j + 2] ); |
trWritef( points[i + j + 3] ); |
} |
} |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Map2f( target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) { |
trWriteCMD( CMD_MAPGRID1D ); |
trWritei( un ); |
trWrited( u1 ); |
trWrited( u2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MapGrid1d( un, u1, u2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) { |
trWriteCMD( CMD_MAPGRID1F ); |
trWritei( un ); |
trWritef( u1 ); |
trWritef( u2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MapGrid1f( un, u1, u2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { |
trWriteCMD( CMD_MAPGRID2D ); |
trWritei( un ); |
trWrited( u1 ); |
trWrited( u2 ); |
trWritei( vn ); |
trWrited( v1 ); |
trWrited( v2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MapGrid2d( un, u1, u2, vn, v1, v2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMapGrid2f( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 ) { |
trWriteCMD( CMD_MAPGRID2F ); |
trWritei( un ); |
trWritef( u1 ); |
trWritef( u2 ); |
trWritei( vn ); |
trWritef( v1 ); |
trWritef( v2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MapGrid2f( un, u1, u2, vn, v1, v2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMaterialf( GLenum face, GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_MATERIALF ); |
trWriteEnum( face ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Materialf( face, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMaterialfv( GLenum face, GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_MATERIALFV ); |
trWriteEnum( face ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_AMBIENT_AND_DIFFUSE: |
case GL_SPECULAR: |
case GL_EMISSION: |
trWriteArrayf( 4, params ); |
break; |
case GL_SHININESS: |
trWritef( params[0] ); |
break; |
case GL_COLOR_INDEXES: |
trWriteArrayf( 3, params ); |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Materialfv( face, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMateriali( GLenum face, GLenum pname, GLint param ) { |
trWriteCMD( CMD_MATERIALI ); |
trWriteEnum( face ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Materiali( face, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMaterialiv( GLenum face, GLenum pname, const GLint *params ) { |
trWriteCMD( CMD_MATERIALIV ); |
trWriteEnum( face ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_AMBIENT: |
case GL_DIFFUSE: |
case GL_AMBIENT_AND_DIFFUSE: |
case GL_SPECULAR: |
case GL_EMISSION: |
trWriteArrayi( 4, params ); |
break; |
case GL_SHININESS: |
trWritei( params[0] ); |
break; |
case GL_COLOR_INDEXES: |
trWriteArrayi( 3, params ); |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->Materialiv( face, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMatrixMode( GLenum mode ) { |
trWriteCMD( CMD_MATRIXMODE ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MatrixMode( mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMinmax( GLenum target, GLenum internalformat, GLboolean sink ) { |
trWriteCMD( CMD_MINMAX ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWriteBool( sink ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Minmax( target, internalformat, sink ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord1dARB( GLenum target, GLdouble s) { |
trWriteCMD( CMD_MULTITEXCOORD1DARB ); |
trWriteEnum( target ); |
trWrited( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord1dARB( target, s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord1dvARB( GLenum target, const GLdouble *v) { |
trWriteCMD( CMD_MULTITEXCOORD1DVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWrited( v[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord1dvARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord1fARB( GLenum target, GLfloat s) { |
trWriteCMD( CMD_MULTITEXCOORD1FARB ); |
trWriteEnum( target ); |
trWritef( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord1fARB( target, s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord1fvARB( GLenum target, const GLfloat *v) { |
trWriteCMD( CMD_MULTITEXCOORD1FVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWritef( v[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord1fvARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord1iARB( GLenum target, GLint s) { |
trWriteCMD( CMD_MULTITEXCOORD1IARB ); |
trWriteEnum( target ); |
trWritei( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord1iARB( target, s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord1ivARB( GLenum target, const GLint *v) { |
trWriteCMD( CMD_MULTITEXCOORD1IVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWritei( v[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord1ivARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord1sARB( GLenum target, GLshort s) { |
trWriteCMD( CMD_MULTITEXCOORD1SARB ); |
trWriteEnum( target ); |
trWrites( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord1sARB( target, s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord1svARB( GLenum target, const GLshort *v) { |
trWriteCMD( CMD_MULTITEXCOORD1SVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWrites( v[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord1svARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord2dARB( GLenum target, GLdouble s, GLdouble t) { |
trWriteCMD( CMD_MULTITEXCOORD2DARB ); |
trWriteEnum( target ); |
trWrited( s ); |
trWrited( t ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord2dARB( target, s, t ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord2dvARB( GLenum target, const GLdouble *v) { |
trWriteCMD( CMD_MULTITEXCOORD2DVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord2dvARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t) { |
trWriteCMD( CMD_MULTITEXCOORD2FARB ); |
trWriteEnum( target ); |
trWritef( s ); |
trWritef( t ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord2fARB( target, s, t ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord2fvARB( GLenum target, const GLfloat *v) { |
trWriteCMD( CMD_MULTITEXCOORD2FVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord2fvARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord2iARB( GLenum target, GLint s, GLint t) { |
trWriteCMD( CMD_MULTITEXCOORD2IARB ); |
trWriteEnum( target ); |
trWritei( s ); |
trWritei( t ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord2iARB( target, s, t ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord2ivARB( GLenum target, const GLint *v) { |
trWriteCMD( CMD_MULTITEXCOORD2IVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord2ivARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord2sARB( GLenum target, GLshort s, GLshort t) { |
trWriteCMD( CMD_MULTITEXCOORD2SARB ); |
trWriteEnum( target ); |
trWrites( s ); |
trWrites( t ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord2sARB( target, s, t ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord2svARB( GLenum target, const GLshort *v) { |
trWriteCMD( CMD_MULTITEXCOORD2SVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord2svARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord3dARB( GLenum target, GLdouble s, GLdouble t, GLdouble r) { |
trWriteCMD( CMD_MULTITEXCOORD3DARB ); |
trWriteEnum( target ); |
trWrited( s ); |
trWrited( t ); |
trWrited( r ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord3dARB( target, s, t, r ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord3dvARB( GLenum target, const GLdouble *v) { |
trWriteCMD( CMD_MULTITEXCOORD3DVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord3dvARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord3fARB( GLenum target, GLfloat s, GLfloat t, GLfloat r) { |
trWriteCMD( CMD_MULTITEXCOORD3FARB ); |
trWriteEnum( target ); |
trWritef( s ); |
trWritef( t ); |
trWritef( r ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord3fARB( target, s, t, r ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord3fvARB( GLenum target, const GLfloat *v) { |
trWriteCMD( CMD_MULTITEXCOORD3FVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord3fvARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord3iARB( GLenum target, GLint s, GLint t, GLint r) { |
trWriteCMD( CMD_MULTITEXCOORD3IARB ); |
trWriteEnum( target ); |
trWritei( s ); |
trWritei( t ); |
trWritei( r ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord3iARB( target, s, t, r ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord3ivARB( GLenum target, const GLint *v) { |
trWriteCMD( CMD_MULTITEXCOORD3IVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord3ivARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord3sARB( GLenum target, GLshort s, GLshort t, GLshort r) { |
trWriteCMD( CMD_MULTITEXCOORD3SARB ); |
trWriteEnum( target ); |
trWrites( s ); |
trWrites( t ); |
trWrites( r ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord3sARB( target, s, t, r ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord3svARB( GLenum target, const GLshort *v) { |
trWriteCMD( CMD_MULTITEXCOORD3SVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord3svARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord4dARB( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) { |
trWriteCMD( CMD_MULTITEXCOORD4DARB ); |
trWriteEnum( target ); |
trWrited( s ); |
trWrited( t ); |
trWrited( r ); |
trWrited( q ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord4dARB( target, s, t, r, q ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord4dvARB( GLenum target, const GLdouble *v) { |
trWriteCMD( CMD_MULTITEXCOORD4DVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord4dvARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord4fARB( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) { |
trWriteCMD( CMD_MULTITEXCOORD4FARB ); |
trWriteEnum( target ); |
trWritef( s ); |
trWritef( t ); |
trWritef( r ); |
trWritef( q ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord4fARB( target, s, t, r, q ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord4fvARB( GLenum target, const GLfloat *v) { |
trWriteCMD( CMD_MULTITEXCOORD4FVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord4fvARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord4iARB( GLenum target, GLint s, GLint t, GLint r, GLint q) { |
trWriteCMD( CMD_MULTITEXCOORD4IARB ); |
trWriteEnum( target ); |
trWritei( s ); |
trWritei( t ); |
trWritei( r ); |
trWritei( q ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord4iARB( target, s, t, r, q ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord4ivARB( GLenum target, const GLint *v) { |
trWriteCMD( CMD_MULTITEXCOORD4IVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord4ivARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord4sARB( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) { |
trWriteCMD( CMD_MULTITEXCOORD4SARB ); |
trWriteEnum( target ); |
trWrites( s ); |
trWrites( t ); |
trWrites( r ); |
trWrites( q ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord4sARB( target, s, t, r, q ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultiTexCoord4svARB( GLenum target, const GLshort *v) { |
trWriteCMD( CMD_MULTITEXCOORD4SVARB ); |
trWriteEnum( target ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultiTexCoord4svARB( target, v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultMatrixd( const GLdouble *m ) { |
trWriteCMD( CMD_MULTMATRIXD ); |
trWritePointer( (void *)m ); |
trFileFlush(); |
trWriteArrayd( 16, m ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultMatrixd( m ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trMultMatrixf( const GLfloat *m ) { |
trWriteCMD( CMD_MULTMATRIXF ); |
trWritePointer( (void *)m ); |
trFileFlush(); |
trWriteArrayf( 16, m ); |
if( trCtx()->doExec ) { |
trGetDispatch()->MultMatrixf( m ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNewList( GLuint list, GLenum mode ) { |
trWriteCMD( CMD_NEWLIST ); |
trWriteui( list ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->NewList( list, mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ) { |
trWriteCMD( CMD_NORMAL3B ); |
trWriteb( nx ); |
trWriteb( ny ); |
trWriteb( nz ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3b( nx, ny, nz ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3bv( const GLbyte *v ) { |
trWriteCMD( CMD_NORMAL3BV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayb( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3bv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ) { |
trWriteCMD( CMD_NORMAL3D ); |
trWrited( nx ); |
trWrited( ny ); |
trWrited( nz ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3d( nx, ny, nz ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3dv( const GLdouble *v ) { |
trWriteCMD( CMD_NORMAL3DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ) { |
trWriteCMD( CMD_NORMAL3F ); |
trWritef( nx ); |
trWritef( ny ); |
trWritef( nz ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3f( nx, ny, nz ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3fv( const GLfloat *v ) { |
trWriteCMD( CMD_NORMAL3FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3i( GLint nx, GLint ny, GLint nz ) { |
trWriteCMD( CMD_NORMAL3I ); |
trWritei( nx ); |
trWritei( ny ); |
trWritei( nz ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3i( nx, ny, nz ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3iv( const GLint *v ) { |
trWriteCMD( CMD_NORMAL3IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3s( GLshort nx, GLshort ny, GLshort nz ) { |
trWriteCMD( CMD_NORMAL3S ); |
trWrites( nx ); |
trWrites( ny ); |
trWrites( nz ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3s( nx, ny, nz ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormal3sv( const GLshort *v ) { |
trWriteCMD( CMD_NORMAL3SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Normal3sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormalPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ) { /* TODO */ |
trWriteCMD( CMD_NORMALPOINTEREXT ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWriteSizei( count ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->NormalPointerEXT( type, stride, count, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trNormalPointer( GLenum type, GLsizei stride, const GLvoid *ptr ) { /* TODO */ |
trWriteCMD( CMD_NORMALPOINTER ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->NormalPointer( type, stride, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trOrtho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ) { |
trWriteCMD( CMD_ORTHO ); |
trWrited( left ); |
trWrited( right ); |
trWrited( bottom ); |
trWrited( top ); |
trWrited( near_val ); |
trWrited( far_val ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Ortho( left, right, bottom, top, near_val, far_val ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPassThrough( GLfloat token ) { |
trWriteCMD( CMD_PASSTHROUGH ); |
trWritef( token ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PassThrough( token ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) { |
trWriteCMD( CMD_PIXELMAPFV ); |
trWriteEnum( map ); |
trWritei( mapsize ); |
trWritePointer( (void *)values ); |
trFileFlush(); |
trWriteArrayf( mapsize, values ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PixelMapfv( map, mapsize, values ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPixelMapuiv( GLenum map, GLint mapsize, const GLuint *values ) { |
trWriteCMD( CMD_PIXELMAPUIV ); |
trWriteEnum( map ); |
trWritei( mapsize ); |
trWritePointer( (void *)values ); |
trFileFlush(); |
trWriteArrayui( mapsize, values ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PixelMapuiv( map, mapsize, values ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPixelMapusv( GLenum map, GLint mapsize, const GLushort *values ) { |
trWriteCMD( CMD_PIXELMAPUSV ); |
trWriteEnum( map ); |
trWritei( mapsize ); |
trWritePointer( (void *)values ); |
trFileFlush(); |
trWriteArrayus( mapsize, values ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PixelMapusv( map, mapsize, values ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPixelStoref( GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_PIXELSTOREF ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PixelStoref( pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPixelStorei( GLenum pname, GLint param ) { |
trWriteCMD( CMD_PIXELSTOREI ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PixelStorei( pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPixelTransferf( GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_PIXELTRANSFERF ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PixelTransferf( pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPixelTransferi( GLenum pname, GLint param ) { |
trWriteCMD( CMD_PIXELTRANSFERI ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PixelTransferi( pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPixelZoom( GLfloat xfactor, GLfloat yfactor ) { |
trWriteCMD( CMD_PIXELZOOM ); |
trWritef( xfactor ); |
trWritef( yfactor ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PixelZoom( xfactor, yfactor ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPointParameterfEXT( GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_POINTPARAMETERFEXT ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PointParameterfEXT( pname, param ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trPointParameterfSGIS( GLenum pname, GLfloat param) { |
trWriteCMD( CMD_POINTPARAMETERFSGIS ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PointParameterfSGIS( pname, param ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trPointParameterfvEXT( GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_POINTPARAMETERFVEXT ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_POINT_SIZE_MIN_EXT: |
case GL_POINT_SIZE_MAX_EXT: |
case GL_POINT_FADE_THRESHOLD_SIZE_EXT: |
trWritef( params[0] ); |
break; |
case GL_DISTANCE_ATTENUATION_EXT: |
trWriteArrayf( 3, params ); |
break; |
default: |
/* The 2nd pass should handle this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->PointParameterfvEXT( pname, params ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trPointParameterfvSGIS( GLenum pname, const GLfloat *params) { /* TODO */ |
trWriteCMD( CMD_POINTPARAMETERFVSGIS ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->PointParameterfvSGIS( pname, params ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trPointSize( GLfloat size ) { |
trWriteCMD( CMD_POINTSIZE ); |
trWritef( size ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PointSize( size ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPolygonMode( GLenum face, GLenum mode ) { |
trWriteCMD( CMD_POLYGONMODE ); |
trWriteEnum( face ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PolygonMode( face, mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPolygonOffsetEXT( GLfloat factor, GLfloat bias ) { |
trWriteCMD( CMD_POLYGONOFFSETEXT ); |
trWritef( factor ); |
trWritef( bias ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PolygonOffsetEXT( factor, bias ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPolygonOffset( GLfloat factor, GLfloat units ) { |
trWriteCMD( CMD_POLYGONOFFSET ); |
trWritef( factor ); |
trWritef( units ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PolygonOffset( factor, units ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPolygonStipple( const GLubyte *mask ) { |
trWriteCMD( CMD_POLYGONSTIPPLE ); |
trWritePointer( (void *)mask ); |
trFileFlush(); |
trWriteArrayub( 64, mask ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PolygonStipple( mask ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPopAttrib( void ) { |
trWriteCMD( CMD_POPATTRIB ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PopAttrib( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPopClientAttrib( void ) { |
trWriteCMD( CMD_POPCLIENTATTRIB ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PopClientAttrib( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPopMatrix( void ) { |
trWriteCMD( CMD_POPMATRIX ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PopMatrix( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPopName( void ) { |
trWriteCMD( CMD_POPNAME ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PopName( ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trPrioritizeTexturesEXT( GLsizei n, const GLuint *textures, const GLclampf *priorities ) { |
trWriteCMD( CMD_PRIORITIZETEXTURESEXT ); |
trWriteSizei( n ); |
trWritePointer( (void *)textures ); |
trFileFlush(); |
trWriteArrayui( n, textures ); |
trWritePointer( (void *)priorities ); |
trFileFlush(); |
/* FIXME!!! */ |
trWriteArrayf( n, priorities ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PrioritizeTexturesEXT( n, textures, priorities ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trPrioritizeTextures( GLsizei n, const GLuint *textures, const GLclampf *priorities ) { |
trWriteCMD( CMD_PRIORITIZETEXTURES ); |
trWriteSizei( n ); |
trWritePointer( (void *)textures ); |
trFileFlush(); |
trWriteArrayui( n, textures ); |
trWritePointer( (void *)priorities ); |
trFileFlush(); |
/* FIXME!!! */ |
trWriteArrayf( n, priorities ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PrioritizeTextures( n, textures, priorities ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPushAttrib( GLbitfield mask ) { |
trWriteCMD( CMD_PUSHATTRIB ); |
trWriteBits( mask ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PushAttrib( mask ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPushClientAttrib( GLbitfield mask ) { |
trWriteCMD( CMD_PUSHCLIENTATTRIB ); |
trWriteBits( mask ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PushClientAttrib( mask ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPushMatrix( void ) { |
trWriteCMD( CMD_PUSHMATRIX ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PushMatrix( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trPushName( GLuint name ) { |
trWriteCMD( CMD_PUSHNAME ); |
trWriteui( name ); |
if( trCtx()->doExec ) { |
trGetDispatch()->PushName( name ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos2d( GLdouble x, GLdouble y ) { |
trWriteCMD( CMD_RASTERPOS2D ); |
trWrited( x ); |
trWrited( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos2d( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos2dv( const GLdouble *v ) { |
trWriteCMD( CMD_RASTERPOS2DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos2dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos2f( GLfloat x, GLfloat y ) { |
trWriteCMD( CMD_RASTERPOS2F ); |
trWritef( x ); |
trWritef( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos2f( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos2fv( const GLfloat *v ) { |
trWriteCMD( CMD_RASTERPOS2FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos2fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos2i( GLint x, GLint y ) { |
trWriteCMD( CMD_RASTERPOS2I ); |
trWritei( x ); |
trWritei( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos2i( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos2iv( const GLint *v ) { |
trWriteCMD( CMD_RASTERPOS2IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos2iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos2s( GLshort x, GLshort y ) { |
trWriteCMD( CMD_RASTERPOS2S ); |
trWrites( x ); |
trWrites( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos2s( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos2sv( const GLshort *v ) { |
trWriteCMD( CMD_RASTERPOS2SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos2sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos3d( GLdouble x, GLdouble y, GLdouble z ) { |
trWriteCMD( CMD_RASTERPOS3D ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos3d( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos3dv( const GLdouble *v ) { |
trWriteCMD( CMD_RASTERPOS3DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos3dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos3f( GLfloat x, GLfloat y, GLfloat z ) { |
trWriteCMD( CMD_RASTERPOS3F ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos3f( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos3fv( const GLfloat *v ) { |
trWriteCMD( CMD_RASTERPOS3FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos3fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos3i( GLint x, GLint y, GLint z ) { |
trWriteCMD( CMD_RASTERPOS3I ); |
trWritei( x ); |
trWritei( y ); |
trWritei( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos3i( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos3iv( const GLint *v ) { |
trWriteCMD( CMD_RASTERPOS3IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos3iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos3s( GLshort x, GLshort y, GLshort z ) { |
trWriteCMD( CMD_RASTERPOS3S ); |
trWrites( x ); |
trWrites( y ); |
trWrites( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos3s( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos3sv( const GLshort *v ) { |
trWriteCMD( CMD_RASTERPOS3SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos3sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) { |
trWriteCMD( CMD_RASTERPOS4D ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
trWrited( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos4d( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos4dv( const GLdouble *v ) { |
trWriteCMD( CMD_RASTERPOS4DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos4dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { |
trWriteCMD( CMD_RASTERPOS4F ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
trWritef( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos4f( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos4fv( const GLfloat *v ) { |
trWriteCMD( CMD_RASTERPOS4FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos4fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos4i( GLint x, GLint y, GLint z, GLint w ) { |
trWriteCMD( CMD_RASTERPOS4I ); |
trWritei( x ); |
trWritei( y ); |
trWritei( z ); |
trWritei( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos4i( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos4iv( const GLint *v ) { |
trWriteCMD( CMD_RASTERPOS4IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos4iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ) { |
trWriteCMD( CMD_RASTERPOS4S ); |
trWrites( x ); |
trWrites( y ); |
trWrites( z ); |
trWrites( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos4s( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRasterPos4sv( const GLshort *v ) { |
trWriteCMD( CMD_RASTERPOS4SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->RasterPos4sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trReadBuffer( GLenum mode ) { |
trWriteCMD( CMD_READBUFFER ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ReadBuffer( mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) { |
GLint pixelsize; |
trWriteCMD( CMD_READPIXELS ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
pixelsize = trGetPixelSize( format, type ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ReadPixels( x, y, width, height, format, type, pixels ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ) { |
trWriteCMD( CMD_RECTD ); |
trWrited( x1 ); |
trWrited( y1 ); |
trWrited( x2 ); |
trWrited( y2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rectd( x1, y1, x2, y2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRectdv( const GLdouble *v1, const GLdouble *v2 ) { |
trWriteCMD( CMD_RECTDV ); |
trWritePointer( (void *)v1 ); |
trFileFlush(); |
trWriteArrayd( 2, v1 ); |
trWritePointer( (void *)v2 ); |
trFileFlush(); |
trWriteArrayd( 2, v2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rectdv( v1, v2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) { |
trWriteCMD( CMD_RECTF ); |
trWritef( x1 ); |
trWritef( y1 ); |
trWritef( x2 ); |
trWritef( y2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rectf( x1, y1, x2, y2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRectfv( const GLfloat *v1, const GLfloat *v2 ) { |
trWriteCMD( CMD_RECTFV ); |
trWritePointer( (void *)v1 ); |
trFileFlush(); |
trWriteArrayf( 2, v1 ); |
trWritePointer( (void *)v2 ); |
trFileFlush(); |
trWriteArrayf( 2, v2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rectfv( v1, v2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRecti( GLint x1, GLint y1, GLint x2, GLint y2 ) { |
trWriteCMD( CMD_RECTI ); |
trWritei( x1 ); |
trWritei( y1 ); |
trWritei( x2 ); |
trWritei( y2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Recti( x1, y1, x2, y2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRectiv( const GLint *v1, const GLint *v2 ) { |
trWriteCMD( CMD_RECTIV ); |
trWritePointer( (void *)v1 ); |
trFileFlush(); |
trWriteArrayi( 2, v1 ); |
trWritePointer( (void *)v2 ); |
trFileFlush(); |
trWriteArrayi( 2, v2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rectiv( v1, v2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ) { |
trWriteCMD( CMD_RECTS ); |
trWrites( x1 ); |
trWrites( y1 ); |
trWrites( x2 ); |
trWrites( y2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rects( x1, y1, x2, y2 ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRectsv( const GLshort *v1, const GLshort *v2 ) { |
trWriteCMD( CMD_RECTSV ); |
trWritePointer( (void *)v1 ); |
trFileFlush(); |
trWriteArrays( 2, v1 ); |
trWritePointer( (void *)v2 ); |
trFileFlush(); |
trWriteArrays( 2, v2 ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rectsv( v1, v2 ); |
trError(); |
} |
} |
GLAPI GLint GLAPIENTRY trRenderMode( GLenum mode ) { |
GLint retval; |
trWriteCMD( CMD_RENDERMODE ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
retval = trGetDispatch()->RenderMode( mode ); |
trError(); |
} else { |
retval = 0; |
} |
trWritei( retval ); |
return retval; |
} |
GLAPI void GLAPIENTRY trResetHistogram( GLenum target ) { |
trWriteCMD( CMD_RESETHISTOGRAM ); |
trWriteEnum( target ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ResetHistogram( target ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trResetMinmax( GLenum target ) { |
trWriteCMD( CMD_RESETMINMAX ); |
trWriteEnum( target ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ResetMinmax( target ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trResizeBuffersMESA( void ) { |
trWriteCMD( CMD_RESIZEBUFFERSMESA ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ResizeBuffersMESA( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) { |
trWriteCMD( CMD_ROTATED ); |
trWrited( angle ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rotated( angle, x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) { |
trWriteCMD( CMD_ROTATEF ); |
trWritef( angle ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Rotatef( angle, x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trScaled( GLdouble x, GLdouble y, GLdouble z ) { |
trWriteCMD( CMD_SCALED ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Scaled( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trScalef( GLfloat x, GLfloat y, GLfloat z ) { |
trWriteCMD( CMD_SCALEF ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Scalef( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trScissor( GLint x, GLint y, GLsizei width, GLsizei height) { |
trWriteCMD( CMD_SCISSOR ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Scissor( x, y, width, height ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trSelectBuffer( GLsizei size, GLuint *buffer ) { |
trWriteCMD( CMD_SELECTBUFFER ); |
trWriteSizei( size ); |
trWritePointer( (void *)buffer ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->SelectBuffer( size, buffer ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trSeparableFilter2D( GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column ) { |
GLint pixelsize; |
trWriteCMD( CMD_SEPARABLEFILTER2D ); |
trWriteEnum( target ); |
trWriteEnum( internalformat ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)row ); |
trFileFlush(); |
trWritePointer( (void *)column ); |
trFileFlush(); |
pixelsize = trGetPixelSize( format, type ); |
trWriteTypeArray( type, width, pixelsize, 0, row ); |
trWriteTypeArray( type, height, pixelsize, 0, column ); |
if( trCtx()->doExec ) { |
trGetDispatch()->SeparableFilter2D( target, internalformat, width, height, format, type, row, column ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trShadeModel( GLenum mode ) { |
trWriteCMD( CMD_SHADEMODEL ); |
trWriteEnum( mode ); |
if( trCtx()->doExec ) { |
trGetDispatch()->ShadeModel( mode ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trStencilFunc( GLenum func, GLint ref, GLuint mask ) { |
trWriteCMD( CMD_STENCILFUNC ); |
trWriteEnum( func ); |
trWritei( ref ); |
trWriteui( mask ); |
if( trCtx()->doExec ) { |
trGetDispatch()->StencilFunc( func, ref, mask ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trStencilMask( GLuint mask ) { |
trWriteCMD( CMD_STENCILMASK ); |
trWriteui( mask ); |
if( trCtx()->doExec ) { |
trGetDispatch()->StencilMask( mask ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trStencilOp( GLenum fail, GLenum zfail, GLenum zpass ) { |
trWriteCMD( CMD_STENCILOP ); |
trWriteEnum( fail ); |
trWriteEnum( zfail ); |
trWriteEnum( zpass ); |
if( trCtx()->doExec ) { |
trGetDispatch()->StencilOp( fail, zfail, zpass ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord1d( GLdouble s ) { |
trWriteCMD( CMD_TEXCOORD1D ); |
trWrited( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord1d( s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord1dv( const GLdouble *v ) { |
trWriteCMD( CMD_TEXCOORD1DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWrited( v[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord1dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord1f( GLfloat s ) { |
trWriteCMD( CMD_TEXCOORD1F ); |
trWritef( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord1f( s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord1fv( const GLfloat *v ) { |
trWriteCMD( CMD_TEXCOORD1FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWritef( v[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord1fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord1i( GLint s ) { |
trWriteCMD( CMD_TEXCOORD1I ); |
trWritei( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord1i( s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord1iv( const GLint *v ) { |
trWriteCMD( CMD_TEXCOORD1IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWritei( v[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord1iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord1s( GLshort s ) { |
trWriteCMD( CMD_TEXCOORD1S ); |
trWrites( s ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord1s( s ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord1sv( const GLshort *v ) { |
trWriteCMD( CMD_TEXCOORD1SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWrites( v[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord1sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord2d( GLdouble s, GLdouble t ) { |
trWriteCMD( CMD_TEXCOORD2D ); |
trWrited( s ); |
trWrited( t ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord2d( s, t ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord2dv( const GLdouble *v ) { |
trWriteCMD( CMD_TEXCOORD2DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord2dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord2f( GLfloat s, GLfloat t ) { |
trWriteCMD( CMD_TEXCOORD2F ); |
trWritef( s ); |
trWritef( t ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord2f( s, t ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord2fv( const GLfloat *v ) { |
trWriteCMD( CMD_TEXCOORD2FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord2fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord2i( GLint s, GLint t ) { |
trWriteCMD( CMD_TEXCOORD2I ); |
trWritei( s ); |
trWritei( t ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord2i( s, t ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord2iv( const GLint *v ) { |
trWriteCMD( CMD_TEXCOORD2IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord2iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord2s( GLshort s, GLshort t ) { |
trWriteCMD( CMD_TEXCOORD2S ); |
trWrites( s ); |
trWrites( t ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord2s( s, t ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord2sv( const GLshort *v ) { |
trWriteCMD( CMD_TEXCOORD2SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord2sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord3d( GLdouble s, GLdouble t, GLdouble r ) { |
trWriteCMD( CMD_TEXCOORD3D ); |
trWrited( s ); |
trWrited( t ); |
trWrited( r ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord3d( s, t, r ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord3dv( const GLdouble *v ) { |
trWriteCMD( CMD_TEXCOORD3DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord3dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord3f( GLfloat s, GLfloat t, GLfloat r ) { |
trWriteCMD( CMD_TEXCOORD3F ); |
trWritef( s ); |
trWritef( t ); |
trWritef( r ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord3f( s, t, r ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord3fv( const GLfloat *v ) { |
trWriteCMD( CMD_TEXCOORD3FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord3fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord3i( GLint s, GLint t, GLint r ) { |
trWriteCMD( CMD_TEXCOORD3I ); |
trWritei( s ); |
trWritei( t ); |
trWritei( r ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord3i( s, t, r ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord3iv( const GLint *v ) { |
trWriteCMD( CMD_TEXCOORD3IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord3iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord3s( GLshort s, GLshort t, GLshort r ) { |
trWriteCMD( CMD_TEXCOORD3S ); |
trWrites( s ); |
trWrites( t ); |
trWrites( r ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord3s( s, t, r ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord3sv( const GLshort *v ) { |
trWriteCMD( CMD_TEXCOORD3SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord3sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ) { |
trWriteCMD( CMD_TEXCOORD4D ); |
trWrited( s ); |
trWrited( t ); |
trWrited( r ); |
trWrited( q ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord4d( s, t, r, q ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord4dv( const GLdouble *v ) { |
trWriteCMD( CMD_TEXCOORD4DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord4dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) { |
trWriteCMD( CMD_TEXCOORD4F ); |
trWritef( s ); |
trWritef( t ); |
trWritef( r ); |
trWritef( q ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord4f( s, t, r, q ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord4fv( const GLfloat *v ) { |
trWriteCMD( CMD_TEXCOORD4FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord4fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord4i( GLint s, GLint t, GLint r, GLint q ) { |
trWriteCMD( CMD_TEXCOORD4I ); |
trWritei( s ); |
trWritei( t ); |
trWritei( r ); |
trWritei( q ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord4i( s, t, r, q ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord4iv( const GLint *v ) { |
trWriteCMD( CMD_TEXCOORD4IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord4iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ) { |
trWriteCMD( CMD_TEXCOORD4S ); |
trWrites( s ); |
trWrites( t ); |
trWrites( r ); |
trWrites( q ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord4s( s, t, r, q ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoord4sv( const GLshort *v ) { |
trWriteCMD( CMD_TEXCOORD4SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoord4sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoordPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ) { /* TODO */ |
trWriteCMD( CMD_TEXCOORDPOINTEREXT ); |
trWritei( size ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWriteSizei( count ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexCoordPointerEXT( size, type, stride, count, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ) { /* TODO */ |
trace_context_t * tctx; |
trWriteCMD( CMD_TEXCOORDPOINTER ); |
trWritei( size ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( tctx->doExec ) { |
trGetDispatch()->TexCoordPointer( size, type, stride, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexEnvf( GLenum target, GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_TEXENVF ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexEnvf( target, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_TEXENVFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_TEXTURE_ENV_MODE: |
trWritef( params[0] ); |
break; |
case GL_TEXTURE_ENV_COLOR: |
trWriteArrayf( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->TexEnvfv( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexEnvi( GLenum target, GLenum pname, GLint param ) { |
trWriteCMD( CMD_TEXENVI ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexEnvi( target, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexEnviv( GLenum target, GLenum pname, const GLint *params ) { |
trWriteCMD( CMD_TEXENVIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_TEXTURE_ENV_MODE: |
trWritei( params[0] ); |
break; |
case GL_TEXTURE_ENV_COLOR: |
trWriteArrayi( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->TexEnviv( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexGend( GLenum coord, GLenum pname, GLdouble param ) { |
trWriteCMD( CMD_TEXGEND ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWrited( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexGend( coord, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexGendv( GLenum coord, GLenum pname, const GLdouble *params ) { |
trWriteCMD( CMD_TEXGENDV ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
trWrited( params[0] ); |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
trWriteArrayd( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->TexGendv( coord, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexGenf( GLenum coord, GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_TEXGENF ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexGenf( coord, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_TEXGENFV ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
trWritef( params[0] ); |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
trWriteArrayf( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->TexGenfv( coord, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexGeni( GLenum coord, GLenum pname, GLint param ) { |
trWriteCMD( CMD_TEXGENI ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexGeni( coord, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexGeniv( GLenum coord, GLenum pname, const GLint *params ) { |
trWriteCMD( CMD_TEXGENIV ); |
trWriteEnum( coord ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
switch( pname ) { |
case GL_TEXTURE_GEN_MODE: |
trWritei( params[0] ); |
break; |
case GL_OBJECT_PLANE: |
case GL_EYE_PLANE: |
trWriteArrayi( 4, params ); |
break; |
default: |
/* The 2nd pass should catch this. */ |
break; |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->TexGeniv( coord, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexImage1D( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_TEXIMAGE1D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( internalFormat ); |
trWriteSizei( width ); |
trWritei( border ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexImage1D( target, level, internalFormat, width, border, format, type, pixels ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexImage2D( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_TEXIMAGE2D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( internalFormat ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWritei( border ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexImage2D( target, level, internalFormat, width, height, border, format, type, pixels ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trTexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) { /* TODO */ |
trWriteCMD( CMD_TEXIMAGE3DEXT ); |
trWriteEnum( target ); |
trWritei( level ); |
trWriteEnum( internalFormat ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteSizei( depth ); |
trWritei( border ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
/* Pixels isn't touched if target is GL_PROXY_TEXTURE_3D */ |
if( target != GL_PROXY_TEXTURE_3D ) { |
pixelsize = trGetPixelSize( format, type ); |
trWritePixelArray( GL_FALSE, type, width, height, depth, pixelsize, pixels ); |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->TexImage3DEXT( target, level, internalFormat, width, height, depth, border, format, type, pixels ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trTexImage3D( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_TEXIMAGE3D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( internalFormat ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteSizei( depth ); |
trWritei( border ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexImage3D( target, level, internalFormat, width, height, depth, border, format, type, pixels ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexParameterf( GLenum target, GLenum pname, GLfloat param ) { |
trWriteCMD( CMD_TEXPARAMETERF ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritef( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexParameterf( target, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) { |
trWriteCMD( CMD_TEXPARAMETERFV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
trWritef( params[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexParameterfv( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexParameteri( GLenum target, GLenum pname, GLint param ) { |
trWriteCMD( CMD_TEXPARAMETERI ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritei( param ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexParameteri( target, pname, param ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexParameteriv( GLenum target, GLenum pname, const GLint *params ) { |
trWriteCMD( CMD_TEXPARAMETERIV ); |
trWriteEnum( target ); |
trWriteEnum( pname ); |
trWritePointer( (void *)params ); |
trFileFlush(); |
trWritei( params[0] ); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexParameteriv( target, pname, params ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels ) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_TEXSUBIMAGE1D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( xoffset ); |
trWriteSizei( width ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexSubImage1D( target, level, xoffset, width, format, type, pixels ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_TEXSUBIMAGE2D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( xoffset ); |
trWritei( yoffset ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels ); |
trError(); |
} |
} |
#if 0 |
// Not in MESAs dispatch table |
GLAPI void GLAPIENTRY trTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_TEXSUBIMAGE3DEXT ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( xoffset ); |
trWritei( yoffset ); |
trWritei( zoffset ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteSizei( depth ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
/* Pixels isn't touched if target is GL_PROXY_TEXTURE_3D */ |
if( target != GL_PROXY_TEXTURE_3D ) { |
pixelsize = trGetPixelSize( format, type ); |
trWritePixelArray( GL_FALSE, type, width, height, depth, pixelsize, pixels ); |
} |
if( trCtx()->doExec ) { |
trGetDispatch()->TexSubImage3DEXT( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels ); |
trError(); |
} |
} |
#endif |
GLAPI void GLAPIENTRY trTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) { /* TODO */ |
GLint pixelsize; |
trWriteCMD( CMD_TEXSUBIMAGE3D ); |
trWriteEnum( target ); |
trWritei( level ); |
trWritei( xoffset ); |
trWritei( yoffset ); |
trWritei( zoffset ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
trWriteSizei( depth ); |
trWriteEnum( format ); |
trWriteEnum( type ); |
trWritePointer( (void *)pixels ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->TexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTranslated( GLdouble x, GLdouble y, GLdouble z ) { |
trWriteCMD( CMD_TRANSLATED ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Translated( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trTranslatef( GLfloat x, GLfloat y, GLfloat z ) { |
trWriteCMD( CMD_TRANSLATEF ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Translatef( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trUnlockArraysEXT( void ) { |
trWriteCMD( CMD_UNLOCKARRAYSEXT ); |
if( trCtx()->doExec ) { |
trGetDispatch()->UnlockArraysEXT( ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex2d( GLdouble x, GLdouble y ) { |
trWriteCMD( CMD_VERTEX2D ); |
trWrited( x ); |
trWrited( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex2d( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex2dv( const GLdouble *v ) { |
trWriteCMD( CMD_VERTEX2DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex2dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex2f( GLfloat x, GLfloat y ) { |
trWriteCMD( CMD_VERTEX2F ); |
trWritef( x ); |
trWritef( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex2f( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex2fv( const GLfloat *v ) { |
trWriteCMD( CMD_VERTEX2FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex2fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex2i( GLint x, GLint y ) { |
trWriteCMD( CMD_VERTEX2I ); |
trWritei( x ); |
trWritei( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex2i( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex2iv( const GLint *v ) { |
trWriteCMD( CMD_VERTEX2IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex2iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex2s( GLshort x, GLshort y ) { |
trWriteCMD( CMD_VERTEX2S ); |
trWrites( x ); |
trWrites( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex2s( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex2sv( const GLshort *v ) { |
trWriteCMD( CMD_VERTEX2SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 2, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex2sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex3d( GLdouble x, GLdouble y, GLdouble z ) { |
trWriteCMD( CMD_VERTEX3D ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex3d( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex3dv( const GLdouble *v ) { |
trWriteCMD( CMD_VERTEX3DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex3dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex3f( GLfloat x, GLfloat y, GLfloat z ) { |
trWriteCMD( CMD_VERTEX3F ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex3f( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex3fv( const GLfloat *v ) { |
trWriteCMD( CMD_VERTEX3FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex3fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex3i( GLint x, GLint y, GLint z ) { |
trWriteCMD( CMD_VERTEX3I ); |
trWritei( x ); |
trWritei( y ); |
trWritei( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex3i( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex3iv( const GLint *v ) { |
trWriteCMD( CMD_VERTEX3IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex3iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex3s( GLshort x, GLshort y, GLshort z ) { |
trWriteCMD( CMD_VERTEX3S ); |
trWrites( x ); |
trWrites( y ); |
trWrites( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex3s( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex3sv( const GLshort *v ) { |
trWriteCMD( CMD_VERTEX3SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 3, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex3sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) { |
trWriteCMD( CMD_VERTEX4D ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
trWrited( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex4d( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex4dv( const GLdouble *v ) { |
trWriteCMD( CMD_VERTEX4DV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayd( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex4dv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { |
trWriteCMD( CMD_VERTEX4F ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
trWritef( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex4f( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex4fv( const GLfloat *v ) { |
trWriteCMD( CMD_VERTEX4FV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayf( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex4fv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex4i( GLint x, GLint y, GLint z, GLint w ) { |
trWriteCMD( CMD_VERTEX4I ); |
trWritei( x ); |
trWritei( y ); |
trWritei( z ); |
trWritei( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex4i( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex4iv( const GLint *v ) { |
trWriteCMD( CMD_VERTEX4IV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrayi( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex4iv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ) { |
trWriteCMD( CMD_VERTEX4S ); |
trWrites( x ); |
trWrites( y ); |
trWrites( z ); |
trWrites( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex4s( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertex4sv( const GLshort *v ) { |
trWriteCMD( CMD_VERTEX4SV ); |
trWritePointer( (void *)v ); |
trFileFlush(); |
trWriteArrays( 4, v ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Vertex4sv( v ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertexPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ) { /* TODO */ |
trWriteCMD( CMD_VERTEXPOINTEREXT ); |
trWritei( size ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWriteSizei( count ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->VertexPointerEXT( size, type, stride, count, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ) { /* TODO */ |
trWriteCMD( CMD_VERTEXPOINTER ); |
trWritei( size ); |
trWriteEnum( type ); |
trWriteSizei( stride ); |
trWritePointer( (void *)ptr ); |
trFileFlush(); |
if( trCtx()->doExec ) { |
trGetDispatch()->VertexPointer( size, type, stride, ptr ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trViewport( GLint x, GLint y, GLsizei width, GLsizei height ) { |
trWriteCMD( CMD_VIEWPORT ); |
trWritei( x ); |
trWritei( y ); |
trWriteSizei( width ); |
trWriteSizei( height ); |
if( trCtx()->doExec ) { |
trGetDispatch()->Viewport( x, y, width, height ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos2dMESA( GLdouble x, GLdouble y ) { |
trWriteCMD( CMD_WINDOWPOS2DMESA ); |
trWrited( x ); |
trWrited( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos2dMESA( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos2dvMESA( const GLdouble *p ) { |
trWriteCMD( CMD_WINDOWPOS2DVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayd( 2, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos2dvMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos2fMESA( GLfloat x, GLfloat y ) { |
trWriteCMD( CMD_WINDOWPOS2FMESA ); |
trWritef( x ); |
trWritef( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos2fMESA( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos2fvMESA( const GLfloat *p ) { |
trWriteCMD( CMD_WINDOWPOS2FVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayf( 2, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos2fvMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos2iMESA( GLint x, GLint y ) { |
trWriteCMD( CMD_WINDOWPOS2IMESA ); |
trWritei( x ); |
trWritei( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos2iMESA( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos2ivMESA( const GLint *p ) { |
trWriteCMD( CMD_WINDOWPOS2IVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayi( 2, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos2ivMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos2sMESA( GLshort x, GLshort y ) { |
trWriteCMD( CMD_WINDOWPOS2SMESA ); |
trWrites( x ); |
trWrites( y ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos2sMESA( x, y ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos2svMESA( const GLshort *p ) { |
trWriteCMD( CMD_WINDOWPOS2SVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrays( 2, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos2svMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z ) { |
trWriteCMD( CMD_WINDOWPOS3DMESA ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos3dMESA( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos3dvMESA( const GLdouble *p ) { |
trWriteCMD( CMD_WINDOWPOS3DVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayd( 3, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos3dvMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z ) { |
trWriteCMD( CMD_WINDOWPOS3FMESA ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos3fMESA( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos3fvMESA( const GLfloat *p ) { |
trWriteCMD( CMD_WINDOWPOS3FVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayf( 3, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos3fvMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos3iMESA( GLint x, GLint y, GLint z ) { |
trWriteCMD( CMD_WINDOWPOS3IMESA ); |
trWritei( x ); |
trWritei( y ); |
trWritei( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos3iMESA( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos3ivMESA( const GLint *p ) { |
trWriteCMD( CMD_WINDOWPOS3IVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayi( 3, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos3ivMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos3sMESA( GLshort x, GLshort y, GLshort z ) { |
trWriteCMD( CMD_WINDOWPOS3SMESA ); |
trWrites( x ); |
trWrites( y ); |
trWrites( z ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos3sMESA( x, y, z ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos3svMESA( const GLshort *p ) { |
trWriteCMD( CMD_WINDOWPOS3SVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrays( 3, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos3svMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w) { |
trWriteCMD( CMD_WINDOWPOS4DMESA ); |
trWrited( x ); |
trWrited( y ); |
trWrited( z ); |
trWrited( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos4dMESA( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos4dvMESA( const GLdouble *p ) { |
trWriteCMD( CMD_WINDOWPOS4DVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayd( 4, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos4dvMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { |
trWriteCMD( CMD_WINDOWPOS4FMESA ); |
trWritef( x ); |
trWritef( y ); |
trWritef( z ); |
trWritef( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos4fMESA( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos4fvMESA( const GLfloat *p ) { |
trWriteCMD( CMD_WINDOWPOS4FVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayf( 4, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos4fvMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w ) { |
trWriteCMD( CMD_WINDOWPOS4IMESA ); |
trWritei( x ); |
trWritei( y ); |
trWritei( z ); |
trWritei( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos4iMESA( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos4ivMESA( const GLint *p ) { |
trWriteCMD( CMD_WINDOWPOS4IVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrayi( 4, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos4ivMESA( p ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos4sMESA( GLshort x, GLshort y, GLshort z, GLshort w ) { |
trWriteCMD( CMD_WINDOWPOS4SMESA ); |
trWrites( x ); |
trWrites( y ); |
trWrites( z ); |
trWrites( w ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos4sMESA( x, y, z, w ); |
trError(); |
} |
} |
GLAPI void GLAPIENTRY trWindowPos4svMESA( const GLshort *p ) { |
trWriteCMD( CMD_WINDOWPOS4SVMESA ); |
trWritePointer( (void *)p ); |
trFileFlush(); |
trWriteArrays( 4, p ); |
if( trCtx()->doExec ) { |
trGetDispatch()->WindowPos4svMESA( p ); |
trError(); |
} |
} |
void trInitDispatch( struct _glapi_table* dispatch ) { |
/* assert(dispatch); */ |
if (!dispatch) |
return; |
memset(dispatch,0,sizeof(struct _glapi_table)); |
dispatch->NewList = trNewList; /* 0 */ |
dispatch->EndList = trEndList; /* 1 */ |
dispatch->CallList = trCallList; /* 2 */ |
dispatch->CallLists = trCallLists; /* 3 */ |
dispatch->DeleteLists = trDeleteLists; /* 4 */ |
dispatch->GenLists = trGenLists; /* 5 */ |
dispatch->ListBase = trListBase; /* 6 */ |
dispatch->Begin = trBegin; /* 7 */ |
dispatch->Bitmap = trBitmap; /* 8 */ |
dispatch->Color3b = trColor3b; /* 9 */ |
dispatch->Color3bv = trColor3bv; /* 10 */ |
dispatch->Color3d = trColor3d; /* 11 */ |
dispatch->Color3dv = trColor3dv; /* 12 */ |
dispatch->Color3f = trColor3f; /* 13 */ |
dispatch->Color3fv = trColor3fv; /* 14 */ |
dispatch->Color3i = trColor3i; /* 15 */ |
dispatch->Color3iv = trColor3iv; /* 16 */ |
dispatch->Color3s = trColor3s; /* 17 */ |
dispatch->Color3sv = trColor3sv; /* 18 */ |
dispatch->Color3ub = trColor3ub; /* 19 */ |
dispatch->Color3ubv = trColor3ubv; /* 20 */ |
dispatch->Color3ui = trColor3ui; /* 21 */ |
dispatch->Color3uiv = trColor3uiv; /* 22 */ |
dispatch->Color3us = trColor3us; /* 23 */ |
dispatch->Color3usv = trColor3usv; /* 24 */ |
dispatch->Color4b = trColor4b; /* 25 */ |
dispatch->Color4bv = trColor4bv; /* 26 */ |
dispatch->Color4d = trColor4d; /* 27 */ |
dispatch->Color4dv = trColor4dv; /* 28 */ |
dispatch->Color4f = trColor4f; /* 29 */ |
dispatch->Color4fv = trColor4fv; /* 30 */ |
dispatch->Color4i = trColor4i; /* 31 */ |
dispatch->Color4iv = trColor4iv; /* 32 */ |
dispatch->Color4s = trColor4s; /* 33 */ |
dispatch->Color4sv = trColor4sv; /* 34 */ |
dispatch->Color4ub = trColor4ub; /* 35 */ |
dispatch->Color4ubv = trColor4ubv; /* 36 */ |
dispatch->Color4ui = trColor4ui; /* 37 */ |
dispatch->Color4uiv = trColor4uiv; /* 38 */ |
dispatch->Color4us = trColor4us; /* 39 */ |
dispatch->Color4usv = trColor4usv; /* 40 */ |
dispatch->EdgeFlag = trEdgeFlag; /* 41 */ |
dispatch->EdgeFlagv = trEdgeFlagv; /* 42 */ |
dispatch->End = trEnd; /* 43 */ |
dispatch->Indexd = trIndexd; /* 44 */ |
dispatch->Indexdv = trIndexdv; /* 45 */ |
dispatch->Indexf = trIndexf; /* 46 */ |
dispatch->Indexfv = trIndexfv; /* 47 */ |
dispatch->Indexi = trIndexi; /* 48 */ |
dispatch->Indexiv = trIndexiv; /* 49 */ |
dispatch->Indexs = trIndexs; /* 50 */ |
dispatch->Indexsv = trIndexsv; /* 51 */ |
dispatch->Normal3b = trNormal3b; /* 52 */ |
dispatch->Normal3bv = trNormal3bv; /* 53 */ |
dispatch->Normal3d = trNormal3d; /* 54 */ |
dispatch->Normal3dv = trNormal3dv; /* 55 */ |
dispatch->Normal3f = trNormal3f; /* 56 */ |
dispatch->Normal3fv = trNormal3fv; /* 57 */ |
dispatch->Normal3i = trNormal3i; /* 58 */ |
dispatch->Normal3iv = trNormal3iv; /* 59 */ |
dispatch->Normal3s = trNormal3s; /* 60 */ |
dispatch->Normal3sv = trNormal3sv; /* 61 */ |
dispatch->RasterPos2d = trRasterPos2d; /* 62 */ |
dispatch->RasterPos2dv = trRasterPos2dv; /* 63 */ |
dispatch->RasterPos2f = trRasterPos2f; /* 64 */ |
dispatch->RasterPos2fv = trRasterPos2fv; /* 65 */ |
dispatch->RasterPos2i = trRasterPos2i; /* 66 */ |
dispatch->RasterPos2iv = trRasterPos2iv; /* 67 */ |
dispatch->RasterPos2s = trRasterPos2s; /* 68 */ |
dispatch->RasterPos2sv = trRasterPos2sv; /* 69 */ |
dispatch->RasterPos3d = trRasterPos3d; /* 70 */ |
dispatch->RasterPos3dv = trRasterPos3dv; /* 71 */ |
dispatch->RasterPos3f = trRasterPos3f; /* 72 */ |
dispatch->RasterPos3fv = trRasterPos3fv; /* 73 */ |
dispatch->RasterPos3i = trRasterPos3i; /* 74 */ |
dispatch->RasterPos3iv = trRasterPos3iv; /* 75 */ |
dispatch->RasterPos3s = trRasterPos3s; /* 76 */ |
dispatch->RasterPos3sv = trRasterPos3sv; /* 77 */ |
dispatch->RasterPos4d = trRasterPos4d; /* 78 */ |
dispatch->RasterPos4dv = trRasterPos4dv; /* 79 */ |
dispatch->RasterPos4f = trRasterPos4f; /* 80 */ |
dispatch->RasterPos4fv = trRasterPos4fv; /* 81 */ |
dispatch->RasterPos4i = trRasterPos4i; /* 82 */ |
dispatch->RasterPos4iv = trRasterPos4iv; /* 83 */ |
dispatch->RasterPos4s = trRasterPos4s; /* 84 */ |
dispatch->RasterPos4sv = trRasterPos4sv; /* 85 */ |
dispatch->Rectd = trRectd; /* 86 */ |
dispatch->Rectdv = trRectdv; /* 87 */ |
dispatch->Rectf = trRectf; /* 88 */ |
dispatch->Rectfv = trRectfv; /* 89 */ |
dispatch->Recti = trRecti; /* 90 */ |
dispatch->Rectiv = trRectiv; /* 91 */ |
dispatch->Rects = trRects; /* 92 */ |
dispatch->Rectsv = trRectsv; /* 93 */ |
dispatch->TexCoord1d = trTexCoord1d; /* 94 */ |
dispatch->TexCoord1dv = trTexCoord1dv; /* 95 */ |
dispatch->TexCoord1f = trTexCoord1f; /* 96 */ |
dispatch->TexCoord1fv = trTexCoord1fv; /* 97 */ |
dispatch->TexCoord1i = trTexCoord1i; /* 98 */ |
dispatch->TexCoord1iv = trTexCoord1iv; /* 99 */ |
dispatch->TexCoord1s = trTexCoord1s; /* 100 */ |
dispatch->TexCoord1sv = trTexCoord1sv; /* 101 */ |
dispatch->TexCoord2d = trTexCoord2d; /* 102 */ |
dispatch->TexCoord2dv = trTexCoord2dv; /* 103 */ |
dispatch->TexCoord2f = trTexCoord2f; /* 104 */ |
dispatch->TexCoord2fv = trTexCoord2fv; /* 105 */ |
dispatch->TexCoord2i = trTexCoord2i; /* 106 */ |
dispatch->TexCoord2iv = trTexCoord2iv; /* 107 */ |
dispatch->TexCoord2s = trTexCoord2s; /* 108 */ |
dispatch->TexCoord2sv = trTexCoord2sv; /* 109 */ |
dispatch->TexCoord3d = trTexCoord3d; /* 110 */ |
dispatch->TexCoord3dv = trTexCoord3dv; /* 111 */ |
dispatch->TexCoord3f = trTexCoord3f; /* 112 */ |
dispatch->TexCoord3fv = trTexCoord3fv; /* 113 */ |
dispatch->TexCoord3i = trTexCoord3i; /* 114 */ |
dispatch->TexCoord3iv = trTexCoord3iv; /* 115 */ |
dispatch->TexCoord3s = trTexCoord3s; /* 116 */ |
dispatch->TexCoord3sv = trTexCoord3sv; /* 117 */ |
dispatch->TexCoord4d = trTexCoord4d; /* 118 */ |
dispatch->TexCoord4dv = trTexCoord4dv; /* 119 */ |
dispatch->TexCoord4f = trTexCoord4f; /* 120 */ |
dispatch->TexCoord4fv = trTexCoord4fv; /* 121 */ |
dispatch->TexCoord4i = trTexCoord4i; /* 122 */ |
dispatch->TexCoord4iv = trTexCoord4iv; /* 123 */ |
dispatch->TexCoord4s = trTexCoord4s; /* 124 */ |
dispatch->TexCoord4sv = trTexCoord4sv; /* 125 */ |
dispatch->Vertex2d = trVertex2d; /* 126 */ |
dispatch->Vertex2dv = trVertex2dv; /* 127 */ |
dispatch->Vertex2f = trVertex2f; /* 128 */ |
dispatch->Vertex2fv = trVertex2fv; /* 129 */ |
dispatch->Vertex2i = trVertex2i; /* 130 */ |
dispatch->Vertex2iv = trVertex2iv; /* 131 */ |
dispatch->Vertex2s = trVertex2s; /* 132 */ |
dispatch->Vertex2sv = trVertex2sv; /* 133 */ |
dispatch->Vertex3d = trVertex3d; /* 134 */ |
dispatch->Vertex3dv = trVertex3dv; /* 135 */ |
dispatch->Vertex3f = trVertex3f; /* 136 */ |
dispatch->Vertex3fv = trVertex3fv; /* 137 */ |
dispatch->Vertex3i = trVertex3i; /* 138 */ |
dispatch->Vertex3iv = trVertex3iv; /* 139 */ |
dispatch->Vertex3s = trVertex3s; /* 140 */ |
dispatch->Vertex3sv = trVertex3sv; /* 141 */ |
dispatch->Vertex4d = trVertex4d; /* 142 */ |
dispatch->Vertex4dv = trVertex4dv; /* 143 */ |
dispatch->Vertex4f = trVertex4f; /* 144 */ |
dispatch->Vertex4fv = trVertex4fv; /* 145 */ |
dispatch->Vertex4i = trVertex4i; /* 146 */ |
dispatch->Vertex4iv = trVertex4iv; /* 147 */ |
dispatch->Vertex4s = trVertex4s; /* 148 */ |
dispatch->Vertex4sv = trVertex4sv; /* 149 */ |
dispatch->ClipPlane = trClipPlane; /* 150 */ |
dispatch->ColorMaterial = trColorMaterial; /* 151 */ |
dispatch->CullFace = trCullFace; /* 152 */ |
dispatch->Fogf = trFogf; /* 153 */ |
dispatch->Fogfv = trFogfv; /* 154 */ |
dispatch->Fogi = trFogi; /* 155 */ |
dispatch->Fogiv = trFogiv; /* 156 */ |
dispatch->FrontFace = trFrontFace; /* 157 */ |
dispatch->Hint = trHint; /* 158 */ |
dispatch->Lightf = trLightf; /* 159 */ |
dispatch->Lightfv = trLightfv; /* 160 */ |
dispatch->Lighti = trLighti; /* 161 */ |
dispatch->Lightiv = trLightiv; /* 162 */ |
dispatch->LightModelf = trLightModelf; /* 163 */ |
dispatch->LightModelfv = trLightModelfv; /* 164 */ |
dispatch->LightModeli = trLightModeli; /* 165 */ |
dispatch->LightModeliv = trLightModeliv; /* 166 */ |
dispatch->LineStipple = trLineStipple; /* 167 */ |
dispatch->LineWidth = trLineWidth; /* 168 */ |
dispatch->Materialf = trMaterialf; /* 169 */ |
dispatch->Materialfv = trMaterialfv; /* 170 */ |
dispatch->Materiali = trMateriali; /* 171 */ |
dispatch->Materialiv = trMaterialiv; /* 172 */ |
dispatch->PointSize = trPointSize; /* 173 */ |
dispatch->PolygonMode = trPolygonMode; /* 174 */ |
dispatch->PolygonStipple = trPolygonStipple; /* 175 */ |
dispatch->Scissor = trScissor; /* 176 */ |
dispatch->ShadeModel = trShadeModel; /* 177 */ |
dispatch->TexParameterf = trTexParameterf; /* 178 */ |
dispatch->TexParameterfv = trTexParameterfv; /* 179 */ |
dispatch->TexParameteri = trTexParameteri; /* 180 */ |
dispatch->TexParameteriv = trTexParameteriv; /* 181 */ |
dispatch->TexImage1D = trTexImage1D; /* 182 */ |
dispatch->TexImage2D = trTexImage2D; /* 183 */ |
dispatch->TexEnvf = trTexEnvf; /* 184 */ |
dispatch->TexEnvfv = trTexEnvfv; /* 185 */ |
dispatch->TexEnvi = trTexEnvi; /* 186 */ |
dispatch->TexEnviv = trTexEnviv; /* 187 */ |
dispatch->TexGend = trTexGend; /* 188 */ |
dispatch->TexGendv = trTexGendv; /* 189 */ |
dispatch->TexGenf = trTexGenf; /* 190 */ |
dispatch->TexGenfv = trTexGenfv; /* 191 */ |
dispatch->TexGeni = trTexGeni; /* 192 */ |
dispatch->TexGeniv = trTexGeniv; /* 193 */ |
dispatch->FeedbackBuffer = trFeedbackBuffer; /* 194 */ |
dispatch->SelectBuffer = trSelectBuffer; /* 195 */ |
dispatch->RenderMode = trRenderMode; /* 196 */ |
dispatch->InitNames = trInitNames; /* 197 */ |
dispatch->LoadName = trLoadName; /* 198 */ |
dispatch->PassThrough = trPassThrough; /* 199 */ |
dispatch->PopName = trPopName; /* 200 */ |
dispatch->PushName = trPushName; /* 201 */ |
dispatch->DrawBuffer = trDrawBuffer; /* 202 */ |
dispatch->Clear = trClear; /* 203 */ |
dispatch->ClearAccum = trClearAccum; /* 204 */ |
dispatch->ClearIndex = trClearIndex; /* 205 */ |
dispatch->ClearColor = trClearColor; /* 206 */ |
dispatch->ClearStencil = trClearStencil; /* 207 */ |
dispatch->ClearDepth = trClearDepth; /* 208 */ |
dispatch->StencilMask = trStencilMask; /* 209 */ |
dispatch->ColorMask = trColorMask; /* 210 */ |
dispatch->DepthMask = trDepthMask; /* 211 */ |
dispatch->IndexMask = trIndexMask; /* 212 */ |
dispatch->Accum = trAccum; /* 213 */ |
dispatch->Disable = trDisable; /* 214 */ |
dispatch->Enable = trEnable; /* 215 */ |
dispatch->Finish = trFinish; /* 216 */ |
dispatch->Flush = trFlush; /* 217 */ |
dispatch->PopAttrib = trPopAttrib; /* 218 */ |
dispatch->PushAttrib = trPushAttrib; /* 219 */ |
dispatch->Map1d = trMap1d; /* 220 */ |
dispatch->Map1f = trMap1f; /* 221 */ |
dispatch->Map2d = trMap2d; /* 222 */ |
dispatch->Map2f = trMap2f; /* 223 */ |
dispatch->MapGrid1d = trMapGrid1d; /* 224 */ |
dispatch->MapGrid1f = trMapGrid1f; /* 225 */ |
dispatch->MapGrid2d = trMapGrid2d; /* 226 */ |
dispatch->MapGrid2f = trMapGrid2f; /* 227 */ |
dispatch->EvalCoord1d = trEvalCoord1d; /* 228 */ |
dispatch->EvalCoord1dv = trEvalCoord1dv; /* 229 */ |
dispatch->EvalCoord1f = trEvalCoord1f; /* 230 */ |
dispatch->EvalCoord1fv = trEvalCoord1fv; /* 231 */ |
dispatch->EvalCoord2d = trEvalCoord2d; /* 232 */ |
dispatch->EvalCoord2dv = trEvalCoord2dv; /* 233 */ |
dispatch->EvalCoord2f = trEvalCoord2f; /* 234 */ |
dispatch->EvalCoord2fv = trEvalCoord2fv; /* 235 */ |
dispatch->EvalMesh1 = trEvalMesh1; /* 236 */ |
dispatch->EvalPoint1 = trEvalPoint1; /* 237 */ |
dispatch->EvalMesh2 = trEvalMesh2; /* 238 */ |
dispatch->EvalPoint2 = trEvalPoint2; /* 239 */ |
dispatch->AlphaFunc = trAlphaFunc; /* 240 */ |
dispatch->BlendFunc = trBlendFunc; /* 241 */ |
dispatch->LogicOp = trLogicOp; /* 242 */ |
dispatch->StencilFunc = trStencilFunc; /* 243 */ |
dispatch->StencilOp = trStencilOp; /* 244 */ |
dispatch->DepthFunc = trDepthFunc; /* 245 */ |
dispatch->PixelZoom = trPixelZoom; /* 246 */ |
dispatch->PixelTransferf = trPixelTransferf; /* 247 */ |
dispatch->PixelTransferi = trPixelTransferi; /* 248 */ |
dispatch->PixelStoref = trPixelStoref; /* 249 */ |
dispatch->PixelStorei = trPixelStorei; /* 250 */ |
dispatch->PixelMapfv = trPixelMapfv; /* 251 */ |
dispatch->PixelMapuiv = trPixelMapuiv; /* 252 */ |
dispatch->PixelMapusv = trPixelMapusv; /* 253 */ |
dispatch->ReadBuffer = trReadBuffer; /* 254 */ |
dispatch->CopyPixels = trCopyPixels; /* 255 */ |
dispatch->ReadPixels = trReadPixels; /* 256 */ |
dispatch->DrawPixels = trDrawPixels; /* 257 */ |
dispatch->GetBooleanv = trGetBooleanv; /* 258 */ |
dispatch->GetClipPlane = trGetClipPlane; /* 259 */ |
dispatch->GetDoublev = trGetDoublev; /* 260 */ |
dispatch->GetError = trGetError; /* 261 */ |
dispatch->GetFloatv = trGetFloatv; /* 262 */ |
dispatch->GetIntegerv = trGetIntegerv; /* 263 */ |
dispatch->GetLightfv = trGetLightfv; /* 264 */ |
dispatch->GetLightiv = trGetLightiv; /* 265 */ |
dispatch->GetMapdv = trGetMapdv; /* 266 */ |
dispatch->GetMapfv = trGetMapfv; /* 267 */ |
dispatch->GetMapiv = trGetMapiv; /* 268 */ |
dispatch->GetMaterialfv = trGetMaterialfv; /* 269 */ |
dispatch->GetMaterialiv = trGetMaterialiv; /* 270 */ |
dispatch->GetPixelMapfv = trGetPixelMapfv; /* 271 */ |
dispatch->GetPixelMapuiv = trGetPixelMapuiv; /* 272 */ |
dispatch->GetPixelMapusv = trGetPixelMapusv; /* 273 */ |
dispatch->GetPolygonStipple = trGetPolygonStipple; /* 274 */ |
dispatch->GetString = trGetString; /* 275 */ |
dispatch->GetTexEnvfv = trGetTexEnvfv; /* 276 */ |
dispatch->GetTexEnviv = trGetTexEnviv; /* 277 */ |
dispatch->GetTexGendv = trGetTexGendv; /* 278 */ |
dispatch->GetTexGenfv = trGetTexGenfv; /* 279 */ |
dispatch->GetTexGeniv = trGetTexGeniv; /* 280 */ |
dispatch->GetTexImage = trGetTexImage; /* 281 */ |
dispatch->GetTexParameterfv = trGetTexParameterfv; /* 282 */ |
dispatch->GetTexParameteriv = trGetTexParameteriv; /* 283 */ |
dispatch->GetTexLevelParameterfv = trGetTexLevelParameterfv; /* 284 */ |
dispatch->GetTexLevelParameteriv = trGetTexLevelParameteriv; /* 285 */ |
dispatch->IsEnabled = trIsEnabled; /* 286 */ |
dispatch->IsList = trIsList; /* 287 */ |
dispatch->DepthRange = trDepthRange; /* 288 */ |
dispatch->Frustum = trFrustum; /* 289 */ |
dispatch->LoadIdentity = trLoadIdentity; /* 290 */ |
dispatch->LoadMatrixf = trLoadMatrixf; /* 291 */ |
dispatch->LoadMatrixd = trLoadMatrixd; /* 292 */ |
dispatch->MatrixMode = trMatrixMode; /* 293 */ |
dispatch->MultMatrixf = trMultMatrixf; /* 294 */ |
dispatch->MultMatrixd = trMultMatrixd; /* 295 */ |
dispatch->Ortho = trOrtho; /* 296 */ |
dispatch->PopMatrix = trPopMatrix; /* 297 */ |
dispatch->PushMatrix = trPushMatrix; /* 298 */ |
dispatch->Rotated = trRotated; /* 299 */ |
dispatch->Rotatef = trRotatef; /* 300 */ |
dispatch->Scaled = trScaled; /* 301 */ |
dispatch->Scalef = trScalef; /* 302 */ |
dispatch->Translated = trTranslated; /* 303 */ |
dispatch->Translatef = trTranslatef; /* 304 */ |
dispatch->Viewport = trViewport; /* 305 */ |
dispatch->ArrayElement = trArrayElement; /* 306 */ |
dispatch->BindTexture = trBindTexture; /* 307 */ |
dispatch->ColorPointer = trColorPointer; /* 308 */ |
dispatch->DisableClientState = trDisableClientState; /* 309 */ |
dispatch->DrawArrays = trDrawArrays; /* 310 */ |
dispatch->DrawElements = trDrawElements; /* 311 */ |
dispatch->EdgeFlagPointer = trEdgeFlagPointer; /* 312 */ |
dispatch->EnableClientState = trEnableClientState; /* 313 */ |
dispatch->IndexPointer = trIndexPointer; /* 314 */ |
dispatch->Indexub = trIndexub; /* 315 */ |
dispatch->Indexubv = trIndexubv; /* 316 */ |
dispatch->InterleavedArrays = trInterleavedArrays; /* 317 */ |
dispatch->NormalPointer = trNormalPointer; /* 318 */ |
dispatch->PolygonOffset = trPolygonOffset; /* 319 */ |
dispatch->TexCoordPointer = trTexCoordPointer; /* 320 */ |
dispatch->VertexPointer = trVertexPointer; /* 321 */ |
dispatch->AreTexturesResident = trAreTexturesResident; /* 322 */ |
dispatch->CopyTexImage1D = trCopyTexImage1D; /* 323 */ |
dispatch->CopyTexImage2D = trCopyTexImage2D; /* 324 */ |
dispatch->CopyTexSubImage1D = trCopyTexSubImage1D; /* 325 */ |
dispatch->CopyTexSubImage2D = trCopyTexSubImage2D; /* 326 */ |
dispatch->DeleteTextures = trDeleteTextures; /* 327 */ |
dispatch->GenTextures = trGenTextures; /* 328 */ |
dispatch->GetPointerv = trGetPointerv; /* 329 */ |
dispatch->IsTexture = trIsTexture; /* 330 */ |
dispatch->PrioritizeTextures = trPrioritizeTextures; /* 331 */ |
dispatch->TexSubImage1D = trTexSubImage1D; /* 332 */ |
dispatch->TexSubImage2D = trTexSubImage2D; /* 333 */ |
dispatch->PopClientAttrib = trPopClientAttrib; /* 334 */ |
dispatch->PushClientAttrib = trPushClientAttrib; /* 335 */ |
#if 1 |
dispatch->BlendColor = trBlendColor; /* 336 */ |
dispatch->BlendEquation = trBlendEquation; /* 337 */ |
dispatch->DrawRangeElements = trDrawRangeElements; /* 338 */ |
dispatch->ColorTable = trColorTable; /* 339 */ |
dispatch->ColorTableParameterfv = trColorTableParameterfv; /* 340 */ |
dispatch->ColorTableParameteriv = trColorTableParameteriv; /* 341 */ |
dispatch->CopyColorTable = trCopyColorTable; /* 342 */ |
dispatch->GetColorTable = trGetColorTable; /* 343 */ |
dispatch->GetColorTableParameterfv = trGetColorTableParameterfv; /* 344 */ |
dispatch->GetColorTableParameteriv = trGetColorTableParameteriv; /* 345 */ |
dispatch->ColorSubTable = trColorSubTable; /* 346 */ |
dispatch->CopyColorSubTable = trCopyColorSubTable; /* 347 */ |
dispatch->ConvolutionFilter1D = trConvolutionFilter1D; /* 348 */ |
dispatch->ConvolutionFilter2D = trConvolutionFilter2D; /* 349 */ |
dispatch->ConvolutionParameterf = trConvolutionParameterf; /* 350 */ |
dispatch->ConvolutionParameterfv = trConvolutionParameterfv; /* 351 */ |
dispatch->ConvolutionParameteri = trConvolutionParameteri; /* 352 */ |
dispatch->ConvolutionParameteriv = trConvolutionParameteriv; /* 353 */ |
dispatch->CopyConvolutionFilter1D = trCopyConvolutionFilter1D; /* 354 */ |
dispatch->CopyConvolutionFilter2D = trCopyConvolutionFilter2D; /* 355 */ |
dispatch->GetConvolutionFilter = trGetConvolutionFilter; /* 356 */ |
dispatch->GetConvolutionParameterfv = trGetConvolutionParameterfv;/* 357 */ |
dispatch->GetConvolutionParameteriv = trGetConvolutionParameteriv;/* 358 */ |
dispatch->GetSeparableFilter = trGetSeparableFilter; /* 359 */ |
dispatch->SeparableFilter2D = trSeparableFilter2D; /* 360 */ |
dispatch->GetHistogram = trGetHistogram; /* 361 */ |
dispatch->GetHistogramParameterfv = trGetHistogramParameterfv; /* 362 */ |
dispatch->GetHistogramParameteriv = trGetHistogramParameteriv; /* 363 */ |
dispatch->GetMinmax = trGetMinmax; /* 364 */ |
dispatch->GetMinmaxParameterfv = trGetMinmaxParameterfv; /* 365 */ |
dispatch->GetMinmaxParameteriv = trGetMinmaxParameteriv; /* 366 */ |
#endif |
#if 0 |
dispatch->Histogram = trHistogram /* 367 */ |
dispatch->Minmax = trMinmax /* 368 */ |
dispatch->ResetHistogram = trResetHistogram /* 369 */ |
dispatch->ResetMinmax = trResetMinmax /* 370 */ |
dispatch->TexImage3D = trTexImage3D /* 371 */ |
dispatch->TexSubImage3D = trTexSubImage3D /* 372 */ |
dispatch->CopyTexSubImage3D = trCopyTexSubImage3D /* 373 */ |
dispatch->ActiveTextureARB = trActiveTextureARB /* 374 */ |
dispatch->ClientActiveTextureARB = trClientActiveTextureARB /* 375 */ |
dispatch->MultiTexCoord1dARB = trMultiTexCoord1dARB /* 376 */ |
dispatch->MultiTexCoord1dvARB = trMultiTexCoord1dvARB /* 377 */ |
dispatch->MultiTexCoord1fARB = trMultiTexCoord1fARB /* 378 */ |
dispatch->MultiTexCoord1fvARB = trMultiTexCoord1fvARB /* 379 */ |
dispatch->MultiTexCoord1iARB = trMultiTexCoord1iARB /* 380 */ |
dispatch->MultiTexCoord1ivARB = trMultiTexCoord1ivARB /* 381 */ |
dispatch->MultiTexCoord1sARB = trMultiTexCoord1sARB /* 382 */ |
dispatch->MultiTexCoord1svARB = trMultiTexCoord1svARB /* 383 */ |
dispatch->MultiTexCoord2dARB = trMultiTexCoord2dARB /* 384 */ |
dispatch->MultiTexCoord2dvARB = trMultiTexCoord2dvARB /* 385 */ |
dispatch->MultiTexCoord2fARB = trMultiTexCoord2fARB /* 386 */ |
dispatch->MultiTexCoord2fvARB = trMultiTexCoord2fvARB /* 387 */ |
dispatch->MultiTexCoord2iARB = trMultiTexCoord2iARB /* 388 */ |
dispatch->MultiTexCoord2ivARB = trMultiTexCoord2ivARB /* 389 */ |
dispatch->MultiTexCoord2sARB = trMultiTexCoord2sARB /* 390 */ |
dispatch->MultiTexCoord2svARB = trMultiTexCoord2svARB /* 391 */ |
dispatch->MultiTexCoord3dARB = trMultiTexCoord3dARB /* 392 */ |
dispatch->MultiTexCoord3dvARB = trMultiTexCoord3dvARB /* 393 */ |
dispatch->MultiTexCoord3fARB = trMultiTexCoord3fARB /* 394 */ |
dispatch->MultiTexCoord3fvARB = trMultiTexCoord3fvARB /* 395 */ |
dispatch->MultiTexCoord3iARB = trMultiTexCoord3iARB /* 396 */ |
dispatch->MultiTexCoord3ivARB = trMultiTexCoord3ivARB /* 397 */ |
dispatch->MultiTexCoord3sARB = trMultiTexCoord3sARB /* 398 */ |
dispatch->MultiTexCoord3svARB = trMultiTexCoord3svARB /* 399 */ |
dispatch->MultiTexCoord4dARB = trMultiTexCoord4dARB /* 400 */ |
dispatch->MultiTexCoord4dvARB = trMultiTexCoord4dvARB /* 401 */ |
dispatch->MultiTexCoord4fARB = trMultiTexCoord4fARB /* 402 */ |
dispatch->MultiTexCoord4fvARB = trMultiTexCoord4fvARB /* 403 */ |
dispatch->MultiTexCoord4iARB = trMultiTexCoord4iARB /* 404 */ |
dispatch->MultiTexCoord4ivARB = trMultiTexCoord4ivARB /* 405 */ |
dispatch->MultiTexCoord4sARB = trMultiTexCoord4sARB /* 406 */ |
dispatch->MultiTexCoord4svARB = trMultiTexCoord4svARB /* 407 */ |
dispatch->LoadTransposeMatrixfARB = trLoadTransposeMatrixfARB /* 408 */ |
dispatch->LoadTransposeMatrixdARB = trLoadTransposeMatrixdARB /* 409 */ |
dispatch->MultTransposeMatrixfARB = trMultTransposeMatrixfARB /* 410 */ |
dispatch->MultTransposeMatrixdARB = trMultTransposeMatrixdARB /* 411 */ |
dispatch->SampleCoverageARB = trSampleCoverageARB /* 412 */ |
dispatch->SamplePassARB = trSamplePassARB /* 413 */ |
dispatch->PolygonOffsetEXT = trPolygonOffsetEXT /* 414 */ |
dispatch->GetTexFilterFuncSGIS = trGetTexFilterFuncSGIS /* 415 */ |
dispatch->TexFilterFuncSGIS = trTexFilterFuncSGIS /* 416 */ |
dispatch->GetHistogramEXT = trGetHistogramEXT /* 417 */ |
dispatch->GetHistogramParameterfvEXT = trGetHistogramParameterfvEXT /* 418 */ |
dispatch->GetHistogramParameterivEXT = trGetHistogramParameterivEXT /* 419 */ |
dispatch->GetMinmaxEXT = trGetMinmaxEXT /* 420 */ |
dispatch->GetMinmaxParameterfvEXT = trGetMinmaxParameterfvEXT /* 421 */ |
dispatch->GetMinmaxParameterivEXT = trGetMinmaxParameterivEXT /* 422 */ |
dispatch->GetConvolutionFilterEXT = trGetConvolutionFilterEXT /* 423 */ |
dispatch->GetConvolutionParameterfvEXT = trGetConvolutionParameterfvEXT /* 424 */ |
dispatch->GetConvolutionParameterivEXT = trGetConvolutionParameterivEXT /* 425 */ |
dispatch->GetSeparableFilterEXT = trGetSeparableFilterEXT /* 426 */ |
dispatch->GetColorTableSGI = trGetColorTableSGI /* 427 */ |
dispatch->GetColorTableParameterfvSGI = trGetColorTableParameterfvSGI /* 428 */ |
dispatch->GetColorTableParameterivSGI = trGetColorTableParameterivSGI /* 429 */ |
dispatch->PixelTexGenSGIX = trPixelTexGenSGIX /* 430 */ |
dispatch->PixelTexGenParameteriSGIS = trPixelTexGenParameteriSGIS /* 431 */ |
dispatch->PixelTexGenParameterivSGIS = trPixelTexGenParameterivSGIS /* 432 */ |
dispatch->PixelTexGenParameterfSGIS = trPixelTexGenParameterfSGIS /* 433 */ |
dispatch->PixelTexGenParameterfvSGIS = trPixelTexGenParameterfvSGIS /* 434 */ |
dispatch->GetPixelTexGenParameterivSGIS = trGetPixelTexGenParameterivSGIS /* 435 */ |
dispatch->GetPixelTexGenParameterfvSGIS = trGetPixelTexGenParameterfvSGIS /* 436 */ |
dispatch->TexImage4DSGIS = trTexImage4DSGIS /* 437 */ |
dispatch->TexSubImage4DSGIS = trTexSubImage4DSGIS /* 438 */ |
dispatch->AreTexturesResidentEXT = trAreTexturesResidentEXT /* 439 */ |
dispatch->GenTexturesEXT = trGenTexturesEXT /* 440 */ |
dispatch->IsTextureEXT = trIsTextureEXT /* 441 */ |
dispatch->DetailTexFuncSGIS = trDetailTexFuncSGIS /* 442 */ |
dispatch->GetDetailTexFuncSGIS = trGetDetailTexFuncSGIS /* 443 */ |
dispatch->SharpenTexFuncSGIS = trSharpenTexFuncSGIS /* 444 */ |
dispatch->GetSharpenTexFuncSGIS = trGetSharpenTexFuncSGIS /* 445 */ |
dispatch->SampleMaskSGIS = trSampleMaskSGIS /* 446 */ |
dispatch->SamplePatternSGIS = trSamplePatternSGIS /* 447 */ |
dispatch->ColorPointerEXT = trColorPointerEXT /* 448 */ |
dispatch->EdgeFlagPointerEXT = trEdgeFlagPointerEXT /* 449 */ |
dispatch->IndexPointerEXT = trIndexPointerEXT /* 450 */ |
dispatch->NormalPointerEXT = trNormalPointerEXT /* 451 */ |
dispatch->TexCoordPointerEXT = trTexCoordPointerEXT /* 452 */ |
dispatch->VertexPointerEXT = trVertexPointerEXT /* 453 */ |
dispatch->SpriteParameterfSGIX = trSpriteParameterfSGIX /* 454 */ |
dispatch->SpriteParameterfvSGIX = trSpriteParameterfvSGIX /* 455 */ |
dispatch->SpriteParameteriSGIX = trSpriteParameteriSGIX /* 456 */ |
dispatch->SpriteParameterivSGIX = trSpriteParameterivSGIX /* 457 */ |
dispatch->PointParameterfEXT = trPointParameterfEXT /* 458 */ |
dispatch->PointParameterfvEXT = trPointParameterfvEXT /* 459 */ |
dispatch->GetInstrumentsSGIX = trGetInstrumentsSGIX /* 460 */ |
dispatch->InstrumentsBufferSGIX = trInstrumentsBufferSGIX /* 461 */ |
dispatch->PollInstrumentsSGIX = trPollInstrumentsSGIX /* 462 */ |
dispatch->ReadInstrumentsSGIX = trReadInstrumentsSGIX /* 463 */ |
dispatch->StartInstrumentsSGIX = trStartInstrumentsSGIX /* 464 */ |
dispatch->StopInstrumentsSGIX = trStopInstrumentsSGIX /* 465 */ |
dispatch->FrameZoomSGIX = trFrameZoomSGIX /* 466 */ |
dispatch->TagSampleBufferSGIX = trTagSampleBufferSGIX /* 467 */ |
dispatch->ReferencePlaneSGIX = trReferencePlaneSGIX /* 468 */ |
dispatch->FlushRasterSGIX = trFlushRasterSGIX /* 469 */ |
dispatch->GetListParameterfvSGIX = trGetListParameterfvSGIX /* 470 */ |
dispatch->GetListParameterivSGIX = trGetListParameterivSGIX /* 471 */ |
dispatch->ListParameterfSGIX = trListParameterfSGIX /* 472 */ |
dispatch->ListParameterfvSGIX = trListParameterfvSGIX /* 473 */ |
dispatch->ListParameteriSGIX = trListParameteriSGIX /* 474 */ |
dispatch->ListParameterivSGIX = trListParameterivSGIX /* 475 */ |
dispatch->FragmentColorMaterialSGIX = trFragmentColorMaterialSGIX /* 476 */ |
dispatch->FragmentLightfSGIX = trFragmentLightfSGIX /* 477 */ |
dispatch->FragmentLightfvSGIX = trFragmentLightfvSGIX /* 478 */ |
dispatch->FragmentLightiSGIX = trFragmentLightiSGIX /* 479 */ |
dispatch->FragmentLightivSGIX = trFragmentLightivSGIX /* 480 */ |
dispatch->FragmentLightModelfSGIX = trFragmentLightModelfSGIX /* 481 */ |
dispatch->FragmentLightModelfvSGIX = trFragmentLightModelfvSGIX /* 482 */ |
dispatch->FragmentLightModeliSGIX = trFragmentLightModeliSGIX /* 483 */ |
dispatch->FragmentLightModelivSGIX = trFragmentLightModelivSGIX /* 484 */ |
dispatch->FragmentMaterialfSGIX = trFragmentMaterialfSGIX /* 485 */ |
dispatch->FragmentMaterialfvSGIX = trFragmentMaterialfvSGIX /* 486 */ |
dispatch->FragmentMaterialiSGIX = trFragmentMaterialiSGIX /* 487 */ |
dispatch->FragmentMaterialivSGIX = trFragmentMaterialivSGIX /* 488 */ |
dispatch->GetFragmentLightfvSGIX = trGetFragmentLightfvSGIX /* 489 */ |
dispatch->GetFragmentLightivSGIX = trGetFragmentLightivSGIX /* 490 */ |
dispatch->GetFragmentMaterialfvSGIX = trGetFragmentMaterialfvSGIX /* 491 */ |
dispatch->GetFragmentMaterialivSGIX = trGetFragmentMaterialivSGIX /* 492 */ |
dispatch->LightEnviSGIX = trLightEnviSGIX /* 493 */ |
dispatch->VertexWeightfEXT = trVertexWeightfEXT /* 494 */ |
dispatch->VertexWeightfvEXT = trVertexWeightfvEXT /* 495 */ |
dispatch->VertexWeightPointerEXT = trVertexWeightPointerEXT /* 496 */ |
dispatch->FlushVertexArrayRangeNV = trFlushVertexArrayRangeNV /* 497 */ |
dispatch->VertexArrayRangeNV = trVertexArrayRangeNV /* 498 */ |
dispatch->CombinerParameterfvNV = trCombinerParameterfvNV /* 499 */ |
dispatch->CombinerParameterfNV = trCombinerParameterfNV /* 500 */ |
dispatch->CombinerParameterivNV = trCombinerParameterivNV /* 501 */ |
dispatch->CombinerParameteriNV = trCombinerParameteriNV /* 502 */ |
dispatch->CombinerInputNV = trCombinerInputNV /* 503 */ |
dispatch->CombinerOutputNV = trCombinerOutputNV /* 504 */ |
dispatch->FinalCombinerInputNV = trFinalCombinerInputNV /* 505 */ |
dispatch->GetCombinerInputParameterfvNV = trGetCombinerInputParameterfvNV /* 506 */ |
dispatch->GetCombinerInputParameterivNV = trGetCombinerInputParameterivNV /* 507 */ |
dispatch->GetCombinerOutputParameterfvNV = trGetCombinerOutputParameterfvNV /* 508 */ |
dispatch->GetCombinerOutputParameterivNV = trGetCombinerOutputParameterivNV /* 509 */ |
dispatch->GetFinalCombinerInputParameterfvNV = trGetFinalCombinerInputParameterfvNV /* 510 */ |
dispatch->GetFinalCombinerInputParameterivNV = trGetFinalCombinerInputParameterivNV /* 511 */ |
dispatch->ResizeBuffersMESA = trResizeBuffersMESA /* 512 */ |
dispatch->WindowPos2dMESA = trWindowPos2dMESA /* 513 */ |
dispatch->WindowPos2dvMESA = trWindowPos2dvMESA /* 514 */ |
dispatch->WindowPos2fMESA = trWindowPos2fMESA /* 515 */ |
dispatch->WindowPos2fvMESA = trWindowPos2fvMESA /* 516 */ |
dispatch->WindowPos2iMESA = trWindowPos2iMESA /* 517 */ |
dispatch->WindowPos2ivMESA = trWindowPos2ivMESA /* 518 */ |
dispatch->WindowPos2sMESA = trWindowPos2sMESA /* 519 */ |
dispatch->WindowPos2svMESA = trWindowPos2svMESA /* 520 */ |
dispatch->WindowPos3dMESA = trWindowPos3dMESA /* 521 */ |
dispatch->WindowPos3dvMESA = trWindowPos3dvMESA /* 522 */ |
dispatch->WindowPos3fMESA = trWindowPos3fMESA /* 523 */ |
dispatch->WindowPos3fvMESA = trWindowPos3fvMESA /* 524 */ |
dispatch->WindowPos3iMESA = trWindowPos3iMESA /* 525 */ |
dispatch->WindowPos3ivMESA = trWindowPos3ivMESA /* 526 */ |
dispatch->WindowPos3sMESA = trWindowPos3sMESA /* 527 */ |
dispatch->WindowPos3svMESA = trWindowPos3svMESA /* 528 */ |
dispatch->WindowPos4dMESA = trWindowPos4dMESA /* 529 */ |
dispatch->WindowPos4dvMESA = trWindowPos4dvMESA /* 530 */ |
dispatch->WindowPos4fMESA = trWindowPos4fMESA /* 531 */ |
dispatch->WindowPos4fvMESA = trWindowPos4fvMESA /* 532 */ |
dispatch->WindowPos4iMESA = trWindowPos4iMESA /* 533 */ |
dispatch->WindowPos4ivMESA = trWindowPos4ivMESA /* 534 */ |
dispatch->WindowPos4sMESA = trWindowPos4sMESA /* 535 */ |
dispatch->WindowPos4svMESA = trWindowPos4svMESA /* 536 */ |
dispatch->BlendFuncSeparateEXT = trBlendFuncSeparateEXT /* 537 */ |
dispatch->IndexMaterialEXT = trIndexMaterialEXT /* 538 */ |
dispatch->IndexFuncEXT = trIndexFuncEXT /* 539 */ |
dispatch->LockArraysEXT = trLockArraysEXT /* 540 */ |
dispatch->UnlockArraysEXT = trUnlockArraysEXT /* 541 */ |
dispatch->CullParameterdvEXT = trCullParameterdvEXT /* 542 */ |
dispatch->CullParameterfvEXT = trCullParameterfvEXT /* 543 */ |
dispatch->HintPGI = trHintPGI /* 544 */ |
dispatch->FogCoordfEXT = trFogCoordfEXT /* 545 */ |
dispatch->FogCoordfvEXT = trFogCoordfvEXT /* 546 */ |
dispatch->FogCoorddEXT = trFogCoorddEXT /* 547 */ |
dispatch->FogCoorddvEXT = trFogCoorddvEXT /* 548 */ |
dispatch->FogCoordPointerEXT = trFogCoordPointerEXT /* 549 */ |
dispatch->GetColorTableEXT = trGetColorTableEXT /* 550 */ |
dispatch->GetColorTableParameterivEXT = trGetColorTableParameterivEXT /* 551 */ |
dispatch->GetColorTableParameterfvEXT = trGetColorTableParameterfvEXT /* 552 */ |
#endif |
} |
#else |
extern void tr_wrapper_dummy_func(void); |
void tr_wrapper_dummy_func(void) |
{ |
} |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_control.c |
---|
0,0 → 1,147 |
#ifdef MESA_TRACE |
#include "glheader.h" |
#include "glapi.h" |
#include "context.h" /* for _mesa_error */ |
#include "mtypes.h" |
#include "tr_context.h" |
#include "tr_write.h" |
void glEnableTraceMESA( GLbitfield mask ) |
{ |
trace_context_t * tctx = trCtx(); |
tctx->traceEnableLogBits = mask; |
tctx->traceEnabled = GL_TRUE; |
} |
void glDisableTraceMESA( GLbitfield mask ) |
{ |
/* Reset traceEnableLogBits ? */ |
trCtx()->traceEnabled = GL_FALSE; |
} |
void glNewTraceMESA( GLbitfield logbits, const GLubyte * traceName ) |
{ |
char * newname; |
GLint length; |
GLcontext * ctx; |
const char * defaultName = "traceGL"; |
ctx = (GLcontext *)_glapi_get_context(); |
assert(ctx); |
assert(ctx->TraceCtx); |
assert(ctx->TraceDispatch); |
if( !ctx || /* Do we even have a context ? */ |
(ctx->TraceCtx->betweenBeginEnd == GL_TRUE) || /* Are we currently between glBegin and glEnd ? */ |
(ctx->TraceDispatch == _glapi_get_override_dispatch(1)) ) { /* Has a trace already started ? */ |
_mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__ ); |
return; |
} |
/* FIXME!!! When do we free tracename after the app is finished? */ |
if( ctx->TraceCtx->traceName ) { |
free( ctx->TraceCtx->traceName ); |
} |
length = strlen((char *)traceName) + 1; |
if( length != 1 ) { |
newname = (char *)malloc( length ); |
strncpy( (char *)newname, (char *)traceName, length ); |
} else { |
length = strlen( defaultName ); |
newname = (char *)malloc( length ); |
strncpy( (char *)newname, defaultName, length ); |
} |
ctx->TraceCtx->traceName = newname; |
ctx->TraceCtx->traceAttribLogBits = logbits; |
trOpenLogFile(); |
trSetTraceDispatch(); |
} |
void glEndTraceMESA(void) |
{ |
GLcontext * ctx; |
ctx = (GLcontext *)_glapi_get_context(); |
assert(ctx); |
assert(ctx->TraceCtx); |
assert(ctx->TraceDispatch); |
/* Do we even have a context ? */ |
/* Are we currently between glBegin and glEnd ? */ |
/* Are we sure the current dispatch _is_ the TraceDispatch ? */ |
if (!ctx || |
(ctx->TraceCtx->betweenBeginEnd == GL_TRUE) || |
(ctx->TraceDispatch != _glapi_get_override_dispatch(1)) ) { |
_mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__ ); |
return; |
} |
#if 0 |
/* Always dump the max indices */ |
// But not yet... |
trWriteCMD( VAR_COLORPOINTER ); |
trWritei( ctx->TraceCtx->trColorPtrState.maxIndex ); |
trWriteCMD( VAR_EDGEFLAGPOINTER ); |
trWritei( ctx->TraceCtx->trEdgeFlagPtrState.maxIndex ); |
trWriteCMD( VAR_INDEXPOINTER ); |
trWritei( ctx->TraceCtx->trIndexPtrState.maxIndex ); |
trWriteCMD( VAR_NORMALPOINTER ); |
trWritei( ctx->TraceCtx->trNormalPtrState.maxIndex ); |
trWriteCMD( VAR_TEXCOORDPOINTER ); |
trWritei( ctx->TraceCtx->trTexCoordPtrState.maxIndex ); |
trWriteCMD( VAR_VERTEXPOINTER ); |
trWritei( ctx->TraceCtx->trVertexPtrState.maxIndex ); |
#endif |
trCloseLogFile(); |
trSetOriginalDispatch(); |
} |
void glTraceAssertAttribMESA( GLbitfield attribMask ) |
{ |
#warning TraceAssertAttrib not implemented |
} |
void glTraceCommentMESA( const GLubyte * comment ) |
{ |
trWriteString( (char *)comment ); |
} |
void glTraceTextureMESA( GLuint name, const GLubyte* comment ) |
{ |
#warning TraceTexture not implemented |
} |
void glTraceListMESA( GLuint name, const GLubyte* comment ) |
{ |
#warning TraceList not implemented |
} |
void glTracePointerMESA( GLvoid* pointer, const GLubyte* comment ) |
{ |
#warning TracePointer not implemented |
} |
void glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment ) |
{ |
#warning TracePointerRange not implemented |
} |
#else |
extern void tr_control_dummy_func(void); |
void tr_control_dummy_func(void) |
{ |
} |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_support.h |
---|
0,0 → 1,16 |
#ifndef TR_SUPPORT_H |
#define TR_SUPPORT_H |
extern void trQueryConvolutionState( void ); |
extern void trZeroGetterData( GLenum pname, GLsizei typesize, GLvoid * params ); |
extern void trPrintColorTableData( GLenum pname, GLenum type, GLvoid * params ); |
extern void trWriteTypeArray( GLenum type, GLsizei width, GLsizei pixelsize, GLint start, const GLvoid * ptr ); |
extern GLint trGetPixelSize( GLenum format, GLenum type ); |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_context.c |
---|
0,0 → 1,118 |
#ifdef MESA_TRACE |
#include "glheader.h" |
#include "glapi.h" |
#include "glapitable.h" |
#include "context.h" |
#include "tr_context.h" |
/* Full precision on floats/double, else human readable. */ |
#define TR_FULL_PRECISION 0x000000001 |
void trInitContext( trace_context_t * tr_context ) |
{ |
int i; |
if (!tr_context) |
return; |
tr_context->traceEnabled = GL_FALSE; |
tr_context->logFP = stdout; |
tr_context->traceName = NULL; |
tr_context->traceAttribLogBits = GL_ALL_ATTRIB_BITS; |
tr_context->traceEnableLogBits = GL_TRACE_ALL_BITS_MESA; |
tr_context->betweenBeginEnd = GL_FALSE; |
tr_context->framecounter = 0; |
tr_context->trDoPrint = GL_TRUE; |
tr_context->doExec = GL_TRUE; |
tr_context->check_errors = GL_TRUE; |
tr_context->head_errors = 0; |
tr_context->tail_errors = 0; |
for( i = 0; i < TR_MAX_QUEUED_ERRORS; i++ ) { |
tr_context->cached_errors[i] = GL_NO_ERROR; |
} |
#if 0 |
tr_context->doAsserts = GL_TRUE; |
tr_context->clientStateValid = GL_FALSE; |
#endif |
} |
/** |
* Get the current context. |
*/ |
trace_context_t* trCtx() { |
GLcontext * ctx; |
ctx = (GLcontext *)_glapi_get_context(); |
assert(ctx); |
assert(ctx->TraceCtx); |
if( (!ctx) || !(ctx->TraceCtx) ) { |
_mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__ ); |
return NULL; |
} |
return ctx->TraceCtx; |
} |
/** |
* Get the current, real dispatch table pointer. |
*/ |
struct _glapi_table* trGetDispatch() { |
return _glapi_get_dispatch(); |
} |
void trSetTraceDispatch( void ) { |
GLcontext * ctx; |
ctx = (GLcontext *)_glapi_get_context(); |
assert( ctx ); |
assert( ctx->TraceCtx ); |
assert( ctx->TraceDispatch ); |
ctx->TraceCtx->traceEnabled = GL_TRUE; |
/* XXX save returned value */ |
(void) _glapi_begin_dispatch_override(ctx->TraceDispatch); |
} |
void trSetOriginalDispatch( void ) { |
GLcontext * ctx; |
ctx = (GLcontext *)_glapi_get_context(); |
assert( ctx ); |
assert( ctx->TraceCtx ); |
assert( ctx->TraceDispatch ); |
ctx->TraceCtx->traceEnabled = GL_FALSE; |
/* XXX pass value we got from _glapi_begin_dispatch_override() */ |
_glapi_end_dispatch_override(1); |
} |
/** |
* Is error checking enabled? |
*/ |
GLboolean trDoErrorCheck() { |
return trCtx()->check_errors; |
} |
#else |
extern void tr_context_dummy_func(void); |
void tr_context_dummy_func(void) |
{ |
} |
#endif |
/shark/trunk/ports/mesa/src/trace/tr_attrib.c |
---|
--- mesa/src/trace/tr_wrapper.h (nonexistent) |
+++ mesa/src/trace/tr_wrapper.h (revision 70) |
@@ -0,0 +1,8 @@ |
+#ifndef TR_WRAPPER_H |
+#define TR_WRAPPER_H |
+ |
+#include "glapitable.h" |
+ |
+void trInitDispatch( struct _glapi_table* dispatch ); |
+ |
+#endif |
/shark/trunk/ports/mesa/src/trace/tr_commands.h |
---|
0,0 → 1,644 |
/* This may look like C code, but it is really -*- C++ -*- */ |
/* $Id: tr_commands.h,v 1.1 2003-02-28 11:54:35 pj Exp $ */ |
/* |
* DebugGL |
* Version: 1.0 |
* |
* Copyright (C) 1999-2000 Bernd Kreimeier, Loki Entertainment |
* All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
*/ |
#ifndef TR_COMMANDS_H |
#define TR_COMMANDS_H |
/** |
* Enumeration of GL commands, for metafile format |
* and networking protocol. Has to be re-indexed |
* if (ever) used as GLX stream. This uses the |
* Mesa internal values. |
*/ |
#define CMD_NEWLIST 0 |
#define CMD_ENDLIST 1 |
#define CMD_CALLLIST 2 |
#define CMD_CALLLISTS 3 |
#define CMD_DELETELISTS 4 |
#define CMD_GENLISTS 5 |
#define CMD_LISTBASE 6 |
#define CMD_BEGIN 7 |
#define CMD_BITMAP 8 |
#define CMD_COLOR3B 9 |
#define CMD_COLOR3BV 10 |
#define CMD_COLOR3D 11 |
#define CMD_COLOR3DV 12 |
#define CMD_COLOR3F 13 |
#define CMD_COLOR3FV 14 |
#define CMD_COLOR3I 15 |
#define CMD_COLOR3IV 16 |
#define CMD_COLOR3S 17 |
#define CMD_COLOR3SV 18 |
#define CMD_COLOR3UB 19 |
#define CMD_COLOR3UBV 20 |
#define CMD_COLOR3UI 21 |
#define CMD_COLOR3UIV 22 |
#define CMD_COLOR3US 23 |
#define CMD_COLOR3USV 24 |
#define CMD_COLOR4B 25 |
#define CMD_COLOR4BV 26 |
#define CMD_COLOR4D 27 |
#define CMD_COLOR4DV 28 |
#define CMD_COLOR4F 29 |
#define CMD_COLOR4FV 30 |
#define CMD_COLOR4I 31 |
#define CMD_COLOR4IV 32 |
#define CMD_COLOR4S 33 |
#define CMD_COLOR4SV 34 |
#define CMD_COLOR4UB 35 |
#define CMD_COLOR4UBV 36 |
#define CMD_COLOR4UI 37 |
#define CMD_COLOR4UIV 38 |
#define CMD_COLOR4US 39 |
#define CMD_COLOR4USV 40 |
#define CMD_EDGEFLAG 41 |
#define CMD_EDGEFLAGV 42 |
#define CMD_END 43 |
#define CMD_INDEXD 44 |
#define CMD_INDEXDV 45 |
#define CMD_INDEXF 46 |
#define CMD_INDEXFV 47 |
#define CMD_INDEXI 48 |
#define CMD_INDEXIV 49 |
#define CMD_INDEXS 50 |
#define CMD_INDEXSV 51 |
#define CMD_NORMAL3B 52 |
#define CMD_NORMAL3BV 53 |
#define CMD_NORMAL3D 54 |
#define CMD_NORMAL3DV 55 |
#define CMD_NORMAL3F 56 |
#define CMD_NORMAL3FV 57 |
#define CMD_NORMAL3I 58 |
#define CMD_NORMAL3IV 59 |
#define CMD_NORMAL3S 60 |
#define CMD_NORMAL3SV 61 |
#define CMD_RASTERPOS2D 62 |
#define CMD_RASTERPOS2DV 63 |
#define CMD_RASTERPOS2F 64 |
#define CMD_RASTERPOS2FV 65 |
#define CMD_RASTERPOS2I 66 |
#define CMD_RASTERPOS2IV 67 |
#define CMD_RASTERPOS2S 68 |
#define CMD_RASTERPOS2SV 69 |
#define CMD_RASTERPOS3D 70 |
#define CMD_RASTERPOS3DV 71 |
#define CMD_RASTERPOS3F 72 |
#define CMD_RASTERPOS3FV 73 |
#define CMD_RASTERPOS3I 74 |
#define CMD_RASTERPOS3IV 75 |
#define CMD_RASTERPOS3S 76 |
#define CMD_RASTERPOS3SV 77 |
#define CMD_RASTERPOS4D 78 |
#define CMD_RASTERPOS4DV 79 |
#define CMD_RASTERPOS4F 80 |
#define CMD_RASTERPOS4FV 81 |
#define CMD_RASTERPOS4I 82 |
#define CMD_RASTERPOS4IV 83 |
#define CMD_RASTERPOS4S 84 |
#define CMD_RASTERPOS4SV 85 |
#define CMD_RECTD 86 |
#define CMD_RECTDV 87 |
#define CMD_RECTF 88 |
#define CMD_RECTFV 89 |
#define CMD_RECTI 90 |
#define CMD_RECTIV 91 |
#define CMD_RECTS 92 |
#define CMD_RECTSV 93 |
#define CMD_TEXCOORD1D 94 |
#define CMD_TEXCOORD1DV 95 |
#define CMD_TEXCOORD1F 96 |
#define CMD_TEXCOORD1FV 97 |
#define CMD_TEXCOORD1I 98 |
#define CMD_TEXCOORD1IV 99 |
#define CMD_TEXCOORD1S 100 |
#define CMD_TEXCOORD1SV 101 |
#define CMD_TEXCOORD2D 102 |
#define CMD_TEXCOORD2DV 103 |
#define CMD_TEXCOORD2F 104 |
#define CMD_TEXCOORD2FV 105 |
#define CMD_TEXCOORD2I 106 |
#define CMD_TEXCOORD2IV 107 |
#define CMD_TEXCOORD2S 108 |
#define CMD_TEXCOORD2SV 109 |
#define CMD_TEXCOORD3D 110 |
#define CMD_TEXCOORD3DV 111 |
#define CMD_TEXCOORD3F 112 |
#define CMD_TEXCOORD3FV 113 |
#define CMD_TEXCOORD3I 114 |
#define CMD_TEXCOORD3IV 115 |
#define CMD_TEXCOORD3S 116 |
#define CMD_TEXCOORD3SV 117 |
#define CMD_TEXCOORD4D 118 |
#define CMD_TEXCOORD4DV 119 |
#define CMD_TEXCOORD4F 120 |
#define CMD_TEXCOORD4FV 121 |
#define CMD_TEXCOORD4I 122 |
#define CMD_TEXCOORD4IV 123 |
#define CMD_TEXCOORD4S 124 |
#define CMD_TEXCOORD4SV 125 |
#define CMD_VERTEX2D 126 |
#define CMD_VERTEX2DV 127 |
#define CMD_VERTEX2F 128 |
#define CMD_VERTEX2FV 129 |
#define CMD_VERTEX2I 130 |
#define CMD_VERTEX2IV 131 |
#define CMD_VERTEX2S 132 |
#define CMD_VERTEX2SV 133 |
#define CMD_VERTEX3D 134 |
#define CMD_VERTEX3DV 135 |
#define CMD_VERTEX3F 136 |
#define CMD_VERTEX3FV 137 |
#define CMD_VERTEX3I 138 |
#define CMD_VERTEX3IV 139 |
#define CMD_VERTEX3S 140 |
#define CMD_VERTEX3SV 141 |
#define CMD_VERTEX4D 142 |
#define CMD_VERTEX4DV 143 |
#define CMD_VERTEX4F 144 |
#define CMD_VERTEX4FV 145 |
#define CMD_VERTEX4I 146 |
#define CMD_VERTEX4IV 147 |
#define CMD_VERTEX4S 148 |
#define CMD_VERTEX4SV 149 |
#define CMD_CLIPPLANE 150 |
#define CMD_COLORMATERIAL 151 |
#define CMD_CULLFACE 152 |
#define CMD_FOGF 153 |
#define CMD_FOGFV 154 |
#define CMD_FOGI 155 |
#define CMD_FOGIV 156 |
#define CMD_FRONTFACE 157 |
#define CMD_HINT 158 |
#define CMD_LIGHTF 159 |
#define CMD_LIGHTFV 160 |
#define CMD_LIGHTI 161 |
#define CMD_LIGHTIV 162 |
#define CMD_LIGHTMODELF 163 |
#define CMD_LIGHTMODELFV 164 |
#define CMD_LIGHTMODELI 165 |
#define CMD_LIGHTMODELIV 166 |
#define CMD_LINESTIPPLE 167 |
#define CMD_LINEWIDTH 168 |
#define CMD_MATERIALF 169 |
#define CMD_MATERIALFV 170 |
#define CMD_MATERIALI 171 |
#define CMD_MATERIALIV 172 |
#define CMD_POINTSIZE 173 |
#define CMD_POLYGONMODE 174 |
#define CMD_POLYGONSTIPPLE 175 |
#define CMD_SCISSOR 176 |
#define CMD_SHADEMODEL 177 |
#define CMD_TEXPARAMETERF 178 |
#define CMD_TEXPARAMETERFV 179 |
#define CMD_TEXPARAMETERI 180 |
#define CMD_TEXPARAMETERIV 181 |
#define CMD_TEXIMAGE1D 182 |
#define CMD_TEXIMAGE2D 183 |
#define CMD_TEXENVF 184 |
#define CMD_TEXENVFV 185 |
#define CMD_TEXENVI 186 |
#define CMD_TEXENVIV 187 |
#define CMD_TEXGEND 188 |
#define CMD_TEXGENDV 189 |
#define CMD_TEXGENF 190 |
#define CMD_TEXGENFV 191 |
#define CMD_TEXGENI 192 |
#define CMD_TEXGENIV 193 |
#define CMD_FEEDBACKBUFFER 194 |
#define CMD_SELECTBUFFER 195 |
#define CMD_RENDERMODE 196 |
#define CMD_INITNAMES 197 |
#define CMD_LOADNAME 198 |
#define CMD_PASSTHROUGH 199 |
#define CMD_POPNAME 200 |
#define CMD_PUSHNAME 201 |
#define CMD_DRAWBUFFER 202 |
#define CMD_CLEAR 203 |
#define CMD_CLEARACCUM 204 |
#define CMD_CLEARINDEX 205 |
#define CMD_CLEARCOLOR 206 |
#define CMD_CLEARSTENCIL 207 |
#define CMD_CLEARDEPTH 208 |
#define CMD_STENCILMASK 209 |
#define CMD_COLORMASK 210 |
#define CMD_DEPTHMASK 211 |
#define CMD_INDEXMASK 212 |
#define CMD_ACCUM 213 |
#define CMD_DISABLE 214 |
#define CMD_ENABLE 215 |
#define CMD_FINISH 216 |
#define CMD_FLUSH 217 |
#define CMD_POPATTRIB 218 |
#define CMD_PUSHATTRIB 219 |
#define CMD_MAP1D 220 |
#define CMD_MAP1F 221 |
#define CMD_MAP2D 222 |
#define CMD_MAP2F 223 |
#define CMD_MAPGRID1D 224 |
#define CMD_MAPGRID1F 225 |
#define CMD_MAPGRID2D 226 |
#define CMD_MAPGRID2F 227 |
#define CMD_EVALCOORD1D 228 |
#define CMD_EVALCOORD1DV 229 |
#define CMD_EVALCOORD1F 230 |
#define CMD_EVALCOORD1FV 231 |
#define CMD_EVALCOORD2D 232 |
#define CMD_EVALCOORD2DV 233 |
#define CMD_EVALCOORD2F 234 |
#define CMD_EVALCOORD2FV 235 |
#define CMD_EVALMESH1 236 |
#define CMD_EVALPOINT1 237 |
#define CMD_EVALMESH2 238 |
#define CMD_EVALPOINT2 239 |
#define CMD_ALPHAFUNC 240 |
#define CMD_BLENDFUNC 241 |
#define CMD_LOGICOP 242 |
#define CMD_STENCILFUNC 243 |
#define CMD_STENCILOP 244 |
#define CMD_DEPTHFUNC 245 |
#define CMD_PIXELZOOM 246 |
#define CMD_PIXELTRANSFERF 247 |
#define CMD_PIXELTRANSFERI 248 |
#define CMD_PIXELSTOREF 249 |
#define CMD_PIXELSTOREI 250 |
#define CMD_PIXELMAPFV 251 |
#define CMD_PIXELMAPUIV 252 |
#define CMD_PIXELMAPUSV 253 |
#define CMD_READBUFFER 254 |
#define CMD_COPYPIXELS 255 |
#define CMD_READPIXELS 256 |
#define CMD_DRAWPIXELS 257 |
#define CMD_GETBOOLEANV 258 |
#define CMD_GETCLIPPLANE 259 |
#define CMD_GETDOUBLEV 260 |
#define CMD_GETERROR 261 |
#define CMD_GETFLOATV 262 |
#define CMD_GETINTEGERV 263 |
#define CMD_GETLIGHTFV 264 |
#define CMD_GETLIGHTIV 265 |
#define CMD_GETMAPDV 266 |
#define CMD_GETMAPFV 267 |
#define CMD_GETMAPIV 268 |
#define CMD_GETMATERIALFV 269 |
#define CMD_GETMATERIALIV 270 |
#define CMD_GETPIXELMAPFV 271 |
#define CMD_GETPIXELMAPUIV 272 |
#define CMD_GETPIXELMAPUSV 273 |
#define CMD_GETPOLYGONSTIPPLE 274 |
#define CMD_GETSTRING 275 |
#define CMD_GETTEXENVFV 276 |
#define CMD_GETTEXENVIV 277 |
#define CMD_GETTEXGENDV 278 |
#define CMD_GETTEXGENFV 279 |
#define CMD_GETTEXGENIV 280 |
#define CMD_GETTEXIMAGE 281 |
#define CMD_GETTEXPARAMETERFV 282 |
#define CMD_GETTEXPARAMETERIV 283 |
#define CMD_GETTEXLEVELPARAMETERFV 284 |
#define CMD_GETTEXLEVELPARAMETERIV 285 |
#define CMD_ISENABLED 286 |
#define CMD_ISLIST 287 |
#define CMD_DEPTHRANGE 288 |
#define CMD_FRUSTUM 289 |
#define CMD_LOADIDENTITY 290 |
#define CMD_LOADMATRIXF 291 |
#define CMD_LOADMATRIXD 292 |
#define CMD_MATRIXMODE 293 |
#define CMD_MULTMATRIXF 294 |
#define CMD_MULTMATRIXD 295 |
#define CMD_ORTHO 296 |
#define CMD_POPMATRIX 297 |
#define CMD_PUSHMATRIX 298 |
#define CMD_ROTATED 299 |
#define CMD_ROTATEF 300 |
#define CMD_SCALED 301 |
#define CMD_SCALEF 302 |
#define CMD_TRANSLATED 303 |
#define CMD_TRANSLATEF 304 |
#define CMD_VIEWPORT 305 |
#define CMD_ARRAYELEMENT 306 |
#define CMD_BINDTEXTURE 307 |
#define CMD_COLORPOINTER 308 |
#define CMD_DISABLECLIENTSTATE 309 |
#define CMD_DRAWARRAYS 310 |
#define CMD_DRAWELEMENTS 311 |
#define CMD_EDGEFLAGPOINTER 312 |
#define CMD_ENABLECLIENTSTATE 313 |
#define CMD_INDEXPOINTER 314 |
#define CMD_INDEXUB 315 |
#define CMD_INDEXUBV 316 |
#define CMD_INTERLEAVEDARRAYS 317 |
#define CMD_NORMALPOINTER 318 |
#define CMD_POLYGONOFFSET 319 |
#define CMD_TEXCOORDPOINTER 320 |
#define CMD_VERTEXPOINTER 321 |
#define CMD_ARETEXTURESRESIDENT 322 |
#define CMD_COPYTEXIMAGE1D 323 |
#define CMD_COPYTEXIMAGE2D 324 |
#define CMD_COPYTEXSUBIMAGE1D 325 |
#define CMD_COPYTEXSUBIMAGE2D 326 |
#define CMD_DELETETEXTURES 327 |
#define CMD_GENTEXTURES 328 |
#define CMD_GETPOINTERV 329 |
#define CMD_ISTEXTURE 330 |
#define CMD_PRIORITIZETEXTURES 331 |
#define CMD_TEXSUBIMAGE1D 332 |
#define CMD_TEXSUBIMAGE2D 333 |
#define CMD_POPCLIENTATTRIB 334 |
#define CMD_PUSHCLIENTATTRIB 335 |
#define CMD_BLENDCOLOR 336 |
#define CMD_BLENDEQUATION 337 |
#define CMD_DRAWRANGEELEMENTS 338 |
#define CMD_COLORTABLE 339 |
#define CMD_COLORTABLEPARAMETERFV 340 |
#define CMD_COLORTABLEPARAMETERIV 341 |
#define CMD_COPYCOLORTABLE 342 |
#define CMD_GETCOLORTABLE 343 |
#define CMD_GETCOLORTABLEPARAMETERFV 344 |
#define CMD_GETCOLORTABLEPARAMETERIV 345 |
#define CMD_COLORSUBTABLE 346 |
#define CMD_COPYCOLORSUBTABLE 347 |
#define CMD_CONVOLUTIONFILTER1D 348 |
#define CMD_CONVOLUTIONFILTER2D 349 |
#define CMD_CONVOLUTIONPARAMETERF 350 |
#define CMD_CONVOLUTIONPARAMETERFV 351 |
#define CMD_CONVOLUTIONPARAMETERI 352 |
#define CMD_CONVOLUTIONPARAMETERIV 353 |
#define CMD_COPYCONVOLUTIONFILTER1D 354 |
#define CMD_COPYCONVOLUTIONFILTER2D 355 |
#define CMD_GETCONVOLUTIONFILTER 356 |
#define CMD_GETCONVOLUTIONPARAMETERFV 357 |
#define CMD_GETCONVOLUTIONPARAMETERIV 358 |
#define CMD_GETSEPARABLEFILTER 359 |
#define CMD_SEPARABLEFILTER2D 360 |
#define CMD_GETHISTOGRAM 361 |
#define CMD_GETHISTOGRAMPARAMETERFV 362 |
#define CMD_GETHISTOGRAMPARAMETERIV 363 |
#define CMD_GETMINMAX 364 |
#define CMD_GETMINMAXPARAMETERFV 365 |
#define CMD_GETMINMAXPARAMETERIV 366 |
#define CMD_HISTOGRAM 367 |
#define CMD_MINMAX 368 |
#define CMD_RESETHISTOGRAM 369 |
#define CMD_RESETMINMAX 370 |
#define CMD_TEXIMAGE3D 371 |
#define CMD_TEXSUBIMAGE3D 372 |
#define CMD_COPYTEXSUBIMAGE3D 373 |
#define CMD_ACTIVETEXTUREARB 374 |
#define CMD_CLIENTACTIVETEXTUREARB 375 |
#define CMD_MULTITEXCOORD1DARB 376 |
#define CMD_MULTITEXCOORD1DVARB 377 |
#define CMD_MULTITEXCOORD1FARB 378 |
#define CMD_MULTITEXCOORD1FVARB 379 |
#define CMD_MULTITEXCOORD1IARB 380 |
#define CMD_MULTITEXCOORD1IVARB 381 |
#define CMD_MULTITEXCOORD1SARB 382 |
#define CMD_MULTITEXCOORD1SVARB 383 |
#define CMD_MULTITEXCOORD2DARB 384 |
#define CMD_MULTITEXCOORD2DVARB 385 |
#define CMD_MULTITEXCOORD2FARB 386 |
#define CMD_MULTITEXCOORD2FVARB 387 |
#define CMD_MULTITEXCOORD2IARB 388 |
#define CMD_MULTITEXCOORD2IVARB 389 |
#define CMD_MULTITEXCOORD2SARB 390 |
#define CMD_MULTITEXCOORD2SVARB 391 |
#define CMD_MULTITEXCOORD3DARB 392 |
#define CMD_MULTITEXCOORD3DVARB 393 |
#define CMD_MULTITEXCOORD3FARB 394 |
#define CMD_MULTITEXCOORD3FVARB 395 |
#define CMD_MULTITEXCOORD3IARB 396 |
#define CMD_MULTITEXCOORD3IVARB 397 |
#define CMD_MULTITEXCOORD3SARB 398 |
#define CMD_MULTITEXCOORD3SVARB 399 |
#define CMD_MULTITEXCOORD4DARB 400 |
#define CMD_MULTITEXCOORD4DVARB 401 |
#define CMD_MULTITEXCOORD4FARB 402 |
#define CMD_MULTITEXCOORD4FVARB 403 |
#define CMD_MULTITEXCOORD4IARB 404 |
#define CMD_MULTITEXCOORD4IVARB 405 |
#define CMD_MULTITEXCOORD4SARB 406 |
#define CMD_MULTITEXCOORD4SVARB 407 |
#define CMD_LOADTRANSPOSEMATRIXFARB 408 |
#define CMD_LOADTRANSPOSEMATRIXDARB 409 |
#define CMD_MULTTRANSPOSEMATRIXFARB 410 |
#define CMD_MULTTRANSPOSEMATRIXDARB 411 |
#define CMD_SAMPLECOVERAGEARB 412 |
#define CMD_SAMPLEPASSARB 413 |
#define CMD_POLYGONOFFSETEXT 414 |
#define CMD_GETTEXFILTERFUNCSGIS 415 |
#define CMD_TEXFILTERFUNCSGIS 416 |
#define CMD_GETHISTOGRAMEXT 417 |
#define CMD_GETHISTOGRAMPARAMETERFVEXT 418 |
#define CMD_GETHISTOGRAMPARAMETERIVEXT 419 |
#define CMD_GETMINMAXEXT 420 |
#define CMD_GETMINMAXPARAMETERFVEXT 421 |
#define CMD_GETMINMAXPARAMETERIVEXT 422 |
#define CMD_GETCONVOLUTIONFILTEREXT 423 |
#define CMD_GETCONVOLUTIONPARAMETERFVEXT 424 |
#define CMD_GETCONVOLUTIONPARAMETERIVEXT 425 |
#define CMD_GETSEPARABLEFILTEREXT 426 |
#define CMD_GETCOLORTABLESGI 427 |
#define CMD_GETCOLORTABLEPARAMETERFVSGI 428 |
#define CMD_GETCOLORTABLEPARAMETERIVSGI 429 |
#define CMD_PIXELTEXGENSGIX 430 |
#define CMD_PIXELTEXGENPARAMETERISGIS 431 |
#define CMD_PIXELTEXGENPARAMETERIVSGIS 432 |
#define CMD_PIXELTEXGENPARAMETERFSGIS 433 |
#define CMD_PIXELTEXGENPARAMETERFVSGIS 434 |
#define CMD_GETPIXELTexGenPARAMETERIVSGIS 435 |
#define CMD_GETPIXELTexGenPARAMETERFVSGIS 436 |
#define CMD_TEXIMAGE4DSGIS 437 |
#define CMD_TEXSUBIMAGE4DSGIS 438 |
#define CMD_ARETEXTURESRESIDENTEXT 439 |
#define CMD_GENTEXTURESEXT 440 |
#define CMD_ISTEXTUREEXT 441 |
#define CMD_DETAILTEXFUNCSGIS 442 |
#define CMD_GETDETAILTEXFUNCSGIS 443 |
#define CMD_SHARPENTEXFUNCSGIS 444 |
#define CMD_GETSHARPENTEXFUNCSGIS 445 |
#define CMD_SAMPLEMASKSGIS 446 |
#define CMD_SAMPLEPATTERNSGIS 447 |
#define CMD_COLORPOINTEREXT 448 |
#define CMD_EDGEFLAGPOINTEREXT 449 |
#define CMD_INDEXPOINTEREXT 450 |
#define CMD_NORMALPOINTEREXT 451 |
#define CMD_TEXCOORDPOINTEREXT 452 |
#define CMD_VERTEXPOINTEREXT 453 |
#define CMD_SPRITEPARAMETERFSGIX 454 |
#define CMD_SPRITEPARAMETERFVSGIX 455 |
#define CMD_SPRITEPARAMETERISGIX 456 |
#define CMD_SPRITEPARAMETERIVSGIX 457 |
#define CMD_POINTPARAMETERFEXT 458 |
#define CMD_POINTPARAMETERFVEXT 459 |
#define CMD_GETINSTRUMENTSSGIX 460 |
#define CMD_INSTRUMENTSBUFFERSGIX 461 |
#define CMD_POLLINSTRUMENTSSGIX 462 |
#define CMD_READINSTRUMENTSSGIX 463 |
#define CMD_STARTINSTRUMENTSSGIX 464 |
#define CMD_STOPINSTRUMENTSSGIX 465 |
#define CMD_FRAMEZOOMSGIX 466 |
#define CMD_TAGSAMPLEBUFFERSGIX 467 |
#define CMD_REFERENCEPLANESGIX 468 |
#define CMD_FLUSHRASTERSGIX 469 |
#define CMD_GETLISTPARAMETERFVSGIX 470 |
#define CMD_GETLISTPARAMETERIVSGIX 471 |
#define CMD_LISTPARAMETERFSGIX 472 |
#define CMD_LISTPARAMETERFVSGIX 473 |
#define CMD_LISTPARAMETERISGIX 474 |
#define CMD_LISTPARAMETERIVSGIX 475 |
#define CMD_FRAGMENTCOLORMATERIALSGIX 476 |
#define CMD_FRAGMENTLIGHTFSGIX 477 |
#define CMD_FRAGMENTLIGHTFVSGIX 478 |
#define CMD_FRAGMENTLIGHTISGIX 479 |
#define CMD_FRAGMENTLIGHTIVSGIX 480 |
#define CMD_FRAGMENTLIGHTMODELFSGIX 481 |
#define CMD_FRAGMENTLIGHTMODELFVSGIX 482 |
#define CMD_FRAGMENTLIGHTMODELISGIX 483 |
#define CMD_FRAGMENTLIGHTMODELIVSGIX 484 |
#define CMD_FRAGMENTMATERIALFSGIX 485 |
#define CMD_FRAGMENTMATERIALFVSGIX 486 |
#define CMD_FRAGMENTMATERIALISGIX 487 |
#define CMD_FRAGMENTMATERIALIVSGIX 488 |
#define CMD_GETFRAGMENTLIGHTFVSGIX 489 |
#define CMD_GETFRAGMENTLIGHTIVSGIX 490 |
#define CMD_GETFRAGMENTMATERIALFVSGIX 491 |
#define CMD_GETFRAGMENTMATERIALIVSGIX 492 |
#define CMD_LIGHTENVISGIX 493 |
#define CMD_VERTEXWEIGHTFEXT 494 |
#define CMD_VERTEXWEIGHTFVEXT 495 |
#define CMD_VERTEXWEIGHTPOINTEREXT 496 |
#define CMD_FLUSHVERTEXARRAYRANGENV 497 |
#define CMD_VERTEXARRAYRANGENV 498 |
#define CMD_COMBINERPARAMETERFVNV 499 |
#define CMD_COMBINERPARAMETERFNV 500 |
#define CMD_COMBINERPARAMETERIVNV 501 |
#define CMD_COMBINERPARAMETERINV 502 |
#define CMD_COMBINERINPUTNV 503 |
#define CMD_COMBINEROUTPUTNV 504 |
#define CMD_FINALCOMBINERINPUTNV 505 |
#define CMD_GETCOMBINERINPUTPARAMETERFVNV 506 |
#define CMD_GETCOMBINERINPUTPARAMETERIVNV 507 |
#define CMD_GETCOMBINEROUTPUTPARAMETERFVNV 508 |
#define CMD_GETCOMBINEROUTPUTPARAMETERIVNV 509 |
#define CMD_GETFINALCOMBINERINPUTPARAMETERFVNV 510 |
#define CMD_GETFINALCOMBINERINPUTPARAMETERIVNV 511 |
#define CMD_RESIZEBUFFERSMESA 512 |
#define CMD_WINDOWPOS2DMESA 513 |
#define CMD_WINDOWPOS2DVMESA 514 |
#define CMD_WINDOWPOS2FMESA 515 |
#define CMD_WINDOWPOS2FVMESA 516 |
#define CMD_WINDOWPOS2IMESA 517 |
#define CMD_WINDOWPOS2IVMESA 518 |
#define CMD_WINDOWPOS2SMESA 519 |
#define CMD_WINDOWPOS2SVMESA 520 |
#define CMD_WINDOWPOS3DMESA 521 |
#define CMD_WINDOWPOS3DVMESA 522 |
#define CMD_WINDOWPOS3FMESA 523 |
#define CMD_WINDOWPOS3FVMESA 524 |
#define CMD_WINDOWPOS3IMESA 525 |
#define CMD_WINDOWPOS3IVMESA 526 |
#define CMD_WINDOWPOS3SMESA 527 |
#define CMD_WINDOWPOS3SVMESA 528 |
#define CMD_WINDOWPOS4DMESA 529 |
#define CMD_WINDOWPOS4DVMESA 530 |
#define CMD_WINDOWPOS4FMESA 531 |
#define CMD_WINDOWPOS4FVMESA 532 |
#define CMD_WINDOWPOS4IMESA 533 |
#define CMD_WINDOWPOS4IVMESA 534 |
#define CMD_WINDOWPOS4SMESA 535 |
#define CMD_WINDOWPOS4SVMESA 536 |
#define CMD_BLENDFUNCSEPARATEEXT 537 |
#define CMD_INDEXMATERIALEXT 538 |
#define CMD_INDEXFUNCEXT 539 |
#define CMD_LOCKARRAYSEXT 540 |
#define CMD_UNLOCKARRAYSEXT 541 |
#define CMD_CULLPARAMETERDVEXT 542 |
#define CMD_CULLPARAMETERFVEXT 543 |
#define CMD_HINTPGI 544 |
#define CMD_FOGCOORDFEXT 545 |
#define CMD_FOGCOORDFVEXT 546 |
#define CMD_FOGCOORDDEXT 547 |
#define CMD_FOGCOORDDVEXT 548 |
#define CMD_FOGCOORDPOINTEREXT 549 |
#define CMD_GETCOLORTABLEEXT 550 |
#define CMD_GETCOLORTABLEPARAMETERIVEXT 551 |
#define CMD_GETCOLORTABLEPARAMETERFVEXT 552 |
/* FIXME: Trace Extension itself - not yet defined. */ |
#define CMD_NEWTRACEMESA 666 |
#define CMD_ENDTRACEMESA 667 |
#define CMD_TRACECOMMENTMESA 668 |
/** |
* Enumeration of non-GL entries in trace stream. |
* This is (static) variable and "various" data, |
* some of which optional. All these values are |
* negative. |
*/ |
#define VAR_VERSION -1 /* Metafile version. Mandatory. */ |
#define VAR_CYCLES -2 /* Profiling, CPU cycles. Optional. */ |
#define VAR_CONTEXT -3 /* Context ID. Optional. */ |
#define VAR_THREAD -4 /* Thread ID. Optional. */ |
#define VAR_STRING -5 /* Internally generated. Optional. */ |
#define VAR_COLORELEMENT -6 |
#define VAR_EDGEFLAGELEMENT -7 |
#define VAR_INDEXELEMENT -8 |
#define VAR_NORMALELEMENT -9 |
#define VAR_TEXCOORDELEMENT -10 |
#define VAR_VERTEXELEMENT -11 /* Dereferenced Vertex Array Data. */ |
/* FIXME: more VAR_ as needed. */ |
/* |
* Mindbender - The following two vars are needed to surround the queries |
* performed when the trace context is in a half initialized |
* state. |
*/ |
#define VAR_OOBBEGIN -14 |
#define VAR_OOBEND -15 |
/* |
* Mindbender - These are needed when the pointer changes through one of the |
* XXXPointer calls. Change these as needed. |
*/ |
#define VAR_COLORPOINTER -8 |
#define VAR_EDGEFLAGPOINTER -9 |
#define VAR_INDEXPOINTER -10 |
#define VAR_NORMALPOINTER -11 |
#define VAR_TEXCOORDPOINTER -12 |
#define VAR_VERTEXPOINTER -13 |
#endif |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_tritmp.h |
---|
0,0 → 1,740 |
/* $Id: t_dd_tritmp.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
/* Template for building functions to plug into the driver interface |
* of t_vb_render.c: |
* ctx->Driver.QuadFunc |
* ctx->Driver.TriangleFunc |
* ctx->Driver.LineFunc |
* ctx->Driver.PointsFunc |
* |
* DO_TWOSIDE: Plug back-color values from the VB into backfacing triangles, |
* and restore vertices afterwards. |
* DO_OFFSET: Calculate offset for triangles and adjust vertices. Restore |
* vertices after rendering. |
* DO_FLAT: For hardware without native flatshading, copy provoking colors |
* into the other vertices. Restore after rendering. |
* DO_UNFILLED: Decompose triangles to lines and points where appropriate. |
* |
* HAVE_RGBA: Vertices have rgba values (otherwise index values). |
* HAVE_SPEC: Vertices have secondary rgba values. |
* |
* VERT_X(v): Alias for vertex x value. |
* VERT_Y(v): Alias for vertex y value. |
* VERT_Z(v): Alias for vertex z value. |
* DEPTH_SCALE: Scale for offset. |
* |
* VERTEX: Hardware vertex type. |
* GET_VERTEX(n): Retreive vertex with index n. |
* AREA_IS_CCW(a): Return true if triangle with signed area a is ccw. |
* |
* VERT_SET_RGBA: Assign vertex rgba from VB color. |
* VERT_COPY_RGBA: Copy vertex rgba another vertex. |
* VERT_SAVE_RGBA: Save vertex rgba to a local variable. |
* VERT_RESTORE_RGBA: Restore vertex rgba from a local variable. |
* --> Similar for IND and SPEC. |
* |
* LOCAL_VARS(n): (At least) define local vars for save/restore rgba. |
* |
*/ |
#if HAVE_RGBA |
#define VERT_SET_IND( v, c ) (void) c |
#define VERT_COPY_IND( v0, v1 ) |
#define VERT_SAVE_IND( idx ) |
#define VERT_RESTORE_IND( idx ) |
#if HAVE_BACK_COLORS |
#define VERT_SET_RGBA( v, c ) |
#endif |
#else |
#define VERT_SET_RGBA( v, c ) (void) c |
#define VERT_COPY_RGBA( v0, v1 ) |
#define VERT_SAVE_RGBA( idx ) |
#define VERT_RESTORE_RGBA( idx ) |
#if HAVE_BACK_COLORS |
#define VERT_SET_IND( v, c ) |
#endif |
#endif |
#if !HAVE_SPEC |
#define VERT_SET_SPEC( v, c ) (void) c |
#define VERT_COPY_SPEC( v0, v1 ) |
#define VERT_SAVE_SPEC( idx ) |
#define VERT_RESTORE_SPEC( idx ) |
#if HAVE_BACK_COLORS |
#define VERT_COPY_SPEC1( v ) |
#endif |
#else |
#if HAVE_BACK_COLORS |
#define VERT_SET_SPEC( v, c ) |
#endif |
#endif |
#if !HAVE_BACK_COLORS |
#define VERT_COPY_SPEC1( v ) |
#define VERT_COPY_IND1( v ) |
#define VERT_COPY_RGBA1( v ) |
#endif |
#ifndef INSANE_VERTICES |
#define VERT_SET_Z(v,val) VERT_Z(v) = val |
#define VERT_Z_ADD(v,val) VERT_Z(v) += val |
#endif |
#if DO_TRI |
static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) |
{ |
struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb; |
VERTEX *v[3]; |
GLfloat offset; |
GLfloat z[3]; |
GLenum mode = GL_FILL; |
GLuint facing; |
LOCAL_VARS(3); |
/* fprintf(stderr, "%s\n", __FUNCTION__); */ |
v[0] = (VERTEX *)GET_VERTEX(e0); |
v[1] = (VERTEX *)GET_VERTEX(e1); |
v[2] = (VERTEX *)GET_VERTEX(e2); |
if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED) |
{ |
GLfloat ex = VERT_X(v[0]) - VERT_X(v[2]); |
GLfloat ey = VERT_Y(v[0]) - VERT_Y(v[2]); |
GLfloat fx = VERT_X(v[1]) - VERT_X(v[2]); |
GLfloat fy = VERT_Y(v[1]) - VERT_Y(v[2]); |
GLfloat cc = ex*fy - ey*fx; |
if (DO_TWOSIDE || DO_UNFILLED) |
{ |
facing = AREA_IS_CCW( cc ) ^ ctx->Polygon._FrontBit; |
if (DO_UNFILLED) { |
if (facing) { |
mode = ctx->Polygon.BackMode; |
if (ctx->Polygon.CullFlag && |
ctx->Polygon.CullFaceMode != GL_FRONT) { |
return; |
} |
} else { |
mode = ctx->Polygon.FrontMode; |
if (ctx->Polygon.CullFlag && |
ctx->Polygon.CullFaceMode != GL_BACK) { |
return; |
} |
} |
} |
if (DO_TWOSIDE && facing == 1) |
{ |
if (HAVE_RGBA) { |
if (HAVE_BACK_COLORS) { |
if (!DO_FLAT) { |
VERT_SAVE_RGBA( 0 ); |
VERT_SAVE_RGBA( 1 ); |
VERT_COPY_RGBA1( v[0] ); |
VERT_COPY_RGBA1( v[1] ); |
} |
VERT_SAVE_RGBA( 2 ); |
VERT_COPY_RGBA1( v[2] ); |
if (HAVE_SPEC) { |
if (!DO_FLAT) { |
VERT_SAVE_SPEC( 0 ); |
VERT_SAVE_SPEC( 1 ); |
VERT_COPY_SPEC1( v[0] ); |
VERT_COPY_SPEC1( v[1] ); |
} |
VERT_SAVE_SPEC( 2 ); |
VERT_COPY_SPEC1( v[2] ); |
} |
} |
else { |
GLchan (*vbcolor)[4] = VB->ColorPtr[1]->Ptr; |
ASSERT(VB->ColorPtr[1]->Type == CHAN_TYPE); |
ASSERT(VB->ColorPtr[1]->StrideB == 4*sizeof(GLchan)); |
(void) vbcolor; |
if (!DO_FLAT) { |
VERT_SAVE_RGBA( 0 ); |
VERT_SAVE_RGBA( 1 ); |
VERT_SET_RGBA( v[0], vbcolor[e0] ); |
VERT_SET_RGBA( v[1], vbcolor[e1] ); |
} |
VERT_SAVE_RGBA( 2 ); |
VERT_SET_RGBA( v[2], vbcolor[e2] ); |
if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { |
GLchan (*vbspec)[4] = VB->SecondaryColorPtr[1]->Ptr; |
if (!DO_FLAT) { |
VERT_SAVE_SPEC( 0 ); |
VERT_SAVE_SPEC( 1 ); |
VERT_SET_SPEC( v[0], vbspec[e0] ); |
VERT_SET_SPEC( v[1], vbspec[e1] ); |
} |
VERT_SAVE_SPEC( 2 ); |
VERT_SET_SPEC( v[2], vbspec[e2] ); |
} |
} |
} |
else { |
GLuint *vbindex = VB->IndexPtr[1]->data; |
if (!DO_FLAT) { |
VERT_SET_IND( v[0], vbindex[e0] ); |
VERT_SET_IND( v[1], vbindex[e1] ); |
} |
VERT_SET_IND( v[2], vbindex[e2] ); |
} |
} |
} |
if (DO_OFFSET) |
{ |
offset = ctx->Polygon.OffsetUnits * DEPTH_SCALE; |
z[0] = VERT_Z(v[0]); |
z[1] = VERT_Z(v[1]); |
z[2] = VERT_Z(v[2]); |
if (cc * cc > 1e-16) { |
GLfloat ic = 1.0 / cc; |
GLfloat ez = z[0] - z[2]; |
GLfloat fz = z[1] - z[2]; |
GLfloat a = ey*fz - ez*fy; |
GLfloat b = ez*fx - ex*fz; |
GLfloat ac = a * ic; |
GLfloat bc = b * ic; |
if ( ac < 0.0f ) ac = -ac; |
if ( bc < 0.0f ) bc = -bc; |
offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor; |
} |
offset *= ctx->MRD; |
} |
} |
if (DO_FLAT) { |
if (HAVE_RGBA) { |
VERT_SAVE_RGBA( 0 ); |
VERT_SAVE_RGBA( 1 ); |
VERT_COPY_RGBA( v[0], v[2] ); |
VERT_COPY_RGBA( v[1], v[2] ); |
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { |
VERT_SAVE_SPEC( 0 ); |
VERT_SAVE_SPEC( 1 ); |
VERT_COPY_SPEC( v[0], v[2] ); |
VERT_COPY_SPEC( v[1], v[2] ); |
} |
} |
else { |
VERT_SAVE_IND( 0 ); |
VERT_SAVE_IND( 1 ); |
VERT_COPY_IND( v[0], v[2] ); |
VERT_COPY_IND( v[1], v[2] ); |
} |
} |
if (mode == GL_POINT) { |
if (DO_OFFSET && ctx->Polygon.OffsetPoint) { |
VERT_Z_ADD(v[0], offset); |
VERT_Z_ADD(v[1], offset); |
VERT_Z_ADD(v[2], offset); |
} |
UNFILLED_TRI( ctx, GL_POINT, e0, e1, e2 ); |
} else if (mode == GL_LINE) { |
if (DO_OFFSET && ctx->Polygon.OffsetLine) { |
VERT_Z_ADD(v[0], offset); |
VERT_Z_ADD(v[1], offset); |
VERT_Z_ADD(v[2], offset); |
} |
UNFILLED_TRI( ctx, GL_LINE, e0, e1, e2 ); |
} else { |
if (DO_OFFSET && ctx->Polygon.OffsetFill) { |
VERT_Z_ADD(v[0], offset); |
VERT_Z_ADD(v[1], offset); |
VERT_Z_ADD(v[2], offset); |
} |
if (DO_UNFILLED) |
RASTERIZE( GL_TRIANGLES ); |
TRI( v[0], v[1], v[2] ); |
} |
if (DO_OFFSET) |
{ |
VERT_SET_Z(v[0], z[0]); |
VERT_SET_Z(v[1], z[1]); |
VERT_SET_Z(v[2], z[2]); |
} |
if (DO_TWOSIDE && facing == 1) |
{ |
if (HAVE_RGBA) { |
if (!DO_FLAT) { |
VERT_RESTORE_RGBA( 0 ); |
VERT_RESTORE_RGBA( 1 ); |
} |
VERT_RESTORE_RGBA( 2 ); |
if (HAVE_SPEC) { |
if (!DO_FLAT) { |
VERT_RESTORE_SPEC( 0 ); |
VERT_RESTORE_SPEC( 1 ); |
} |
VERT_RESTORE_SPEC( 2 ); |
} |
} |
else { |
GLuint *vbindex = VB->IndexPtr[0]->data; |
if (!DO_FLAT) { |
VERT_SET_IND( v[0], vbindex[e0] ); |
VERT_SET_IND( v[1], vbindex[e1] ); |
} |
VERT_SET_IND( v[2], vbindex[e2] ); |
} |
} |
if (DO_FLAT) { |
if (HAVE_RGBA) { |
VERT_RESTORE_RGBA( 0 ); |
VERT_RESTORE_RGBA( 1 ); |
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { |
VERT_RESTORE_SPEC( 0 ); |
VERT_RESTORE_SPEC( 1 ); |
} |
} |
else { |
VERT_RESTORE_IND( 0 ); |
VERT_RESTORE_IND( 1 ); |
} |
} |
} |
#endif |
#if DO_QUAD |
#if DO_FULL_QUAD |
static void TAG(quad)( GLcontext *ctx, |
GLuint e0, GLuint e1, GLuint e2, GLuint e3 ) |
{ |
struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb; |
VERTEX *v[4]; |
GLfloat offset; |
GLfloat z[4]; |
GLenum mode = GL_FILL; |
GLuint facing; |
LOCAL_VARS(4); |
v[0] = (VERTEX *)GET_VERTEX(e0); |
v[1] = (VERTEX *)GET_VERTEX(e1); |
v[2] = (VERTEX *)GET_VERTEX(e2); |
v[3] = (VERTEX *)GET_VERTEX(e3); |
if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED) |
{ |
GLfloat ex = VERT_X(v[2]) - VERT_X(v[0]); |
GLfloat ey = VERT_Y(v[2]) - VERT_Y(v[0]); |
GLfloat fx = VERT_X(v[3]) - VERT_X(v[1]); |
GLfloat fy = VERT_Y(v[3]) - VERT_Y(v[1]); |
GLfloat cc = ex*fy - ey*fx; |
if (DO_TWOSIDE || DO_UNFILLED) |
{ |
facing = AREA_IS_CCW( cc ) ^ ctx->Polygon._FrontBit; |
if (DO_UNFILLED) { |
if (facing) { |
mode = ctx->Polygon.BackMode; |
if (ctx->Polygon.CullFlag && |
ctx->Polygon.CullFaceMode != GL_FRONT) { |
return; |
} |
} else { |
mode = ctx->Polygon.FrontMode; |
if (ctx->Polygon.CullFlag && |
ctx->Polygon.CullFaceMode != GL_BACK) { |
return; |
} |
} |
} |
if (DO_TWOSIDE && facing == 1) |
{ |
if (HAVE_RGBA) { |
GLchan (*vbcolor)[4] = VB->ColorPtr[1]->Ptr; |
(void)vbcolor; |
if (HAVE_BACK_COLORS) { |
if (!DO_FLAT) { |
VERT_SAVE_RGBA( 0 ); |
VERT_SAVE_RGBA( 1 ); |
VERT_SAVE_RGBA( 2 ); |
VERT_COPY_RGBA1( v[0] ); |
VERT_COPY_RGBA1( v[1] ); |
VERT_COPY_RGBA1( v[2] ); |
} |
VERT_SAVE_RGBA( 3 ); |
VERT_COPY_RGBA1( v[3] ); |
if (HAVE_SPEC) { |
if (!DO_FLAT) { |
VERT_SAVE_SPEC( 0 ); |
VERT_SAVE_SPEC( 1 ); |
VERT_SAVE_SPEC( 2 ); |
VERT_COPY_SPEC1( v[0] ); |
VERT_COPY_SPEC1( v[1] ); |
VERT_COPY_SPEC1( v[2] ); |
} |
VERT_SAVE_SPEC( 3 ); |
VERT_COPY_SPEC1( v[3] ); |
} |
} |
else { |
if (!DO_FLAT) { |
VERT_SAVE_RGBA( 0 ); |
VERT_SAVE_RGBA( 1 ); |
VERT_SAVE_RGBA( 2 ); |
VERT_SET_RGBA( v[0], vbcolor[e0] ); |
VERT_SET_RGBA( v[1], vbcolor[e1] ); |
VERT_SET_RGBA( v[2], vbcolor[e2] ); |
} |
VERT_SAVE_RGBA( 3 ); |
VERT_SET_RGBA( v[3], vbcolor[e3] ); |
if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { |
GLchan (*vbspec)[4] = VB->SecondaryColorPtr[1]->Ptr; |
ASSERT(VB->SecondaryColorPtr[1]->StrideB==4*sizeof(GLchan)); |
if (!DO_FLAT) { |
VERT_SAVE_SPEC( 0 ); |
VERT_SAVE_SPEC( 1 ); |
VERT_SAVE_SPEC( 2 ); |
VERT_SET_SPEC( v[0], vbspec[e0] ); |
VERT_SET_SPEC( v[1], vbspec[e1] ); |
VERT_SET_SPEC( v[2], vbspec[e2] ); |
} |
VERT_SAVE_SPEC( 3 ); |
VERT_SET_SPEC( v[3], vbspec[e3] ); |
} |
} |
} |
else { |
GLuint *vbindex = VB->IndexPtr[1]->data; |
if (!DO_FLAT) { |
VERT_SET_IND( v[0], vbindex[e0] ); |
VERT_SET_IND( v[1], vbindex[e1] ); |
VERT_SET_IND( v[2], vbindex[e2] ); |
} |
VERT_SET_IND( v[3], vbindex[e3] ); |
} |
} |
} |
if (DO_OFFSET) |
{ |
offset = ctx->Polygon.OffsetUnits * DEPTH_SCALE; |
z[0] = VERT_Z(v[0]); |
z[1] = VERT_Z(v[1]); |
z[2] = VERT_Z(v[2]); |
z[3] = VERT_Z(v[3]); |
if (cc * cc > 1e-16) { |
GLfloat ez = z[2] - z[0]; |
GLfloat fz = z[3] - z[1]; |
GLfloat a = ey*fz - ez*fy; |
GLfloat b = ez*fx - ex*fz; |
GLfloat ic = 1.0 / cc; |
GLfloat ac = a * ic; |
GLfloat bc = b * ic; |
if ( ac < 0.0f ) ac = -ac; |
if ( bc < 0.0f ) bc = -bc; |
offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor; |
} |
offset *= ctx->MRD; |
} |
} |
if (DO_FLAT) { |
if (HAVE_RGBA) { |
VERT_SAVE_RGBA( 0 ); |
VERT_SAVE_RGBA( 1 ); |
VERT_SAVE_RGBA( 2 ); |
VERT_COPY_RGBA( v[0], v[3] ); |
VERT_COPY_RGBA( v[1], v[3] ); |
VERT_COPY_RGBA( v[2], v[3] ); |
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { |
VERT_SAVE_SPEC( 0 ); |
VERT_SAVE_SPEC( 1 ); |
VERT_SAVE_SPEC( 2 ); |
VERT_COPY_SPEC( v[0], v[3] ); |
VERT_COPY_SPEC( v[1], v[3] ); |
VERT_COPY_SPEC( v[2], v[3] ); |
} |
} |
else { |
VERT_SAVE_IND( 0 ); |
VERT_SAVE_IND( 1 ); |
VERT_SAVE_IND( 2 ); |
VERT_COPY_IND( v[0], v[3] ); |
VERT_COPY_IND( v[1], v[3] ); |
VERT_COPY_IND( v[2], v[3] ); |
} |
} |
if (mode == GL_POINT) { |
if (( DO_OFFSET) && ctx->Polygon.OffsetPoint) { |
VERT_Z_ADD(v[0], offset); |
VERT_Z_ADD(v[1], offset); |
VERT_Z_ADD(v[2], offset); |
VERT_Z_ADD(v[3], offset); |
} |
UNFILLED_QUAD( ctx, GL_POINT, e0, e1, e2, e3 ); |
} else if (mode == GL_LINE) { |
if (DO_OFFSET && ctx->Polygon.OffsetLine) { |
VERT_Z_ADD(v[0], offset); |
VERT_Z_ADD(v[1], offset); |
VERT_Z_ADD(v[2], offset); |
VERT_Z_ADD(v[3], offset); |
} |
UNFILLED_QUAD( ctx, GL_LINE, e0, e1, e2, e3 ); |
} else { |
if (DO_OFFSET && ctx->Polygon.OffsetFill) { |
VERT_Z_ADD(v[0], offset); |
VERT_Z_ADD(v[1], offset); |
VERT_Z_ADD(v[2], offset); |
VERT_Z_ADD(v[3], offset); |
} |
RASTERIZE( GL_TRIANGLES ); |
QUAD( (v[0]), (v[1]), (v[2]), (v[3]) ); |
} |
if (DO_OFFSET) |
{ |
VERT_SET_Z(v[0], z[0]); |
VERT_SET_Z(v[1], z[1]); |
VERT_SET_Z(v[2], z[2]); |
VERT_SET_Z(v[3], z[3]); |
} |
if (DO_TWOSIDE && facing == 1) |
{ |
if (HAVE_RGBA) { |
if (!DO_FLAT) { |
VERT_RESTORE_RGBA( 0 ); |
VERT_RESTORE_RGBA( 1 ); |
VERT_RESTORE_RGBA( 2 ); |
} |
VERT_RESTORE_RGBA( 3 ); |
if (HAVE_SPEC) { |
if (!DO_FLAT) { |
VERT_RESTORE_SPEC( 0 ); |
VERT_RESTORE_SPEC( 1 ); |
VERT_RESTORE_SPEC( 2 ); |
} |
VERT_RESTORE_SPEC( 3 ); |
} |
} |
else { |
GLuint *vbindex = VB->IndexPtr[0]->data; |
if (!DO_FLAT) { |
VERT_SET_IND( v[0], vbindex[e0] ); |
VERT_SET_IND( v[1], vbindex[e1] ); |
VERT_SET_IND( v[2], vbindex[e2] ); |
} |
VERT_SET_IND( v[3], vbindex[e3] ); |
} |
} |
if (DO_FLAT) { |
if (HAVE_RGBA) { |
VERT_RESTORE_RGBA( 0 ); |
VERT_RESTORE_RGBA( 1 ); |
VERT_RESTORE_RGBA( 2 ); |
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { |
VERT_RESTORE_SPEC( 0 ); |
VERT_RESTORE_SPEC( 1 ); |
VERT_RESTORE_SPEC( 2 ); |
} |
} |
else { |
VERT_RESTORE_IND( 0 ); |
VERT_RESTORE_IND( 1 ); |
VERT_RESTORE_IND( 2 ); |
} |
} |
} |
#else |
static void TAG(quad)( GLcontext *ctx, GLuint e0, |
GLuint e1, GLuint e2, GLuint e3 ) |
{ |
if (DO_UNFILLED) { |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
GLubyte ef1 = VB->EdgeFlag[e1]; |
GLubyte ef3 = VB->EdgeFlag[e3]; |
VB->EdgeFlag[e1] = 0; |
TAG(triangle)( ctx, e0, e1, e3 ); |
VB->EdgeFlag[e1] = ef1; |
VB->EdgeFlag[e3] = 0; |
TAG(triangle)( ctx, e1, e2, e3 ); |
VB->EdgeFlag[e3] = ef3; |
} else { |
TAG(triangle)( ctx, e0, e1, e3 ); |
TAG(triangle)( ctx, e1, e2, e3 ); |
} |
} |
#endif |
#endif |
#if DO_LINE |
static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 ) |
{ |
TNLvertexbuffer *VB = &TNL_CONTEXT(ctx)->vb; |
VERTEX *v[2]; |
LOCAL_VARS(2); |
v[0] = (VERTEX *)GET_VERTEX(e0); |
v[1] = (VERTEX *)GET_VERTEX(e1); |
if (DO_FLAT) { |
if (HAVE_RGBA) { |
VERT_SAVE_RGBA( 0 ); |
VERT_COPY_RGBA( v[0], v[1] ); |
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { |
VERT_SAVE_SPEC( 0 ); |
VERT_COPY_SPEC( v[0], v[1] ); |
} |
} |
else { |
VERT_SAVE_IND( 0 ); |
VERT_COPY_IND( v[0], v[1] ); |
} |
} |
LINE( v[0], v[1] ); |
if (DO_FLAT) { |
if (HAVE_RGBA) { |
VERT_RESTORE_RGBA( 0 ); |
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { |
VERT_RESTORE_SPEC( 0 ); |
} |
} |
else { |
VERT_RESTORE_IND( 0 ); |
} |
} |
} |
#endif |
#if DO_POINTS |
static void TAG(points)( GLcontext *ctx, GLuint first, GLuint last ) |
{ |
struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb; |
int i; |
LOCAL_VARS(1); |
if (VB->Elts == 0) { |
for ( i = first ; i < last ; i++ ) { |
if ( VB->ClipMask[i] == 0 ) { |
VERTEX *v = (VERTEX *)GET_VERTEX(i); |
POINT( v ); |
} |
} |
} else { |
for ( i = first ; i < last ; i++ ) { |
GLuint e = VB->Elts[i]; |
if ( VB->ClipMask[e] == 0 ) { |
VERTEX *v = (VERTEX *)GET_VERTEX(e); |
POINT( v ); |
} |
} |
} |
} |
#endif |
static void TAG(init)( void ) |
{ |
#if DO_QUAD |
TAB[IND].quad = TAG(quad); |
#endif |
#if DO_TRI |
TAB[IND].triangle = TAG(triangle); |
#endif |
#if DO_LINE |
TAB[IND].line = TAG(line); |
#endif |
#if DO_POINTS |
TAB[IND].points = TAG(points); |
#endif |
} |
#undef IND |
#undef TAG |
#if HAVE_RGBA |
#undef VERT_SET_IND |
#undef VERT_COPY_IND |
#undef VERT_SAVE_IND |
#undef VERT_RESTORE_IND |
#if HAVE_BACK_COLORS |
#undef VERT_SET_RGBA |
#endif |
#else |
#undef VERT_SET_RGBA |
#undef VERT_COPY_RGBA |
#undef VERT_SAVE_RGBA |
#undef VERT_RESTORE_RGBA |
#if HAVE_BACK_COLORS |
#undef VERT_SET_IND |
#endif |
#endif |
#if !HAVE_SPEC |
#undef VERT_SET_SPEC |
#undef VERT_COPY_SPEC |
#undef VERT_SAVE_SPEC |
#undef VERT_RESTORE_SPEC |
#if HAVE_BACK_COLORS |
#undef VERT_COPY_SPEC1 |
#endif |
#else |
#if HAVE_BACK_COLORS |
#undef VERT_SET_SPEC |
#endif |
#endif |
#if !HAVE_BACK_COLORS |
#undef VERT_COPY_SPEC1 |
#undef VERT_COPY_IND1 |
#undef VERT_COPY_RGBA1 |
#endif |
#ifndef INSANE_VERTICES |
#undef VERT_SET_Z |
#undef VERT_Z_ADD |
#endif |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_rendertmp.h |
---|
0,0 → 1,438 |
/* $Id: t_dd_rendertmp.h,v 1.1 2003-02-28 11:54:01 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
#ifndef POSTFIX |
#define POSTFIX |
#endif |
#ifndef INIT |
#define INIT(x) |
#endif |
#ifndef NEED_EDGEFLAG_SETUP |
#define NEED_EDGEFLAG_SETUP 0 |
#define EDGEFLAG_GET(a) 0 |
#define EDGEFLAG_SET(a,b) (void)b |
#endif |
#ifndef RESET_STIPPLE |
#define RESET_STIPPLE |
#endif |
#ifndef RESET_OCCLUSION |
#define RESET_OCCLUSION |
#endif |
#ifndef TEST_PRIM_END |
#define TEST_PRIM_END(flags) (flags & PRIM_END) |
#define TEST_PRIM_BEGIN(flags) (flags & PRIM_BEGIN) |
#define TEST_PRIM_PARITY(flags) (flags & PRIM_PARITY) |
#endif |
#ifndef ELT |
#define ELT(x) x |
#endif |
#ifndef RENDER_TAB_QUALIFIER |
#define RENDER_TAB_QUALIFIER static |
#endif |
static void TAG(render_points)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
(void) flags; |
RESET_OCCLUSION; |
INIT(GL_POINTS); |
RENDER_POINTS( start, count ); |
POSTFIX; |
} |
static void TAG(render_lines)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j; |
LOCAL_VARS; |
(void) flags; |
RESET_OCCLUSION; |
INIT(GL_LINES); |
for (j=start+1; j<count; j+=2 ) { |
RENDER_LINE( ELT(j-1), ELT(j) ); |
RESET_STIPPLE; |
} |
POSTFIX; |
} |
static void TAG(render_line_strip)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j; |
LOCAL_VARS; |
(void) flags; |
RESET_OCCLUSION; |
INIT(GL_LINE_STRIP); |
for (j=start+1; j<count; j++ ) |
RENDER_LINE( ELT(j-1), ELT(j) ); |
if (TEST_PRIM_END(flags)) |
RESET_STIPPLE; |
POSTFIX; |
} |
static void TAG(render_line_loop)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint i; |
LOCAL_VARS; |
(void) flags; |
RESET_OCCLUSION; |
INIT(GL_LINE_LOOP); |
if (start+1 < count) { |
if (TEST_PRIM_BEGIN(flags)) { |
RENDER_LINE( ELT(start), ELT(start+1) ); |
} |
for ( i = start+2 ; i < count ; i++) { |
RENDER_LINE( ELT(i-1), ELT(i) ); |
} |
if ( TEST_PRIM_END(flags)) { |
RENDER_LINE( ELT(count-1), ELT(start) ); |
RESET_STIPPLE; |
} |
} |
POSTFIX; |
} |
static void TAG(render_triangles)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j; |
LOCAL_VARS; |
(void) flags; |
INIT(GL_TRIANGLES); |
if (NEED_EDGEFLAG_SETUP) { |
for (j=start+2; j<count; j+=3) { |
/* Leave the edgeflags as supplied by the user. |
*/ |
RENDER_TRI( ELT(j-2), ELT(j-1), ELT(j) ); |
RESET_STIPPLE; |
} |
} else { |
for (j=start+2; j<count; j+=3) { |
RENDER_TRI( ELT(j-2), ELT(j-1), ELT(j) ); |
} |
} |
POSTFIX; |
} |
static void TAG(render_tri_strip)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j; |
GLuint parity = 0; |
LOCAL_VARS; |
if (TEST_PRIM_PARITY(flags)) |
parity = 1; |
INIT(GL_TRIANGLE_STRIP); |
if (NEED_EDGEFLAG_SETUP) { |
for (j=start+2;j<count;j++,parity^=1) { |
GLuint ej2 = ELT(j-2+parity); |
GLuint ej1 = ELT(j-1-parity); |
GLuint ej = ELT(j); |
GLboolean ef2 = EDGEFLAG_GET( ej2 ); |
GLboolean ef1 = EDGEFLAG_GET( ej1 ); |
GLboolean ef = EDGEFLAG_GET( ej ); |
EDGEFLAG_SET( ej2, GL_TRUE ); |
EDGEFLAG_SET( ej1, GL_TRUE ); |
EDGEFLAG_SET( ej, GL_TRUE ); |
RENDER_TRI( ej2, ej1, ej ); |
EDGEFLAG_SET( ej2, ef2 ); |
EDGEFLAG_SET( ej1, ef1 ); |
EDGEFLAG_SET( ej, ef ); |
RESET_STIPPLE; |
} |
} else { |
for (j=start+2; j<count ; j++, parity^=1) { |
RENDER_TRI( ELT(j-2+parity), ELT(j-1-parity), ELT(j) ); |
} |
} |
POSTFIX; |
} |
static void TAG(render_tri_fan)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j; |
LOCAL_VARS; |
(void) flags; |
INIT(GL_TRIANGLE_FAN); |
if (NEED_EDGEFLAG_SETUP) { |
for (j=start+2;j<count;j++) { |
/* For trifans, all edges are boundary. |
*/ |
GLuint ejs = ELT(start); |
GLuint ej1 = ELT(j-1); |
GLuint ej = ELT(j); |
GLboolean efs = EDGEFLAG_GET( ejs ); |
GLboolean ef1 = EDGEFLAG_GET( ej1 ); |
GLboolean ef = EDGEFLAG_GET( ej ); |
EDGEFLAG_SET( ejs, GL_TRUE ); |
EDGEFLAG_SET( ej1, GL_TRUE ); |
EDGEFLAG_SET( ej, GL_TRUE ); |
RENDER_TRI( ejs, ej1, ej); |
EDGEFLAG_SET( ejs, efs ); |
EDGEFLAG_SET( ej1, ef1 ); |
EDGEFLAG_SET( ej, ef ); |
RESET_STIPPLE; |
} |
} else { |
for (j=start+2;j<count;j++) { |
RENDER_TRI( ELT(start), ELT(j-1), ELT(j) ); |
} |
} |
POSTFIX; |
} |
static void TAG(render_poly)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j = start+2; |
LOCAL_VARS; |
(void) flags; |
INIT(GL_POLYGON); |
if (NEED_EDGEFLAG_SETUP) { |
GLboolean efstart = EDGEFLAG_GET( ELT(start) ); |
GLboolean efcount = EDGEFLAG_GET( ELT(count-1) ); |
/* If the primitive does not begin here, the first edge |
* is non-boundary. |
*/ |
if (!TEST_PRIM_BEGIN(flags)) |
EDGEFLAG_SET( ELT(start), GL_FALSE ); |
/* If the primitive does not end here, the final edge is |
* non-boundary. |
*/ |
if (!TEST_PRIM_END(flags)) |
EDGEFLAG_SET( ELT(count-1), GL_FALSE ); |
/* Draw the first triangles (possibly zero) |
*/ |
if (j<count-1) { |
GLboolean ef = EDGEFLAG_GET( ELT(j) ); |
EDGEFLAG_SET( ELT(j), GL_FALSE ); |
RENDER_TRI( ELT(j-1), ELT(j), ELT(start) ); |
EDGEFLAG_SET( ELT(j), ef ); |
j++; |
/* Don't render the first edge again: |
*/ |
EDGEFLAG_SET( ELT(start), GL_FALSE ); |
for (;j<count-1;j++) { |
GLboolean efj = EDGEFLAG_GET( ELT(j) ); |
EDGEFLAG_SET( ELT(j), GL_FALSE ); |
RENDER_TRI( ELT(j-1), ELT(j), ELT(start) ); |
EDGEFLAG_SET( ELT(j), efj ); |
} |
} |
/* Draw the last or only triangle |
*/ |
if (j < count) |
RENDER_TRI( ELT(j-1), ELT(j), ELT(start) ); |
/* Restore the first and last edgeflags: |
*/ |
EDGEFLAG_SET( ELT(count-1), efcount ); |
EDGEFLAG_SET( ELT(start), efstart ); |
if (TEST_PRIM_END(flags)) { |
RESET_STIPPLE; |
} |
} |
else { |
for (j=start+2;j<count;j++) { |
RENDER_TRI( ELT(j-1), ELT(j), ELT(start) ); |
} |
} |
POSTFIX; |
} |
static void TAG(render_quads)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j; |
LOCAL_VARS; |
(void) flags; |
INIT(GL_QUADS); |
if (NEED_EDGEFLAG_SETUP) { |
for (j=start+3; j<count; j+=4) { |
/* Use user-specified edgeflags for quads. |
*/ |
RENDER_QUAD( ELT(j-3), ELT(j-2), ELT(j-1), ELT(j) ); |
RESET_STIPPLE; |
} |
} else { |
for (j=start+3; j<count; j+=4) { |
RENDER_QUAD( ELT(j-3), ELT(j-2), ELT(j-1), ELT(j) ); |
} |
} |
POSTFIX; |
} |
static void TAG(render_quad_strip)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j; |
LOCAL_VARS; |
(void) flags; |
INIT(GL_QUAD_STRIP); |
if (NEED_EDGEFLAG_SETUP) { |
for (j=start+3;j<count;j+=2) { |
/* All edges are boundary. Set edgeflags to 1, draw the |
* quad, and restore them to the original values. |
*/ |
GLboolean ef3 = EDGEFLAG_GET( ELT(j-3) ); |
GLboolean ef2 = EDGEFLAG_GET( ELT(j-2) ); |
GLboolean ef1 = EDGEFLAG_GET( ELT(j-1) ); |
GLboolean ef = EDGEFLAG_GET( ELT(j) ); |
EDGEFLAG_SET( ELT(j-3), GL_TRUE ); |
EDGEFLAG_SET( ELT(j-2), GL_TRUE ); |
EDGEFLAG_SET( ELT(j-1), GL_TRUE ); |
EDGEFLAG_SET( ELT(j), GL_TRUE ); |
RENDER_QUAD( ELT(j-1), ELT(j-3), ELT(j-2), ELT(j) ); |
EDGEFLAG_SET( ELT(j-3), ef3 ); |
EDGEFLAG_SET( ELT(j-2), ef2 ); |
EDGEFLAG_SET( ELT(j-1), ef1 ); |
EDGEFLAG_SET( ELT(j), ef ); |
RESET_STIPPLE; |
} |
} else { |
for (j=start+3;j<count;j+=2) { |
RENDER_QUAD( ELT(j-1), ELT(j-3), ELT(j-2), ELT(j) ); |
} |
} |
POSTFIX; |
} |
static void TAG(render_noop)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
(void)(ctx && start && count && flags); |
} |
RENDER_TAB_QUALIFIER void (*TAG(render_tab)[GL_POLYGON+2])(GLcontext *, |
GLuint, |
GLuint, |
GLuint) = |
{ |
TAG(render_points), |
TAG(render_lines), |
TAG(render_line_loop), |
TAG(render_line_strip), |
TAG(render_triangles), |
TAG(render_tri_strip), |
TAG(render_tri_fan), |
TAG(render_quads), |
TAG(render_quad_strip), |
TAG(render_poly), |
TAG(render_noop), |
}; |
#ifndef PRESERVE_VB_DEFS |
#undef RENDER_TRI |
#undef RENDER_QUAD |
#undef RENDER_LINE |
#undef RENDER_POINTS |
#undef LOCAL_VARS |
#undef INIT |
#undef POSTFIX |
#undef RESET_STIPPLE |
#undef DBG |
#undef ELT |
#undef RENDER_TAB_QUALIFIER |
#endif |
#ifndef PRESERVE_TAG |
#undef TAG |
#endif |
#undef PRESERVE_VB_DEFS |
#undef PRESERVE_TAG |
/shark/trunk/ports/mesa/src/tnl_dd/imm/t_dd_imm_tapi.h |
---|
0,0 → 1,76 |
/* $Id: t_dd_imm_tapi.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Gareth Hughes <gareth@valinux.com> |
* Keith Whitwell <keith_whitwell@yahoo.com> |
*/ |
/* Template for immediate mode texture coordinate functions. |
*/ |
#ifndef DO_PROJ_TEX |
#error "Need to define DO_PROJ_TEX" |
#endif |
/* ============================================================= |
* Notify on calls to texture4f, to allow switch to projected texture |
* vertex format: |
*/ |
static void TAG(TexCoord4f)( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) |
{ |
GET_CURRENT; |
DO_PROJ_TEX; |
TEXCOORD4( s, t, r, q ); |
} |
static void TAG(TexCoord4fv)( const GLfloat *v ) |
{ |
GET_CURRENT; |
DO_PROJ_TEX; |
TEXCOORD4( v[0], v[1], v[2], v[3] ); |
} |
static void TAG(MultiTexCoord4fARB)( GLenum target, GLfloat s, |
GLfloat t, GLfloat r, GLfloat q ) |
{ |
GET_CURRENT; |
DO_PROJ_TEX; |
MULTI_TEXCOORD4( unit, s, t, r, q ); |
} |
static void TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *v ) |
{ |
GET_CURRENT; |
DO_PROJ_TEX; |
MULTI_TEXCOORD4( unit, v[0], v[1], v[2], v[3] ); |
} |
#undef DO_PROJ_TEX |
#undef TAG |
/shark/trunk/ports/mesa/src/tnl_dd/imm/t_dd_imm_vapi.h |
---|
0,0 → 1,160 |
/* $Id: t_dd_imm_vapi.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Gareth Hughes <gareth@valinux.com> |
* Keith Whitwell <keithw@valinux.com> |
*/ |
/* Template for immediate mode vertex functions. |
*/ |
#define DBG 0 |
#define VERTEX( ox, oy, oz, ow ) |
do { |
GET_CURRENT_VERTEX; |
GLfloat w; |
GLuint mask; |
const GLfloat * const m = ctx->_ModelProjectMatrix.m; |
if (DO_FULL_MATRIX) { |
VERTEX_CLIP(0) = m[0] * ox + m[4] * oy + m[8] * oz + m[12] * ow; |
VERTEX_CLIP(1) = m[1] * ox + m[5] * oy + m[9] * oz + m[13] * ow; |
VERTEX_CLIP(2) = m[2] * ox + m[6] * oy + m[10] * oz + m[14] * ow; |
VERTEX_CLIP(3) = m[3] * ox + m[7] * oy + m[11] * oz + m[15] * ow; |
w = VERTEX_CLIP(3); |
} |
else if (DO_NOROT_MATRIX) { |
VERTEX_CLIP(0) = m[0] * ox + m[12] * ow; |
VERTEX_CLIP(1) = m[5] * oy + m[13] * ow; |
VERTEX_CLIP(2) = m[10] * oz + m[14] * ow; |
VERTEX_CLIP(3) = ow; |
w = ow; |
} |
else { |
ASSERT (DO_IDENTITY_MATRIX); |
VERTEX_CLIP(0) = ox; |
VERTEX_CLIP(1) = oy; |
VERTEX_CLIP(2) = oz; |
VERTEX_CLIP(3) = ow; |
w = ow; |
} |
mask = 0; |
if (DO_CLIP_TEST) { |
if ( VERTEX_CLIP(0) > w ) mask |= CLIP_RIGHT_BIT; |
if ( VERTEX_CLIP(0) < -w ) mask |= CLIP_LEFT_BIT; |
if ( VERTEX_CLIP(1) > w ) mask |= CLIP_TOP_BIT; |
if ( VERTEX_CLIP(1) < -w ) mask |= CLIP_BOTTOM_BIT; |
if ( VERTEX_CLIP(2) > w ) mask |= CLIP_FAR_BIT; |
if ( VERTEX_CLIP(2) < -w ) mask |= CLIP_NEAR_BIT; |
VERTEX_MASK(v) = mask; |
} |
if (!mask) { |
if (HAVE_VERTEX_WIN) { |
if (!HAVE_HW_VIEWPORT) { |
const GLfloat *s = GET_VIEWPORT_MATRIX(); |
if (HAVE_W && HAVE_HW_DIVIDE) { |
VERTEX_WIN( 0 ) = s[0] * VERTEX_CLIP( 0 ) + s[12]; |
VERTEX_WIN( 1 ) = s[5] * VERTEX_CLIP( 1 ) + s[13]; |
VERTEX_WIN( 2 ) = s[10] * VERTEX_CLIP( 2 ) + s[14]; |
VERTEX_WIN( 3 ) = w; |
} |
else { |
const GLfloat oow = 1.0/w; /* possibly opt away */ |
VERTEX_WIN( 0 ) = s[0] * VERTEX_CLIP( 0 ) * oow + s[12]; |
VERTEX_WIN( 1 ) = s[5] * VERTEX_CLIP( 1 ) * oow + s[13]; |
VERTEX_WIN( 2 ) = s[10] * VERTEX_CLIP( 2 ) * oow + s[14]; |
if (HAVE_W) |
VERTEX_WIN( 3 ) = oow; |
} |
} |
else if (HAVE_W && HAVE_HW_DIVIDE) { |
if (!VERTEX_WIN_IS_VERTEX_CLIP) { |
VERTEX_WIN( 0 ) = VERTEX_CLIP( 0 ); |
VERTEX_WIN( 1 ) = VERTEX_CLIP( 1 ); |
VERTEX_WIN( 2 ) = VERTEX_CLIP( 2 ); |
VERTEX_WIN( 3 ) = w; |
} |
} |
else { |
const GLfloat oow = 1.0/w; /* possibly opt away */ |
VERTEX_WIN( 0 ) = VERTEX_CLIP( 0 ) * oow; |
VERTEX_WIN( 1 ) = VERTEX_CLIP( 1 ) * oow; |
VERTEX_WIN( 2 ) = VERTEX_CLIP( 2 ) * oow; |
if (HAVE_W) |
VERTEX_WIN( 3 ) = oow; |
} |
} |
} else if (!FALLBACK_OR_CLIPPING) { |
SET_CLIPPING(); /* transition to clipping */ |
} |
COPY_VERTEX_FROM_CURRENT; |
BUILD_PRIM_FROM_VERTEX; |
} |
/* Let the compiler optimize away the constant operations: |
*/ |
static void VTAG(Vertex2f)( GLfloat ox, GLfloat oy ) |
{ |
/* Cliptest on clip[2] could also be eliminated... |
*/ |
VERTEX( ox, oy, 0, 1 ); |
} |
static void VTAG(Vertex2fv)( const GLfloat *obj ) |
{ |
/* Cliptest on clip[2] could also be eliminated... |
*/ |
VERTEX( obj[0], obj[1], 0, 1 ); |
} |
static void VTAG(Vertex3f)( GLfloat ox, GLfloat oy, GLfloat oz ) |
{ |
VERTEX( ox, oy, oz, 1 ); |
} |
static void VTAG(Vertex3fv)( const GLfloat *obj ) |
{ |
VERTEX( obj[0], obj[1], obj[2], 1 ); |
} |
static void VTAG(Vertex4f)( GLfloat ox, GLfloat oy, GLfloat oz, GLfloat ow ) |
{ |
VERTEX( ox, oy, oz, ow ); |
} |
static void VTAG(Vertex4fv)( const GLfloat *obj ) |
{ |
VERTEX( obj[0], obj[1], obj[2], obj[3] ); |
} |
#undef DO_FULL_MATRIX |
#undef VTAG |
#undef VERTEX |
/shark/trunk/ports/mesa/src/tnl_dd/imm/t_dd_imm_vb.c |
---|
0,0 → 1,205 |
/* $Id: t_dd_imm_vb.c,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith_whitwell@yahoo.com> |
*/ |
/* Template to build clipping routines to support t_dd_imm_primtmp.h. |
* |
* The TAG(draw_line) and TAG(draw_triangle) routines are called in |
* clipping and fallback scenarios, and when the native hardware |
* primitive (eg polygons) is unavailable. |
*/ |
#define CLIP_DOTPROD(K, A, B, C, D) \ |
(CLIP_X(K)*A + CLIP_Y(K)*B + \ |
CLIP_Z(K)*C + CLIP_W(K)*D) |
#define POLY_CLIP( PLANE, A, B, C, D ) \ |
do { \ |
if (mask & PLANE) { \ |
TNL_VERTEX **indata = inlist[in]; \ |
TNL_VERTEX **outdata = inlist[in ^= 1]; \ |
TNL_VERTEX *J = indata[0]; \ |
GLfloat dpJ = CLIP_DOTPROD(J, A, B, C, D ); \ |
GLuint outcount = 0; \ |
GLuint i; \ |
\ |
indata[n] = indata[0]; /* prevent rotation of vertices */ \ |
for (i = 1; i <= n; i++) { \ |
TNL_VERTEX *I = indata[i]; \ |
GLfloat dpI = CLIP_DOTPROD(idx, A, B, C, D ); \ |
\ |
if (!NEGATIVE(dpPrev)) { \ |
outdata[outcount++] = J; \ |
} \ |
\ |
if (DIFFERENT_SIGNS(dpI, dpJ)) { \ |
TNL_VERTEX *O = verts++; \ |
outdata[outcount++] = O; \ |
if (NEGATIVE(dpI)) { \ |
/* Going out of bounds. Avoid division by zero as we \ |
* know dp != dpPrev from DIFFERENT_SIGNS, above. \ |
*/ \ |
GLfloat t = dpI / (dpI - dpJ); \ |
INTERP( ctx, t, O, I, J ); \ |
} else { \ |
/* Coming back in. \ |
*/ \ |
GLfloat t = dpJ / (dpJ - dpI); \ |
INTERP( ctx, t, O, J, I ); \ |
} \ |
} \ |
\ |
J = I; \ |
dpJ = dpI; \ |
} \ |
\ |
if (outcount < 3) \ |
return; \ |
\ |
nr = outcount; \ |
} \ |
} while (0) |
#define LINE_CLIP(PLANE, A, B, C, D ) \ |
do { \ |
if (mask & PLANE) { \ |
GLfloat dpI = CLIP_DOTPROD( I, A, B, C, D ); \ |
GLfloat dpJ = CLIP_DOTPROD( J, A, B, C, D ); \ |
\ |
if (DIFFERENT_SIGNS(dpI, dpJ)) { \ |
TNL_VERTEX *O = verts++; \ |
if (NEGATIVE(dpJ)) { \ |
GLfloat t = dpI / (dpI - dpJ); \ |
INTERP( ctx, t, O, I, J ); \ |
J = O; \ |
} else { \ |
GLfloat t = dpJ / (dpJ - dpI); \ |
INTERP( ctx, t, O, J, I ); \ |
I = O; \ |
} \ |
} \ |
else if (NEGATIVE(dpI)) \ |
return; \ |
} \ |
} while (0) |
/* Clip a line against the viewport and user clip planes. |
*/ |
static void TAG(clip_draw_line)( GLcontext *ctx, |
TNL_VERTEX *I, |
TNL_VERTEX *J, |
GLuint mask ) |
{ |
LOCAL_VARS; |
GET_INTERP_FUNC; |
TNL_VERTEX tmp[MAX_CLIPPED_VERTICES]; |
TNL_VERTEX *verts = tmp; |
TNL_VERTEX *pv = J; |
LINE_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 ); |
LINE_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 ); |
LINE_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 ); |
LINE_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 ); |
LINE_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); |
LINE_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); |
if ((ctx->_TriangleCaps & DD_FLATSHADE) && J != pv) |
COPY_PV( ctx, J, pv ); |
DRAW_LINE( I, J ); |
} |
/* Clip a triangle against the viewport and user clip planes. |
*/ |
static void TAG(clip_draw_triangle)( GLcontext *ctx, |
TNL_VERTEX *v0, |
TNL_VERTEX *v1, |
TNL_VERTEX *v2, |
GLuint mask ) |
{ |
LOCAL_VARS; |
GET_INTERP_FUNC; |
TNL_VERTEX tmp[MAX_CLIPPED_VERTICES]; |
TNL_VERTEX *verts = tmp; |
TNL_VERTEX *(inlist[2][MAX_CLIPPED_VERTICES]); |
TNL_VERTEX **out; |
GLuint in = 0; |
GLuint n = 3; |
GLuint i; |
ASSIGN_3V(inlist, v2, v0, v1 ); /* pv rotated to slot zero */ |
POLY_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 ); |
POLY_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 ); |
POLY_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 ); |
POLY_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 ); |
POLY_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); |
POLY_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); |
if ((ctx->_TriangleCaps & DD_FLATSHADE) && v2 != inlist[0]) |
COPY_PV( ctx, inlist[0], v2 ); |
out = inlist[in]; |
DRAW_POLYGON( out, n ); |
} |
static __inline void TAG(draw_triangle)( GLcontext *ctx, |
TNL_VERTEX *v0, |
TNL_VERTEX *v1, |
TNL_VERTEX *v2 ) |
{ |
LOCAL_VARS; |
GLubyte ormask = (v0->mask | v1->mask | v2->mask); |
if ( !ormask ) { |
DRAW_TRI( v0, v1, v2 ); |
} else if ( !(v0->mask & v1->mask & v2->mask) ) { |
TAG(clip_draw_triangle)( ctx, v0, v1, v2, ormask ); |
} |
} |
static __inline void TAG(draw_line)( GLcontext *ctx, |
TNL_VERTEX *v0, |
TNL_VERTEX *v1 ) |
{ |
LOCAL_VARS; |
GLubyte ormask = (v0->mask | v1->mask); |
if ( !ormask ) { |
DRAW_LINE( v0, v1 ); |
} else if ( !(v0->mask & v1->mask) ) { |
TAG(clip_draw_line)( ctx, v0, v1, ormask ); |
} |
} |
/shark/trunk/ports/mesa/src/tnl_dd/imm/NOTES.imm |
---|
0,0 → 1,112 |
NOTE: |
These files are incomplete. They do not yet form a working |
implementation of hte concepts discused below. |
OVERVIEW |
The t_dd_imm_* files form a set of templates to produce driver - |
specific software tnl modules for a small subset of transformation and |
lighting states. |
The approach is quite different to the large vertex buffers of the |
src/tnl module, and is based around a cache of four recent vertices |
and a 'current' vertex which is updated directly from the Color, |
Normal, Texcoord, SecondaryColor and Fog entrypoints. |
The current vertex is actually a composite of the ctx->Current values |
and a partial hardware vertex maintained where the hardware values |
differ from those in ctx->Current. For example, clamped color values |
are kept in the hardware vertex, while texcoords remain in |
ctx->Current. |
A crude diagram: |
+--------------+ +-------------------+ |
| ctx->Current | | Current-HW-vertex | |
+--------------+ +-------------------+ |
\ / |
\ / |
\ / |
\ / |
--------- -------- |
| | |
v v |
+--------+ +--------+ +--------+ +--------+ |
| vert-0 | | vert-1 | | vert-2 | | vert-3 | |
+--------+ +--------+ +--------+ +--------+ |
| |
| |
v |
DMA |
Here values from ctx->Current and current-HW-vertex are merged to |
build vert-2, which is then dumped to hardware (DMA). A state machine |
determines which vertex is built in turn, and how the vertices are |
used to present primitives to hardware. These actions all occur |
during a call to Vertex{234}f{v}. |
Each vert-n includes clip coordinates and a clipmask in addition to |
the hardware (window) coordinates. This information allows clipping |
to take place directly on these vertices, if need be. |
t_dd_imm_capi.h |
Color{34}{fub}{v}() implementations. These update both |
ctx->Current (unclamped float colors) and current-HW-vertex |
with hardware-specific color values (typically unsigned |
bytes). |
When lighting is enabled, the functions from src/api_noop.c |
should be used, which just update ctx->Current. (The |
current-hw-vertex colors are produced from lighting, which is |
keyed to Normal3f). |
t_dd_imm_vb.c |
Support functions for clipping and fallback. See |
t_dd_imm_primtmp.h. |
t_dd_imm_napi.c |
t_dd_imm_napi.h |
Versions of Normal3f{v} to perform lighting with one or more |
infinite lights. Updates ctx->Current.Normal and the current |
HW colors. |
When lighting is disabled, use the functions from api_noop.c |
instead. |
t_dd_imm_primtmp.h |
State machine to control emission of vertices and primitives |
to hardware. Called indirectly from Vertex{234}f{v}. Capable |
of supporting hardware strip and fan primitives, and of |
decomposing to discreet primitives for clipping or fallback, |
or where the native primitive is unavailable. |
t_dd_imm_tapi.h |
Implementations of TexCoord{v} and MultiTexCoord4f{v}ARB to |
fire a callback when transitioning to projective texture. |
Most drivers will need to change vertex format at this point, |
some may need to enable a software rasterization fallback. |
t_dd_imm_vapi.h |
Implementations of Vertex{234}f{v}. These perform |
transformation and cliptesting on their arguments, then jump |
into the state machine implemented in primtmp.h. |
t_dd_imm_vertex.h |
Support functions for building and clip-interpolating hardware |
vertices. Called from primtmp.h. |
Keith Whitwell, June 2001. |
/shark/trunk/ports/mesa/src/tnl_dd/imm/t_dd_imm_napi.h |
---|
0,0 → 1,227 |
/* $Id: t_dd_imm_napi.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Gareth Hughes <gareth@valinux.com> |
* Keith Whitwell <keith_whitwell@yahoo.com> |
*/ |
/* Template for immediate mode normal functions. Optimize for infinite |
* lights when doing software lighting. |
*/ |
static void TAG(Normal3f_single)( GLfloat x, GLfloat y, GLfloat z ) |
{ |
GET_CURRENT_VERTEX; |
const struct gl_light *light = ctx->Light.EnabledList.prev; |
GLfloat n_dot_h, n_dot_VP, spec, sum[3]; |
GLfloat *normal = ctx->Current.Normal; |
GLfloat scale = 1.0; |
ASSIGN_3V( normal, x, y, z ); |
COPY_3V( sum, BASE_COLOR ); |
if ( IND & NORM_RESCALE ) { |
scale = ctx->_ModelViewInvScale; |
} else if ( IND & NORM_NORMALIZE ) { |
scale = LEN_3FV( normal ); |
if ( scale != 0.0 ) scale = 1.0 / scale; |
} |
n_dot_VP = DOT3( normal, light->_VP_inf_norm ) * scale; |
if ( n_dot_VP > 0.0F ) { |
ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] ); |
n_dot_h = DOT3( normal, light->_h_inf_norm ) * scale; |
if ( n_dot_h > 0.0F ) { |
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); |
ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] ); |
} |
} |
#ifdef LIT_COLOR_IS_FLOAT |
LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f); |
LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f); |
LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f); |
#else |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] ); |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] ); |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] ); |
#endif |
LIT_COLOR( ACOMP ) = LIT_ALPHA; |
} |
static void TAG(Normal3fv_single)( const GLfloat *normal ) |
{ |
GET_CURRENT_VERTEX; |
const struct gl_light *light = ctx->Light.EnabledList.prev; |
GLfloat n_dot_h, n_dot_VP, spec, sum[3]; |
GLfloat scale = 1.0; |
COPY_3V( ctx->Current.Normal, normal ); |
COPY_3V( sum, BASE_COLOR ); |
if ( IND & NORM_RESCALE ) { |
scale = ctx->_ModelViewInvScale; |
} else if ( IND & NORM_NORMALIZE ) { |
scale = LEN_3FV( normal ); |
if ( scale != 0.0 ) scale = 1.0 / scale; |
} |
n_dot_VP = DOT3( normal, light->_VP_inf_norm ) * scale; |
if ( n_dot_VP > 0.0F ) { |
ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] ); |
n_dot_h = DOT3( normal, light->_h_inf_norm ) * scale; |
if ( n_dot_h > 0.0F ) { |
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); |
ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] ); |
} |
} |
#ifdef LIT_COLOR_IS_FLOAT |
LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f); |
LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f); |
LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f); |
#else |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] ); |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] ); |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] ); |
#endif |
LIT_COLOR( ACOMP ) = LIT_ALPHA; |
} |
static void TAG(Normal3f_multi)( GLfloat x, GLfloat y, GLfloat z ) |
{ |
GET_CURRENT_VERTEX; |
struct gl_light *light; |
GLfloat n_dot_h, n_dot_VP, spec, sum[3], tmp[3]; |
GLfloat *normal; |
ASSIGN_3V( ctx->Current.Normal, x, y, z ); |
COPY_3V( sum, BASE_COLOR ); |
if ( IND & NORM_RESCALE ) { |
normal = tmp; |
ASSIGN_3V( normal, x, y, z ); |
SELF_SCALE_SCALAR_3V( normal, ctx->_ModelViewInvScale ); |
} else if ( IND & NORM_NORMALIZE ) { |
normal = tmp; |
ASSIGN_3V( normal, x, y, z ); |
NORMALIZE_3FV( normal ); |
} else { |
normal = ctx->Current.Normal; |
} |
foreach ( light, &ctx->Light.EnabledList ) { |
n_dot_VP = DOT3( normal, light->_VP_inf_norm ); |
if ( n_dot_VP > 0.0F ) { |
ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] ); |
n_dot_h = DOT3( normal, light->_h_inf_norm ); |
if ( n_dot_h > 0.0F ) { |
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); |
ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] ); |
} |
} |
} |
#ifdef LIT_COLOR_IS_FLOAT |
LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f); |
LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f); |
LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f); |
#else |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] ); |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] ); |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] ); |
#endif |
LIT_COLOR( ACOMP ) = LIT_ALPHA; |
} |
static void TAG(Normal3fv_multi)( const GLfloat *n ) |
{ |
GET_CURRENT_VERTEX; |
struct gl_light *light; |
GLfloat n_dot_h, n_dot_VP, spec, sum[3], tmp[3]; |
GLfloat *normal; |
COPY_3V( ctx->Current.Normal, n ); |
COPY_3V( sum, BASE_COLOR ); |
if ( IND & NORM_RESCALE ) { |
normal = tmp; |
COPY_3V( normal, n ); |
SELF_SCALE_SCALAR_3V( normal, ctx->_ModelViewInvScale ); |
} else if ( IND & NORM_NORMALIZE ) { |
normal = tmp; |
COPY_3V( normal, n ); |
NORMALIZE_3FV( normal ); |
} else { |
normal = ctx->Current.Normal; |
} |
foreach ( light, &ctx->Light.EnabledList ) { |
n_dot_VP = DOT3( normal, light->_VP_inf_norm ); |
if ( n_dot_VP > 0.0F ) { |
ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] ); |
n_dot_h = DOT3( normal, light->_h_inf_norm ); |
if ( n_dot_h > 0.0F ) { |
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec ); |
ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] ); |
} |
} |
} |
#ifdef LIT_COLOR_IS_FLOAT |
LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f); |
LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f); |
LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f); |
#else |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] ); |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] ); |
UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] ); |
#endif |
LIT_COLOR( ACOMP ) = LIT_ALPHA; |
} |
static void TAG(init_norm)( void ) |
{ |
norm_tab[IND].normal3f_single = TAG(Normal3f_single); |
norm_tab[IND].normal3fv_single = TAG(Normal3fv_single); |
norm_tab[IND].normal3f_multi = TAG(Normal3f_multi); |
norm_tab[IND].normal3fv_multi = TAG(Normal3fv_multi); |
} |
#ifndef PRESERVE_NORMAL_DEFS |
#undef GET_CURRENT |
#undef GET_CURRENT_VERTEX |
#undef LIT_COLOR |
#undef LIT_COLOR_IS_FLOAT |
#endif |
#undef PRESERVE_NORMAL_DEFS |
#undef IND |
#undef TAG |
/shark/trunk/ports/mesa/src/tnl_dd/imm/t_dd_imm_vbtmp.h |
---|
0,0 → 1,269 |
/* $Id: t_dd_imm_vbtmp.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith_whitwell@yahoo.com> |
*/ |
/* Template to build support for t_dd_imm_* tnl module using vertices |
* as defined in t_dd_vertex.h. |
* |
* See t_dd_vbtmp.h for definitions of arguments to this file. |
* Unfortunately it seems necessary to duplicate a lot of that code. |
*/ |
#ifndef LOCALVARS |
#define LOCALVARS |
#endif |
/* COPY_VERTEX_FROM_CURRENT in t_dd_imm_vapi.c |
*/ |
static void TAG(emit_vfmt)( GLcontext *ctx, VERTEX *v ) |
{ |
LOCALVARS |
; |
/* This template assumes (like t_dd_vbtmp.h) that color is ubyte. |
*/ |
if (DO_TEX0 || DO_TEX1 || !HAVE_TINY_VERTICES) |
{ |
const GLubyte *col = GET_HARDWARE_COLOR(); |
if (HAVE_RGBA_COLOR) { |
v->v.ui[4] = *(GLuint *)&col; |
} else { |
v->v.color.blue = col[2]; |
v->v.color.green = col[1]; |
v->v.color.red = col[0]; |
v->v.color.alpha = col[3]; |
} |
} |
else { |
if (HAVE_RGBA_COLOR) { |
v->v.ui[3] = *(GLuint *)col; |
} |
else { |
v->tv.color.blue = col[2]; |
v->tv.color.green = col[1]; |
v->tv.color.red = col[0]; |
v->tv.color.alpha = col[3]; |
} |
} |
if (DO_TEX0) { |
GLfloat *tc = ctx->Current.Texture[0]; |
v->v.u0 = tc[0]; |
v->v.v0 = tc[1]; |
if (DO_PTEX) { |
if (HAVE_PTEX_VERTICES) { |
v->pv.q0 = tc[3]; |
} |
else { |
float rhw = 1.0 / tc[3]; |
v->v.w *= tc[3]; |
v->v.u0 *= rhw; |
v->v.v0 *= rhw; |
} |
} |
} |
if (DO_TEX1) { |
GLfloat *tc = ctx->Current.Texture[1]; |
if (DO_PTEX) { |
v->pv.u1 = tc[0]; |
v->pv.v1 = tc[1]; |
v->pv.q1 = tc[3]; |
} |
else { |
v->v.u1 = tc[0]; |
v->v.v1 = tc[1]; |
} |
} |
else if (DO_PTEX) { |
*(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ |
} |
if (DO_TEX2) { |
GLfloat *tc = ctx->Current.Texture[2]; |
if (DO_PTEX) { |
v->pv.u2 = tc[0]; |
v->pv.v2 = tc[1]; |
v->pv.q2 = tc[3]; |
} |
else { |
v->v.u2 = tc[0]; |
v->v.v2 = tc[1]; |
} |
} |
if (DO_TEX3) { |
GLfloat *tc = ctx->Current.Texture[3]; |
if (DO_PTEX) { |
v->pv.u3 = tc[0]; |
v->pv.v3 = tc[1]; |
v->pv.q3 = tc[3]; |
} |
else { |
v->v.u3 = tc[0]; |
v->v.v3 = tc[1]; |
} |
} |
} |
static void TAG(interp)( GLcontext *ctx, |
GLfloat t, |
TNL_VERTEX *dst, |
TNL_VERTEX *in, |
TNL_VERTEX *out ) |
{ |
LOCALVARS |
const GLfloat *s = GET_VIEWPORT_MAT(); |
GLfloat w; |
(void)s; |
if (HAVE_HW_DIVIDE) { |
VIEWPORT_X( dst->v.v.x, dst->clip[0] ); |
VIEWPORT_Y( dst->v.v.y, dst->clip[1] ); |
VIEWPORT_Z( dst->v.v.z, dst->clip[2] ); |
w = dstclip[3]; |
} |
else { |
w = 1.0 / dst->clip[3]; |
VIEWPORT_X( dst->v.v.x, dst->clip[0] * w ); |
VIEWPORT_Y( dst->v.v.y, dst->clip[1] * w ); |
VIEWPORT_Z( dst->v.v.z, dst->clip[2] * w ); |
} |
if (HAVE_HW_DIVIDE || DO_TEX0) { |
dst->v.v.w = w; |
INTERP_UB( t, dst->v.ub4[4][0], out->v.ub4[4][0], in->v.ub4[4][0] ); |
INTERP_UB( t, dst->v.ub4[4][1], out->v.ub4[4][1], in->v.ub4[4][1] ); |
INTERP_UB( t, dst->v.ub4[4][2], out->v.ub4[4][2], in->v.ub4[4][2] ); |
INTERP_UB( t, dst->v.ub4[4][3], out->v.ub4[4][3], in->v.ub4[4][3] ); |
if (DO_TEX0) { |
if (DO_PTEX) { |
if (HAVE_PTEX_VERTICES) { |
INTERP_F( t, dst->v.pv.u0, out->v.pv.u0, in->v.pv.u0 ); |
INTERP_F( t, dst->v.pv.v0, out->v.pv.v0, in->v.pv.v0 ); |
INTERP_F( t, dst->v.pv.q0, out->v.pv.q0, in->v.pv.q0 ); |
} else { |
GLfloat wout = out->clip[3]; /* projected clip */ |
GLfloat win = in->clip[3]; /* projected clip */ |
GLfloat qout = out->v.pv.w / wout; |
GLfloat qin = in->v.pv.w / win; |
GLfloat qdst, rqdst; |
ASSERT( !HAVE_HW_DIVIDE ); /* assert win, wout projected clip */ |
INTERP_F( t, dst->v.v.u0, out->v.v.u0 * qout, in->v.v.u0 * qin ); |
INTERP_F( t, dst->v.v.v0, out->v.v.v0 * qout, in->v.v.v0 * qin ); |
INTERP_F( t, qdst, qout, qin ); |
rqdst = 1.0 / qdst; |
dst->v.v.u0 *= rqdst; |
dst->v.v.v0 *= rqdst; |
dst->v.v.w *= rqdst; |
} |
} |
else { |
INTERP_F( t, dst->v.v.u0, out->v.v.u0, in->v.v.u0 ); |
INTERP_F( t, dst->v.v.v0, out->v.v.v0, in->v.v.v0 ); |
} |
} |
if (DO_TEX1) { |
if (DO_PTEX) { |
INTERP_F( t, dst->v.pv.u1, out->v.pv.u1, in->v.pv.u1 ); |
INTERP_F( t, dst->v.pv.v1, out->v.pv.v1, in->v.pv.v1 ); |
INTERP_F( t, dst->v.pv.q1, out->v.pv.q1, in->v.pv.q1 ); |
} else { |
INTERP_F( t, dst->v.v.u1, out->v.v.u1, in->v.v.u1 ); |
INTERP_F( t, dst->v.v.v1, out->v.v.v1, in->v.v.v1 ); |
} |
} |
else if (DO_PTEX) { |
dst->v.pv.q0 = 0.0; /* must be a valid float on radeon */ |
} |
if (DO_TEX2) { |
if (DO_PTEX) { |
INTERP_F( t, dst->v.pv.u2, out->v.pv.u2, in->v.pv.u2 ); |
INTERP_F( t, dst->v.pv.v2, out->v.pv.v2, in->v.pv.v2 ); |
INTERP_F( t, dst->v.pv.q2, out->v.pv.q2, in->v.pv.q2 ); |
} else { |
INTERP_F( t, dst->v.v.u2, out->v.v.u2, in->v.v.u2 ); |
INTERP_F( t, dst->v.v.v2, out->v.v.v2, in->v.v.v2 ); |
} |
} |
if (DO_TEX3) { |
if (DO_PTEX) { |
INTERP_F( t, dst->v.pv.u3, out->v.pv.u3, in->v.pv.u3 ); |
INTERP_F( t, dst->v.pv.v3, out->v.pv.v3, in->v.pv.v3 ); |
INTERP_F( t, dst->v.pv.q3, out->v.pv.q3, in->v.pv.q3 ); |
} else { |
INTERP_F( t, dst->v.v.u3, out->v.v.u3, in->v.v.u3 ); |
INTERP_F( t, dst->v.v.v3, out->v.v.v3, in->v.v.v3 ); |
} |
} |
} else { |
/* 4-dword vertex. Color is in v[3] and there is no oow coordinate. |
*/ |
INTERP_UB( t, dst->v.ub4[3][0], out->v.ub4[3][0], in->v.ub4[3][0] ); |
INTERP_UB( t, dst->v.ub4[3][1], out->v.ub4[3][1], in->v.ub4[3][1] ); |
INTERP_UB( t, dst->v.ub4[3][2], out->v.ub4[3][2], in->v.ub4[3][2] ); |
INTERP_UB( t, dst->v.ub4[3][3], out->v.ub4[3][3], in->v.ub4[3][3] ); |
} |
} |
static __inline void TAG(copy_pv)( GLcontext *ctx, |
TNL_VERTEX *dst, |
TNL_VERTEX *src ) |
{ |
if (DO_TEX0 || DO_TEX1 || !HAVE_TINY_VERTICES) { |
dst->v.v.ui[4] = src->v.v.ui[4]; |
} |
else { |
dst->v.v.ui[3] = src->v.v.ui[3]; |
} |
} |
static void TAG(init)( void ) |
{ |
setup_tab[IND].emit = TAG(emit_vfmt); |
setup_tab[IND].interp = TAG(interp_vfmt); |
} |
#undef IND |
#undef TAG |
/shark/trunk/ports/mesa/src/tnl_dd/imm/t_dd_imm_primtmp.h |
---|
0,0 → 1,571 |
/* $Id: t_dd_imm_primtmp.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keithw@valinux.com> |
* Gareth Hughes <gareth@valinux.com> |
*/ |
/* Template for immediate mode vertices. |
* |
* Probably instantiate once for each vertex format used: |
* - TINY_VERTICES |
* - TEX0_VERTICES |
* - TEX1_VERTICES |
* - PTEX_VERTICES |
* |
* Have to handle TEX->PTEX transition somehow. |
*/ |
#define DBG 0 |
/* ============================================================= |
* GL_POINTS |
*/ |
static void TAG(flush_point_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
if ( !v0->mask ) { |
LOCAL_VARS; |
DRAW_POINT( v0 ); |
} |
} |
/* ============================================================= |
* GL_LINES |
*/ |
static void TAG(flush_line_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_line_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
FLUSH_VERTEX = TAG(flush_line_1); |
ACTIVE_VERTEX = IMM_VERTICES( 1 ); |
} |
static void TAG(flush_line_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
TNL_VERTEX *v1 = v0 - 1; |
ACTIVE_VERTEX = IMM_VERTICES( 0 ); |
FLUSH_VERTEX = TAG(flush_line_0); |
if (FALLBACK_OR_CLIPPING) |
CLIP_OR_DRAW_LINE( ctx, v1, v0 ); |
else |
DRAW_LINE( ctx, v1, v0 ); |
} |
/* ============================================================= |
* GL_LINE_LOOP |
*/ |
static void TAG(flush_line_loop_2)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_line_loop_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_line_loop_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = v0 + 1; |
FLUSH_VERTEX = TAG(flush_line_loop_1); |
} |
#define DRAW_LINELOOP_LINE( a, b ) \ |
if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING) { \ |
CLIP_OR_DRAW_LINE( ctx, a, b ); \ |
} else if (EXTEND_PRIM( 1 )) { \ |
EMIT_VERTEX( b ); \ |
} else { \ |
BEGIN_PRIM( GL_LINE_STRIP, 2 ); \ |
EMIT_VERTEX( a ); \ |
EMIT_VERTEX( b ); \ |
} |
static void TAG(flush_line_loop_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
TNL_VERTEX *v1 = v0 - 1; |
ACTIVE_VERTEX = v1; |
FLUSH_VERTEX = TAG(flush_line_loop_2); |
DRAW_LINELOOP_LINE( v1, v0 ); |
} |
static void TAG(flush_line_loop_2)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
TNL_VERTEX *v1 = v0 + 1; |
ACTIVE_VERTEX = v1; |
FLUSH_VERTEX = TAG(flush_line_loop_1); |
DRAW_LINELOOP_LINE( v1, v0 ); |
} |
static void TAG(end_line_loop)( GLcontext *ctx ) |
{ |
LOCAL_VARS; |
if ( FLUSH_VERTEX != TAG(flush_line_loop_0) ) { |
TNL_VERTEX *v1 = ACTIVE_VERTEX; |
TNL_VERTEX *v0 = IMM_VERTICES( 0 ); |
DRAW_LINELOOP_LINE( v1, v0 ); |
} |
} |
/* ============================================================= |
* GL_LINE_STRIP |
*/ |
static void TAG(flush_line_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_line_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_line_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = v0 + 1; |
FLUSH_VERTEX = TAG(flush_line_strip_0b); |
} |
static void TAG(flush_line_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
TNL_VERTEX *v1 = v0 - 1; |
ACTIVE_VERTEX = v1; |
FLUSH_VERTEX = TAG(flush_line_strip_2); |
if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING) |
CLIP_OR_DRAW_LINE( ctx, v1, v0 ); |
else if (EXTEND_PRIM( 1 )) { |
EMIT_VERTEX( v0 ); |
} else { |
BEGIN_PRIM( GL_LINE_STRIP, 2 ); |
EMIT_VERTEX( v1 ); |
EMIT_VERTEX( v0 ); |
} |
} |
static void TAG(flush_line_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
TNL_VERTEX *v1 = v0 + 1; |
ACTIVE_VERTEX = v1; |
FLUSH_VERTEX = TAG(flush_line_strip_1); |
if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING) |
CLIP_OR_DRAW_LINE( ctx, v1, v0 ); |
else if (EXTEND_PRIM( 1 )) { |
EMIT_VERTEX( v0 ); |
} else { |
BEGIN_PRIM( GL_LINE_STRIP, 2 ); |
EMIT_VERTEX( v1 ); |
EMIT_VERTEX( v0 ); |
} |
} |
/* ============================================================= |
* GL_TRIANGLES |
*/ |
static void TAG(flush_triangle_2)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_triangle_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_triangle_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" ); |
ACTIVE_VERTEX = v0 + 1; |
FLUSH_VERTEX = TAG(flush_triangle_1); |
BEGIN_PRIM( GL_TRIANGLES, 0 ); |
} |
static void TAG(flush_triangle_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" ); |
ACTIVE_VERTEX = v0 + 1; |
FLUSH_VERTEX = TAG(flush_triangle_2); |
} |
static void TAG(flush_triangle_2)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
TNL_VERTEX *v2 = v0 - 2; |
TNL_VERTEX *v1 = v0 - 1; |
if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" ); |
ACTIVE_VERTEX = v2; |
FLUSH_VERTEX = TAG(flush_triangle_0); |
/* nothing gained by trying to emit as hw primitives -- that |
* happens normally in this case. |
*/ |
if (FALLBACK_OR_CLIPPING) |
CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 ); |
else |
DRAW_TRI( ctx, v2, v1, v0 ); |
} |
/* ============================================================= |
* GL_TRIANGLE_STRIP |
*/ |
static void TAG(flush_tri_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_tri_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_tri_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_tri_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = IMM_VERTICES( 1 ); |
FLUSH_VERTEX = TAG(flush_tri_strip_1); |
} |
static void TAG(flush_tri_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = IMM_VERTICES( 2 ); |
FLUSH_VERTEX = TAG(flush_tri_strip_2); |
} |
#define DO_TRISTRIP_TRI( vert0, vert1 ) \ |
if (!HAVE_TRI_STRIP || FALLBACK_OR_CLIPPING) { \ |
TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ |
TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ |
TAG(draw_tri)( ctx, v2, v1, v0 ); \ |
} else if (EXTEND_PRIM( 1 )) { \ |
EMIT_VERTEX( v0 ); \ |
} else { \ |
TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ |
TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ |
BEGIN_PRIM( GL_TRIANGLE_STRIP, 3 ); \ |
EMIT_VERTEX( v2 ); \ |
EMIT_VERTEX( v1 ); \ |
EMIT_VERTEX( v0 ); \ |
} |
static void TAG(flush_tri_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
FLUSH_VERTEX = TAG(flush_tri_strip_3); |
ACTIVE_VERTEX = IMM_VERTICES( 3 ); |
DO_TRISTRIP_TRI( 0, 1 ); |
} |
static void TAG(flush_tri_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
FLUSH_VERTEX = TAG(flush_tri_strip_4); |
ACTIVE_VERTEX = IMM_VERTICES( 0 ); |
DO_TRISTRIP_TRI( 1, 2 ); |
} |
static void TAG(flush_tri_strip_4)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
FLUSH_VERTEX = TAG(flush_tri_strip_5); |
ACTIVE_VERTEX = IMM_VERTICES( 1 ); |
DO_TRISTRIP_TRI( 2, 3 ); |
} |
static void TAG(flush_tri_strip_5)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
FLUSH_VERTEX = TAG(flush_tri_strip_2); |
ACTIVE_VERTEX = IMM_VERTICES( 2 ); |
DO_TRISTRIP_TRI( 0, 3 ); |
} |
/* ============================================================= |
* GL_TRIANGLE_FAN |
*/ |
static void TAG(flush_tri_fan_2)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_tri_fan_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_tri_fan_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = v0 + 1; |
FLUSH_VERTEX = TAG(flush_tri_fan_1); |
} |
static void TAG(flush_tri_fan_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = v0 + 1; |
FLUSH_VERTEX = TAG(flush_tri_fan_2); |
} |
#define DO_TRIFAN_TRI( vert0, vert1 ) \ |
if (!HAVE_TRI_FAN || FALLBACK_OR_CLIPPING) { \ |
TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ |
TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ |
TAG(draw_tri)( ctx, v2, v1, v0 ); \ |
} else if (EXTEND_PRIM( 1 )) { \ |
EMIT_VERTEX( v0 ); \ |
} else { \ |
TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ |
TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ |
BEGIN_PRIM( GL_TRIANGLE_FAN, 3 ); \ |
EMIT_VERTEX( v2 ); \ |
EMIT_VERTEX( v1 ); \ |
EMIT_VERTEX( v0 ); \ |
} |
static void TAG(flush_tri_fan_2)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = IMM_VERTICES( 1 ); |
FLUSH_VERTEX = TAG(flush_tri_fan_3 ); |
DO_TRIFAN_TRI( 0, 1 ); |
} |
static void TAG(flush_tri_fan_3)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = IMM_VERTICES( 2 ); |
FLUSH_VERTEX = TAG(flush_tri_fan_2 ); |
DO_TRIFAN_TRI( 0, 2 ); |
} |
/* ============================================================= |
* GL_QUADS |
*/ |
static void TAG(flush_quad_3)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_quad_2)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_quad_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_quad_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
IMM_VERTEX( v0 ) = v0 + 1; |
FLUSH_VERTEX = TAG(flush_quad_1); |
} |
static void TAG(flush_quad_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
IMM_VERTEX( v0 ) = v0 + 1; |
FLUSH_VERTEX = TAG(flush_quad_2); |
} |
static void TAG(flush_quad_2)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
IMM_VERTEX( v0 ) = v0 + 1; |
FLUSH_VERTEX = TAG(flush_quad_3); |
} |
static void TAG(flush_quad_3)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
TNL_VERTEX *v3 = v0 - 3; |
TNL_VERTEX *v2 = v0 - 2; |
TNL_VERTEX *v1 = v0 - 1; |
IMM_VERTEX( v0 ) = v3; |
FLUSH_VERTEX = TAG(flush_quad_0); |
if (!HAVE_HW_QUADS || FALLBACK_OR_CLIPPING) { |
CLIP_OR_DRAW_TRI( ctx, v3, v2, v0 ); |
CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 ); |
} else { |
EXTEND_PRIM_NF( GL_QUADS, 4 ); |
EMIT_VERTEX( v3 ); |
EMIT_VERTEX( v2 ); |
EMIT_VERTEX( v1 ); |
EMIT_VERTEX( v0 ); |
} |
} |
/* ============================================================= |
* GL_QUAD_STRIP |
*/ |
static void TAG(flush_quad_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_quad_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_quad_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_quad_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
IMM_VERTEX( v3 ) = v0; |
IMM_VERTEX( v0 ) = v0 + 1; |
FLUSH_VERTEX = TAG(flush_quad_strip_1); |
} |
static void TAG(flush_quad_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
IMM_VERTEX( v2 ) = v0; |
IMM_VERTEX( v0 ) = v0 + 1; |
FLUSH_VERTEX = TAG(flush_quad_strip_2); |
} |
static void TAG(flush_quad_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
IMM_VERTEX( v1 ) = v0; |
IMM_VERTEX( v0 ) = v0 + 1; |
FLUSH_VERTEX = TAG(flush_quad_strip_3); |
} |
static void TAG(flush_quad_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
TNL_VERTEX *v3 = IMM_VERTEX( v3 ); |
TNL_VERTEX *v2 = IMM_VERTEX( v2 ); |
TNL_VERTEX *v1 = IMM_VERTEX( v1 ); |
IMM_VERTEX( v0 ) = v3; |
IMM_VERTEX( v2 ) = v0; |
IMM_VERTEX( v3 ) = v1; |
FLUSH_VERTEX = TAG(flush_quad_strip_2); |
if (FALLBACK_OR_CLIPPING) { |
CLIP_OR_DRAW_TRI( ctx, v3, v2, v0 ); |
CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 ); |
} else { |
DRAW_TRI( ctx, v3, v2, v0 ); |
DRAW_TRI( ctx, v2, v1, v0 ); |
} |
} |
/* ============================================================= |
* GL_POLYGON |
*/ |
static void TAG(flush_poly_2)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_poly_1)( GLcontext *ctx, TNL_VERTEX *v0 ); |
static void TAG(flush_poly_0)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = IMM_VERTICES( 1 ); |
FLUSH_VERTEX = TAG(flush_poly_1); |
} |
static void TAG(flush_poly_1)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = IMM_VERTICES( 2 ); |
FLUSH_VERTEX = TAG(flush_poly_2); |
} |
#define DO_POLY_TRI( vert0, vert1 ) \ |
if (!HAVE_POLYGONS || FALLBACK_OR_CLIPPING) { \ |
TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ |
TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ |
TAG(draw_tri)( ctx, v1, v0, v2 ); \ |
} else if (EXTEND_PRIM( 1 )) { \ |
EMIT_VERTEX( v0 ); \ |
} else { \ |
TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \ |
TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \ |
BEGIN_PRIM( GL_POLYGON, 3 ); \ |
EMIT_VERTEX( v2 ); \ |
EMIT_VERTEX( v1 ); \ |
EMIT_VERTEX( v0 ); \ |
} |
static void TAG(flush_poly_2)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = IMM_VERTICES( 1 ); |
FLUSH_VERTEX = TAG(flush_poly_3); |
DO_POLY_TRI( 0, 1 ); |
} |
static void TAG(flush_poly_3)( GLcontext *ctx, TNL_VERTEX *v0 ) |
{ |
LOCAL_VARS; |
ACTIVE_VERTEX = IMM_VERTICES( 2 ); |
FLUSH_VERTEX = TAG(flush_poly_2); |
DO_POLY_TRI( 0, 2 ); |
} |
void (*TAG(flush_tab)[GL_POLYGON+1])( GLcontext *, TNL_VERTEX * ) = |
{ |
TAG(flush_point), |
TAG(flush_line_0), |
TAG(flush_line_loop_0), |
TAG(flush_line_strip_0), |
TAG(flush_triangle_0), |
TAG(flush_tri_strip_0), |
TAG(flush_tri_fan_0), |
TAG(flush_quad_0), |
TAG(flush_quad_strip_0), |
TAG(flush_poly_0), |
}; |
#ifndef PRESERVE_PRIM_DEFS |
#undef LOCAL_VARS |
#undef GET_INTERP_FUNC |
#undef IMM_VERTEX |
#undef IMM_VERTICES |
#undef FLUSH_VERTEX |
#endif |
#undef PRESERVE_PRIM_DEFS |
#undef EXTEND_PRIM |
#undef EMIT_VERTEX |
#undef EMIT_VERTEX_TRI |
#undef EMIT_VERTEX_LINE |
#undef EMIT_VERTEX_POINT |
#undef TAG |
/shark/trunk/ports/mesa/src/tnl_dd/imm/t_dd_imm_capi.h |
---|
0,0 → 1,420 |
/* $Id: t_dd_imm_capi.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Gareth Hughes <gareth@valinux.com> |
*/ |
/* Template for immediate mode color functions. |
* |
* FIXME: Floating-point color versions of these... |
*/ |
static void TAG(Color3f)( GLfloat r, GLfloat g, GLfloat b ) |
{ |
GET_CURRENT; |
#ifdef COLOR_IS_FLOAT |
CURRENT_COLOR( RCOMP ) = CLAMP(r, 0.0f, 1.0f); |
CURRENT_COLOR( GCOMP ) = CLAMP(g, 0.0f, 1.0f); |
CURRENT_COLOR( BCOMP ) = CLAMP(b, 0.0f, 1.0f); |
CURRENT_COLOR( ACOMP ) = 1.0f; |
#else |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), r ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), g ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), b ); |
CURRENT_COLOR( ACOMP ) = 255; |
#endif |
} |
static void TAG(Color3fv)( const GLfloat *v ) |
{ |
GET_CURRENT; |
#ifdef COLOR_IS_FLOAT |
CURRENT_COLOR( RCOMP ) = CLAMP(v[0], 0.0f, 1.0f); |
CURRENT_COLOR( GCOMP ) = CLAMP(v[1], 0.0f, 1.0f); |
CURRENT_COLOR( BCOMP ) = CLAMP(v[2], 0.0f, 1.0f); |
CURRENT_COLOR( ACOMP ) = 1.0f; |
#else |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), v[0] ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), v[1] ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), v[2] ); |
CURRENT_COLOR( ACOMP ) = 255; |
#endif |
} |
static void TAG(Color3ub)( GLubyte r, GLubyte g, GLubyte b ) |
{ |
GET_CURRENT; |
#ifdef COLOR_IS_FLOAT |
CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( r ); |
CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( g ); |
CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( b ); |
CURRENT_COLOR( ACOMP ) = 1.0f; |
#else |
CURRENT_COLOR( RCOMP ) = r; |
CURRENT_COLOR( GCOMP ) = g; |
CURRENT_COLOR( BCOMP ) = b; |
CURRENT_COLOR( ACOMP ) = 255; |
#endif |
} |
static void TAG(Color3ubv)( const GLubyte *v ) |
{ |
GET_CURRENT; |
#ifdef COLOR_IS_FLOAT |
CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( v[0] ); |
CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( v[1] ); |
CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( v[2] ); |
CURRENT_COLOR( ACOMP ) = 1.0f; |
#else |
CURRENT_COLOR( RCOMP ) = v[0]; |
CURRENT_COLOR( GCOMP ) = v[1]; |
CURRENT_COLOR( BCOMP ) = v[2]; |
CURRENT_COLOR( ACOMP ) = 255; |
#endif |
} |
static void TAG(Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) |
{ |
GET_CURRENT; |
#ifdef COLOR_IS_FLOAT |
CURRENT_COLOR( RCOMP ) = CLAMP(r, 0.0f, 1.0f); |
CURRENT_COLOR( GCOMP ) = CLAMP(g, 0.0f, 1.0f); |
CURRENT_COLOR( BCOMP ) = CLAMP(b, 0.0f, 1.0f); |
CURRENT_COLOR( ACOMP ) = CLAMP(a, 0.0f, 1.0f); |
#else |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), r ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), g ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), b ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( ACOMP ), a ); |
#endif |
} |
static void TAG(Color4fv)( const GLfloat *v ) |
{ |
GET_CURRENT; |
#ifdef COLOR_IS_FLOAT |
CURRENT_COLOR( RCOMP ) = CLAMP(v[0], 0.0f, 1.0f); |
CURRENT_COLOR( GCOMP ) = CLAMP(v[1], 0.0f, 1.0f); |
CURRENT_COLOR( BCOMP ) = CLAMP(v[2], 0.0f, 1.0f); |
CURRENT_COLOR( ACOMP ) = CLAMP(v[3], 0.0f, 1.0f); |
#else |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), v[0] ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), v[1] ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), v[2] ); |
UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( ACOMP ), v[3] ); |
#endif |
} |
static void TAG(Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) |
{ |
GET_CURRENT; |
#ifdef COLOR_IS_FLOAT |
CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( r ); |
CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( g ); |
CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( b ); |
CURRENT_COLOR( ACOMP ) = UBYTE_TO_FLOAT( a ); |
#else |
CURRENT_COLOR( RCOMP ) = r; |
CURRENT_COLOR( GCOMP ) = g; |
CURRENT_COLOR( BCOMP ) = b; |
CURRENT_COLOR( ACOMP ) = a; |
#endif |
} |
static void TAG(Color4ubv)( const GLubyte *v ) |
{ |
GET_CURRENT; |
#ifdef COLOR_IS_FLOAT |
CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( v[0] ); |
CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( v[1] ); |
CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( v[2] ); |
CURRENT_COLOR( ACOMP ) = UBYTE_TO_FLOAT( v[3] ); |
#else |
CURRENT_COLOR( RCOMP ) = v[0]; |
CURRENT_COLOR( GCOMP ) = v[1]; |
CURRENT_COLOR( BCOMP ) = v[2]; |
CURRENT_COLOR( ACOMP ) = v[3]; |
#endif |
} |
static void TAG(ColorMaterial3f)( GLfloat r, GLfloat g, GLfloat b ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
GLfloat *color = ctx->Current.Color; |
color[0] = r; |
color[1] = g; |
color[2] = b; |
color[3] = 1.0; |
_mesa_update_color_material( ctx, color ); |
RECALC_BASE_COLOR( ctx ); |
} |
static void TAG(ColorMaterial3fv)( const GLfloat *v ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
GLfloat *color = ctx->Current.Color; |
color[0] = v[0]; |
color[1] = v[1]; |
color[2] = v[2]; |
color[3] = 1.0; |
_mesa_update_color_material( ctx, color ); |
RECALC_BASE_COLOR( ctx ); |
} |
static void TAG(ColorMaterial3ub)( GLubyte r, GLubyte g, GLubyte b ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
GLfloat *color = ctx->Current.Color; |
color[0] = UBYTE_TO_FLOAT( r ); |
color[1] = UBYTE_TO_FLOAT( g ); |
color[2] = UBYTE_TO_FLOAT( b ); |
color[3] = 1.0; |
_mesa_update_color_material( ctx, color ); |
RECALC_BASE_COLOR( ctx ); |
} |
static void TAG(ColorMaterial3ubv)( const GLubyte *v ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
GLfloat *color = ctx->Current.Color; |
color[0] = UBYTE_TO_FLOAT( v[0] ); |
color[1] = UBYTE_TO_FLOAT( v[1] ); |
color[2] = UBYTE_TO_FLOAT( v[2] ); |
color[3] = 1.0; |
_mesa_update_color_material( ctx, color ); |
RECALC_BASE_COLOR( ctx ); |
} |
static void TAG(ColorMaterial4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
GLfloat *color = ctx->Current.Color; |
color[0] = r; |
color[1] = g; |
color[2] = b; |
color[3] = a; |
_mesa_update_color_material( ctx, color ); |
RECALC_BASE_COLOR( ctx ); |
} |
static void TAG(ColorMaterial4fv)( const GLfloat *v ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
GLfloat *color = ctx->Current.Color; |
color[0] = v[0]; |
color[1] = v[1]; |
color[2] = v[2]; |
color[3] = v[3]; |
_mesa_update_color_material( ctx, color ); |
RECALC_BASE_COLOR( ctx ); |
} |
static void TAG(ColorMaterial4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
GLfloat *color = ctx->Current.Color; |
color[0] = UBYTE_TO_FLOAT( r ); |
color[1] = UBYTE_TO_FLOAT( g ); |
color[2] = UBYTE_TO_FLOAT( b ); |
color[3] = UBYTE_TO_FLOAT( a ); |
_mesa_update_color_material( ctx, color ); |
RECALC_BASE_COLOR( ctx ); |
} |
static void TAG(ColorMaterial4ubv)( const GLubyte *v ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
GLfloat *color = ctx->Current.Color; |
color[0] = UBYTE_TO_FLOAT( v[0] ); |
color[1] = UBYTE_TO_FLOAT( v[1] ); |
color[2] = UBYTE_TO_FLOAT( v[2] ); |
color[3] = UBYTE_TO_FLOAT( v[3] ); |
_mesa_update_color_material( ctx, color ); |
RECALC_BASE_COLOR( ctx ); |
} |
/* ============================================================= |
* Color chooser functions: |
*/ |
static void TAG(choose_Color3f)( GLfloat r, GLfloat g, GLfloat b ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
if ( ctx->Light.Enabled ) { |
if ( ctx->Light.ColorMaterialEnabled ) { |
ctx->Exec->Color3f = TAG(ColorMaterial3f); |
} else { |
ctx->Exec->Color3f = _mesa_noop_Color3f; |
} |
} else { |
ctx->Exec->Color3f = TAG(Color3f); |
} |
glColor3f( r, g, b ); |
} |
static void TAG(choose_Color3fv)( const GLfloat *v ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
if ( ctx->Light.Enabled ) { |
if ( ctx->Light.ColorMaterialEnabled ) { |
ctx->Exec->Color3fv = TAG(ColorMaterial3fv); |
} else { |
ctx->Exec->Color3fv = _mesa_noop_Color3fv; |
} |
} else { |
ctx->Exec->Color3fv = TAG(Color3fv); |
} |
glColor3fv( v ); |
} |
static void TAG(choose_Color3ub)( GLubyte r, GLubyte g, GLubyte b ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
if ( ctx->Light.Enabled ) { |
if ( ctx->Light.ColorMaterialEnabled ) { |
ctx->Exec->Color3ub = TAG(ColorMaterial3ub); |
} else { |
ctx->Exec->Color3ub = _mesa_noop_Color3ub; |
} |
} else { |
ctx->Exec->Color3ub = TAG(Color3ub); |
} |
glColor3ub( r, g, b ); |
} |
static void TAG(choose_Color3ubv)( const GLubyte *v ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
if ( ctx->Light.Enabled ) { |
if ( ctx->Light.ColorMaterialEnabled ) { |
ctx->Exec->Color3ubv = TAG(ColorMaterial3ubv); |
} else { |
ctx->Exec->Color3ubv = _mesa_noop_Color3ubv; |
} |
} else { |
ctx->Exec->Color3ubv = TAG(Color3ubv); |
} |
glColor3ubv( v ); |
} |
static void TAG(choose_Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
if ( ctx->Light.Enabled ) { |
if ( ctx->Light.ColorMaterialEnabled ) { |
ctx->Exec->Color4f = TAG(ColorMaterial4f); |
} else { |
ctx->Exec->Color4f = _mesa_noop_Color4f; |
} |
} else { |
ctx->Exec->Color4f = TAG(Color4f); |
} |
glColor4f( r, g, b, a ); |
} |
static void TAG(choose_Color4fv)( const GLfloat *v ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
if ( ctx->Light.Enabled ) { |
if ( ctx->Light.ColorMaterialEnabled ) { |
ctx->Exec->Color4fv = TAG(ColorMaterial4fv); |
} else { |
ctx->Exec->Color4fv = _mesa_noop_Color4fv; |
} |
} else { |
ctx->Exec->Color4fv = TAG(Color4fv); |
} |
glColor4fv( v ); |
} |
static void TAG(choose_Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
if ( ctx->Light.Enabled ) { |
if ( ctx->Light.ColorMaterialEnabled ) { |
ctx->Exec->Color4ub = TAG(ColorMaterial4ub); |
} else { |
ctx->Exec->Color4ub = _mesa_noop_Color4ub; |
} |
} else { |
ctx->Exec->Color4ub = TAG(Color4ub); |
} |
glColor4ub( r, g, b, a ); |
} |
static void TAG(choose_Color4ubv)( const GLubyte *v ) |
{ |
GET_CURRENT_CONTEXT(ctx); |
if ( ctx->Light.Enabled ) { |
if ( ctx->Light.ColorMaterialEnabled ) { |
ctx->Exec->Color4ubv = TAG(ColorMaterial4ubv); |
} else { |
ctx->Exec->Color4ubv = _mesa_noop_Color4ubv; |
} |
} else { |
ctx->Exec->Color4ubv = TAG(Color4ubv); |
} |
glColor4ubv( v ); |
} |
#undef GET_CURRENT |
#undef CURRENT_COLOR |
#undef CURRENT_SPECULAR |
#undef COLOR_IS_FLOAT |
#undef RECALC_BASE_COLOR |
#undef TAG |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_vb.c |
---|
0,0 → 1,392 |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
#include "math/m_translate.h" |
#if (HAVE_HW_VIEWPORT) |
#define UNVIEWPORT_VARS |
#define UNVIEWPORT_X(x) x |
#define UNVIEWPORT_Y(x) x |
#define UNVIEWPORT_Z(x) x |
#endif |
#ifndef LOCALVARS |
#define LOCALVARS |
#endif |
#ifndef CHECK_HW_DIVIDE |
#define CHECK_HW_DIVIDE 1 |
#endif |
/* These don't need to be duplicated, but there's currently nowhere |
* really convenient to put them. Need to build some actual .o files in |
* this directory? |
*/ |
static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc ) |
{ |
LOCALVARS |
GLubyte *verts = GET_VERTEX_STORE(); |
GLuint shift = GET_VERTEX_STRIDE_SHIFT(); |
GLuint *dst = (GLuint *)(verts + (edst << shift)); |
GLuint *src = (GLuint *)(verts + (esrc << shift)); |
dst[4] = src[4]; |
dst[5] = src[5]; |
} |
static void copy_pv_rgba4( GLcontext *ctx, GLuint edst, GLuint esrc ) |
{ |
LOCALVARS |
GLubyte *verts = GET_VERTEX_STORE(); |
GLuint shift = GET_VERTEX_STRIDE_SHIFT(); |
GLuint *dst = (GLuint *)(verts + (edst << shift)); |
GLuint *src = (GLuint *)(verts + (esrc << shift)); |
dst[4] = src[4]; |
} |
static void copy_pv_rgba3( GLcontext *ctx, GLuint edst, GLuint esrc ) |
{ |
LOCALVARS |
GLubyte *verts = GET_VERTEX_STORE(); |
GLuint shift = GET_VERTEX_STRIDE_SHIFT(); |
GLuint *dst = (GLuint *)(verts + (edst << shift)); |
GLuint *src = (GLuint *)(verts + (esrc << shift)); |
dst[3] = src[3]; |
} |
void TAG(translate_vertex)(GLcontext *ctx, |
const VERTEX *src, |
SWvertex *dst) |
{ |
LOCALVARS |
GLuint format = GET_VERTEX_FORMAT(); |
GLfloat *s = ctx->Viewport._WindowMap.m; |
UNVIEWPORT_VARS; |
if (format == TINY_VERTEX_FORMAT) { |
if (HAVE_HW_VIEWPORT) { |
dst->win[0] = s[0] * src->v.x + s[12]; |
dst->win[1] = s[5] * src->v.y + s[13]; |
dst->win[2] = s[10] * src->v.z + s[14]; |
dst->win[3] = 1.0; |
} else { |
dst->win[0] = UNVIEWPORT_X( src->v.x ); |
dst->win[1] = UNVIEWPORT_Y( src->v.y ); |
dst->win[2] = UNVIEWPORT_Z( src->v.z ); |
dst->win[3] = 1.0; |
} |
dst->color[0] = src->tv.color.red; |
dst->color[1] = src->tv.color.green; |
dst->color[2] = src->tv.color.blue; |
dst->color[3] = src->tv.color.alpha; |
} |
else { |
if (HAVE_HW_VIEWPORT) { |
if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { |
GLfloat oow = 1.0 / src->v.w; |
dst->win[0] = s[0] * src->v.x * oow + s[12]; |
dst->win[1] = s[5] * src->v.y * oow + s[13]; |
dst->win[2] = s[10] * src->v.z * oow + s[14]; |
dst->win[3] = oow; |
} else { |
dst->win[0] = s[0] * src->v.x + s[12]; |
dst->win[1] = s[5] * src->v.y + s[13]; |
dst->win[2] = s[10] * src->v.z + s[14]; |
dst->win[3] = src->v.w; |
} |
} else { |
dst->win[0] = UNVIEWPORT_X( src->v.x ); |
dst->win[1] = UNVIEWPORT_Y( src->v.y ); |
dst->win[2] = UNVIEWPORT_Z( src->v.z ); |
dst->win[3] = src->v.w; |
} |
dst->color[0] = src->v.color.red; |
dst->color[1] = src->v.color.green; |
dst->color[2] = src->v.color.blue; |
dst->color[3] = src->v.color.alpha; |
dst->specular[0] = src->v.specular.red; |
dst->specular[1] = src->v.specular.green; |
dst->specular[2] = src->v.specular.blue; |
dst->fog = src->v.specular.alpha/255.0; |
if (HAVE_PTEX_VERTICES && |
((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) || |
(format == PROJ_TEX1_VERTEX_FORMAT))) { |
dst->texcoord[0][0] = src->pv.u0; |
dst->texcoord[0][1] = src->pv.v0; |
dst->texcoord[0][3] = src->pv.q0; |
dst->texcoord[1][0] = src->pv.u1; |
dst->texcoord[1][1] = src->pv.v1; |
dst->texcoord[1][3] = src->pv.q1; |
if (HAVE_TEX2_VERTICES) { |
dst->texcoord[2][0] = src->pv.u2; |
dst->texcoord[2][1] = src->pv.v2; |
dst->texcoord[2][3] = src->pv.q2; |
} |
if (HAVE_TEX3_VERTICES) { |
dst->texcoord[3][0] = src->pv.u3; |
dst->texcoord[3][1] = src->pv.v3; |
dst->texcoord[3][3] = src->pv.q3; |
} |
} |
else { |
dst->texcoord[0][0] = src->v.u0; |
dst->texcoord[0][1] = src->v.v0; |
dst->texcoord[0][3] = 1.0; |
dst->texcoord[1][0] = src->v.u1; |
dst->texcoord[1][1] = src->v.v1; |
dst->texcoord[1][3] = 1.0; |
if (HAVE_TEX2_VERTICES) { |
dst->texcoord[2][0] = src->v.u2; |
dst->texcoord[2][1] = src->v.v2; |
dst->texcoord[2][3] = 1.0; |
} |
if (HAVE_TEX3_VERTICES) { |
dst->texcoord[3][0] = src->v.u3; |
dst->texcoord[3][1] = src->v.v3; |
dst->texcoord[3][3] = 1.0; |
} |
} |
} |
dst->pointSize = ctx->Point._Size; |
} |
void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v ) |
{ |
LOCALVARS |
GLuint format = GET_VERTEX_FORMAT(); |
fprintf(stderr, "(%x) ", format); |
switch (format) { |
#if HAVE_TINY_VERTICES |
case TINY_VERTEX_FORMAT: |
fprintf(stderr, "xyz %.4f,%.4f,%.4f rgba %x:%x:%x:%x\n", |
v->v.x, v->v.y, v->v.z, |
v->tv.color.red, |
v->tv.color.green, |
v->tv.color.blue, |
v->tv.color.alpha); |
break; |
#endif |
#if HAVE_NOTEX_VERTICES |
case NOTEX_VERTEX_FORMAT: |
fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x spec %x:%x:%x:%x\n", |
v->v.x, v->v.y, v->v.z, v->v.w, |
v->v.color.red, |
v->v.color.green, |
v->v.color.blue, |
v->v.color.alpha, |
v->v.specular.red, |
v->v.specular.green, |
v->v.specular.blue, |
v->v.specular.alpha); |
break; |
#endif |
#if HAVE_TEX0_VERTICES |
case TEX0_VERTEX_FORMAT: |
fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f\n", |
v->v.x, v->v.y, v->v.z, v->v.w, |
v->v.color.red, |
v->v.color.green, |
v->v.color.blue, |
v->v.color.alpha, |
v->v.u0, |
v->v.v0); |
break; |
#endif |
#if HAVE_TEX1_VERTICES |
case TEX1_VERTEX_FORMAT: |
fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f st %.4f,%.4f\n", |
v->v.x, v->v.y, v->v.z, v->v.w, |
v->v.color.red, |
v->v.color.green, |
v->v.color.blue, |
v->v.color.alpha, |
v->v.u0, |
v->v.v0, |
v->v.u1, |
v->v.u2); |
break; |
#endif |
#if HAVE_PTEX_VERTICES |
case PROJ_TEX1_VERTEX_FORMAT: |
fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x stq %.4f,%.4f,%.4f stq %.4f,%.4f,%.4f\n", |
v->v.x, v->v.y, v->v.z, v->v.w, |
v->v.color.red, |
v->v.color.green, |
v->v.color.blue, |
v->v.color.alpha, |
v->pv.u0, |
v->pv.v0, |
v->pv.q0, |
v->pv.u1, |
v->pv.v1, |
v->pv.q1); |
break; |
#endif |
default: |
fprintf(stderr, "???\n"); |
break; |
} |
fprintf(stderr, "\n"); |
} |
static void do_import( struct vertex_buffer *VB, |
struct gl_client_array *to, |
struct gl_client_array *from ) |
{ |
GLuint count = VB->Count; |
if (!to->Ptr) { |
to->Ptr = ALIGN_MALLOC( VB->Size * 4 * sizeof(GLubyte), 32 ); |
to->Type = GL_UNSIGNED_BYTE; |
} |
/* No need to transform the same value 3000 times. |
*/ |
if (!from->StrideB) { |
to->StrideB = 0; |
count = 1; |
} |
else |
to->StrideB = 4 * sizeof(GLubyte); |
_math_trans_4ub( (GLubyte (*)[4]) to->Ptr, |
from->Ptr, |
from->StrideB, |
from->Type, |
from->Size, |
0, |
count); |
} |
#ifndef IMPORT_QUALIFIER |
#define IMPORT_QUALIFIER static |
#endif |
IMPORT_QUALIFIER void TAG(import_float_colors)( GLcontext *ctx ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
struct gl_client_array *to = GET_UBYTE_COLOR_STORE(); |
do_import( VB, to, VB->ColorPtr[0] ); |
VB->ColorPtr[0] = to; |
} |
IMPORT_QUALIFIER void TAG(import_float_spec_colors)( GLcontext *ctx ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
struct gl_client_array *to = GET_UBYTE_SPEC_COLOR_STORE(); |
do_import( VB, to, VB->SecondaryColorPtr[0] ); |
VB->SecondaryColorPtr[0] = to; |
} |
/* Interpolate the elements of the VB not included in typical hardware |
* vertices. |
* |
* NOTE: All these arrays are guarenteed by tnl to be writeable and |
* have good stride. |
*/ |
#ifndef INTERP_QUALIFIER |
#define INTERP_QUALIFIER static |
#endif |
#define GET_COLOR(ptr, idx) (((GLchan (*)[4])((ptr)->Ptr))[idx]) |
INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx, |
GLfloat t, |
GLuint dst, GLuint out, GLuint in, |
GLboolean force_boundary ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
if (VB->ColorPtr[1]) { |
INTERP_4CHAN( t, |
GET_COLOR(VB->ColorPtr[1], dst), |
GET_COLOR(VB->ColorPtr[1], out), |
GET_COLOR(VB->ColorPtr[1], in) ); |
if (VB->SecondaryColorPtr[1]) { |
INTERP_3CHAN( t, |
GET_COLOR(VB->SecondaryColorPtr[1], dst), |
GET_COLOR(VB->SecondaryColorPtr[1], out), |
GET_COLOR(VB->SecondaryColorPtr[1], in) ); |
} |
} |
if (VB->EdgeFlag) { |
VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary; |
} |
INTERP_VERTEX(ctx, t, dst, out, in, force_boundary); |
} |
INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx, |
GLuint dst, GLuint src ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
if (VB->ColorPtr[1]) { |
COPY_CHAN4( GET_COLOR(VB->ColorPtr[1], dst), |
GET_COLOR(VB->ColorPtr[1], src) ); |
if (VB->SecondaryColorPtr[1]) { |
COPY_CHAN4( GET_COLOR(VB->SecondaryColorPtr[1], dst), |
GET_COLOR(VB->SecondaryColorPtr[1], src) ); |
} |
} |
COPY_PV_VERTEX(ctx, dst, src); |
} |
#undef INTERP_QUALIFIER |
#undef IMPORT_QUALIFIER |
#undef GET_COLOR |
#undef IND |
#undef TAG |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_unfilled.h |
---|
0,0 → 1,213 |
/* $Id: t_dd_unfilled.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
#if HAVE_RGBA |
#define VERT_SET_IND( v, c ) |
#define VERT_COPY_IND( v0, v1 ) |
#define VERT_SAVE_IND( idx ) |
#define VERT_RESTORE_IND( idx ) |
#endif |
#if !HAVE_SPEC |
#define VERT_SET_SPEC( v, c ) |
#define VERT_COPY_SPEC( v0, v1 ) |
#define VERT_SAVE_SPEC( idx ) |
#define VERT_RESTORE_SPEC( idx ) |
#endif |
static void TAG(unfilled_tri)( GLcontext *ctx, |
GLenum mode, |
GLuint e0, GLuint e1, GLuint e2 ) |
{ |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
GLubyte *ef = VB->EdgeFlag; |
VERTEX *v[3]; |
LOCAL_VARS(3); |
v[0] = (VERTEX *)GET_VERTEX(e0); |
v[1] = (VERTEX *)GET_VERTEX(e1); |
v[2] = (VERTEX *)GET_VERTEX(e2); |
if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) { |
if (HAVE_RGBA) { |
VERT_SAVE_RGBA(0); |
VERT_SAVE_RGBA(1); |
VERT_COPY_RGBA(v[0], v[2]); |
VERT_COPY_RGBA(v[1], v[2]); |
if (HAVE_SPEC) { |
VERT_SAVE_SPEC(0); |
VERT_SAVE_SPEC(1); |
VERT_COPY_SPEC(v[0], v[2]); |
VERT_COPY_SPEC(v[1], v[2]); |
} |
} else { |
VERT_SAVE_IND(0); |
VERT_SAVE_IND(1); |
VERT_COPY_IND(v[0], v[2]); |
VERT_COPY_IND(v[1], v[2]); |
} |
} |
/* fprintf(stderr, "%s %s %d %d %d\n", __FUNCTION__, */ |
/* _mesa_lookup_enum_by_nr( mode ), */ |
/* ef[e0], ef[e1], ef[e2]); */ |
if (mode == GL_POINT) { |
RASTERIZE(GL_POINTS); |
if (ef[e0]) POINT( v[0] ); |
if (ef[e1]) POINT( v[1] ); |
if (ef[e2]) POINT( v[2] ); |
} |
else { |
RASTERIZE(GL_LINES); |
if (RENDER_PRIMITIVE == GL_POLYGON) { |
if (ef[e2]) LINE( v[2], v[0] ); |
if (ef[e0]) LINE( v[0], v[1] ); |
if (ef[e1]) LINE( v[1], v[2] ); |
} |
else { |
if (ef[e0]) LINE( v[0], v[1] ); |
if (ef[e1]) LINE( v[1], v[2] ); |
if (ef[e2]) LINE( v[2], v[0] ); |
} |
} |
if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) { |
if (HAVE_RGBA) { |
VERT_RESTORE_RGBA(0); |
VERT_RESTORE_RGBA(1); |
if (HAVE_SPEC) { |
VERT_RESTORE_SPEC(0); |
VERT_RESTORE_SPEC(1); |
} |
} else { |
VERT_RESTORE_IND(0); |
VERT_RESTORE_IND(1); |
} |
} |
} |
static void TAG(unfilled_quad)( GLcontext *ctx, |
GLenum mode, |
GLuint e0, GLuint e1, |
GLuint e2, GLuint e3 ) |
{ |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
GLubyte *ef = VB->EdgeFlag; |
VERTEX *v[4]; |
LOCAL_VARS(4); |
v[0] = (VERTEX *)GET_VERTEX(e0); |
v[1] = (VERTEX *)GET_VERTEX(e1); |
v[2] = (VERTEX *)GET_VERTEX(e2); |
v[3] = (VERTEX *)GET_VERTEX(e3); |
/* Hardware flatshading breaks down here. If the hardware doesn't |
* support flatshading, this will already have been done: |
*/ |
if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) { |
if (HAVE_RGBA) { |
VERT_SAVE_RGBA(0); |
VERT_SAVE_RGBA(1); |
VERT_SAVE_RGBA(2); |
VERT_COPY_RGBA(v[0], v[3]); |
VERT_COPY_RGBA(v[1], v[3]); |
VERT_COPY_RGBA(v[2], v[3]); |
if (HAVE_SPEC) { |
VERT_SAVE_SPEC(0); |
VERT_SAVE_SPEC(1); |
VERT_SAVE_SPEC(2); |
VERT_COPY_SPEC(v[0], v[3]); |
VERT_COPY_SPEC(v[1], v[3]); |
VERT_COPY_SPEC(v[2], v[3]); |
} |
} else { |
VERT_SAVE_IND(0); |
VERT_SAVE_IND(1); |
VERT_SAVE_IND(2); |
VERT_COPY_IND(v[0], v[3]); |
VERT_COPY_IND(v[1], v[3]); |
VERT_COPY_IND(v[2], v[3]); |
} |
} |
if (mode == GL_POINT) { |
RASTERIZE(GL_POINTS); |
if (ef[e0]) POINT( v[0] ); |
if (ef[e1]) POINT( v[1] ); |
if (ef[e2]) POINT( v[2] ); |
if (ef[e3]) POINT( v[3] ); |
} |
else { |
RASTERIZE(GL_LINES); |
if (ef[e0]) LINE( v[0], v[1] ); |
if (ef[e1]) LINE( v[1], v[2] ); |
if (ef[e2]) LINE( v[2], v[3] ); |
if (ef[e3]) LINE( v[3], v[0] ); |
} |
if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) { |
if (HAVE_RGBA) { |
VERT_RESTORE_RGBA(0); |
VERT_RESTORE_RGBA(1); |
VERT_RESTORE_RGBA(2); |
if (HAVE_SPEC) { |
VERT_RESTORE_SPEC(0); |
VERT_RESTORE_SPEC(1); |
VERT_RESTORE_SPEC(2); |
} |
} else { |
VERT_RESTORE_IND(0); |
VERT_RESTORE_IND(1); |
VERT_RESTORE_IND(2); |
} |
} |
} |
#if HAVE_RGBA |
#undef VERT_SET_IND |
#undef VERT_COPY_IND |
#undef VERT_SAVE_IND |
#undef VERT_RESTORE_IND |
#endif |
#if !HAVE_SPEC |
#undef VERT_SET_SPEC |
#undef VERT_COPY_SPEC |
#undef VERT_SAVE_SPEC |
#undef VERT_RESTORE_SPEC |
#endif |
#undef TAG |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_dmatmp.h |
---|
0,0 → 1,1106 |
/* $Id: t_dd_dmatmp.h,v 1.1 2003-02-28 11:54:01 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
/* Template for render stages which build and emit vertices directly |
* to fixed-size dma buffers. Useful for rendering strips and other |
* native primitives where clipping and per-vertex tweaks such as |
* those in t_dd_tritmp.h are not required. |
* |
* Produces code for both inline triangles and indexed triangles. |
* Where various primitive types are unaccelerated by hardware, the |
* code attempts to fallback to other primitive types (quadstrips to |
* tristrips, lineloops to linestrips), or to indexed vertices. |
* Ultimately, a FALLBACK() macro is invoked if there is no way to |
* render the primitive natively. |
*/ |
#if !defined(HAVE_TRIANGLES) |
#error "must have at least triangles to use render template" |
#endif |
#if !HAVE_ELTS |
#define ELTS_VARS |
#define ALLOC_ELTS( nr ) |
#define EMIT_ELT( offset, elt ) |
#define EMIT_TWO_ELTS( offset, elt0, elt1 ) |
#define INCR_ELTS( nr ) |
#define ELT_INIT(prim) |
#define GET_CURRENT_VB_MAX_ELTS() 0 |
#define GET_SUBSEQUENT_VB_MAX_ELTS() 0 |
#define ALLOC_ELTS_NEW_PRIMITIVE(nr) |
#define RELEASE_ELT_VERTS() |
#define EMIT_INDEXED_VERTS( ctx, start, count ) |
#endif |
#ifndef EMIT_TWO_ELTS |
#define EMIT_TWO_ELTS( offset, elt0, elt1 ) \ |
do { \ |
EMIT_ELT( offset, elt0 ); \ |
EMIT_ELT( offset+1, elt1 ); \ |
} while (0) |
#endif |
#ifndef FINISH |
#define FINISH |
#endif |
/**********************************************************************/ |
/* Render whole begin/end objects */ |
/**********************************************************************/ |
static GLboolean TAG(emit_elt_verts)( GLcontext *ctx, |
GLuint start, GLuint count ) |
{ |
if (HAVE_ELTS) { |
LOCAL_VARS; |
GLuint nr = count - start; |
if ( nr >= GET_SUBSEQUENT_VB_MAX_VERTS() ) /* assumes same packing for |
* indexed and regualar verts |
*/ |
return GL_FALSE; |
NEW_PRIMITIVE(); /* finish last prim */ |
EMIT_INDEXED_VERTS( ctx, start, count ); |
return GL_TRUE; |
} else { |
return GL_FALSE; |
} |
} |
#if (HAVE_ELTS) |
static void TAG(emit_elts)( GLcontext *ctx, GLuint *elts, GLuint nr ) |
{ |
GLint i; |
LOCAL_VARS; |
ELTS_VARS; |
ALLOC_ELTS( nr ); |
for ( i = 0 ; i < nr ; i+=2, elts += 2 ) { |
EMIT_TWO_ELTS( 0, elts[0], elts[1] ); |
INCR_ELTS( 2 ); |
} |
} |
#endif |
/*********************************************************************** |
* Render non-indexed primitives. |
***********************************************************************/ |
static void TAG(render_points_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_POINTS) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz = GET_CURRENT_VB_MAX_VERTS(); |
GLuint j, nr; |
INIT( GL_POINTS ); |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr ) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
FINISH; |
} else { |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_lines_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_LINES) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz = GET_CURRENT_VB_MAX_VERTS(); |
GLuint j, nr; |
INIT( GL_LINES ); |
/* Emit whole number of lines in total and in each buffer: |
*/ |
count -= (count-start) & 1; |
currentsz -= currentsz & 1; |
dmasz -= dmasz & 1; |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr ) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
FINISH; |
} else { |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_line_strip_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_LINE_STRIPS) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz = GET_CURRENT_VB_MAX_VERTS(); |
GLuint j, nr; |
NEW_PRIMITIVE(); /* always a new primitive */ |
INIT( GL_LINE_STRIP ); |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
FINISH; |
} else { |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_line_loop_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_LINE_STRIPS) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz = GET_CURRENT_VB_MAX_VERTS(); |
GLuint j, nr; |
NEW_PRIMITIVE(); |
INIT( GL_LINE_STRIP ); |
if (flags & PRIM_BEGIN) |
j = start; |
else |
j = start + 1; |
/* Ensure last vertex won't wrap buffers: |
*/ |
currentsz--; |
dmasz--; |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
if (j + 1 < count) { |
for ( ; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
if (start < count - 1 && (flags & PRIM_END)) |
EMIT_VERTS( ctx, start, 1 ); |
} |
else if (start + 1 < count && (flags & PRIM_END)) { |
EMIT_VERTS( ctx, start+1, 1 ); |
EMIT_VERTS( ctx, start, 1 ); |
} |
FINISH; |
} else { |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_triangles_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/3) * 3; |
int currentsz = (GET_CURRENT_VB_MAX_VERTS()/3) * 3; |
GLuint j, nr; |
INIT(GL_TRIANGLES); |
/* Emit whole number of tris in total. dmasz is already a multiple |
* of 3. |
*/ |
count -= (count-start)%3; |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
FINISH; |
} |
static void TAG(render_tri_strip_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_TRI_STRIPS) { |
LOCAL_VARS; |
GLuint j, nr; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz; |
INIT(GL_TRIANGLE_STRIP); |
NEW_PRIMITIVE(); |
currentsz = GET_CURRENT_VB_MAX_VERTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
if ((flags & PRIM_PARITY) && count - start > 2) { |
if (HAVE_TRI_STRIP_1 && 0) { |
} else { |
EMIT_VERTS( ctx, start, 1 ); |
currentsz--; |
} |
} |
/* From here on emit even numbers of tris when wrapping over buffers: |
*/ |
dmasz -= (dmasz & 1); |
currentsz -= (currentsz & 1); |
for (j = start ; j + 2 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
FINISH; |
} else { |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_tri_fan_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_TRI_FANS) { |
LOCAL_VARS; |
GLuint j, nr; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz = GET_CURRENT_VB_MAX_VERTS(); |
NEW_PRIMITIVE(); |
INIT(GL_TRIANGLE_FAN); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start + 1 ; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j + 1 ); |
EMIT_VERTS( ctx, start, 1 ); |
EMIT_VERTS( ctx, j, nr - 1 ); |
currentsz = dmasz; |
} |
FINISH; |
} |
else { |
/* Could write code to emit these as indexed vertices (for the |
* g400, for instance). |
*/ |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_poly_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_POLYGONS) { |
LOCAL_VARS; |
GLuint j, nr; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz = GET_CURRENT_VB_MAX_VERTS(); |
NEW_PRIMITIVE(); |
INIT(GL_POLYGON); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start + 1 ; j + 1 < count ; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j + 1 ); |
EMIT_VERTS( ctx, start, 1 ); |
EMIT_VERTS( ctx, j, nr - 1 ); |
currentsz = dmasz; |
} |
FINISH; |
} |
else if (HAVE_TRI_FANS && !(ctx->_TriangleCaps & DD_FLATSHADE)) { |
TAG(render_tri_fan_verts)( ctx, start, count, flags ); |
} else { |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_quad_strip_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
GLuint j, nr; |
if (HAVE_QUAD_STRIPS) { |
LOCAL_VARS; |
GLuint j, nr; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz; |
INIT(GL_QUAD_STRIP); |
NEW_PRIMITIVE(); |
currentsz = GET_CURRENT_VB_MAX_VERTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
dmasz -= (dmasz & 2); |
currentsz -= (currentsz & 2); |
for (j = start ; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
FINISH; |
} else if (HAVE_TRI_STRIPS && (ctx->_TriangleCaps & DD_FLATSHADE)) { |
if (TAG(emit_elt_verts)( ctx, start, count )) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
/* Simulate flat-shaded quadstrips using indexed vertices: |
*/ |
NEW_PRIMITIVE(); |
ELT_INIT( GL_TRIANGLES ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of quads in total, and in each buffer. |
*/ |
dmasz -= dmasz & 1; |
count -= (count-start) & 1; |
currentsz -= currentsz & 1; |
if (currentsz < 12) |
currentsz = dmasz; |
currentsz = currentsz/6*2; |
dmasz = dmasz/6*2; |
for (j = start; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
if (nr >= 4) { |
GLint quads = (nr/2)-1; |
GLint i; |
ELTS_VARS; |
NEW_PRIMITIVE(); |
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 ); |
for ( i = j-start ; i < j-start+quads*2 ; i+=2 ) { |
EMIT_TWO_ELTS( 0, (i+0), (i+1) ); |
EMIT_TWO_ELTS( 2, (i+2), (i+1) ); |
EMIT_TWO_ELTS( 4, (i+3), (i+2) ); |
INCR_ELTS( 6 ); |
} |
NEW_PRIMITIVE(); |
} |
currentsz = dmasz; |
} |
RELEASE_ELT_VERTS(); |
} |
else { |
/* Vertices won't fit in a single buffer or elts not available, |
* VERT_FALLBACK. |
*/ |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
else if (HAVE_TRI_STRIPS) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS(); |
int currentsz = GET_CURRENT_VB_MAX_VERTS(); |
/* Emit smooth-shaded quadstrips as tristrips: |
*/ |
NEW_PRIMITIVE(); |
INIT( GL_TRIANGLE_STRIP ); |
/* Emit whole number of quads in total, and in each buffer. |
*/ |
dmasz -= dmasz & 1; |
currentsz -= currentsz & 1; |
count -= (count-start) & 1; |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
FINISH; |
} else { |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_quads_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_QUADS) { |
LOCAL_VARS; |
int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/4) * 4; |
int currentsz = (GET_CURRENT_VB_MAX_VERTS()/4) * 4; |
GLuint j, nr; |
INIT(GL_QUADS); |
/* Emit whole number of quads in total. dmasz is already a multiple |
* of 4. |
*/ |
count -= (count-start)%4; |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr) { |
nr = MIN2( currentsz, count - j ); |
EMIT_VERTS( ctx, j, nr ); |
currentsz = dmasz; |
} |
FINISH; |
} else if (TAG(emit_elt_verts)( ctx, start, count )) { |
/* Hardware doesn't have a quad primitive type -- try to |
* simulate it using indexed vertices and the triangle |
* primitive: |
*/ |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
NEW_PRIMITIVE(); |
ELT_INIT( GL_TRIANGLES ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of quads in total, and in each buffer. |
*/ |
dmasz -= dmasz & 3; |
count -= (count-start) & 3; |
currentsz -= currentsz & 3; |
/* Adjust for rendering as triangles: |
*/ |
currentsz = currentsz/6*4; |
dmasz = dmasz/6*4; |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr ) { |
nr = MIN2( currentsz, count - j ); |
if (nr >= 4) { |
GLint quads = nr/4; |
GLint i; |
ELTS_VARS; |
NEW_PRIMITIVE(); |
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 ); |
for ( i = j-start ; i < j-start+quads*4 ; i+=4 ) { |
EMIT_TWO_ELTS( 0, (i+0), (i+1) ); |
EMIT_TWO_ELTS( 2, (i+3), (i+1) ); |
EMIT_TWO_ELTS( 4, (i+2), (i+3) ); |
INCR_ELTS( 6 ); |
} |
NEW_PRIMITIVE(); |
} |
currentsz = dmasz; |
} |
RELEASE_ELT_VERTS(); |
} |
else { |
/* Vertices won't fit in a single buffer, fallback. |
*/ |
VERT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_noop)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
} |
static render_func TAG(render_tab_verts)[GL_POLYGON+2] = |
{ |
TAG(render_points_verts), |
TAG(render_lines_verts), |
TAG(render_line_loop_verts), |
TAG(render_line_strip_verts), |
TAG(render_triangles_verts), |
TAG(render_tri_strip_verts), |
TAG(render_tri_fan_verts), |
TAG(render_quads_verts), |
TAG(render_quad_strip_verts), |
TAG(render_poly_verts), |
TAG(render_noop), |
}; |
/**************************************************************************** |
* Render elts using hardware indexed verts * |
****************************************************************************/ |
#if (HAVE_ELTS) |
static void TAG(render_points_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_POINTS) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
GLuint j, nr; |
ELT_INIT( GL_POINTS ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} else { |
ELT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_lines_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_LINES) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
GLuint j, nr; |
ELT_INIT( GL_LINES ); |
/* Emit whole number of lines in total and in each buffer: |
*/ |
count -= (count-start) & 1; |
currentsz -= currentsz & 1; |
dmasz -= dmasz & 1; |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} else { |
ELT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_line_strip_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_LINE_STRIPS) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
GLuint j, nr; |
NEW_PRIMITIVE(); /* always a new primitive */ |
ELT_INIT( GL_LINE_STRIP ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} else { |
/* TODO: Try to emit as indexed lines. |
*/ |
ELT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_line_loop_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_LINE_STRIPS) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
GLuint j, nr; |
NEW_PRIMITIVE(); |
ELT_INIT( GL_LINE_STRIP ); |
if (flags & PRIM_BEGIN) |
j = start; |
else |
j = start + 1; |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
/* Ensure last vertex doesn't wrap: |
*/ |
currentsz--; |
dmasz--; |
for ( ; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j ); |
/* NEW_PRIMITIVE(); */ |
TAG(emit_elts)( ctx, elts+j, nr ); |
currentsz = dmasz; |
} |
if (flags & PRIM_END) |
TAG(emit_elts)( ctx, elts+start, 1 ); |
NEW_PRIMITIVE(); |
} else { |
/* TODO: Try to emit as indexed lines */ |
ELT_FALLBACK( ctx, start, count, flags ); |
} |
} |
/* For verts, we still eliminate the copy from main memory to dma |
* buffers. For elts, this is probably no better (worse?) than the |
* standard path. |
*/ |
static void TAG(render_triangles_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/3*3; |
int currentsz; |
GLuint j, nr; |
NEW_PRIMITIVE(); |
ELT_INIT( GL_TRIANGLES ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of tris in total. dmasz is already a multiple |
* of 3. |
*/ |
count -= (count-start)%3; |
currentsz -= currentsz%3; |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
static void TAG(render_tri_strip_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_TRI_STRIPS) { |
LOCAL_VARS; |
GLuint j, nr; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
NEW_PRIMITIVE(); |
ELT_INIT( GL_TRIANGLE_STRIP ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
if ((flags & PRIM_PARITY) && count - start > 2) { |
TAG(emit_elts)( ctx, elts+start, 1 ); |
} |
/* Keep the same winding over multiple buffers: |
*/ |
dmasz -= (dmasz & 1); |
currentsz -= (currentsz & 1); |
for (j = start ; j + 2 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} else { |
/* TODO: try to emit as indexed triangles */ |
ELT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_tri_fan_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_TRI_FANS) { |
LOCAL_VARS; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
GLuint j, nr; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
NEW_PRIMITIVE(); |
ELT_INIT( GL_TRIANGLE_FAN ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start + 1 ; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j + 1 ); |
TAG(emit_elts)( ctx, elts+start, 1 ); |
TAG(emit_elts)( ctx, elts+j, nr - 1 ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} else { |
/* TODO: try to emit as indexed triangles */ |
ELT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_poly_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_POLYGONS && 0) { |
} else if (HAVE_TRI_FANS && !(ctx->_TriangleCaps & DD_FLATSHADE)) { |
LOCAL_VARS; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
GLuint j, nr; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
NEW_PRIMITIVE(); |
ELT_INIT( GL_TRIANGLE_FAN ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start + 1 ; j + 1 < count ; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j + 1 ); |
TAG(emit_elts)( ctx, elts+start, 1 ); |
TAG(emit_elts)( ctx, elts+j, nr - 1 ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} else { |
ELT_FALLBACK( ctx, start, count, flags ); |
} |
} |
static void TAG(render_quad_strip_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_QUAD_STRIPS && 0) { |
} |
else if (HAVE_TRI_STRIPS) { |
LOCAL_VARS; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
NEW_PRIMITIVE(); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of quads in total, and in each buffer. |
*/ |
dmasz -= dmasz & 1; |
count -= (count-start) & 1; |
currentsz -= currentsz & 1; |
if (currentsz < 12) |
currentsz = dmasz; |
if (ctx->_TriangleCaps & DD_FLATSHADE) { |
ELT_INIT( GL_TRIANGLES ); |
currentsz = currentsz/6*2; |
dmasz = dmasz/6*2; |
for (j = start; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
if (nr >= 4) |
{ |
GLint i; |
GLint quads = (nr/2)-1; |
ELTS_VARS; |
NEW_PRIMITIVE(); |
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 ); |
for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) { |
EMIT_TWO_ELTS( 0, elts[0], elts[1] ); |
EMIT_TWO_ELTS( 2, elts[2], elts[1] ); |
EMIT_TWO_ELTS( 4, elts[3], elts[2] ); |
INCR_ELTS( 6 ); |
} |
NEW_PRIMITIVE(); |
} |
currentsz = dmasz; |
} |
} |
else { |
ELT_INIT( GL_TRIANGLE_STRIP ); |
for (j = start; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
} |
} |
static void TAG(render_quads_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (HAVE_QUADS && 0) { |
} else { |
LOCAL_VARS; |
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
ELT_INIT( GL_TRIANGLES ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of quads in total, and in each buffer. |
*/ |
dmasz -= dmasz & 3; |
count -= (count-start) & 3; |
currentsz -= currentsz & 3; |
/* Adjust for rendering as triangles: |
*/ |
currentsz = currentsz/6*4; |
dmasz = dmasz/6*4; |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
if (nr >= 4) |
{ |
GLint quads = nr/4; |
GLint i; |
ELTS_VARS; |
NEW_PRIMITIVE(); |
ALLOC_ELTS_NEW_PRIMITIVE( quads * 6 ); |
for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) { |
EMIT_TWO_ELTS( 0, elts[0], elts[1] ); |
EMIT_TWO_ELTS( 2, elts[3], elts[1] ); |
EMIT_TWO_ELTS( 4, elts[2], elts[3] ); |
INCR_ELTS( 6 ); |
} |
} |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
} |
static render_func TAG(render_tab_elts)[GL_POLYGON+2] = |
{ |
TAG(render_points_elts), |
TAG(render_lines_elts), |
TAG(render_line_loop_elts), |
TAG(render_line_strip_elts), |
TAG(render_triangles_elts), |
TAG(render_tri_strip_elts), |
TAG(render_tri_fan_elts), |
TAG(render_quads_elts), |
TAG(render_quad_strip_elts), |
TAG(render_poly_elts), |
TAG(render_noop), |
}; |
#endif |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_dmatmp2.h |
---|
0,0 → 1,1095 |
/* |
* Mesa 3-D graphics library |
* Version: 4.0.3 |
* |
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
/* Template for render stages which build and emit vertices directly |
* to fixed-size dma buffers. Useful for rendering strips and other |
* native primitives where clipping and per-vertex tweaks such as |
* those in t_dd_tritmp.h are not required. |
* |
*/ |
#if !HAVE_TRIANGLES || !HAVE_POINTS || !HAVE_LINES |
#error "must have points, lines & triangles to use render template" |
#endif |
#if !HAVE_TRI_STRIPS || !HAVE_TRI_FANS |
#error "must have tri strip and fans to use render template" |
#endif |
#if !HAVE_LINE_STRIPS |
#error "must have line strips to use render template" |
#endif |
#if !HAVE_POLYGONS |
#error "must have polygons to use render template" |
#endif |
#if !HAVE_ELTS |
#error "must have elts to use render template" |
#endif |
#ifndef EMIT_TWO_ELTS |
#define EMIT_TWO_ELTS( offset, elt0, elt1 ) \ |
do { \ |
EMIT_ELT( offset, elt0 ); \ |
EMIT_ELT( offset+1, elt1 ); \ |
} while (0) |
#endif |
/**********************************************************************/ |
/* Render whole begin/end objects */ |
/**********************************************************************/ |
static void TAG(emit_elts)( GLcontext *ctx, GLuint *elts, GLuint nr ) |
{ |
GLint i; |
LOCAL_VARS; |
ELTS_VARS; |
ALLOC_ELTS( nr ); |
for ( i = 0 ; i < nr ; i+=2, elts += 2 ) { |
EMIT_TWO_ELTS( 0, elts[0], elts[1] ); |
INCR_ELTS( 2 ); |
} |
} |
static void TAG(emit_consecutive_elts)( GLcontext *ctx, GLuint start, GLuint nr ) |
{ |
GLint i; |
LOCAL_VARS; |
ELTS_VARS; |
ALLOC_ELTS( nr ); |
for ( i = 0 ; i+1 < nr ; i+=2, start += 2 ) { |
EMIT_TWO_ELTS( 0, start, start+1 ); |
INCR_ELTS( 2 ); |
} |
if (i < nr) { |
EMIT_ELT( 0, start ); |
INCR_ELTS( 1 ); |
} |
} |
/*********************************************************************** |
* Render non-indexed primitives. |
***********************************************************************/ |
static void TAG(render_points_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (start < count) { |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
EMIT_PRIM( ctx, GL_POINTS, HW_POINTS, start, count ); |
} |
} |
static void TAG(render_lines_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
count -= (count-start) & 1; |
if (start+1 >= count) |
return; |
if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) { |
RESET_STIPPLE(); |
AUTO_STIPPLE( GL_TRUE ); |
} |
EMIT_PRIM( ctx, GL_LINES, HW_LINES, start, count ); |
if ((flags & PRIM_END) && ctx->Line.StippleFlag) |
AUTO_STIPPLE( GL_FALSE ); |
} |
static void TAG(render_line_strip_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
if (start+1 >= count) |
return; |
if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) |
RESET_STIPPLE(); |
if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) |
{ |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
ELT_INIT( GL_LINES, HW_LINES ); |
/* Emit whole number of lines in each full buffer. |
*/ |
dmasz = dmasz/2; |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
currentsz = currentsz/2; |
if (currentsz < 4) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start; j + 1 < count; j += nr - 1 ) { |
GLint i; |
ELTS_VARS; |
nr = MIN2( currentsz, count - j ); |
ALLOC_ELTS( (nr-1)*2 ); |
for ( i = j ; i+1 < j+nr ; i+=1 ) { |
EMIT_TWO_ELTS( 0, (i+0), (i+1) ); |
INCR_ELTS( 2 ); |
} |
if (nr == currentsz) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
} |
} |
else |
EMIT_PRIM( ctx, GL_LINE_STRIP, HW_LINE_STRIP, start, count ); |
} |
static void TAG(render_line_loop_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
GLuint j, nr; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
if (flags & PRIM_BEGIN) { |
j = start; |
if (ctx->Line.StippleFlag) |
RESET_STIPPLE( ); |
} |
else |
j = start + 1; |
if (flags & PRIM_END) { |
if (start+1 >= count) |
return; |
if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) { |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
ELT_INIT( GL_LINES, HW_LINES ); |
/* Emit whole number of lines in each full buffer. |
*/ |
dmasz = dmasz/2; |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
currentsz = currentsz/2; |
if (currentsz < 4) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
/* Ensure last vertex doesn't wrap: |
*/ |
currentsz--; |
dmasz--; |
for (; j + 1 < count; ) { |
GLint i; |
ELTS_VARS; |
nr = MIN2( currentsz, count - j ); |
ALLOC_ELTS( (nr-1)*2 ); |
for ( i = j ; i+1 < j+nr ; i+=1 ) { |
EMIT_TWO_ELTS( 0, (i+0), (i+1) ); |
INCR_ELTS( 2 ); |
} |
j += nr - 1; |
if (j + 1 < count) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
else { |
ALLOC_ELTS( 2 ); |
EMIT_TWO_ELTS( 0, (j), (start) ); |
INCR_ELTS( 2 ); |
} |
} |
} |
else |
{ |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
/* Ensure last vertex doesn't wrap: |
*/ |
currentsz--; |
dmasz--; |
for ( ; j + 1 < count; ) { |
nr = MIN2( currentsz, count - j ); |
if (j + nr < count) { |
TAG(emit_consecutive_elts)( ctx, j, nr ); |
currentsz = dmasz; |
j += nr - 1; |
NEW_BUFFER(); |
} |
else if (nr) { |
ELTS_VARS; |
int i; |
ALLOC_ELTS( nr + 1 ); |
for ( i = 0 ; i+1 < nr ; i+=2, j += 2 ) { |
EMIT_TWO_ELTS( 0, j, j+1 ); |
INCR_ELTS( 2 ); |
} |
if (i < nr) { |
EMIT_ELT( 0, j ); j++; |
INCR_ELTS( 1 ); |
} |
EMIT_ELT( 0, start ); |
INCR_ELTS( 1 ); |
NEW_BUFFER(); |
} |
else { |
fprintf(stderr, "warining nr==0\n"); |
} |
} |
} |
} else { |
TAG(render_line_strip_verts)( ctx, j, count, flags ); |
} |
} |
static void TAG(render_triangles_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
count -= (count-start)%3; |
if (start+2 >= count) { |
return; |
} |
/* need a PREFER_DISCRETE_ELT_PRIM here too.. |
*/ |
EMIT_PRIM( ctx, GL_TRIANGLES, HW_TRIANGLES, start, count ); |
} |
static void TAG(render_tri_strip_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
if (start + 2 >= count) |
return; |
if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) |
{ |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
int parity = 0; |
GLuint j, nr; |
ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); |
if (flags & PRIM_PARITY) |
parity = 1; |
/* Emit even number of tris in each full buffer. |
*/ |
dmasz = dmasz/3; |
dmasz -= dmasz & 1; |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
currentsz = currentsz/3; |
currentsz -= currentsz & 1; |
if (currentsz < 4) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start; j + 2 < count; j += nr - 2 ) { |
GLint i; |
ELTS_VARS; |
nr = MIN2( currentsz, count - j ); |
ALLOC_ELTS( (nr-2)*3 ); |
for ( i = j ; i+2 < j+nr ; i++, parity^=1 ) { |
EMIT_ELT( 0, (i+0+parity) ); |
EMIT_ELT( 1, (i+1-parity) ); |
EMIT_ELT( 2, (i+2) ); |
INCR_ELTS( 3 ); |
} |
if (nr == currentsz) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
} |
} |
else if ((flags & PRIM_PARITY) == 0) |
EMIT_PRIM( ctx, GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0, start, count ); |
else if (HAVE_TRI_STRIP_1) |
EMIT_PRIM( ctx, GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_1, start, count ); |
else { |
/* Emit the first triangle with elts, then the rest as a regular strip. |
* TODO: Make this unlikely in t_imm_api.c |
*/ |
ELTS_VARS; |
ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); |
ALLOC_ELTS( 3 ); |
EMIT_ELT( 0, (start+1) ); |
EMIT_ELT( 1, (start+0) ); |
EMIT_ELT( 2, (start+2) ); |
INCR_ELTS( 3 ); |
NEW_PRIMITIVE(); |
start++; |
if (start + 2 >= count) |
return; |
EMIT_PRIM( ctx, GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0, start, |
count ); |
} |
} |
static void TAG(render_tri_fan_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
if (start+2 >= count) |
return; |
if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) |
{ |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); |
dmasz = dmasz/3; |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
currentsz = currentsz/3; |
if (currentsz < 4) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start + 1; j + 1 < count; j += nr - 1 ) { |
GLint i; |
ELTS_VARS; |
nr = MIN2( currentsz, count - j ); |
ALLOC_ELTS( (nr-1)*3 ); |
for ( i = j ; i+1 < j+nr ; i++ ) { |
EMIT_ELT( 0, (start) ); |
EMIT_ELT( 1, (i) ); |
EMIT_ELT( 2, (i+1) ); |
INCR_ELTS( 3 ); |
} |
if (nr == currentsz) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
} |
} |
else { |
EMIT_PRIM( ctx, GL_TRIANGLE_FAN, HW_TRIANGLE_FAN, start, count ); |
} |
} |
static void TAG(render_poly_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
if (start+2 >= count) |
return; |
EMIT_PRIM( ctx, GL_POLYGON, HW_POLYGON, start, count ); |
} |
static void TAG(render_quad_strip_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
count -= (count-start) & 1; |
if (start+3 >= count) |
return; |
if (HAVE_QUAD_STRIPS) { |
EMIT_PRIM( ctx, GL_QUAD_STRIP, HW_QUAD_STRIP, start, count ); |
} |
else if (ctx->_TriangleCaps & DD_FLATSHADE) { |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of quads in total, and in each buffer. |
*/ |
currentsz = (currentsz/6)*2; |
dmasz = (dmasz/6)*2; |
if (currentsz < 4) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start; j + 3 < count; j += nr - 2 ) { |
ELTS_VARS; |
GLint quads, i; |
nr = MIN2( currentsz, count - j ); |
quads = (nr/2)-1; |
ALLOC_ELTS( quads*6 ); |
for ( i = j ; i < j+quads*2 ; i+=2 ) { |
EMIT_TWO_ELTS( 0, (i+0), (i+1) ); |
EMIT_TWO_ELTS( 2, (i+2), (i+1) ); |
EMIT_TWO_ELTS( 4, (i+3), (i+2) ); |
INCR_ELTS( 6 ); |
} |
if (nr == currentsz) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
} |
} |
else { |
EMIT_PRIM( ctx, GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0, start, count ); |
} |
} |
static void TAG(render_quads_verts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
count -= (count-start)%4; |
if (start+3 >= count) |
return; |
if (HAVE_QUADS) { |
EMIT_PRIM( ctx, HW_QUADS, GL_QUADS, start, count ); |
} |
else { |
/* Hardware doesn't have a quad primitive type -- simulate it |
* using indexed vertices and the triangle primitive: |
*/ |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Adjust for rendering as triangles: |
*/ |
currentsz = (currentsz/6)*4; |
dmasz = (dmasz/6)*4; |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start; j < count; j += nr ) { |
ELTS_VARS; |
GLint quads, i; |
nr = MIN2( currentsz, count - j ); |
quads = nr/4; |
ALLOC_ELTS( quads*6 ); |
for ( i = j ; i < j+quads*4 ; i+=4 ) { |
EMIT_TWO_ELTS( 0, (i+0), (i+1) ); |
EMIT_TWO_ELTS( 2, (i+3), (i+1) ); |
EMIT_TWO_ELTS( 4, (i+2), (i+3) ); |
INCR_ELTS( 6 ); |
} |
if (nr == currentsz) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
} |
} |
} |
static void TAG(render_noop)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
} |
static render_func TAG(render_tab_verts)[GL_POLYGON+2] = |
{ |
TAG(render_points_verts), |
TAG(render_lines_verts), |
TAG(render_line_loop_verts), |
TAG(render_line_strip_verts), |
TAG(render_triangles_verts), |
TAG(render_tri_strip_verts), |
TAG(render_tri_fan_verts), |
TAG(render_quads_verts), |
TAG(render_quad_strip_verts), |
TAG(render_poly_verts), |
TAG(render_noop), |
}; |
/**************************************************************************** |
* Render elts using hardware indexed verts * |
****************************************************************************/ |
static void TAG(render_points_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint *elts = GET_ELTS(); |
GLuint j, nr; |
ELT_INIT( GL_POINTS, HW_POINTS ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
static void TAG(render_lines_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint *elts = GET_ELTS(); |
GLuint j, nr; |
if (start+1 >= count) |
return; |
if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) { |
RESET_STIPPLE(); |
AUTO_STIPPLE( GL_TRUE ); |
} |
ELT_INIT( GL_LINES, HW_LINES ); |
/* Emit whole number of lines in total and in each buffer: |
*/ |
count -= (count-start) & 1; |
currentsz -= currentsz & 1; |
dmasz -= dmasz & 1; |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
if ((flags & PRIM_END) && ctx->Line.StippleFlag) |
AUTO_STIPPLE( GL_FALSE ); |
} |
static void TAG(render_line_strip_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint *elts = GET_ELTS(); |
GLuint j, nr; |
if (start+1 >= count) |
return; |
ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP ); |
if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) |
RESET_STIPPLE(); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
static void TAG(render_line_loop_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint *elts = GET_ELTS(); |
GLuint j, nr; |
if (0) fprintf(stderr, "%s\n", __FUNCTION__); |
if (flags & PRIM_BEGIN) |
j = start; |
else |
j = start + 1; |
if (flags & PRIM_END) { |
if (start+1 >= count) |
return; |
} |
else { |
if (j+1 >= count) |
return; |
} |
ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP ); |
if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) |
RESET_STIPPLE(); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
/* Ensure last vertex doesn't wrap: |
*/ |
currentsz--; |
dmasz--; |
for ( ; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
currentsz = dmasz; |
} |
if (flags & PRIM_END) |
TAG(emit_elts)( ctx, elts+start, 1 ); |
NEW_PRIMITIVE(); |
} |
static void TAG(render_triangles_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
GLuint *elts = GET_ELTS(); |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/3*3; |
int currentsz; |
GLuint j, nr; |
if (start+2 >= count) |
return; |
/* NEW_PRIMITIVE(); */ |
ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of tris in total. dmasz is already a multiple |
* of 3. |
*/ |
count -= (count-start)%3; |
currentsz -= currentsz%3; |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j < count; j += nr) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
static void TAG(render_tri_strip_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
GLuint j, nr; |
GLuint *elts = GET_ELTS(); |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
if (start+2 >= count) |
return; |
ELT_INIT( GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0 ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
if ((flags & PRIM_PARITY) && count - start > 2) { |
TAG(emit_elts)( ctx, elts+start, 1 ); |
currentsz--; |
} |
/* Keep the same winding over multiple buffers: |
*/ |
dmasz -= (dmasz & 1); |
currentsz -= (currentsz & 1); |
for (j = start ; j + 2 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
static void TAG(render_tri_fan_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
GLuint *elts = GET_ELTS(); |
GLuint j, nr; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
if (start+2 >= count) |
return; |
ELT_INIT( GL_TRIANGLE_FAN, HW_TRIANGLE_FAN ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start + 1 ; j + 1 < count; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j + 1 ); |
TAG(emit_elts)( ctx, elts+start, 1 ); |
TAG(emit_elts)( ctx, elts+j, nr - 1 ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
static void TAG(render_poly_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
LOCAL_VARS; |
GLuint *elts = GET_ELTS(); |
GLuint j, nr; |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
if (start+2 >= count) |
return; |
ELT_INIT( GL_POLYGON, HW_POLYGON ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
if (currentsz < 8) { |
NEW_BUFFER(); |
currentsz = dmasz; |
} |
for (j = start + 1 ; j + 1 < count ; j += nr - 1 ) { |
nr = MIN2( currentsz, count - j + 1 ); |
TAG(emit_elts)( ctx, elts+start, 1 ); |
TAG(emit_elts)( ctx, elts+j, nr - 1 ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
static void TAG(render_quad_strip_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (start+3 >= count) |
return; |
if (HAVE_QUAD_STRIPS && 0) { |
} |
else { |
LOCAL_VARS; |
GLuint *elts = GET_ELTS(); |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
NEW_PRIMITIVE(); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of quads in total, and in each buffer. |
*/ |
dmasz -= dmasz & 1; |
count -= (count-start) & 1; |
currentsz -= currentsz & 1; |
if (currentsz < 12) |
currentsz = dmasz; |
if (ctx->_TriangleCaps & DD_FLATSHADE) { |
ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); |
currentsz = currentsz/6*2; |
dmasz = dmasz/6*2; |
for (j = start; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
if (nr >= 4) |
{ |
GLint i; |
GLint quads = (nr/2)-1; |
ELTS_VARS; |
ALLOC_ELTS( quads*6 ); |
for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) { |
EMIT_TWO_ELTS( 0, elts[0], elts[1] ); |
EMIT_TWO_ELTS( 2, elts[2], elts[1] ); |
EMIT_TWO_ELTS( 4, elts[3], elts[2] ); |
INCR_ELTS( 6 ); |
} |
NEW_PRIMITIVE(); |
} |
currentsz = dmasz; |
} |
} |
else { |
ELT_INIT( GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0 ); |
for (j = start; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
TAG(emit_elts)( ctx, elts+j, nr ); |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
} |
} |
static void TAG(render_quads_elts)( GLcontext *ctx, |
GLuint start, |
GLuint count, |
GLuint flags ) |
{ |
if (start+3 >= count) |
return; |
if (HAVE_QUADS && 0) { |
} else { |
LOCAL_VARS; |
GLuint *elts = GET_ELTS(); |
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); |
int currentsz; |
GLuint j, nr; |
ELT_INIT( GL_TRIANGLES, HW_TRIANGLES ); |
currentsz = GET_CURRENT_VB_MAX_ELTS(); |
/* Emit whole number of quads in total, and in each buffer. |
*/ |
dmasz -= dmasz & 3; |
count -= (count-start) & 3; |
currentsz -= currentsz & 3; |
/* Adjust for rendering as triangles: |
*/ |
currentsz = currentsz/6*4; |
dmasz = dmasz/6*4; |
if (currentsz < 8) |
currentsz = dmasz; |
for (j = start; j + 3 < count; j += nr - 2 ) { |
nr = MIN2( currentsz, count - j ); |
if (nr >= 4) |
{ |
GLint quads = nr/4; |
GLint i; |
ELTS_VARS; |
ALLOC_ELTS( quads * 6 ); |
for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) { |
EMIT_TWO_ELTS( 0, elts[0], elts[1] ); |
EMIT_TWO_ELTS( 2, elts[3], elts[1] ); |
EMIT_TWO_ELTS( 4, elts[2], elts[3] ); |
INCR_ELTS( 6 ); |
} |
} |
NEW_PRIMITIVE(); |
currentsz = dmasz; |
} |
} |
} |
static render_func TAG(render_tab_elts)[GL_POLYGON+2] = |
{ |
TAG(render_points_elts), |
TAG(render_lines_elts), |
TAG(render_line_loop_elts), |
TAG(render_line_strip_elts), |
TAG(render_triangles_elts), |
TAG(render_tri_strip_elts), |
TAG(render_tri_fan_elts), |
TAG(render_quads_elts), |
TAG(render_quad_strip_elts), |
TAG(render_poly_elts), |
TAG(render_noop), |
}; |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_vbtmp.h |
---|
0,0 → 1,835 |
/* $Id: t_dd_vbtmp.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 4.1 |
* |
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
/* Unlike the other templates here, this assumes quite a bit about the |
* underlying hardware. Specifically it assumes a d3d-like vertex |
* format, with a layout more or less constrained to look like the |
* following: |
* |
* union { |
* struct { |
* float x, y, z, w; |
* struct { char r, g, b, a; } color; |
* struct { char r, g, b, fog; } spec; |
* float u0, v0; |
* float u1, v1; |
* float u2, v2; |
* float u3, v3; |
* } v; |
* struct { |
* float x, y, z, w; |
* struct { char r, g, b, a; } color; |
* struct { char r, g, b, fog; } spec; |
* float u0, v0, q0; |
* float u1, v1, q1; |
* float u2, v2, q2; |
* float u3, v3, q3; |
* } pv; |
* struct { |
* float x, y, z; |
* struct { char r, g, b, a; } color; |
* } tv; |
* float f[16]; |
* unsigned int ui[16]; |
* unsigned char ub4[4][16]; |
* } |
* |
* VERTEX: hw vertex type as above |
* VERTEX_COLOR: hw color struct type in VERTEX |
* |
* DO_XYZW: Emit xyz and maybe w coordinates. |
* DO_RGBA: Emit color. |
* DO_SPEC: Emit specular color. |
* DO_FOG: Emit fog coordinate in specular alpha. |
* DO_TEX0: Emit tex0 u,v coordinates. |
* DO_TEX1: Emit tex1 u,v coordinates. |
* DO_TEX2: Emit tex2 u,v coordinates. |
* DO_TEX3: Emit tex3 u,v coordinates. |
* DO_PTEX: Emit tex0,1,2,3 q coordinates where possible. |
* |
* HAVE_RGBA_COLOR: Hardware takes color in rgba order (else bgra). |
* |
* HAVE_HW_VIEWPORT: Hardware performs viewport transform. |
* HAVE_HW_DIVIDE: Hardware performs perspective divide. |
* |
* HAVE_TINY_VERTICES: Hardware understands v.tv format. |
* HAVE_PTEX_VERTICES: Hardware understands v.pv format. |
* HAVE_NOTEX_VERTICES: Hardware understands v.v format with texcount 0. |
* |
* Additionally, this template assumes it is emitting *transformed* |
* vertices; the modifications to emit untransformed vertices (ie. to |
* t&l hardware) are probably too great to cooexist with the code |
* already in this file. |
* |
* NOTE: The PTEX vertex format always includes TEX0 and TEX1, even if |
* only TEX0 is enabled, in order to maintain a vertex size which is |
* an exact number of quadwords. |
*/ |
#if (HAVE_HW_VIEWPORT) |
#define VIEWPORT_X(dst,x) dst = x |
#define VIEWPORT_Y(dst,y) dst = y |
#define VIEWPORT_Z(dst,z) dst = z |
#else |
#define VIEWPORT_X(dst,x) dst = s[0] * x + s[12] |
#define VIEWPORT_Y(dst,y) dst = s[5] * y + s[13] |
#define VIEWPORT_Z(dst,z) dst = s[10] * z + s[14] |
#endif |
#if (HAVE_HW_DIVIDE && !HAVE_PTEX_VERTICES) |
#error "can't cope with this combination" |
#endif |
#ifndef LOCALVARS |
#define LOCALVARS |
#endif |
#ifndef CHECK_HW_DIVIDE |
#define CHECK_HW_DIVIDE 1 |
#endif |
#if (HAVE_HW_DIVIDE || DO_SPEC || DO_TEX0 || DO_FOG || !HAVE_TINY_VERTICES) |
static void TAG(emit)( GLcontext *ctx, |
GLuint start, GLuint end, |
void *dest, |
GLuint stride ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
GLfloat (*tc0)[4], (*tc1)[4], (*fog)[4]; |
GLfloat (*tc2)[4], (*tc3)[4]; |
GLubyte (*col)[4], (*spec)[4]; |
GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride; |
GLuint tc2_stride, tc3_stride; |
GLuint tc0_size, tc1_size; |
GLuint tc2_size, tc3_size; |
GLfloat (*coord)[4]; |
GLuint coord_stride; |
VERTEX *v = (VERTEX *)dest; |
const GLfloat *s = GET_VIEWPORT_MAT(); |
const GLubyte *mask = VB->ClipMask; |
int i; |
/* fprintf(stderr, "%s(big) importable %d %d..%d\n", */ |
/* __FUNCTION__, VB->importable_data, start, end); */ |
if (HAVE_HW_VIEWPORT && HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { |
(void) s; |
coord = VB->ClipPtr->data; |
coord_stride = VB->ClipPtr->stride; |
} |
else { |
coord = VB->NdcPtr->data; |
coord_stride = VB->NdcPtr->stride; |
} |
if (DO_TEX3) { |
const GLuint t3 = GET_TEXSOURCE(3); |
tc3 = VB->TexCoordPtr[t3]->data; |
tc3_stride = VB->TexCoordPtr[t3]->stride; |
if (DO_PTEX) |
tc3_size = VB->TexCoordPtr[t3]->size; |
} |
if (DO_TEX2) { |
const GLuint t2 = GET_TEXSOURCE(2); |
tc2 = VB->TexCoordPtr[t2]->data; |
tc2_stride = VB->TexCoordPtr[t2]->stride; |
if (DO_PTEX) |
tc2_size = VB->TexCoordPtr[t2]->size; |
} |
if (DO_TEX1) { |
const GLuint t1 = GET_TEXSOURCE(1); |
tc1 = VB->TexCoordPtr[t1]->data; |
tc1_stride = VB->TexCoordPtr[t1]->stride; |
if (DO_PTEX) |
tc1_size = VB->TexCoordPtr[t1]->size; |
} |
if (DO_TEX0) { |
const GLuint t0 = GET_TEXSOURCE(0); |
tc0_stride = VB->TexCoordPtr[t0]->stride; |
tc0 = VB->TexCoordPtr[t0]->data; |
if (DO_PTEX) |
tc0_size = VB->TexCoordPtr[t0]->size; |
} |
if (DO_RGBA) { |
if (VB->ColorPtr[0]->Type != GL_UNSIGNED_BYTE) |
IMPORT_FLOAT_COLORS( ctx ); |
col = (GLubyte (*)[4])VB->ColorPtr[0]->Ptr; |
col_stride = VB->ColorPtr[0]->StrideB; |
} |
if (DO_SPEC) { |
if (VB->SecondaryColorPtr[0]) { |
if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE) |
IMPORT_FLOAT_SPEC_COLORS( ctx ); |
spec = (GLubyte (*)[4])VB->SecondaryColorPtr[0]->Ptr; |
spec_stride = VB->SecondaryColorPtr[0]->StrideB; |
} else { |
GLubyte tmp[4]; |
spec = &tmp; |
spec_stride = 0; |
} |
} |
if (DO_FOG) { |
if (VB->FogCoordPtr) { |
fog = VB->FogCoordPtr->data; |
fog_stride = VB->FogCoordPtr->stride; |
} |
else { |
static GLfloat tmp[4] = {0, 0, 0, 0}; |
fog = &tmp; |
fog_stride = 0; |
} |
} |
if (VB->importable_data) { |
/* May have nonstandard strides: |
*/ |
if (start) { |
coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride); |
if (DO_TEX0) |
tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + start * tc0_stride); |
if (DO_TEX1) |
tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + start * tc1_stride); |
if (DO_TEX2) |
tc2 = (GLfloat (*)[4])((GLubyte *)tc2 + start * tc2_stride); |
if (DO_TEX3) |
tc3 = (GLfloat (*)[4])((GLubyte *)tc3 + start * tc3_stride); |
if (DO_RGBA) |
STRIDE_4UB(col, start * col_stride); |
if (DO_SPEC) |
STRIDE_4UB(spec, start * spec_stride); |
if (DO_FOG) |
/*STRIDE_F(fog, start * fog_stride);*/ |
fog = (GLfloat (*)[4])((GLfloat *)fog + start * fog_stride); |
} |
for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) { |
if (DO_XYZW) { |
if (HAVE_HW_VIEWPORT || mask[i] == 0) { |
VIEWPORT_X(v->v.x, coord[0][0]); |
VIEWPORT_Y(v->v.y, coord[0][1]); |
VIEWPORT_Z(v->v.z, coord[0][2]); |
v->v.w = coord[0][3]; |
} |
/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %.2f\n", */ |
/* i, v->v.x, v->v.y, v->v.z, v->v.w); */ |
coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride); |
} |
if (DO_RGBA) { |
if (HAVE_RGBA_COLOR) { |
*(GLuint *)&v->v.color = LE32_TO_CPU(*(GLuint *)&col[0]); |
STRIDE_4UB(col, col_stride); |
} else { |
v->v.color.blue = col[0][2]; |
v->v.color.green = col[0][1]; |
v->v.color.red = col[0][0]; |
v->v.color.alpha = col[0][3]; |
STRIDE_4UB(col, col_stride); |
} |
} |
if (DO_SPEC) { |
v->v.specular.red = spec[0][0]; |
v->v.specular.green = spec[0][1]; |
v->v.specular.blue = spec[0][2]; |
STRIDE_4UB(spec, spec_stride); |
} |
if (DO_FOG) { |
v->v.specular.alpha = fog[0][0] * 255.0; |
/*STRIDE_F(fog, fog_stride);*/ |
fog = (GLfloat (*)[4])((GLfloat *)fog + fog_stride); |
} |
if (DO_TEX0) { |
v->v.u0 = tc0[0][0]; |
v->v.v0 = tc0[0][1]; |
if (DO_PTEX) { |
if (HAVE_PTEX_VERTICES) { |
if (tc0_size == 4) |
v->pv.q0 = tc0[0][3]; |
else |
v->pv.q0 = 1.0; |
} |
else if (tc0_size == 4) { |
float rhw = 1.0 / tc0[0][3]; |
v->v.w *= tc0[0][3]; |
v->v.u0 *= rhw; |
v->v.v0 *= rhw; |
} |
} |
tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + tc0_stride); |
} |
if (DO_TEX1) { |
if (DO_PTEX) { |
v->pv.u1 = tc1[0][0]; |
v->pv.v1 = tc1[0][1]; |
if (tc1_size == 4) |
v->pv.q1 = tc1[0][3]; |
else |
v->pv.q1 = 1.0; |
} |
else { |
v->v.u1 = tc1[0][0]; |
v->v.v1 = tc1[0][1]; |
} |
tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + tc1_stride); |
} |
else if (DO_PTEX) { |
*(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ |
} |
if (DO_TEX2) { |
if (DO_PTEX) { |
v->pv.u2 = tc2[0][0]; |
v->pv.v2 = tc2[0][1]; |
if (tc2_size == 4) |
v->pv.q2 = tc2[0][3]; |
else |
v->pv.q2 = 1.0; |
} |
else { |
v->v.u2 = tc2[0][0]; |
v->v.v2 = tc2[0][1]; |
} |
tc2 = (GLfloat (*)[4])((GLubyte *)tc2 + tc2_stride); |
} |
if (DO_TEX3) { |
if (DO_PTEX) { |
v->pv.u3 = tc3[0][0]; |
v->pv.v3 = tc3[0][1]; |
if (tc3_size == 4) |
v->pv.q3 = tc3[0][3]; |
else |
v->pv.q3 = 1.0; |
} |
else { |
v->v.u3 = tc3[0][0]; |
v->v.v3 = tc3[0][1]; |
} |
tc3 = (GLfloat (*)[4])((GLubyte *)tc3 + tc3_stride); |
} |
} |
} |
else { |
for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) { |
if (DO_XYZW) { |
if (HAVE_HW_VIEWPORT || mask[i] == 0) { |
VIEWPORT_X(v->v.x, coord[i][0]); |
VIEWPORT_Y(v->v.y, coord[i][1]); |
VIEWPORT_Z(v->v.z, coord[i][2]); |
v->v.w = coord[i][3]; |
} |
} |
if (DO_RGBA) { |
if (HAVE_RGBA_COLOR) { |
*(GLuint *)&v->v.color = LE32_TO_CPU(*(GLuint *)&col[i]); |
} |
else { |
v->v.color.blue = col[i][2]; |
v->v.color.green = col[i][1]; |
v->v.color.red = col[i][0]; |
v->v.color.alpha = col[i][3]; |
} |
} |
if (DO_SPEC) { |
v->v.specular.red = spec[i][0]; |
v->v.specular.green = spec[i][1]; |
v->v.specular.blue = spec[i][2]; |
} |
if (DO_FOG) { |
v->v.specular.alpha = fog[i][0] * 255.0; |
} |
if (DO_TEX0) { |
v->v.u0 = tc0[i][0]; |
v->v.v0 = tc0[i][1]; |
if (DO_PTEX) { |
if (HAVE_PTEX_VERTICES) { |
if (tc0_size == 4) |
v->pv.q0 = tc0[i][3]; |
else |
v->pv.q0 = 1.0; |
v->pv.q1 = 0; /* radeon */ |
} |
else if (tc0_size == 4) { |
float rhw = 1.0 / tc0[i][3]; |
v->v.w *= tc0[i][3]; |
v->v.u0 *= rhw; |
v->v.v0 *= rhw; |
} |
} |
} |
if (DO_TEX1) { |
if (DO_PTEX) { |
v->pv.u1 = tc1[i][0]; |
v->pv.v1 = tc1[i][1]; |
if (tc1_size == 4) |
v->pv.q1 = tc1[i][3]; |
else |
v->pv.q1 = 1.0; |
} |
else { |
v->v.u1 = tc1[i][0]; |
v->v.v1 = tc1[i][1]; |
} |
} |
} |
} |
} |
#else |
#if DO_XYZW |
#if HAVE_HW_DIVIDE |
#error "cannot use tiny vertices with hw perspective divide" |
#endif |
static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end, |
void *dest, GLuint stride ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
GLubyte (*col)[4]; |
GLuint col_stride; |
GLfloat (*coord)[4] = VB->NdcPtr->data; |
GLuint coord_stride = VB->NdcPtr->stride; |
GLfloat *v = (GLfloat *)dest; |
const GLubyte *mask = VB->ClipMask; |
const GLfloat *s = GET_VIEWPORT_MAT(); |
int i; |
(void) s; |
ASSERT(stride == 4); |
if (VB->ColorPtr[0]->Type != GL_UNSIGNED_BYTE) |
IMPORT_FLOAT_COLORS( ctx ); |
col = (GLubyte (*)[4])VB->ColorPtr[0]->Ptr; |
col_stride = VB->ColorPtr[0]->StrideB; |
ASSERT(VB->ColorPtr[0]->Type == GL_UNSIGNED_BYTE); |
/* fprintf(stderr, "%s(small) importable %x\n", */ |
/* __FUNCTION__, VB->importable_data); */ |
/* Pack what's left into a 4-dword vertex. Color is in a different |
* place, and there is no 'w' coordinate. |
*/ |
if (VB->importable_data) { |
if (start) { |
coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride); |
STRIDE_4UB(col, start * col_stride); |
} |
for (i=start; i < end; i++, v+=4) { |
if (HAVE_HW_VIEWPORT || mask[i] == 0) { |
VIEWPORT_X(v[0], coord[0][0]); |
VIEWPORT_Y(v[1], coord[0][1]); |
VIEWPORT_Z(v[2], coord[0][2]); |
} |
coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride); |
if (DO_RGBA) { |
if (HAVE_RGBA_COLOR) { |
*(GLuint *)&v[3] = LE32_TO_CPU(*(GLuint *)col); |
} |
else { |
VERTEX_COLOR *c = (VERTEX_COLOR *)&v[3]; |
c->blue = col[0][2]; |
c->green = col[0][1]; |
c->red = col[0][0]; |
c->alpha = col[0][3]; |
} |
STRIDE_4UB( col, col_stride ); |
} |
/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %x\n", */ |
/* i, v[0], v[1], v[2], *(int *)&v[3]); */ |
} |
} |
else { |
for (i=start; i < end; i++, v+=4) { |
if (HAVE_HW_VIEWPORT || mask[i] == 0) { |
VIEWPORT_X(v[0], coord[i][0]); |
VIEWPORT_Y(v[1], coord[i][1]); |
VIEWPORT_Z(v[2], coord[i][2]); |
} |
if (DO_RGBA) { |
if (HAVE_RGBA_COLOR) { |
*(GLuint *)&v[3] = LE32_TO_CPU(*(GLuint *)&col[i]); |
} |
else { |
VERTEX_COLOR *c = (VERTEX_COLOR *)&v[3]; |
c->blue = col[i][2]; |
c->green = col[i][1]; |
c->red = col[i][0]; |
c->alpha = col[i][3]; |
} |
} |
/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %x\n", */ |
/* i, v[0], v[1], v[2], *(int *)&v[3]); */ |
} |
} |
} |
#else |
static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end, |
void *dest, GLuint stride ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
GLubyte (*col)[4]; |
GLuint col_stride; |
GLfloat *v = (GLfloat *)dest; |
int i; |
if (VB->ColorPtr[0]->Type != GL_UNSIGNED_BYTE) |
IMPORT_FLOAT_COLORS( ctx ); |
col = VB->ColorPtr[0]->Ptr; |
col_stride = VB->ColorPtr[0]->StrideB; |
if (start) |
STRIDE_4UB(col, col_stride * start); |
/* Need to figure out where color is: |
*/ |
if (GET_VERTEX_FORMAT() == TINY_VERTEX_FORMAT) |
v += 3; |
else |
v += 4; |
for (i=start; i < end; i++, STRIDE_F(v, stride)) { |
if (HAVE_RGBA_COLOR) { |
*(GLuint *)v = LE32_TO_CPU(*(GLuint *)col[0]); |
} |
else { |
VERTEX_COLOR *c = (VERTEX_COLOR *)v; |
c->blue = col[0][2]; |
c->green = col[0][1]; |
c->red = col[0][0]; |
c->alpha = col[0][3]; |
} |
STRIDE_4UB( col, col_stride ); |
} |
} |
#endif /* emit */ |
#endif /* emit */ |
#if (DO_XYZW) && (DO_RGBA) |
#if (HAVE_PTEX_VERTICES) |
static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
/* Force 'missing' texcoords to something valid. |
*/ |
if (DO_TEX3 && VB->TexCoordPtr[2] == 0) |
VB->TexCoordPtr[2] = VB->TexCoordPtr[3]; |
if (DO_TEX2 && VB->TexCoordPtr[1] == 0) |
VB->TexCoordPtr[1] = VB->TexCoordPtr[2]; |
if (DO_TEX1 && VB->TexCoordPtr[0] == 0) |
VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; |
if (DO_PTEX) |
return GL_TRUE; |
if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || |
(DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || |
(DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4) || |
(DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4)) |
return GL_FALSE; |
return GL_TRUE; |
} |
#else |
static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
/* Force 'missing' texcoords to something valid. |
*/ |
if (DO_TEX3 && VB->TexCoordPtr[2] == 0) |
VB->TexCoordPtr[2] = VB->TexCoordPtr[3]; |
if (DO_TEX2 && VB->TexCoordPtr[1] == 0) |
VB->TexCoordPtr[1] = VB->TexCoordPtr[2]; |
if (DO_TEX1 && VB->TexCoordPtr[0] == 0) |
VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; |
if (DO_PTEX) |
return GL_TRUE; |
/* No hardware support for projective texture. Can fake it for |
* TEX0 only. |
*/ |
if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || |
(DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || |
(DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4)) { |
PTEX_FALLBACK(); |
return GL_FALSE; |
} |
if (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4) { |
if (DO_TEX1 || DO_TEX2 || DO_TEX3) { |
PTEX_FALLBACK(); |
} |
return GL_FALSE; |
} |
return GL_TRUE; |
} |
#endif /* ptex */ |
static void TAG(interp)( GLcontext *ctx, |
GLfloat t, |
GLuint edst, GLuint eout, GLuint ein, |
GLboolean force_boundary ) |
{ |
LOCALVARS |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
GLubyte *ddverts = GET_VERTEX_STORE(); |
GLuint shift = GET_VERTEX_STRIDE_SHIFT(); |
const GLfloat *dstclip = VB->ClipPtr->data[edst]; |
GLfloat w; |
const GLfloat *s = GET_VIEWPORT_MAT(); |
VERTEX *dst = (VERTEX *)(ddverts + (edst << shift)); |
VERTEX *in = (VERTEX *)(ddverts + (ein << shift)); |
VERTEX *out = (VERTEX *)(ddverts + (eout << shift)); |
(void)s; |
if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { |
VIEWPORT_X( dst->v.x, dstclip[0] ); |
VIEWPORT_Y( dst->v.y, dstclip[1] ); |
VIEWPORT_Z( dst->v.z, dstclip[2] ); |
w = dstclip[3]; |
} |
else { |
w = 1.0 / dstclip[3]; |
VIEWPORT_X( dst->v.x, dstclip[0] * w ); |
VIEWPORT_Y( dst->v.y, dstclip[1] * w ); |
VIEWPORT_Z( dst->v.z, dstclip[2] * w ); |
} |
if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) || |
DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 || |
DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) { |
dst->v.w = w; |
INTERP_UB( t, dst->ub4[4][0], out->ub4[4][0], in->ub4[4][0] ); |
INTERP_UB( t, dst->ub4[4][1], out->ub4[4][1], in->ub4[4][1] ); |
INTERP_UB( t, dst->ub4[4][2], out->ub4[4][2], in->ub4[4][2] ); |
INTERP_UB( t, dst->ub4[4][3], out->ub4[4][3], in->ub4[4][3] ); |
if (DO_SPEC) { |
INTERP_UB( t, dst->v.specular.red, out->v.specular.red, in->v.specular.red ); |
INTERP_UB( t, dst->v.specular.green, out->v.specular.green, in->v.specular.green ); |
INTERP_UB( t, dst->v.specular.blue, out->v.specular.blue, in->v.specular.blue ); |
} |
if (DO_FOG) { |
INTERP_UB( t, dst->v.specular.alpha, out->v.specular.alpha, in->v.specular.alpha ); |
} |
if (DO_TEX0) { |
if (DO_PTEX) { |
if (HAVE_PTEX_VERTICES) { |
INTERP_F( t, dst->pv.u0, out->pv.u0, in->pv.u0 ); |
INTERP_F( t, dst->pv.v0, out->pv.v0, in->pv.v0 ); |
INTERP_F( t, dst->pv.q0, out->pv.q0, in->pv.q0 ); |
} else { |
GLfloat wout = VB->NdcPtr->data[eout][3]; |
GLfloat win = VB->NdcPtr->data[ein][3]; |
GLfloat qout = out->pv.w / wout; |
GLfloat qin = in->pv.w / win; |
GLfloat qdst, rqdst; |
ASSERT( !HAVE_HW_DIVIDE ); |
INTERP_F( t, dst->v.u0, out->v.u0 * qout, in->v.u0 * qin ); |
INTERP_F( t, dst->v.v0, out->v.v0 * qout, in->v.v0 * qin ); |
INTERP_F( t, qdst, qout, qin ); |
rqdst = 1.0 / qdst; |
dst->v.u0 *= rqdst; |
dst->v.v0 *= rqdst; |
dst->v.w *= rqdst; |
} |
} |
else { |
INTERP_F( t, dst->v.u0, out->v.u0, in->v.u0 ); |
INTERP_F( t, dst->v.v0, out->v.v0, in->v.v0 ); |
} |
} |
if (DO_TEX1) { |
if (DO_PTEX) { |
INTERP_F( t, dst->pv.u1, out->pv.u1, in->pv.u1 ); |
INTERP_F( t, dst->pv.v1, out->pv.v1, in->pv.v1 ); |
INTERP_F( t, dst->pv.q1, out->pv.q1, in->pv.q1 ); |
} else { |
INTERP_F( t, dst->v.u1, out->v.u1, in->v.u1 ); |
INTERP_F( t, dst->v.v1, out->v.v1, in->v.v1 ); |
} |
} |
else if (DO_PTEX) { |
dst->pv.q1 = 0.0; /* must be a valid float on radeon */ |
} |
if (DO_TEX2) { |
if (DO_PTEX) { |
INTERP_F( t, dst->pv.u2, out->pv.u2, in->pv.u2 ); |
INTERP_F( t, dst->pv.v2, out->pv.v2, in->pv.v2 ); |
INTERP_F( t, dst->pv.q2, out->pv.q2, in->pv.q2 ); |
} else { |
INTERP_F( t, dst->v.u2, out->v.u2, in->v.u2 ); |
INTERP_F( t, dst->v.v2, out->v.v2, in->v.v2 ); |
} |
} |
if (DO_TEX3) { |
if (DO_PTEX) { |
INTERP_F( t, dst->pv.u3, out->pv.u3, in->pv.u3 ); |
INTERP_F( t, dst->pv.v3, out->pv.v3, in->pv.v3 ); |
INTERP_F( t, dst->pv.q3, out->pv.q3, in->pv.q3 ); |
} else { |
INTERP_F( t, dst->v.u3, out->v.u3, in->v.u3 ); |
INTERP_F( t, dst->v.v3, out->v.v3, in->v.v3 ); |
} |
} |
} else { |
/* 4-dword vertex. Color is in v[3] and there is no oow coordinate. |
*/ |
INTERP_UB( t, dst->ub4[3][0], out->ub4[3][0], in->ub4[3][0] ); |
INTERP_UB( t, dst->ub4[3][1], out->ub4[3][1], in->ub4[3][1] ); |
INTERP_UB( t, dst->ub4[3][2], out->ub4[3][2], in->ub4[3][2] ); |
INTERP_UB( t, dst->ub4[3][3], out->ub4[3][3], in->ub4[3][3] ); |
} |
} |
#endif /* rgba && xyzw */ |
static void TAG(init)( void ) |
{ |
setup_tab[IND].emit = TAG(emit); |
#if (DO_XYZW && DO_RGBA) |
setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes); |
setup_tab[IND].interp = TAG(interp); |
#endif |
if (DO_SPEC) |
setup_tab[IND].copy_pv = copy_pv_rgba4_spec5; |
else if (HAVE_HW_DIVIDE || DO_SPEC || DO_FOG || DO_TEX0 || DO_TEX1 || |
DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) |
setup_tab[IND].copy_pv = copy_pv_rgba4; |
else |
setup_tab[IND].copy_pv = copy_pv_rgba3; |
if (DO_TEX3) { |
if (DO_PTEX) { |
ASSERT(HAVE_PTEX_VERTICES); |
setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 18; |
setup_tab[IND].vertex_stride_shift = 7; |
} |
else { |
setup_tab[IND].vertex_format = TEX3_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 14; |
setup_tab[IND].vertex_stride_shift = 6; |
} |
} |
else if (DO_TEX2) { |
if (DO_PTEX) { |
ASSERT(HAVE_PTEX_VERTICES); |
setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 18; |
setup_tab[IND].vertex_stride_shift = 7; |
} |
else { |
setup_tab[IND].vertex_format = TEX2_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 12; |
setup_tab[IND].vertex_stride_shift = 6; |
} |
} |
else if (DO_TEX1) { |
if (DO_PTEX) { |
ASSERT(HAVE_PTEX_VERTICES); |
setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 12; |
setup_tab[IND].vertex_stride_shift = 6; |
} |
else { |
setup_tab[IND].vertex_format = TEX1_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 10; |
setup_tab[IND].vertex_stride_shift = 6; |
} |
} |
else if (DO_TEX0) { |
if (DO_PTEX && HAVE_PTEX_VERTICES) { |
setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 12; |
setup_tab[IND].vertex_stride_shift = 6; |
} else { |
setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 8; |
setup_tab[IND].vertex_stride_shift = 5; |
} |
} |
else if (!HAVE_HW_DIVIDE && !DO_SPEC && !DO_FOG && HAVE_TINY_VERTICES) { |
setup_tab[IND].vertex_format = TINY_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 4; |
setup_tab[IND].vertex_stride_shift = 4; |
} else if (HAVE_NOTEX_VERTICES) { |
setup_tab[IND].vertex_format = NOTEX_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 6; |
setup_tab[IND].vertex_stride_shift = 5; |
} else { |
setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT; |
setup_tab[IND].vertex_size = 8; |
setup_tab[IND].vertex_stride_shift = 5; |
} |
assert(setup_tab[IND].vertex_size * 4 <= |
1 << setup_tab[IND].vertex_stride_shift); |
} |
#undef IND |
#undef TAG |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd.c |
---|
0,0 → 1,59 |
/* $Id: t_dd.c,v 1.1 2003-02-28 11:54:01 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 3.5 |
* |
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc ) |
{ |
i810ContextPtr imesa = I810_CONTEXT( ctx ); |
GLubyte *i810verts = (GLubyte *)imesa->verts; |
GLuint shift = imesa->vertex_stride_shift; |
i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift)); |
i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift)); |
dst->ui[4] = src->ui[4]; |
dst->ui[5] = src->ui[5]; |
} |
static void copy_pv_rgba4( GLcontext *ctx, GLuint edst, GLuint esrc ) |
{ |
i810ContextPtr imesa = I810_CONTEXT( ctx ); |
GLubyte *i810verts = (GLubyte *)imesa->verts; |
GLuint shift = imesa->vertex_stride_shift; |
i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift)); |
i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift)); |
dst->ui[4] = src->ui[4]; |
} |
static void copy_pv_rgba3( GLcontext *ctx, GLuint edst, GLuint esrc ) |
{ |
i810ContextPtr imesa = I810_CONTEXT( ctx ); |
GLubyte *i810verts = (GLubyte *)imesa->verts; |
GLuint shift = imesa->vertex_stride_shift; |
i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift)); |
i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift)); |
dst->ui[3] = src->ui[3]; |
} |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_vertex.h |
---|
0,0 → 1,79 |
/* $Id: t_dd_vertex.h,v 1.1 2003-02-28 11:54:02 pj Exp $ */ |
/* |
* Mesa 3-D graphics library |
* Version: 4.0.3 |
* |
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved. |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
* to deal in the Software without restriction, including without limitation |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
* and/or sell copies of the Software, and to permit persons to whom the |
* Software is furnished to do so, subject to the following conditions: |
* |
* The above copyright notice and this permission notice shall be included |
* in all copies or substantial portions of the Software. |
* |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
* |
* Authors: |
* Keith Whitwell <keith@tungstengraphics.com> |
*/ |
typedef struct { |
GLfloat x, y, z, w; |
} TAG(_coord_t); |
#ifdef COLOR_IS_RGBA |
typedef struct { |
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN |
GLubyte alpha, blue, green, red; |
#else |
GLubyte red, green, blue, alpha; |
#endif |
} TAG(_color_t); |
#else |
typedef struct { |
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN |
GLubyte alpha, red, green, blue; |
#else |
GLubyte blue, green, red, alpha; |
#endif |
} TAG(_color_t); |
#endif |
typedef union { |
struct { |
GLfloat x, y, z, w; |
TAG(_color_t) color; |
TAG(_color_t) specular; |
GLfloat u0, v0; |
GLfloat u1, v1; |
GLfloat u2, v2; |
GLfloat u3, v3; |
} v; |
struct { |
GLfloat x, y, z, w; |
TAG(_color_t) color; |
TAG(_color_t) specular; |
GLfloat u0, v0, q0; |
GLfloat u1, v1, q1; |
GLfloat u2, v2, q2; |
GLfloat u3, v3, q3; |
} pv; |
struct { |
GLfloat x, y, z; |
TAG(_color_t) color; |
} tv; |
GLfloat f[24]; |
GLuint ui[24]; |
GLubyte ub4[24][4]; |
} TAG(Vertex), *TAG(VertexPtr); |
/shark/trunk/ports/mesa/src/tnl_dd/t_dd_triemit.h |
---|
0,0 → 1,157 |
#ifndef DO_DEBUG_VERTS |
#define DO_DEBUG_VERTS 0 |
#endif |
#ifndef PRINT_VERTEX |
#define PRINT_VERTEX(x) |
#endif |
#if defined(USE_X86_ASM) |
#define COPY_DWORDS( j, vb, vertsize, v ) \ |
do { \ |
int __tmp; \ |
__asm__ __volatile__( "rep ; movsl" \ |
: "=%c" (j), "=D" (vb), "=S" (__tmp) \ |
: "0" (vertsize), \ |
"D" ((long)vb), \ |
"S" ((long)v) ); \ |
} while (0) |
#else |
#define COPY_DWORDS( j, vb, vertsize, v ) \ |
do { \ |
for ( j = 0 ; j < vertsize ; j++ ) \ |
vb[j] = ((GLuint *)v)[j]; \ |
vb += vertsize; \ |
} while (0) |
#endif |
#if HAVE_QUADS |
static __inline void TAG(quad)( CTX_ARG, |
VERTEX *v0, |
VERTEX *v1, |
VERTEX *v2, |
VERTEX *v3 ) |
{ |
GLuint vertsize = GET_VERTEX_DWORDS(); |
GLuint *vb = (GLuint *)ALLOC_VERTS( 4, vertsize); |
GLuint j; |
if (DO_DEBUG_VERTS) { |
fprintf(stderr, "%s\n", __FUNCTION__); |
PRINT_VERTEX(v0); |
PRINT_VERTEX(v1); |
PRINT_VERTEX(v2); |
PRINT_VERTEX(v3); |
} |
COPY_DWORDS( j, vb, vertsize, v0 ); |
COPY_DWORDS( j, vb, vertsize, v1 ); |
COPY_DWORDS( j, vb, vertsize, v2 ); |
COPY_DWORDS( j, vb, vertsize, v3 ); |
} |
#else |
static __inline void TAG(quad)( CTX_ARG, |
VERTEX *v0, |
VERTEX *v1, |
VERTEX *v2, |
VERTEX *v3 ) |
{ |
GLuint vertsize = GET_VERTEX_DWORDS(); |
GLuint *vb = (GLuint *)ALLOC_VERTS( 6, vertsize); |
GLuint j; |
if (DO_DEBUG_VERTS) { |
fprintf(stderr, "%s\n", __FUNCTION__); |
PRINT_VERTEX(v0); |
PRINT_VERTEX(v1); |
PRINT_VERTEX(v2); |
PRINT_VERTEX(v3); |
} |
COPY_DWORDS( j, vb, vertsize, v0 ); |
COPY_DWORDS( j, vb, vertsize, v1 ); |
COPY_DWORDS( j, vb, vertsize, v3 ); |
COPY_DWORDS( j, vb, vertsize, v1 ); |
COPY_DWORDS( j, vb, vertsize, v2 ); |
COPY_DWORDS( j, vb, vertsize, v3 ); |
} |
#endif |
static __inline void TAG(triangle)( CTX_ARG, |
VERTEX *v0, |
VERTEX *v1, |
VERTEX *v2 ) |
{ |
GLuint vertsize = GET_VERTEX_DWORDS(); |
GLuint *vb = (GLuint *)ALLOC_VERTS( 3, vertsize); |
GLuint j; |
if (DO_DEBUG_VERTS) { |
fprintf(stderr, "%s\n", __FUNCTION__); |
PRINT_VERTEX(v0); |
PRINT_VERTEX(v1); |
PRINT_VERTEX(v2); |
} |
COPY_DWORDS( j, vb, vertsize, v0 ); |
COPY_DWORDS( j, vb, vertsize, v1 ); |
COPY_DWORDS( j, vb, vertsize, v2 ); |
} |
#if HAVE_LINES |
static __inline void TAG(line)( CTX_ARG, |
VERTEX *v0, |
VERTEX *v1 ) |
{ |
GLuint vertsize = GET_VERTEX_DWORDS(); |
GLuint *vb = (GLuint *)ALLOC_VERTS( 2, vertsize); |
GLuint j; |
COPY_DWORDS( j, vb, vertsize, v0 ); |
COPY_DWORDS( j, vb, vertsize, v1 ); |
} |
#endif |
#if HAVE_POINTS |
static __inline void TAG(point)( CTX_ARG, |
VERTEX *v0 ) |
{ |
GLuint vertsize = GET_VERTEX_DWORDS(); |
GLuint *vb = (GLuint *)ALLOC_VERTS( 1, vertsize); |
int j; |
COPY_DWORDS( j, vb, vertsize, v0 ); |
} |
#endif |
static void TAG(fast_clipped_poly)( GLcontext *ctx, const GLuint *elts, |
GLuint n ) |
{ |
LOCAL_VARS |
GLuint vertsize = GET_VERTEX_DWORDS(); |
GLuint *vb = (GLuint *)ALLOC_VERTS( (n-2) * 3, vertsize ); |
const GLuint *start = (const GLuint *)VERT(elts[0]); |
int i,j; |
if (DO_DEBUG_VERTS) { |
fprintf(stderr, "%s\n", __FUNCTION__); |
PRINT_VERTEX(VERT(elts[0])); |
PRINT_VERTEX(VERT(elts[1])); |
} |
for (i = 2 ; i < n ; i++) { |
if (DO_DEBUG_VERTS) { |
PRINT_VERTEX(VERT(elts[i])); |
} |
COPY_DWORDS( j, vb, vertsize, VERT(elts[i-1]) ); |
COPY_DWORDS( j, vb, vertsize, VERT(elts[i]) ); |
COPY_DWORDS( j, vb, vertsize, start ); |
} |
} |