mesa: Remove EXT_histogram.
This has always been optional, and not useful.
This commit is contained in:
@@ -78,7 +78,6 @@ struct gl_enable_attrib
|
||||
GLboolean DepthTest;
|
||||
GLboolean Dither;
|
||||
GLboolean Fog;
|
||||
GLboolean Histogram;
|
||||
GLboolean Light[MAX_LIGHTS];
|
||||
GLboolean Lighting;
|
||||
GLboolean LineSmooth;
|
||||
@@ -107,7 +106,6 @@ struct gl_enable_attrib
|
||||
GLboolean Map2Vertex4;
|
||||
GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
|
||||
|
||||
GLboolean MinMax;
|
||||
GLboolean Normalize;
|
||||
GLboolean PixelTexture;
|
||||
GLboolean PointSmooth;
|
||||
@@ -279,8 +277,6 @@ _mesa_PushAttrib(GLbitfield mask)
|
||||
attr->Lighting = ctx->Light.Enabled;
|
||||
attr->LineSmooth = ctx->Line.SmoothFlag;
|
||||
attr->LineStipple = ctx->Line.StippleFlag;
|
||||
attr->Histogram = ctx->Pixel.HistogramEnabled;
|
||||
attr->MinMax = ctx->Pixel.MinMaxEnabled;
|
||||
attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled;
|
||||
attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled;
|
||||
attr->Map1Color4 = ctx->Eval.Map1Color4;
|
||||
|
@@ -98,7 +98,6 @@
|
||||
#include "feedback.h"
|
||||
#include "fog.h"
|
||||
#include "framebuffer.h"
|
||||
#include "histogram.h"
|
||||
#include "hint.h"
|
||||
#include "hash.h"
|
||||
#include "light.h"
|
||||
@@ -738,7 +737,6 @@ init_attrib_groups(GLcontext *ctx)
|
||||
_mesa_init_fbobjects( ctx );
|
||||
_mesa_init_feedback( ctx );
|
||||
_mesa_init_fog( ctx );
|
||||
_mesa_init_histogram( ctx );
|
||||
_mesa_init_hint( ctx );
|
||||
_mesa_init_line( ctx );
|
||||
_mesa_init_lighting( ctx );
|
||||
|
@@ -363,13 +363,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
|
||||
FLUSH_VERTICES(ctx, _NEW_FOG);
|
||||
ctx->Fog.Enabled = state;
|
||||
break;
|
||||
case GL_HISTOGRAM:
|
||||
CHECK_EXTENSION(EXT_histogram, cap);
|
||||
if (ctx->Pixel.HistogramEnabled == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_PIXEL);
|
||||
ctx->Pixel.HistogramEnabled = state;
|
||||
break;
|
||||
case GL_LIGHT0:
|
||||
case GL_LIGHT1:
|
||||
case GL_LIGHT2:
|
||||
@@ -534,12 +527,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
ctx->Eval.Map2Vertex4 = state;
|
||||
break;
|
||||
case GL_MINMAX:
|
||||
if (ctx->Pixel.MinMaxEnabled == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_PIXEL);
|
||||
ctx->Pixel.MinMaxEnabled = state;
|
||||
break;
|
||||
case GL_NORMALIZE:
|
||||
if (ctx->Transform.Normalize == state)
|
||||
return;
|
||||
@@ -1356,14 +1343,6 @@ _mesa_IsEnabled( GLenum cap )
|
||||
return (ctx->Array.ArrayObj->PointSize.Enabled != 0);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_histogram */
|
||||
case GL_HISTOGRAM:
|
||||
CHECK_EXTENSION(EXT_histogram);
|
||||
return ctx->Pixel.HistogramEnabled;
|
||||
case GL_MINMAX:
|
||||
CHECK_EXTENSION(EXT_histogram);
|
||||
return ctx->Pixel.MinMaxEnabled;
|
||||
|
||||
/* GL_SGI_color_table */
|
||||
case GL_COLOR_TABLE_SGI:
|
||||
CHECK_EXTENSION(SGI_color_table);
|
||||
|
@@ -128,7 +128,6 @@ static const struct {
|
||||
{ OFF, "GL_EXT_framebuffer_sRGB", F(EXT_framebuffer_sRGB) },
|
||||
{ OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) },
|
||||
{ OFF, "GL_EXT_gpu_program_parameters", F(EXT_gpu_program_parameters) },
|
||||
{ OFF, "GL_EXT_histogram", F(EXT_histogram) },
|
||||
{ ON, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) },
|
||||
{ OFF, "GL_EXT_packed_depth_stencil", F(EXT_packed_depth_stencil) },
|
||||
{ OFF, "GL_EXT_packed_float", F(EXT_packed_float) },
|
||||
@@ -319,7 +318,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
|
||||
#if FEATURE_ARB_framebuffer_object
|
||||
ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
|
||||
#endif
|
||||
ctx->Extensions.EXT_histogram = GL_TRUE;
|
||||
/*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/
|
||||
ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
|
||||
ctx->Extensions.EXT_paletted_texture = GL_TRUE;
|
||||
@@ -400,7 +398,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.EXT_histogram = GL_TRUE;
|
||||
ctx->Extensions.SGI_color_matrix = GL_TRUE;
|
||||
ctx->Extensions.SGI_color_table = GL_TRUE;
|
||||
}
|
||||
|
@@ -277,7 +277,6 @@ EXTRA_EXT(NV_texture_rectangle);
|
||||
EXTRA_EXT(EXT_stencil_two_side);
|
||||
EXTRA_EXT(NV_light_max_exponent);
|
||||
EXTRA_EXT(EXT_convolution);
|
||||
EXTRA_EXT(EXT_histogram);
|
||||
EXTRA_EXT(SGI_color_table);
|
||||
EXTRA_EXT(SGI_texture_color_table);
|
||||
EXTRA_EXT(EXT_depth_bounds_test);
|
||||
@@ -938,11 +937,6 @@ static const struct value_desc values[] = {
|
||||
CONTEXT_FLOAT(Pixel.PostConvolutionBias[3]),
|
||||
extra_EXT_convolution },
|
||||
|
||||
/* GL_EXT_histogram */
|
||||
{ GL_HISTOGRAM, CONTEXT_BOOL(Pixel.HistogramEnabled),
|
||||
extra_EXT_histogram },
|
||||
{ GL_MINMAX, CONTEXT_BOOL(Pixel.MinMaxEnabled), extra_EXT_histogram },
|
||||
|
||||
/* GL_SGI_color_table */
|
||||
{ GL_COLOR_TABLE_SGI,
|
||||
CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]),
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,4 @@ _mesa_init_histogram_dispatch(struct _glapi_table *disp)
|
||||
|
||||
#endif /* FEATURE_histogram */
|
||||
|
||||
extern void _mesa_init_histogram( GLcontext * ctx );
|
||||
|
||||
#endif /* HISTOGRAM_H */
|
||||
|
@@ -1876,69 +1876,6 @@ _mesa_scale_and_bias_depth_uint(const GLcontext *ctx, GLuint n,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Update the min/max values from an array of fragment colors.
|
||||
*/
|
||||
static void
|
||||
update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4])
|
||||
{
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i++) {
|
||||
/* update mins */
|
||||
if (rgba[i][RCOMP] < ctx->MinMax.Min[RCOMP])
|
||||
ctx->MinMax.Min[RCOMP] = rgba[i][RCOMP];
|
||||
if (rgba[i][GCOMP] < ctx->MinMax.Min[GCOMP])
|
||||
ctx->MinMax.Min[GCOMP] = rgba[i][GCOMP];
|
||||
if (rgba[i][BCOMP] < ctx->MinMax.Min[BCOMP])
|
||||
ctx->MinMax.Min[BCOMP] = rgba[i][BCOMP];
|
||||
if (rgba[i][ACOMP] < ctx->MinMax.Min[ACOMP])
|
||||
ctx->MinMax.Min[ACOMP] = rgba[i][ACOMP];
|
||||
|
||||
/* update maxs */
|
||||
if (rgba[i][RCOMP] > ctx->MinMax.Max[RCOMP])
|
||||
ctx->MinMax.Max[RCOMP] = rgba[i][RCOMP];
|
||||
if (rgba[i][GCOMP] > ctx->MinMax.Max[GCOMP])
|
||||
ctx->MinMax.Max[GCOMP] = rgba[i][GCOMP];
|
||||
if (rgba[i][BCOMP] > ctx->MinMax.Max[BCOMP])
|
||||
ctx->MinMax.Max[BCOMP] = rgba[i][BCOMP];
|
||||
if (rgba[i][ACOMP] > ctx->MinMax.Max[ACOMP])
|
||||
ctx->MinMax.Max[ACOMP] = rgba[i][ACOMP];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Update the histogram values from an array of fragment colors.
|
||||
*/
|
||||
static void
|
||||
update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4])
|
||||
{
|
||||
const GLint max = ctx->Histogram.Width - 1;
|
||||
GLfloat w = (GLfloat) max;
|
||||
GLuint i;
|
||||
|
||||
if (ctx->Histogram.Width == 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
GLint ri = IROUND(rgba[i][RCOMP] * w);
|
||||
GLint gi = IROUND(rgba[i][GCOMP] * w);
|
||||
GLint bi = IROUND(rgba[i][BCOMP] * w);
|
||||
GLint ai = IROUND(rgba[i][ACOMP] * w);
|
||||
ri = CLAMP(ri, 0, max);
|
||||
gi = CLAMP(gi, 0, max);
|
||||
bi = CLAMP(bi, 0, max);
|
||||
ai = CLAMP(ai, 0, max);
|
||||
ctx->Histogram.Count[ri][RCOMP]++;
|
||||
ctx->Histogram.Count[gi][GCOMP]++;
|
||||
ctx->Histogram.Count[bi][BCOMP]++;
|
||||
ctx->Histogram.Count[ai][ACOMP]++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Apply various pixel transfer operations to an array of RGBA pixels
|
||||
* as indicated by the transferOps bitmask
|
||||
@@ -1992,14 +1929,6 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps,
|
||||
if (transferOps & IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT) {
|
||||
_mesa_lookup_rgba_float(&ctx->ColorTable[COLORTABLE_POSTCOLORMATRIX], n, rgba);
|
||||
}
|
||||
/* update histogram count */
|
||||
if (transferOps & IMAGE_HISTOGRAM_BIT) {
|
||||
update_histogram(ctx, n, (CONST GLfloat (*)[4]) rgba);
|
||||
}
|
||||
/* update min/max values */
|
||||
if (transferOps & IMAGE_MIN_MAX_BIT) {
|
||||
update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba);
|
||||
}
|
||||
/* clamping to [0,1] */
|
||||
if (transferOps & IMAGE_CLAMP_BIT) {
|
||||
GLuint i;
|
||||
@@ -2132,9 +2061,6 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
|
||||
|
||||
if (transferOps) {
|
||||
_mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
|
||||
if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
|
||||
|
@@ -100,7 +100,6 @@
|
||||
#define FEATURE_drawpix FEATURE_GL
|
||||
#define FEATURE_evaluators FEATURE_GL
|
||||
#define FEATURE_feedback FEATURE_GL
|
||||
#define FEATURE_histogram FEATURE_GL
|
||||
#define FEATURE_pixel_transfer FEATURE_GL
|
||||
#define FEATURE_queryobj FEATURE_GL
|
||||
#define FEATURE_rastpos FEATURE_GL
|
||||
|
@@ -811,34 +811,6 @@ struct gl_hint_attrib
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Histogram attributes.
|
||||
*/
|
||||
struct gl_histogram_attrib
|
||||
{
|
||||
GLuint Width; /**< number of table entries */
|
||||
GLint Format; /**< GL_ALPHA, GL_RGB, etc */
|
||||
GLuint Count[HISTOGRAM_TABLE_SIZE][4]; /**< the histogram */
|
||||
GLboolean Sink; /**< terminate image transfer? */
|
||||
GLubyte RedSize; /**< Bits per counter */
|
||||
GLubyte GreenSize;
|
||||
GLubyte BlueSize;
|
||||
GLubyte AlphaSize;
|
||||
GLubyte LuminanceSize;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Color Min/max state.
|
||||
*/
|
||||
struct gl_minmax_attrib
|
||||
{
|
||||
GLenum Format;
|
||||
GLboolean Sink;
|
||||
GLfloat Min[4], Max[4]; /**< RGBA */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Image convolution state.
|
||||
*/
|
||||
@@ -1013,11 +985,6 @@ struct gl_pixel_attrib
|
||||
GLfloat PostColorMatrixScale[4]; /**< RGBA */
|
||||
GLfloat PostColorMatrixBias[4]; /**< RGBA */
|
||||
|
||||
/* Histogram & minmax (GL_EXT_histogram) */
|
||||
/* Note: histogram and minmax data are not part of this attrib group */
|
||||
GLboolean HistogramEnabled;
|
||||
GLboolean MinMaxEnabled;
|
||||
|
||||
/*--- End Pixel Transfer State ---*/
|
||||
|
||||
/** glPixelZoom */
|
||||
@@ -2717,7 +2684,6 @@ struct gl_extensions
|
||||
GLboolean EXT_framebuffer_object;
|
||||
GLboolean EXT_framebuffer_sRGB;
|
||||
GLboolean EXT_gpu_program_parameters;
|
||||
GLboolean EXT_histogram;
|
||||
GLboolean EXT_multi_draw_arrays;
|
||||
GLboolean EXT_paletted_texture;
|
||||
GLboolean EXT_packed_depth_stencil;
|
||||
@@ -2831,8 +2797,6 @@ struct gl_matrix_stack
|
||||
#define IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT 0x40
|
||||
#define IMAGE_COLOR_MATRIX_BIT 0x80
|
||||
#define IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT 0x100
|
||||
#define IMAGE_HISTOGRAM_BIT 0x200
|
||||
#define IMAGE_MIN_MAX_BIT 0x400
|
||||
#define IMAGE_CLAMP_BIT 0x800
|
||||
|
||||
|
||||
@@ -2846,9 +2810,7 @@ struct gl_matrix_stack
|
||||
#define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS | \
|
||||
IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT | \
|
||||
IMAGE_COLOR_MATRIX_BIT | \
|
||||
IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT |\
|
||||
IMAGE_HISTOGRAM_BIT | \
|
||||
IMAGE_MIN_MAX_BIT)
|
||||
IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT)
|
||||
/*@}*/
|
||||
|
||||
|
||||
@@ -3206,8 +3168,6 @@ struct __GLcontextRec
|
||||
/** \name Other assorted state (not pushed/popped on attribute stack) */
|
||||
/*@{*/
|
||||
struct gl_pixelmaps PixelMaps;
|
||||
struct gl_histogram_attrib Histogram;
|
||||
struct gl_minmax_attrib MinMax;
|
||||
struct gl_convolution_attrib Convolution1D;
|
||||
struct gl_convolution_attrib Convolution2D;
|
||||
struct gl_convolution_attrib Separable2D;
|
||||
|
@@ -738,12 +738,6 @@ update_image_transfer_state(GLcontext *ctx)
|
||||
if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX])
|
||||
mask |= IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT;
|
||||
|
||||
if (ctx->Pixel.HistogramEnabled)
|
||||
mask |= IMAGE_HISTOGRAM_BIT;
|
||||
|
||||
if (ctx->Pixel.MinMaxEnabled)
|
||||
mask |= IMAGE_MIN_MAX_BIT;
|
||||
|
||||
ctx->_ImageTransferState = mask;
|
||||
}
|
||||
|
||||
@@ -829,8 +823,6 @@ _mesa_init_pixel( GLcontext *ctx )
|
||||
init_pixelmap(&ctx->PixelMaps.GtoG);
|
||||
init_pixelmap(&ctx->PixelMaps.BtoB);
|
||||
init_pixelmap(&ctx->PixelMaps.AtoA);
|
||||
ctx->Pixel.HistogramEnabled = GL_FALSE;
|
||||
ctx->Pixel.MinMaxEnabled = GL_FALSE;
|
||||
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);
|
||||
for (i = 0; i < COLORTABLE_MAX; i++) {
|
||||
|
@@ -103,8 +103,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
||||
GLint row;
|
||||
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
|
||||
const GLbitfield transferOps = ctx->_ImageTransferState;
|
||||
const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink)
|
||||
|| (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink);
|
||||
GLfloat *dest, *tmpImage, *convImage;
|
||||
SWspan span;
|
||||
|
||||
@@ -160,7 +158,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
||||
width, rgba);
|
||||
}
|
||||
|
||||
if (!sink) {
|
||||
/* write the new image */
|
||||
for (row = 0; row < height; row++) {
|
||||
const GLfloat *src = convImage + row * width * 4;
|
||||
@@ -183,7 +180,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
||||
}
|
||||
/* restore this */
|
||||
span.array->ChanType = CHAN_TYPE;
|
||||
}
|
||||
|
||||
free(convImage);
|
||||
}
|
||||
|
@@ -551,8 +551,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
|
||||
* General solution
|
||||
*/
|
||||
{
|
||||
const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink)
|
||||
|| (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink);
|
||||
const GLbitfield interpMask = span.interpMask;
|
||||
const GLbitfield arrayMask = span.arrayMask;
|
||||
const GLint srcStride
|
||||
@@ -575,8 +573,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
|
||||
_mesa_unpack_color_span_float(ctx, spanWidth, GL_RGBA, rgba,
|
||||
format, type, source, unpack,
|
||||
transferOps);
|
||||
/* draw the span */
|
||||
if (!sink) {
|
||||
/* Set these for each row since the _swrast_write_* functions
|
||||
* may change them while clipping/rendering.
|
||||
*/
|
||||
@@ -592,7 +588,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
|
||||
else {
|
||||
_swrast_write_rgba_span(ctx, &span);
|
||||
}
|
||||
}
|
||||
|
||||
source += srcStride;
|
||||
} /* for row */
|
||||
|
Reference in New Issue
Block a user