diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_state_upload.c | 1 | ||||
-rw-r--r-- | src/mesa/main/context.c | 2 | ||||
-rw-r--r-- | src/mesa/main/debug.c | 3 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 2 | ||||
-rw-r--r-- | src/mesa/main/extensions.c | 3 | ||||
-rw-r--r-- | src/mesa/main/get.c | 25 | ||||
-rw-r--r-- | src/mesa/main/image.c | 34 | ||||
-rw-r--r-- | src/mesa/main/image.h | 5 | ||||
-rw-r--r-- | src/mesa/main/matrix.c | 6 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 25 | ||||
-rw-r--r-- | src/mesa/main/pixel.c | 66 | ||||
-rw-r--r-- | src/mesa/main/querymatrix.c | 4 | ||||
-rw-r--r-- | src/mesa/program/prog_statevars.c | 29 | ||||
-rw-r--r-- | src/mesa/program/prog_statevars.h | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_pixeltransfer.c | 130 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 1 |
16 files changed, 5 insertions, 334 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index a0c130557e3..e4f36a7ec38 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -231,7 +231,6 @@ static struct dirty_bit_map mesa_bits[] = { DEFINE_BIT(_NEW_MODELVIEW), DEFINE_BIT(_NEW_PROJECTION), DEFINE_BIT(_NEW_TEXTURE_MATRIX), - DEFINE_BIT(_NEW_COLOR_MATRIX), DEFINE_BIT(_NEW_ACCUM), DEFINE_BIT(_NEW_COLOR), DEFINE_BIT(_NEW_DEPTH), diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 774553ccce4..87285683f80 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -341,7 +341,6 @@ static void dummy_enum_func(void) { gl_buffer_index bi = BUFFER_FRONT_LEFT; - gl_colortable_index ci = COLORTABLE_PRECONVOLUTION; gl_face_index fi = FACE_POS_X; gl_frag_attrib fa = FRAG_ATTRIB_WPOS; gl_frag_result fr = FRAG_RESULT_DEPTH; @@ -352,7 +351,6 @@ dummy_enum_func(void) gl_geom_result gr = GEOM_RESULT_POS; (void) bi; - (void) ci; (void) fi; (void) fa; (void) fr; diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 526145aeccf..4205c7a4b71 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -85,13 +85,12 @@ void _mesa_print_state( const char *msg, GLuint state ) { _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", + "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", msg, state, (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "", (state & _NEW_PROJECTION) ? "ctx->Projection, " : "", (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "", - (state & _NEW_COLOR_MATRIX) ? "ctx->ColorMatrix, " : "", (state & _NEW_ACCUM) ? "ctx->Accum, " : "", (state & _NEW_COLOR) ? "ctx->Color, " : "", (state & _NEW_DEPTH) ? "ctx->Depth, " : "", diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index d847d4d5d3c..3a730f0e406 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1552,7 +1552,6 @@ save_ColorTableParameterfv(GLenum target, GLenum pname, n[3].f = params[0]; if (pname == GL_COLOR_TABLE_SGI || pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI || pname == GL_TEXTURE_COLOR_TABLE_SGI) { n[4].f = params[1]; n[5].f = params[2]; @@ -1581,7 +1580,6 @@ save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) n[3].i = params[0]; if (pname == GL_COLOR_TABLE_SGI || pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI || pname == GL_TEXTURE_COLOR_TABLE_SGI) { n[4].i = params[1]; n[5].i = params[2]; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 3e4801030d1..3f86973e3ea 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -206,7 +206,6 @@ static const struct { { OFF, "GL_NV_vertex_program", F(NV_vertex_program) }, { OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) }, { ON, "GL_OES_read_format", F(OES_read_format) }, - { OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) }, { OFF, "GL_SGI_texture_color_table", F(SGI_texture_color_table) }, { OFF, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) }, { OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) }, @@ -366,7 +365,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program ctx->Extensions.NV_fragment_program_option = GL_TRUE; #endif - ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGI_texture_color_table = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE; @@ -396,7 +394,6 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; ctx->Extensions.EXT_convolution = GL_TRUE; - ctx->Extensions.SGI_color_matrix = GL_TRUE; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index bb2ce759d36..33ea81b83a6 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -874,36 +874,12 @@ static const struct value_desc values[] = { extra_EXT_compiled_vertex_array }, /* GL_ARB_transpose_matrix */ - { GL_TRANSPOSE_COLOR_MATRIX_ARB, CONTEXT_MATRIX_T(ColorMatrixStack.Top), NO_EXTRA }, { GL_TRANSPOSE_MODELVIEW_MATRIX_ARB, CONTEXT_MATRIX_T(ModelviewMatrixStack), NO_EXTRA }, { GL_TRANSPOSE_PROJECTION_MATRIX_ARB, CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA }, { GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA }, - /* GL_SGI_color_matrix (also in 1.2 imaging) */ - { GL_COLOR_MATRIX_SGI, CONTEXT_MATRIX(ColorMatrixStack.Top), NO_EXTRA }, - { GL_COLOR_MATRIX_STACK_DEPTH_SGI, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, ColorMatrixStack.Depth), NO_EXTRA }, - { GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI, - CONST(MAX_COLOR_STACK_DEPTH), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_RED_SCALE_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixScale[0]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixScale[1]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixScale[2]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixScale[3]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_RED_BIAS_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixBias[0]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixBias[1]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixBias[2]), NO_EXTRA }, - { GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI, - CONTEXT_FLOAT(Pixel.PostColorMatrixBias[3]), NO_EXTRA }, - /* GL_EXT_convolution (also in 1.2 imaging) */ { GL_CONVOLUTION_1D_EXT, CONTEXT_BOOL(Pixel.Convolution1DEnabled), extra_EXT_convolution }, @@ -1449,7 +1425,6 @@ find_custom_value(GLcontext *ctx, const struct value_desc *d, union value *v) case GL_MODELVIEW_STACK_DEPTH: case GL_PROJECTION_STACK_DEPTH: - case GL_COLOR_MATRIX_STACK_DEPTH_SGI: v->value_int = *(GLint *) ((char *) ctx + d->offset) + 1; break; diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 7918ef7926b..788584ae85f 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1525,36 +1525,6 @@ _mesa_map_rgba( const GLcontext *ctx, GLuint n, GLfloat rgba[][4] ) } } - -/* - * Apply the color matrix and post color matrix scaling and biasing. - */ -void -_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]) -{ - const GLfloat rs = ctx->Pixel.PostColorMatrixScale[0]; - const GLfloat rb = ctx->Pixel.PostColorMatrixBias[0]; - const GLfloat gs = ctx->Pixel.PostColorMatrixScale[1]; - const GLfloat gb = ctx->Pixel.PostColorMatrixBias[1]; - const GLfloat bs = ctx->Pixel.PostColorMatrixScale[2]; - const GLfloat bb = ctx->Pixel.PostColorMatrixBias[2]; - const GLfloat as = ctx->Pixel.PostColorMatrixScale[3]; - const GLfloat ab = ctx->Pixel.PostColorMatrixBias[3]; - const GLfloat *m = ctx->ColorMatrixStack.Top->m; - GLuint i; - for (i = 0; i < n; i++) { - const GLfloat r = rgba[i][RCOMP]; - const GLfloat g = rgba[i][GCOMP]; - const GLfloat b = rgba[i][BCOMP]; - const GLfloat a = rgba[i][ACOMP]; - rgba[i][RCOMP] = (m[0] * r + m[4] * g + m[ 8] * b + m[12] * a) * rs + rb; - rgba[i][GCOMP] = (m[1] * r + m[5] * g + m[ 9] * b + m[13] * a) * gs + gb; - rgba[i][BCOMP] = (m[2] * r + m[6] * g + m[10] * b + m[14] * a) * bs + bb; - rgba[i][ACOMP] = (m[3] * r + m[7] * g + m[11] * b + m[15] * a) * as + ab; - } -} - - /** * Apply a color table lookup to an array of floating point RGBA colors. */ @@ -1913,10 +1883,6 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, ctx->Pixel.PostConvolutionBias[BCOMP], ctx->Pixel.PostConvolutionBias[ACOMP]); } - /* color matrix transform */ - if (transferOps & IMAGE_COLOR_MATRIX_BIT) { - _mesa_transform_rgba(ctx, n, rgba); - } /* clamping to [0,1] */ if (transferOps & IMAGE_CLAMP_BIT) { GLuint i; diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 8b180d6bfe6..672dbf2823e 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -163,11 +163,6 @@ _mesa_scale_and_bias_rgba(GLuint n, GLfloat rgba[][4], extern void _mesa_map_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); - -extern void -_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); - - extern void _mesa_lookup_rgba_float(const struct gl_color_table *table, GLuint n, GLfloat rgba[][4]); diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 4b8c00b5b63..8ed718cd38e 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -177,9 +177,6 @@ _mesa_MatrixMode( GLenum mode ) ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack)); ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit]; break; - case GL_COLOR: - ctx->CurrentStack = &ctx->ColorMatrixStack; - break; case GL_MATRIX0_NV: case GL_MATRIX1_NV: case GL_MATRIX2_NV: @@ -724,8 +721,6 @@ void _mesa_init_matrix( GLcontext * ctx ) _NEW_MODELVIEW); init_matrix_stack(&ctx->ProjectionMatrixStack, MAX_PROJECTION_STACK_DEPTH, _NEW_PROJECTION); - init_matrix_stack(&ctx->ColorMatrixStack, MAX_COLOR_STACK_DEPTH, - _NEW_COLOR_MATRIX); for (i = 0; i < Elements(ctx->TextureMatrixStack); i++) init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH, _NEW_TEXTURE_MATRIX); @@ -753,7 +748,6 @@ void _mesa_free_matrix_data( GLcontext *ctx ) free_matrix_stack(&ctx->ModelviewMatrixStack); free_matrix_stack(&ctx->ProjectionMatrixStack); - free_matrix_stack(&ctx->ColorMatrixStack); for (i = 0; i < Elements(ctx->TextureMatrixStack); i++) free_matrix_stack(&ctx->TextureMatrixStack[i]); for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 97187326085..c982f55e825 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -454,16 +454,6 @@ typedef enum BUFFER_BIT_COLOR7) -/** The pixel transfer path has three color tables: */ -typedef enum -{ - COLORTABLE_PRECONVOLUTION, - COLORTABLE_POSTCONVOLUTION, - COLORTABLE_POSTCOLORMATRIX, - COLORTABLE_MAX -} gl_colortable_index; - - /** * Data structure for color tables */ @@ -975,11 +965,6 @@ struct gl_pixel_attrib GLfloat PostConvolutionScale[4]; /**< RGBA */ GLfloat PostConvolutionBias[4]; /**< RGBA */ - /* Color matrix (GL_SGI_color_matrix) */ - /* Note: the color matrix is not part of this attrib group */ - GLfloat PostColorMatrixScale[4]; /**< RGBA */ - GLfloat PostColorMatrixBias[4]; /**< RGBA */ - /*--- End Pixel Transfer State ---*/ /** glPixelZoom */ @@ -2748,7 +2733,6 @@ struct gl_extensions GLboolean NV_vertex_program; GLboolean NV_vertex_program1_1; GLboolean OES_read_format; - GLboolean SGI_color_matrix; GLboolean SGI_texture_color_table; GLboolean SGIS_generate_mipmap; GLboolean SGIS_texture_edge_clamp; @@ -2787,7 +2771,6 @@ struct gl_matrix_stack #define IMAGE_MAP_COLOR_BIT 0x4 #define IMAGE_CONVOLUTION_BIT 0x10 #define IMAGE_POST_CONVOLUTION_SCALE_BIAS 0x20 -#define IMAGE_COLOR_MATRIX_BIT 0x80 #define IMAGE_CLAMP_BIT 0x800 @@ -2797,8 +2780,7 @@ struct gl_matrix_stack IMAGE_MAP_COLOR_BIT) /** Pixel transfer ops after convolution */ -#define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS | \ - IMAGE_COLOR_MATRIX_BIT) +#define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS) /*@}*/ @@ -2811,7 +2793,6 @@ struct gl_matrix_stack #define _NEW_MODELVIEW 0x1 /**< __GLcontextRec::ModelView */ #define _NEW_PROJECTION 0x2 /**< __GLcontextRec::Projection */ #define _NEW_TEXTURE_MATRIX 0x4 /**< __GLcontextRec::TextureMatrix */ -#define _NEW_COLOR_MATRIX 0x8 /**< __GLcontextRec::ColorMatrix */ #define _NEW_ACCUM 0x10 /**< __GLcontextRec::Accum */ #define _NEW_COLOR 0x20 /**< __GLcontextRec::Color */ #define _NEW_DEPTH 0x40 /**< __GLcontextRec::Depth */ @@ -2934,8 +2915,7 @@ struct gl_matrix_stack #define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \ _NEW_TEXTURE) -#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL | \ - _NEW_COLOR_MATRIX) +#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL) /*@}*/ @@ -3083,7 +3063,6 @@ struct __GLcontextRec /*@{*/ struct gl_matrix_stack ModelviewMatrixStack; struct gl_matrix_stack ProjectionMatrixStack; - struct gl_matrix_stack ColorMatrixStack; struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS]; struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES]; struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */ diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 834a41108c2..5e900b4eed9 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -566,54 +566,6 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param ) FLUSH_VERTICES(ctx, _NEW_PIXEL); ctx->Pixel.DepthBias = param; break; - case GL_POST_COLOR_MATRIX_RED_SCALE: - if (ctx->Pixel.PostColorMatrixScale[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[0] = param; - break; - case GL_POST_COLOR_MATRIX_RED_BIAS: - if (ctx->Pixel.PostColorMatrixBias[0] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[0] = param; - break; - case GL_POST_COLOR_MATRIX_GREEN_SCALE: - if (ctx->Pixel.PostColorMatrixScale[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[1] = param; - break; - case GL_POST_COLOR_MATRIX_GREEN_BIAS: - if (ctx->Pixel.PostColorMatrixBias[1] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[1] = param; - break; - case GL_POST_COLOR_MATRIX_BLUE_SCALE: - if (ctx->Pixel.PostColorMatrixScale[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[2] = param; - break; - case GL_POST_COLOR_MATRIX_BLUE_BIAS: - if (ctx->Pixel.PostColorMatrixBias[2] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[2] = param; - break; - case GL_POST_COLOR_MATRIX_ALPHA_SCALE: - if (ctx->Pixel.PostColorMatrixScale[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixScale[3] = param; - break; - case GL_POST_COLOR_MATRIX_ALPHA_BIAS: - if (ctx->Pixel.PostColorMatrixBias[3] == param) - return; - FLUSH_VERTICES(ctx, _NEW_PIXEL); - ctx->Pixel.PostColorMatrixBias[3] = param; - break; case GL_POST_CONVOLUTION_RED_SCALE: if (ctx->Pixel.PostConvolutionScale[0] == param) return; @@ -718,17 +670,6 @@ update_image_transfer_state(GLcontext *ctx) } } - if (ctx->ColorMatrixStack.Top->type != MATRIX_IDENTITY || - ctx->Pixel.PostColorMatrixScale[0] != 1.0F || - ctx->Pixel.PostColorMatrixBias[0] != 0.0F || - ctx->Pixel.PostColorMatrixScale[1] != 1.0F || - ctx->Pixel.PostColorMatrixBias[1] != 0.0F || - ctx->Pixel.PostColorMatrixScale[2] != 1.0F || - ctx->Pixel.PostColorMatrixBias[2] != 0.0F || - ctx->Pixel.PostColorMatrixScale[3] != 1.0F || - ctx->Pixel.PostColorMatrixBias[3] != 0.0F) - mask |= IMAGE_COLOR_MATRIX_BIT; - ctx->_ImageTransferState = mask; } @@ -738,11 +679,6 @@ update_image_transfer_state(GLcontext *ctx) */ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) { - if (new_state & _NEW_COLOR_MATRIX) - _math_matrix_analyse( ctx->ColorMatrixStack.Top ); - - /* References ColorMatrix.type (derived above). - */ if (new_state & _MESA_NEW_TRANSFER_STATE) update_image_transfer_state(ctx); } @@ -814,8 +750,6 @@ _mesa_init_pixel( GLcontext *ctx ) init_pixelmap(&ctx->PixelMaps.GtoG); init_pixelmap(&ctx->PixelMaps.BtoB); init_pixelmap(&ctx->PixelMaps.AtoA); - ASSIGN_4V(ctx->Pixel.PostColorMatrixScale, 1.0, 1.0, 1.0, 1.0); - ASSIGN_4V(ctx->Pixel.PostColorMatrixBias, 0.0, 0.0, 0.0, 0.0); ctx->Pixel.Convolution1DEnabled = GL_FALSE; ctx->Pixel.Convolution2DEnabled = GL_FALSE; ctx->Pixel.Separable2DEnabled = GL_FALSE; diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c index 36236eb9a75..944ad435f7a 100644 --- a/src/mesa/main/querymatrix.c +++ b/src/mesa/main/querymatrix.c @@ -117,10 +117,6 @@ GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[ {GL_MODELVIEW, GL_MODELVIEW_MATRIX}, {GL_PROJECTION, GL_PROJECTION_MATRIX}, {GL_TEXTURE, GL_TEXTURE_MATRIX}, -#if 0 - /* this doesn't exist in GLES */ - {GL_COLOR, GL_COLOR_MATRIX}, -#endif }; /* Call Mesa to get the current matrix in floating-point form. First, diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index 2687f8ae2c0..c6fb42b9a69 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -273,7 +273,6 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], case STATE_MVP_MATRIX: case STATE_TEXTURE_MATRIX: case STATE_PROGRAM_MATRIX: - case STATE_COLOR_MATRIX: { /* state[0] = modelview, projection, texture, etc. */ /* state[1] = which texture matrix or program matrix */ @@ -309,9 +308,6 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], ASSERT(index < Elements(ctx->ProgramMatrixStack)); matrix = ctx->ProgramMatrixStack[index].Top; } - else if (mat == STATE_COLOR_MATRIX) { - matrix = ctx->ColorMatrixStack.Top; - } else { _mesa_problem(ctx, "Bad matrix name in _mesa_fetch_state()"); return; @@ -555,14 +551,6 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], value[3] = ctx->Pixel.AlphaBias; return; - case STATE_PCM_SCALE: - COPY_4V(value, ctx->Pixel.PostColorMatrixScale); - return; - - case STATE_PCM_BIAS: - COPY_4V(value, ctx->Pixel.PostColorMatrixBias); - return; - case STATE_SHADOW_AMBIENT: { const int unit = (int) state[2]; @@ -667,8 +655,6 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) return _NEW_TEXTURE_MATRIX; case STATE_PROGRAM_MATRIX: return _NEW_TRACK_MATRIX; - case STATE_COLOR_MATRIX: - return _NEW_COLOR_MATRIX; case STATE_DEPTH_RANGE: return _NEW_VIEWPORT; @@ -706,8 +692,6 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) case STATE_PT_SCALE: case STATE_PT_BIAS: - case STATE_PCM_SCALE: - case STATE_PCM_BIAS: return _NEW_PIXEL; case STATE_FB_SIZE: @@ -792,9 +776,6 @@ append_token(char *dst, gl_state_index k) case STATE_PROGRAM_MATRIX: append(dst, "matrix.program"); break; - case STATE_COLOR_MATRIX: - append(dst, "matrix.color"); - break; case STATE_MATRIX_INVERSE: append(dst, ".inverse"); break; @@ -913,12 +894,6 @@ append_token(char *dst, gl_state_index k) case STATE_PT_BIAS: append(dst, "PTbias"); break; - case STATE_PCM_SCALE: - append(dst, "PCMscale"); - break; - case STATE_PCM_BIAS: - append(dst, "PCMbias"); - break; case STATE_SHADOW_AMBIENT: append(dst, "CompareFailValue"); break; @@ -1010,7 +985,6 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) case STATE_MVP_MATRIX: case STATE_TEXTURE_MATRIX: case STATE_PROGRAM_MATRIX: - case STATE_COLOR_MATRIX: { /* state[0] = modelview, projection, texture, etc. */ /* state[1] = which texture matrix or program matrix */ @@ -1147,9 +1121,6 @@ _mesa_load_tracked_matrices(GLcontext *ctx) Elements(ctx->TextureMatrixStack) - 1); mat = ctx->TextureMatrixStack[unit].Top; } - else if (ctx->VertexProgram.TrackMatrix[i] == GL_COLOR) { - mat = ctx->ColorMatrixStack.Top; - } else if (ctx->VertexProgram.TrackMatrix[i]==GL_MODELVIEW_PROJECTION_NV) { /* XXX verify the combined matrix is up to date */ mat = &ctx->_ModelProjectMatrix; diff --git a/src/mesa/program/prog_statevars.h b/src/mesa/program/prog_statevars.h index 1753471ffb6..cfce226fb49 100644 --- a/src/mesa/program/prog_statevars.h +++ b/src/mesa/program/prog_statevars.h @@ -67,7 +67,6 @@ typedef enum gl_state_index_ { STATE_MVP_MATRIX, STATE_TEXTURE_MATRIX, STATE_PROGRAM_MATRIX, - STATE_COLOR_MATRIX, STATE_MATRIX_INVERSE, STATE_MATRIX_TRANSPOSE, STATE_MATRIX_INVTRANS, @@ -116,8 +115,6 @@ typedef enum gl_state_index_ { STATE_LIGHT_HALF_VECTOR, /* object vs eye space */ STATE_PT_SCALE, /**< Pixel transfer RGBA scale */ STATE_PT_BIAS, /**< Pixel transfer RGBA bias */ - STATE_PCM_SCALE, /**< Post color matrix RGBA scale */ - STATE_PCM_BIAS, /**< Post color matrix RGBA bias */ STATE_SHADOW_AMBIENT, /**< ARB_shadow_ambient fail value; token[2] is texture unit index */ STATE_FB_SIZE, /**< (width-1, height-1, 0, 0) */ STATE_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */ diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 8a8d17599ec..081b6b3e233 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -27,7 +27,7 @@ /* * Generate fragment programs to implement pixel transfer ops, such as - * scale/bias, colormatrix, colortable, convolution... + * scale/bias, colortable, convolution... * * Authors: * Brian Paul @@ -55,8 +55,6 @@ struct state_key { GLuint scaleAndBias:1; - GLuint colorMatrix:1; - GLuint colorMatrixPostScaleBias:1; GLuint pixelMaps:1; #if 0 @@ -70,27 +68,9 @@ struct state_key #endif }; - -static GLboolean -is_identity(const GLfloat m[16]) -{ - GLuint i; - for (i = 0; i < 16; i++) { - const int row = i % 4, col = i / 4; - const float val = (GLfloat)(row == col); - if (m[i] != val) - return GL_FALSE; - } - return GL_TRUE; -} - - static void make_state_key(GLcontext *ctx, struct state_key *key) { - static const GLfloat zero[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; - static const GLfloat one[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; - memset(key, 0, sizeof(*key)); if (ctx->Pixel.RedBias != 0.0 || ctx->Pixel.RedScale != 1.0 || @@ -100,15 +80,6 @@ make_state_key(GLcontext *ctx, struct state_key *key) key->scaleAndBias = 1; } - if (!is_identity(ctx->ColorMatrixStack.Top->m)) { - key->colorMatrix = 1; - } - - if (!TEST_EQ_4V(ctx->Pixel.PostColorMatrixScale, one) || - !TEST_EQ_4V(ctx->Pixel.PostColorMatrixBias, zero)) { - key->colorMatrixPostScaleBias = 1; - } - key->pixelMaps = ctx->Pixel.MapColorFlag; } @@ -306,103 +277,6 @@ get_pixel_transfer_program(GLcontext *ctx, const struct state_key *key) fp->Base.SamplersUsed |= (1 << 1); /* sampler 1 is used */ } - if (key->colorMatrix) { - static const gl_state_index row0_state[STATE_LENGTH] = - { STATE_COLOR_MATRIX, 0, 0, 0, 0 }; - static const gl_state_index row1_state[STATE_LENGTH] = - { STATE_COLOR_MATRIX, 0, 1, 1, 0 }; - static const gl_state_index row2_state[STATE_LENGTH] = - { STATE_COLOR_MATRIX, 0, 2, 2, 0 }; - static const gl_state_index row3_state[STATE_LENGTH] = - { STATE_COLOR_MATRIX, 0, 3, 3, 0 }; - - GLint row0_p = _mesa_add_state_reference(params, row0_state); - GLint row1_p = _mesa_add_state_reference(params, row1_state); - GLint row2_p = _mesa_add_state_reference(params, row2_state); - GLint row3_p = _mesa_add_state_reference(params, row3_state); - const GLuint temp = 1; - - /* DP4 temp.x, colorTemp, matrow0; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_DP4; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = temp; - inst[ic].DstReg.WriteMask = WRITEMASK_X; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = row0_p; - ic++; - - /* DP4 temp.y, colorTemp, matrow1; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_DP4; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = temp; - inst[ic].DstReg.WriteMask = WRITEMASK_Y; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = row1_p; - ic++; - - /* DP4 temp.z, colorTemp, matrow2; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_DP4; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = temp; - inst[ic].DstReg.WriteMask = WRITEMASK_Z; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = row2_p; - ic++; - - /* DP4 temp.w, colorTemp, matrow3; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_DP4; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = temp; - inst[ic].DstReg.WriteMask = WRITEMASK_W; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = row3_p; - ic++; - - /* MOV colorTemp, temp; */ - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_MOV; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = colorTemp; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = temp; - ic++; - } - - if (key->colorMatrixPostScaleBias) { - static const gl_state_index scale_state[STATE_LENGTH] = - { STATE_INTERNAL, STATE_PT_SCALE, 0, 0, 0 }; - static const gl_state_index bias_state[STATE_LENGTH] = - { STATE_INTERNAL, STATE_PT_BIAS, 0, 0, 0 }; - GLint scale_param, bias_param; - - scale_param = _mesa_add_state_reference(params, scale_state); - bias_param = _mesa_add_state_reference(params, bias_state); - - _mesa_init_instructions(inst + ic, 1); - inst[ic].Opcode = OPCODE_MAD; - inst[ic].DstReg.File = PROGRAM_TEMPORARY; - inst[ic].DstReg.Index = colorTemp; - inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY; - inst[ic].SrcReg[0].Index = colorTemp; - inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[1].Index = scale_param; - inst[ic].SrcReg[2].File = PROGRAM_STATE_VAR; - inst[ic].SrcReg[2].Index = bias_param; - ic++; - } - /* Modify last instruction's dst reg to write to result.color */ { struct prog_instruction *last = &inst[ic - 1]; @@ -473,7 +347,7 @@ update_pixel_transfer(struct st_context *st) const struct st_tracked_state st_update_pixel_transfer = { "st_update_pixel_transfer", /* name */ { /* dirty */ - _NEW_PIXEL | _NEW_COLOR_MATRIX, /* mesa */ + _NEW_PIXEL, /* mesa */ 0, /* st */ }, update_pixel_transfer /* update */ diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 017f6c5cf7e..225f75e3af0 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -271,7 +271,6 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.OES_draw_texture = GL_TRUE; #endif - ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; /* |