- case GL_COLOR_TABLE_SGI:
- if (pname == GL_COLOR_TABLE_SCALE_SGI) {
- ctx->Pixel.ColorTableScale[0] = params[0];
- ctx->Pixel.ColorTableScale[1] = params[1];
- ctx->Pixel.ColorTableScale[2] = params[2];
- ctx->Pixel.ColorTableScale[3] = params[3];
- }
- else if (pname == GL_COLOR_TABLE_BIAS_SGI) {
- ctx->Pixel.ColorTableBias[0] = params[0];
- ctx->Pixel.ColorTableBias[1] = params[1];
- ctx->Pixel.ColorTableBias[2] = params[2];
- ctx->Pixel.ColorTableBias[3] = params[3];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(pname)");
- return;
- }
- break;
- case GL_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameter(target)");
- return;
- }
- if (pname == GL_COLOR_TABLE_SCALE_SGI) {
- ctx->Pixel.TextureColorTableScale[0] = params[0];
- ctx->Pixel.TextureColorTableScale[1] = params[1];
- ctx->Pixel.TextureColorTableScale[2] = params[2];
- ctx->Pixel.TextureColorTableScale[3] = params[3];
- }
- else if (pname == GL_COLOR_TABLE_BIAS_SGI) {
- ctx->Pixel.TextureColorTableBias[0] = params[0];
- ctx->Pixel.TextureColorTableBias[1] = params[1];
- ctx->Pixel.TextureColorTableBias[2] = params[2];
- ctx->Pixel.TextureColorTableBias[3] = params[3];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(pname)");
- return;
- }
- break;
- case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
- if (pname == GL_COLOR_TABLE_SCALE_SGI) {
- ctx->Pixel.PCCTscale[0] = params[0];
- ctx->Pixel.PCCTscale[1] = params[1];
- ctx->Pixel.PCCTscale[2] = params[2];
- ctx->Pixel.PCCTscale[3] = params[3];
- }
- else if (pname == GL_COLOR_TABLE_BIAS_SGI) {
- ctx->Pixel.PCCTbias[0] = params[0];
- ctx->Pixel.PCCTbias[1] = params[1];
- ctx->Pixel.PCCTbias[2] = params[2];
- ctx->Pixel.PCCTbias[3] = params[3];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(pname)");
- return;
- }
- break;
- case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
- if (pname == GL_COLOR_TABLE_SCALE_SGI) {
- ctx->Pixel.PCMCTscale[0] = params[0];
- ctx->Pixel.PCMCTscale[1] = params[1];
- ctx->Pixel.PCMCTscale[2] = params[2];
- ctx->Pixel.PCMCTscale[3] = params[3];
- }
- else if (pname == GL_COLOR_TABLE_BIAS_SGI) {
- ctx->Pixel.PCMCTbias[0] = params[0];
- ctx->Pixel.PCMCTbias[1] = params[1];
- ctx->Pixel.PCMCTbias[2] = params[2];
- ctx->Pixel.PCMCTbias[3] = params[3];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(pname)");
- return;
- }
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameter(target)");
- return;
+ case GL_COLOR_TABLE_SGI:
+ scale = ctx->Pixel.ColorTableScale[COLORTABLE_PRECONVOLUTION];
+ bias = ctx->Pixel.ColorTableBias[COLORTABLE_PRECONVOLUTION];
+ break;
+ case GL_TEXTURE_COLOR_TABLE_SGI:
+ scale = ctx->Pixel.TextureColorTableScale;
+ bias = ctx->Pixel.TextureColorTableBias;
+ break;
+ case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCONVOLUTION];
+ bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCONVOLUTION];
+ break;
+ case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ scale = ctx->Pixel.ColorTableScale[COLORTABLE_POSTCOLORMATRIX];
+ bias = ctx->Pixel.ColorTableBias[COLORTABLE_POSTCOLORMATRIX];
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameter(target)");
+ return;
+ }
+
+ if (pname == GL_COLOR_TABLE_SCALE_SGI) {
+ COPY_4V(scale, params);
+ }
+ else if (pname == GL_COLOR_TABLE_BIAS_SGI) {
+ COPY_4V(bias, params);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(pname)");
+ return;