diff options
author | Keith Whitwell <keithw@vmware.com> | 2010-10-17 19:03:42 -0700 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2010-10-17 19:09:42 -0700 |
commit | 0072acd447dc6be652e63752e50215c3105322c8 (patch) | |
tree | 847d1763b54772d336a04e606f8248291c3092b7 /src/mesa/main/get.c | |
parent | 543fb77ddece7e1806e8eaa0d65bb2a945ef9a75 (diff) | |
parent | ca2b2ac131933b4171b519813df1aaa3a81621cd (diff) |
Merge remote branch 'origin/master' into lp-setup-llvm
Conflicts:
src/gallium/drivers/llvmpipe/lp_setup_coef.c
src/gallium/drivers/llvmpipe/lp_setup_coef.h
src/gallium/drivers/llvmpipe/lp_setup_coef_intrin.c
src/gallium/drivers/llvmpipe/lp_setup_point.c
src/gallium/drivers/llvmpipe/lp_setup_tri.c
src/gallium/drivers/llvmpipe/lp_state_derived.c
src/gallium/drivers/llvmpipe/lp_state_fs.h
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r-- | src/mesa/main/get.c | 108 |
1 files changed, 16 insertions, 92 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 2062134a39..8224c15627 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -36,17 +36,17 @@ /* This is a table driven implemetation of the glGet*v() functions. * The basic idea is that most getters just look up an int somewhere - * in GLcontext and then convert it to a bool or float according to + * in struct gl_context and then convert it to a bool or float according to * which of glGetIntegerv() glGetBooleanv() etc is being called. * Instead of generating code to do this, we can just record the enum - * value and the offset into GLcontext in an array of structs. Then + * value and the offset into struct gl_context in an array of structs. Then * in glGet*(), we lookup the struct for the enum in question, and use * the offset to get the int we need. * * Sometimes we need to look up a float, a boolean, a bit in a * bitfield, a matrix or other types instead, so we need to track the - * type of the value in GLcontext. And sometimes the value isn't in - * GLcontext but in the drawbuffer, the array object, current texture + * type of the value in struct gl_context. And sometimes the value isn't in + * struct gl_context but in the drawbuffer, the array object, current texture * unit, or maybe it's a computed value. So we need to also track * where or how to find the value. Finally, we sometimes need to * check that one of a number of extensions are enabled, the GL @@ -165,7 +165,7 @@ union value { #define BUFFER_FIELD(field, type) \ LOC_BUFFER, type, offsetof(struct gl_framebuffer, field) #define CONTEXT_FIELD(field, type) \ - LOC_CONTEXT, type, offsetof(GLcontext, field) + LOC_CONTEXT, type, offsetof(struct gl_context, field) #define ARRAY_FIELD(field, type) \ LOC_ARRAY, type, offsetof(struct gl_array_object, field) #define CONST(value) \ @@ -276,9 +276,6 @@ EXTRA_EXT(NV_fragment_program); 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); EXTRA_EXT(ARB_depth_clamp); @@ -374,7 +371,7 @@ static const struct value_desc values[] = { { GL_MAX_ELEMENTS_VERTICES, CONTEXT_INT(Const.MaxArrayLockSize), NO_EXTRA }, { GL_MAX_ELEMENTS_INDICES, CONTEXT_INT(Const.MaxArrayLockSize), NO_EXTRA }, { GL_MAX_TEXTURE_SIZE, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, Const.MaxTextureLevels), NO_EXTRA }, + offsetof(struct gl_context, Const.MaxTextureLevels), NO_EXTRA }, { GL_MAX_VIEWPORT_DIMS, CONTEXT_INT2(Const.MaxViewportWidth), NO_EXTRA }, { GL_PACK_ALIGNMENT, CONTEXT_INT(Pack.Alignment), NO_EXTRA }, { GL_ALIASED_POINT_SIZE_RANGE, CONTEXT_FLOAT2(Const.MinPointSize), NO_EXTRA }, @@ -413,7 +410,7 @@ static const struct value_desc values[] = { { GL_TEXTURE_BINDING_CUBE_MAP_ARB, LOC_CUSTOM, TYPE_INT, TEXTURE_CUBE_INDEX, extra_ARB_texture_cube_map }, { GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, Const.MaxCubeTextureLevels), + offsetof(struct gl_context, Const.MaxCubeTextureLevels), extra_ARB_texture_cube_map }, /* XXX: OES_texture_cube_map */ /* XXX: OES_blend_subtract */ @@ -525,7 +522,7 @@ static const struct value_desc values[] = { { GL_MAX_TEXTURE_STACK_DEPTH, CONST(MAX_TEXTURE_STACK_DEPTH), NO_EXTRA }, { GL_MODELVIEW_MATRIX, CONTEXT_MATRIX(ModelviewMatrixStack.Top), NO_EXTRA }, { GL_MODELVIEW_STACK_DEPTH, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, ModelviewMatrixStack.Depth), NO_EXTRA }, + offsetof(struct gl_context, ModelviewMatrixStack.Depth), NO_EXTRA }, { GL_NORMALIZE, CONTEXT_BOOL(Transform.Normalize), NO_EXTRA }, { GL_PACK_SKIP_IMAGES_EXT, CONTEXT_INT(Pack.SkipImages), NO_EXTRA }, { GL_PERSPECTIVE_CORRECTION_HINT, CONTEXT_ENUM(Hint.PerspectiveCorrection), NO_EXTRA }, @@ -538,7 +535,7 @@ static const struct value_desc values[] = { { GL_POINT_FADE_THRESHOLD_SIZE_EXT, CONTEXT_FLOAT(Point.Threshold), NO_EXTRA }, { GL_PROJECTION_MATRIX, CONTEXT_MATRIX(ProjectionMatrixStack.Top), NO_EXTRA }, { GL_PROJECTION_STACK_DEPTH, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, ProjectionMatrixStack.Depth), NO_EXTRA }, + offsetof(struct gl_context, ProjectionMatrixStack.Depth), NO_EXTRA }, { GL_RESCALE_NORMAL, CONTEXT_BOOL(Transform.RescaleNormals), NO_EXTRA }, { GL_SHADE_MODEL, CONTEXT_ENUM(Light.ShadeModel), NO_EXTRA }, { GL_TEXTURE_2D, LOC_CUSTOM, TYPE_BOOLEAN, 0, NO_EXTRA }, @@ -675,7 +672,7 @@ static const struct value_desc values[] = { /* OES_texture_3D */ { GL_TEXTURE_BINDING_3D, LOC_CUSTOM, TYPE_INT, TEXTURE_3D_INDEX, NO_EXTRA }, { GL_MAX_3D_TEXTURE_SIZE, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, Const.Max3DTextureLevels), NO_EXTRA }, + offsetof(struct gl_context, Const.Max3DTextureLevels), NO_EXTRA }, /* GL_ARB_fragment_program/OES_standard_derivatives */ { GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB, @@ -686,11 +683,11 @@ static const struct value_desc values[] = { /* Enums unique to OpenGL ES 2.0 */ { 0, 0, TYPE_API_MASK, API_OPENGLES2_BIT, NO_EXTRA }, { GL_MAX_FRAGMENT_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, Const.FragmentProgram.MaxUniformComponents), NO_EXTRA }, + offsetof(struct gl_context, Const.FragmentProgram.MaxUniformComponents), NO_EXTRA }, { GL_MAX_VARYING_VECTORS, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, Const.MaxVarying), NO_EXTRA }, + offsetof(struct gl_context, Const.MaxVarying), NO_EXTRA }, { GL_MAX_VERTEX_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, - offsetof(GLcontext, Const.VertexProgram.MaxUniformComponents), NO_EXTRA }, + offsetof(struct gl_context, Const.VertexProgram.MaxUniformComponents), NO_EXTRA }, { GL_SHADER_COMPILER, CONST(1), NO_EXTRA }, /* OES_get_program_binary */ { GL_NUM_SHADER_BINARY_FORMATS, CONST(0), NO_EXTRA }, @@ -876,84 +873,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 }, - { GL_CONVOLUTION_2D_EXT, CONTEXT_BOOL(Pixel.Convolution2DEnabled), - extra_EXT_convolution }, - { GL_SEPARABLE_2D_EXT, CONTEXT_BOOL(Pixel.Separable2DEnabled), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_RED_SCALE_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionScale[0]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_GREEN_SCALE_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionScale[1]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_BLUE_SCALE_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionScale[2]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_ALPHA_SCALE_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionScale[3]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_RED_BIAS_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionBias[0]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_GREEN_BIAS_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionBias[1]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_BLUE_BIAS_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionBias[2]), - extra_EXT_convolution }, - { GL_POST_CONVOLUTION_ALPHA_BIAS_EXT, - CONTEXT_FLOAT(Pixel.PostConvolutionBias[3]), - extra_EXT_convolution }, - - /* GL_EXT_histogram / GL_ARB_imaging */ - { GL_HISTOGRAM, CONTEXT_BOOL(Pixel.HistogramEnabled), - extra_EXT_histogram }, - { GL_MINMAX, CONTEXT_BOOL(Pixel.MinMaxEnabled), extra_EXT_histogram }, - - /* GL_SGI_color_table / GL_ARB_imaging */ - { GL_COLOR_TABLE_SGI, - CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]), - extra_SGI_color_table }, - { GL_POST_CONVOLUTION_COLOR_TABLE_SGI, - CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]), - extra_SGI_color_table }, - { GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI, - CONTEXT_BOOL(Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]), - extra_SGI_color_table }, - /* GL_SGI_texture_color_table */ { GL_TEXTURE_COLOR_TABLE_SGI, LOC_TEXUNIT, TYPE_BOOLEAN, offsetof(struct gl_texture_unit, ColorTableEnabled), @@ -1331,7 +1256,7 @@ print_table_stats(void) * * \param the current context, for determining the API in question */ -void _mesa_init_get_hash(GLcontext *ctx) +void _mesa_init_get_hash(struct gl_context *ctx) { int i, hash, index, mask; int api_mask = 0, api_bit; @@ -1380,7 +1305,7 @@ void _mesa_init_get_hash(GLcontext *ctx) * \param v pointer to the tmp declared in the calling glGet*v() function */ static void -find_custom_value(GLcontext *ctx, const struct value_desc *d, union value *v) +find_custom_value(struct gl_context *ctx, const struct value_desc *d, union value *v) { struct gl_buffer_object *buffer_obj; struct gl_client_array *array; @@ -1467,7 +1392,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; @@ -1659,7 +1583,7 @@ find_custom_value(GLcontext *ctx, const struct value_desc *d, union value *v) * otherwise GL_TRUE. */ static GLboolean -check_extra(GLcontext *ctx, const char *func, const struct value_desc *d) +check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d) { const GLuint version = ctx->VersionMajor * 10 + ctx->VersionMinor; int total, enabled; |