From cfc5bafcb2db8c6e05d7be6bb7315960be08c0d8 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 1 Jul 2014 08:46:12 +0200 Subject: fontconfig mesa pixman git update 1 July 2014 pixman commit 5a2edb3f2c2cfde6b25ac614e2004a9f78583d74 fontconfig commit dab60e4476ada4ad4639599ea24dd012d4a79584 mesa commit 1bfc0a11027449ae7ab7c28eb695f26de530eccf --- mesalib/src/mesa/drivers/common/meta.c | 53 ++---- mesalib/src/mesa/drivers/dri/common/dri_util.c | 6 +- mesalib/src/mesa/drivers/dri/common/xmlconfig.c | 207 ++++++++++++--------- mesalib/src/mesa/drivers/dri/common/xmlconfig.h | 29 +-- .../mesa/drivers/dri/common/xmlpool/t_options.h | 14 ++ mesalib/src/mesa/main/context.c | 3 - mesalib/src/mesa/main/dlist.c | 46 ----- mesalib/src/mesa/main/extensions.c | 3 +- mesalib/src/mesa/main/ff_fragment_shader.cpp | 80 -------- mesalib/src/mesa/main/format_pack.c | 25 --- mesalib/src/mesa/main/format_unpack.c | 14 -- mesalib/src/mesa/main/formats.c | 20 +- mesalib/src/mesa/main/formats.h | 2 - mesalib/src/mesa/main/glformats.c | 35 ---- mesalib/src/mesa/main/glformats.h | 3 - mesalib/src/mesa/main/mtypes.h | 14 +- mesalib/src/mesa/main/pack.c | 137 -------------- mesalib/src/mesa/main/pack.h | 8 - mesalib/src/mesa/main/queryobj.c | 18 +- mesalib/src/mesa/main/shaderapi.c | 1 + mesalib/src/mesa/main/shaderobj.c | 1 + mesalib/src/mesa/main/texenv.c | 198 -------------------- mesalib/src/mesa/main/texenv.h | 12 -- mesalib/src/mesa/main/texformat.c | 5 - mesalib/src/mesa/main/texgetimage.c | 5 - mesalib/src/mesa/main/teximage.c | 13 +- mesalib/src/mesa/main/texstate.c | 15 -- mesalib/src/mesa/main/texstore.c | 78 -------- mesalib/src/mesa/main/vdpau.c | 11 ++ mesalib/src/mesa/program/prog_statevars.c | 30 --- mesalib/src/mesa/program/prog_statevars.h | 2 - mesalib/src/mesa/program/program.c | 1 + mesalib/src/mesa/swrast/s_texcombine.c | 77 +------- mesalib/src/mesa/swrast/s_texfetch.c | 1 - mesalib/src/mesa/swrast/s_texfetch_tmp.h | 16 -- 35 files changed, 202 insertions(+), 981 deletions(-) (limited to 'mesalib/src/mesa') diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index 1a2e45320..f313f5645 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -1515,23 +1515,15 @@ static void meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear) { const char *vs_source = + "#extension GL_AMD_vertex_shader_layer : enable\n" "attribute vec4 position;\n" - "void main()\n" - "{\n" - " gl_Position = position;\n" - "}\n"; - const char *gs_source = - "#version 150\n" - "layout(triangles) in;\n" - "layout(triangle_strip, max_vertices = 4) out;\n" "uniform int layer;\n" "void main()\n" "{\n" - " for (int i = 0; i < 3; i++) {\n" - " gl_Layer = layer;\n" - " gl_Position = gl_in[i].gl_Position;\n" - " EmitVertex();\n" - " }\n" + "#ifdef GL_AMD_vertex_shader_layer\n" + " gl_Layer = layer;\n" + "#endif\n" + " gl_Position = position;\n" "}\n"; const char *fs_source = "uniform vec4 color;\n" @@ -1539,7 +1531,7 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear) "{\n" " gl_FragColor = color;\n" "}\n"; - GLuint vs, gs = 0, fs; + GLuint vs, fs; bool has_integer_textures; _mesa_meta_setup_vertex_objects(&clear->VAO, &clear->VBO, true, 3, 0, 0); @@ -1551,12 +1543,6 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear) _mesa_ShaderSource(vs, 1, &vs_source, NULL); _mesa_CompileShader(vs); - if (_mesa_has_geometry_shaders(ctx)) { - gs = _mesa_CreateShader(GL_GEOMETRY_SHADER); - _mesa_ShaderSource(gs, 1, &gs_source, NULL); - _mesa_CompileShader(gs); - } - fs = _mesa_CreateShader(GL_FRAGMENT_SHADER); _mesa_ShaderSource(fs, 1, &fs_source, NULL); _mesa_CompileShader(fs); @@ -1564,20 +1550,14 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear) clear->ShaderProg = _mesa_CreateProgram(); _mesa_AttachShader(clear->ShaderProg, fs); _mesa_DeleteShader(fs); - if (gs != 0) - _mesa_AttachShader(clear->ShaderProg, gs); _mesa_AttachShader(clear->ShaderProg, vs); _mesa_DeleteShader(vs); _mesa_BindAttribLocation(clear->ShaderProg, 0, "position"); _mesa_ObjectLabel(GL_PROGRAM, clear->ShaderProg, -1, "meta clear"); _mesa_LinkProgram(clear->ShaderProg); - clear->ColorLocation = _mesa_GetUniformLocation(clear->ShaderProg, - "color"); - if (gs != 0) { - clear->LayerLocation = _mesa_GetUniformLocation(clear->ShaderProg, - "layer"); - } + clear->ColorLocation = _mesa_GetUniformLocation(clear->ShaderProg, "color"); + clear->LayerLocation = _mesa_GetUniformLocation(clear->ShaderProg, "layer"); has_integer_textures = _mesa_is_gles3(ctx) || (_mesa_is_desktop_gl(ctx) && ctx->Const.GLSLVersion >= 130); @@ -1587,9 +1567,14 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear) const char *vs_int_source = ralloc_asprintf(shader_source_mem_ctx, "#version 130\n" + "#extension GL_AMD_vertex_shader_layer : enable\n" "in vec4 position;\n" + "uniform int layer;\n" "void main()\n" "{\n" + "#ifdef GL_AMD_vertex_shader_layer\n" + " gl_Layer = layer;\n" + "#endif\n" " gl_Position = position;\n" "}\n"); const char *fs_int_source = @@ -1612,8 +1597,6 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear) clear->IntegerShaderProg = _mesa_CreateProgram(); _mesa_AttachShader(clear->IntegerShaderProg, fs); _mesa_DeleteShader(fs); - if (gs != 0) - _mesa_AttachShader(clear->IntegerShaderProg, gs); _mesa_AttachShader(clear->IntegerShaderProg, vs); _mesa_DeleteShader(vs); _mesa_BindAttribLocation(clear->IntegerShaderProg, 0, "position"); @@ -1629,13 +1612,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear) clear->IntegerColorLocation = _mesa_GetUniformLocation(clear->IntegerShaderProg, "color"); - if (gs != 0) { - clear->IntegerLayerLocation = - _mesa_GetUniformLocation(clear->IntegerShaderProg, "layer"); - } + clear->IntegerLayerLocation = + _mesa_GetUniformLocation(clear->IntegerShaderProg, "layer"); } - if (gs != 0) - _mesa_DeleteShader(gs); } static void @@ -1843,7 +1822,7 @@ meta_clear(struct gl_context *ctx, GLbitfield buffers, bool glsl) /* draw quad(s) */ if (fb->MaxNumLayers > 0) { unsigned layer; - assert(glsl); + assert(glsl && clear->LayerLocation != -1); for (layer = 0; layer < fb->MaxNumLayers; layer++) { if (fb->_IntegerColor) _mesa_Uniform1i(clear->IntegerLayerLocation, layer); diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c index 471287909..8506f5356 100644 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.c +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c @@ -677,7 +677,7 @@ dri2ReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer) static int -dri2ConfigQueryb(__DRIscreen *screen, const char *var, GLboolean *val) +dri2ConfigQueryb(__DRIscreen *screen, const char *var, bool *val) { if (!driCheckOption(&screen->optionCache, var, DRI_BOOL)) return -1; @@ -688,7 +688,7 @@ dri2ConfigQueryb(__DRIscreen *screen, const char *var, GLboolean *val) } static int -dri2ConfigQueryi(__DRIscreen *screen, const char *var, GLint *val) +dri2ConfigQueryi(__DRIscreen *screen, const char *var, int *val) { if (!driCheckOption(&screen->optionCache, var, DRI_INT) && !driCheckOption(&screen->optionCache, var, DRI_ENUM)) @@ -700,7 +700,7 @@ dri2ConfigQueryi(__DRIscreen *screen, const char *var, GLint *val) } static int -dri2ConfigQueryf(__DRIscreen *screen, const char *var, GLfloat *val) +dri2ConfigQueryf(__DRIscreen *screen, const char *var, float *val) { if (!driCheckOption(&screen->optionCache, var, DRI_FLOAT)) return -1; diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c index b95e452f1..5091c115b 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c +++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c @@ -27,8 +27,6 @@ * \author Felix Kuehling */ -#include "main/glheader.h" - #include #include #include @@ -106,15 +104,15 @@ static const char *__getProgramName () { #endif /** \brief Find an option in an option cache with the name as key */ -static GLuint findOption (const driOptionCache *cache, const char *name) { - GLuint len = strlen (name); - GLuint size = 1 << cache->tableSize, mask = size - 1; - GLuint hash = 0; - GLuint i, shift; +static uint32_t findOption (const driOptionCache *cache, const char *name) { + uint32_t len = strlen (name); + uint32_t size = 1 << cache->tableSize, mask = size - 1; + uint32_t hash = 0; + uint32_t i, shift; /* compute a hash from the variable length name */ for (i = 0, shift = 0; i < len; ++i, shift = (shift+8) & 31) - hash += (GLuint)name[i] << shift; + hash += (uint32_t)name[i] << shift; hash *= hash; hash = (hash >> (16-cache->tableSize/2)) & mask; @@ -134,7 +132,7 @@ static GLuint findOption (const driOptionCache *cache, const char *name) { /** \brief Like strdup but using malloc and with error checking. */ #define XSTRDUP(dest,source) do { \ - GLuint len = strlen (source); \ + uint32_t len = strlen (source); \ if (!(dest = malloc(len+1))) { \ fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__); \ abort(); \ @@ -146,8 +144,8 @@ static int compare (const void *a, const void *b) { return strcmp (*(char *const*)a, *(char *const*)b); } /** \brief Binary search in a string array. */ -static GLuint bsearchStr (const XML_Char *name, - const XML_Char *elems[], GLuint count) { +static uint32_t bsearchStr (const XML_Char *name, + const XML_Char *elems[], uint32_t count) { const XML_Char **found; found = bsearch (&name, elems, count, sizeof (XML_Char *), compare); if (found) @@ -165,11 +163,11 @@ static GLuint bsearchStr (const XML_Char *name, * returning tail points to the first character that is not part of * the integer number. If no number was found then tail points to the * start of the input string. */ -static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { - GLint radix = base == 0 ? 10 : base; - GLint result = 0; - GLint sign = 1; - GLboolean numberFound = GL_FALSE; +static int strToI (const XML_Char *string, const XML_Char **tail, int base) { + int radix = base == 0 ? 10 : base; + int result = 0; + int sign = 1; + bool numberFound = false; const XML_Char *start = string; assert (radix >= 2 && radix <= 36); @@ -180,7 +178,7 @@ static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { } else if (*string == '+') string++; if (base == 0 && *string == '0') { - numberFound = GL_TRUE; + numberFound = true; if (*(string+1) == 'x' || *(string+1) == 'X') { radix = 16; string += 2; @@ -190,7 +188,7 @@ static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { } } do { - GLint digit = -1; + int digit = -1; if (radix <= 10) { if (*string >= '0' && *string < '0' + radix) digit = *string - '0'; @@ -203,12 +201,12 @@ static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { digit = *string - 'A' + 10; } if (digit != -1) { - numberFound = GL_TRUE; + numberFound = true; result = radix*result + digit; string++; } else break; - } while (GL_TRUE); + } while (true); *tail = numberFound ? string : start; return sign * result; } @@ -225,9 +223,9 @@ static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { * to the start of the input string. * * Uses two passes for maximum accuracy. */ -static GLfloat strToF (const XML_Char *string, const XML_Char **tail) { - GLint nDigits = 0, pointPos, exponent; - GLfloat sign = 1.0f, result = 0.0f, scale; +static float strToF (const XML_Char *string, const XML_Char **tail) { + int nDigits = 0, pointPos, exponent; + float sign = 1.0f, result = 0.0f, scale; const XML_Char *start = string, *numStart; /* sign */ @@ -270,13 +268,13 @@ static GLfloat strToF (const XML_Char *string, const XML_Char **tail) { string = numStart; /* scale of the first digit */ - scale = sign * (GLfloat)pow (10.0, (GLdouble)(pointPos-1 + exponent)); + scale = sign * (float)pow (10.0, (double)(pointPos-1 + exponent)); /* second pass: parse digits */ do { if (*string != '.') { assert (*string >= '0' && *string <= '9'); - result += scale * (GLfloat)(*string - '0'); + result += scale * (float)(*string - '0'); scale *= 0.1f; nDigits--; } @@ -287,7 +285,7 @@ static GLfloat strToF (const XML_Char *string, const XML_Char **tail) { } /** \brief Parse a value of a given type. */ -static GLboolean parseValue (driOptionValue *v, driOptionType type, +static bool parseValue (driOptionValue *v, driOptionType type, const XML_Char *string) { const XML_Char *tail = NULL; /* skip leading white-space */ @@ -295,14 +293,14 @@ static GLboolean parseValue (driOptionValue *v, driOptionType type, switch (type) { case DRI_BOOL: if (!strcmp (string, "false")) { - v->_bool = GL_FALSE; + v->_bool = false; tail = string + 5; } else if (!strcmp (string, "true")) { - v->_bool = GL_TRUE; + v->_bool = true; tail = string + 4; } else - return GL_FALSE; + return false; break; case DRI_ENUM: /* enum is just a special integer */ case DRI_INT: @@ -311,23 +309,28 @@ static GLboolean parseValue (driOptionValue *v, driOptionType type, case DRI_FLOAT: v->_float = strToF (string, &tail); break; + case DRI_STRING: + if (v->_string) + free (v->_string); + v->_string = strndup(string, STRING_CONF_MAXLEN); + return GL_TRUE; } if (tail == string) - return GL_FALSE; /* empty string (or containing only white-space) */ + return false; /* empty string (or containing only white-space) */ /* skip trailing white space */ if (*tail) tail += strspn (tail, " \f\n\r\t\v"); if (*tail) - return GL_FALSE; /* something left over that is not part of value */ + return false; /* something left over that is not part of value */ - return GL_TRUE; + return true; } /** \brief Parse a list of ranges of type info->type. */ -static GLboolean parseRanges (driOptionInfo *info, const XML_Char *string) { +static bool parseRanges (driOptionInfo *info, const XML_Char *string) { XML_Char *cp, *range; - GLuint nRanges, i; + uint32_t nRanges, i; driOptionRange *ranges; XSTRDUP (cp, string); @@ -375,39 +378,41 @@ static GLboolean parseRanges (driOptionInfo *info, const XML_Char *string) { free(cp); if (i < nRanges) { free(ranges); - return GL_FALSE; + return false; } else assert (range == NULL); info->nRanges = nRanges; info->ranges = ranges; - return GL_TRUE; + return true; } /** \brief Check if a value is in one of info->ranges. */ -static GLboolean checkValue (const driOptionValue *v, const driOptionInfo *info) { - GLuint i; +static bool checkValue (const driOptionValue *v, const driOptionInfo *info) { + uint32_t i; assert (info->type != DRI_BOOL); /* should be caught by the parser */ if (info->nRanges == 0) - return GL_TRUE; + return true; switch (info->type) { case DRI_ENUM: /* enum is just a special integer */ case DRI_INT: for (i = 0; i < info->nRanges; ++i) if (v->_int >= info->ranges[i].start._int && v->_int <= info->ranges[i].end._int) - return GL_TRUE; + return true; break; case DRI_FLOAT: for (i = 0; i < info->nRanges; ++i) if (v->_float >= info->ranges[i].start._float && v->_float <= info->ranges[i].end._float) - return GL_TRUE; + return true; + break; + case DRI_STRING: break; default: assert (0); /* should never happen */ } - return GL_FALSE; + return false; } /** @@ -478,11 +483,11 @@ struct OptInfoData { const char *name; XML_Parser parser; driOptionCache *cache; - GLboolean inDriInfo; - GLboolean inSection; - GLboolean inDesc; - GLboolean inOption; - GLboolean inEnum; + bool inDriInfo; + bool inSection; + bool inDesc; + bool inOption; + bool inEnum; int curOption; }; @@ -500,10 +505,10 @@ static const XML_Char *OptInfoElems[] = { * for external configuration tools. */ static void parseEnumAttr (struct OptInfoData *data, const XML_Char **attr) { - GLuint i; + uint32_t i; const XML_Char *value = NULL, *text = NULL; driOptionValue v; - GLuint opt = data->curOption; + uint32_t opt = data->curOption; for (i = 0; attr[i]; i += 2) { if (!strcmp (attr[i], "value")) value = attr[i+1]; else if (!strcmp (attr[i], "text")) text = attr[i+1]; @@ -523,7 +528,7 @@ static void parseEnumAttr (struct OptInfoData *data, const XML_Char **attr) { * for external configuration tools. */ static void parseDescAttr (struct OptInfoData *data, const XML_Char **attr) { - GLuint i; + uint32_t i; const XML_Char *lang = NULL, *text = NULL; for (i = 0; attr[i]; i += 2) { if (!strcmp (attr[i], "lang")) lang = attr[i+1]; @@ -541,9 +546,9 @@ static void parseOptInfoAttr (struct OptInfoData *data, const XML_Char **attr) { const XML_Char *attrVal[OA_COUNT] = {NULL, NULL, NULL, NULL}; const char *defaultVal; driOptionCache *cache = data->cache; - GLuint opt, i; + uint32_t opt, i; for (i = 0; attr[i]; i += 2) { - GLuint attrName = bsearchStr (attr[i], optAttr, OA_COUNT); + uint32_t attrName = bsearchStr (attr[i], optAttr, OA_COUNT); if (attrName >= OA_COUNT) XML_FATAL ("illegal option attribute: %s", attr[i]); attrVal[attrName] = attr[i+1]; @@ -567,6 +572,8 @@ static void parseOptInfoAttr (struct OptInfoData *data, const XML_Char **attr) { cache->info[opt].type = DRI_INT; else if (!strcmp (attrVal[OA_TYPE], "float")) cache->info[opt].type = DRI_FLOAT; + else if (!strcmp (attrVal[OA_TYPE], "string")) + cache->info[opt].type = DRI_STRING; else XML_FATAL ("illegal type in option: %s.", attrVal[OA_TYPE]); @@ -608,7 +615,7 @@ static void optInfoStartElem (void *userData, const XML_Char *name, XML_FATAL1 ("nested elements."); if (attr[0]) XML_FATAL1 ("attributes specified on element."); - data->inDriInfo = GL_TRUE; + data->inDriInfo = true; break; case OI_SECTION: if (!data->inDriInfo) @@ -617,14 +624,14 @@ static void optInfoStartElem (void *userData, const XML_Char *name, XML_FATAL1 ("nested
elements."); if (attr[0]) XML_FATAL1 ("attributes specified on
element."); - data->inSection = GL_TRUE; + data->inSection = true; break; case OI_DESCRIPTION: if (!data->inSection && !data->inOption) XML_FATAL1 (" must be inside or inDesc) XML_FATAL1 ("nested elements."); - data->inDesc = GL_TRUE; + data->inDesc = true; parseDescAttr (data, attr); break; case OI_OPTION: @@ -634,7 +641,7 @@ static void optInfoStartElem (void *userData, const XML_Char *name, XML_FATAL1 ("