aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fontconfig/doc/fcformat.fncs7
-rw-r--r--fontconfig/fc-cat/fc-cat.c39
-rw-r--r--fontconfig/fc-list/fc-list.c17
-rw-r--r--fontconfig/fc-match/fc-match.c38
-rw-r--r--fontconfig/src/fcdir.c7
-rw-r--r--fontconfig/src/fcformat.c7
-rw-r--r--fontconfig/src/fcname.c3
-rw-r--r--mesalib/src/glsl/linker.cpp41
-rw-r--r--mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml2
-rw-r--r--mesalib/src/mesa/state_tracker/st_format.c6
10 files changed, 79 insertions, 88 deletions
diff --git a/fontconfig/doc/fcformat.fncs b/fontconfig/doc/fcformat.fncs
index 125e6b437..c136e8cf2 100644
--- a/fontconfig/doc/fcformat.fncs
+++ b/fontconfig/doc/fcformat.fncs
@@ -202,6 +202,13 @@ command on the pattern, without the final newline.
</para></listitem></varlistentry>
<varlistentry><term>
+fccat
+</term><listitem><para>
+Expands to the output of the default output format of the fc-cat
+command on the pattern, without the final newline.
+</para></listitem></varlistentry>
+
+<varlistentry><term>
pkgkit
</term><listitem><para>
Expands to the list of PackageKit font() tags for the pattern.
diff --git a/fontconfig/fc-cat/fc-cat.c b/fontconfig/fc-cat/fc-cat.c
index c6c399343..5ee947ec2 100644
--- a/fontconfig/fc-cat/fc-cat.c
+++ b/fontconfig/fc-cat/fc-cat.c
@@ -194,11 +194,9 @@ file_base_name (const FcChar8 *cache, const FcChar8 *file)
static FcBool
cache_print_set (FcFontSet *set, FcStrSet *dirs, const FcChar8 *base_name, FcBool verbose)
{
- FcChar8 *name, *dir;
- const FcChar8 *file, *base;
- int ret;
+ FcChar8 *dir;
+ const FcChar8 *base;
int n;
- int id;
int ndir = 0;
FcStrList *list;
@@ -227,37 +225,22 @@ cache_print_set (FcFontSet *set, FcStrSet *dirs, const FcChar8 *base_name, FcBoo
for (n = 0; n < set->nfont; n++)
{
FcPattern *font = set->fonts[n];
+ FcChar8 *s;
- if (FcPatternGetString (font, FC_FILE, 0, (FcChar8 **) &file) != FcResultMatch)
- goto bail3;
- base = file_base_name (base_name, file);
- if (FcPatternGetInteger (font, FC_INDEX, 0, &id) != FcResultMatch)
- goto bail3;
- if (!write_string (stdout, base))
- goto bail3;
- if (PUTC (' ', stdout) == EOF)
- goto bail3;
- if (!write_int (stdout, id))
- goto bail3;
- if (PUTC (' ', stdout) == EOF)
- goto bail3;
- name = FcNameUnparse (font);
- if (!name)
- goto bail3;
- ret = write_string (stdout, name);
- FcStrFree (name);
- if (!ret)
- goto bail3;
- if (PUTC ('\n', stdout) == EOF)
- goto bail3;
+ s = FcPatternFormat (font, "%{=fccat}\n");
+ if (s)
+ {
+ printf ("%s", s);
+ free (s);
+ }
}
if (verbose && !set->nfont && !ndir)
printf ("<empty>\n");
-
+
FcStrListDone (list);
return FcTrue;
-
+
bail3:
FcStrListDone (list);
bail2:
diff --git a/fontconfig/fc-list/fc-list.c b/fontconfig/fc-list/fc-list.c
index 12c2ca550..ad383328e 100644
--- a/fontconfig/fc-list/fc-list.c
+++ b/fontconfig/fc-list/fc-list.c
@@ -156,7 +156,9 @@ main (int argc, char **argv)
if (quiet && !os)
os = FcObjectSetCreate ();
if (!verbose && !format && !os)
- os = FcObjectSetBuild (FC_FAMILY, FC_STYLE, (char *) 0);
+ os = FcObjectSetBuild (FC_FAMILY, FC_STYLE, FC_FILE, (char *) 0);
+ if (!format)
+ format = "%{=fclist}\n";
fs = FcFontList (0, pat, os);
if (os)
FcObjectSetDestroy (os);
@@ -173,7 +175,7 @@ main (int argc, char **argv)
{
FcPatternPrint (fs->fonts[j]);
}
- else if (format)
+ else
{
FcChar8 *s;
@@ -184,17 +186,6 @@ main (int argc, char **argv)
free (s);
}
}
- else
- {
- FcChar8 *str;
- FcChar8 *file;
-
- str = FcNameUnparse (fs->fonts[j]);
- if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, &file) == FcResultMatch)
- printf ("%s: ", file);
- printf ("%s\n", str);
- free (str);
- }
}
}
diff --git a/fontconfig/fc-match/fc-match.c b/fontconfig/fc-match/fc-match.c
index 48ba6cfe8..e64b4bcdd 100644
--- a/fontconfig/fc-match/fc-match.c
+++ b/fontconfig/fc-match/fc-match.c
@@ -195,6 +195,14 @@ main (int argc, char **argv)
}
FcPatternDestroy (pat);
+ if (!format)
+ {
+ if (os)
+ format = "%{=unparse}\n";
+ else
+ format = "%{=fcmatch}\n";
+ }
+
if (fs)
{
int j;
@@ -209,7 +217,7 @@ main (int argc, char **argv)
{
FcPatternPrint (font);
}
- else if (format)
+ else
{
FcChar8 *s;
@@ -220,34 +228,6 @@ main (int argc, char **argv)
free (s);
}
}
- else if (os)
- {
- FcChar8 *str;
- str = FcNameUnparse (font);
- printf ("%s\n", str);
- free (str);
- }
- else
- {
- FcChar8 *family;
- FcChar8 *style;
- FcChar8 *file;
-
- if (FcPatternGetString (font, FC_FILE, 0, &file) != FcResultMatch)
- file = (FcChar8 *) "<unknown filename>";
- else
- {
- FcChar8 *slash = (FcChar8 *) strrchr ((char *) file, '/');
- if (slash)
- file = slash+1;
- }
- if (FcPatternGetString (font, FC_FAMILY, 0, &family) != FcResultMatch)
- family = (FcChar8 *) "<unknown family>";
- if (FcPatternGetString (font, FC_STYLE, 0, &style) != FcResultMatch)
- style = (FcChar8 *) "<unknown style>";
-
- printf ("%s: \"%s\" \"%s\"\n", file, family, style);
- }
FcPatternDestroy (font);
}
diff --git a/fontconfig/src/fcdir.c b/fontconfig/src/fcdir.c
index 359446c36..8a2b97625 100644
--- a/fontconfig/src/fcdir.c
+++ b/fontconfig/src/fcdir.c
@@ -65,7 +65,7 @@ FcFileScanFontConfig (FcFontSet *set,
/*
* Edit pattern with user-defined rules
*/
- if (font && config && !FcConfigSubstituteWithPat (config, font, NULL, FcMatchScan))
+ if (font && config && !FcConfigSubstitute (config, font, FcMatchScan))
{
FcPatternDestroy (font);
font = NULL;
@@ -75,7 +75,7 @@ FcFileScanFontConfig (FcFontSet *set,
/*
* Add the font
*/
- if (font && (!config || FcConfigAcceptFont (config, font)))
+ if (font)
{
if (FcDebug() & FC_DBG_SCANV)
{
@@ -304,9 +304,6 @@ FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config)
{
FcCache *cache = NULL;
- if (config && !FcConfigAcceptFilename (config, dir))
- return NULL;
-
/* Try to use existing cache file */
if (!force)
cache = FcDirCacheLoad (dir, config, NULL);
diff --git a/fontconfig/src/fcformat.c b/fontconfig/src/fcformat.c
index 1368b7186..d8518f458 100644
--- a/fontconfig/src/fcformat.c
+++ b/fontconfig/src/fcformat.c
@@ -62,6 +62,7 @@
* unparse FcNameUnparse
* fcmatch fc-match default
* fclist fc-list default
+ * fccat fc-cat default
* pkgkit PackageKit package tag format
*
*
@@ -74,8 +75,9 @@
*/
+#define FCCAT_FORMAT "\"%{file|basename|cescape}\" %{index} \"%{-file{%{=unparse|cescape}}}\""
#define FCMATCH_FORMAT "%{file:-<unknown filename>|basename}: \"%{family[0]:-<unknown family>}\" \"%{style[0]:-<unknown style>}\""
-#define FCLIST_FORMAT "%{?file{%{file}: }}%{=unparse}"
+#define FCLIST_FORMAT "%{?file{%{file}: }}%{-file{%{=unparse}}}"
#define PKGKIT_FORMAT "%{[]family{font(%{family|downcase|delete( )})\n}}%{[]lang{font(:lang=%{lang|downcase|translate(_,-)})\n}}"
@@ -304,6 +306,7 @@ interpret_builtin (FcFormatContext *c,
#define BUILTIN(name, format) \
else if (0 == strcmp ((const char *) c->word, name))\
ret = FcPatternFormatToBuf (pat, (const FcChar8 *) format, buf)
+ BUILTIN ("fccat", FCCAT_FORMAT);
BUILTIN ("fcmatch", FCMATCH_FORMAT);
BUILTIN ("fclist", FCLIST_FORMAT);
BUILTIN ("pkgkit", PKGKIT_FORMAT);
@@ -732,7 +735,7 @@ interpret_simple (FcFormatContext *c,
c->word = c->word + strlen ((const char *) c->word) + 1;
/* for now we just support 'default value' */
if (!expect_char (c, '-') ||
- !read_chars (c, '\0'))
+ !read_chars (c, '|'))
{
c->word = orig;
return FcFalse;
diff --git a/fontconfig/src/fcname.c b/fontconfig/src/fcname.c
index 86c10b65e..d77eff6f7 100644
--- a/fontconfig/src/fcname.c
+++ b/fontconfig/src/fcname.c
@@ -874,8 +874,7 @@ FcNameUnparseEscaped (FcPattern *pat, FcBool escape)
{
o = &l->types[i];
if (!strcmp (o->object, FC_FAMILY) ||
- !strcmp (o->object, FC_SIZE) ||
- !strcmp (o->object, FC_FILE))
+ !strcmp (o->object, FC_SIZE))
continue;
e = FcPatternObjectFindElt (pat, FcObjectFromName (o->object));
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index 255edc6a7..b6479e7a3 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -1405,8 +1405,9 @@ demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode)
}
-void
-assign_varying_locations(struct gl_shader_program *prog,
+bool
+assign_varying_locations(struct gl_context *ctx,
+ struct gl_shader_program *prog,
gl_shader *producer, gl_shader *consumer)
{
/* FINISHME: Set dynamically when geometry shader support is added. */
@@ -1462,6 +1463,8 @@ assign_varying_locations(struct gl_shader_program *prog,
}
}
+ unsigned varying_vectors = 0;
+
foreach_list(node, consumer->ir) {
ir_variable *const var = ((ir_instruction *) node)->as_variable();
@@ -1492,8 +1495,32 @@ assign_varying_locations(struct gl_shader_program *prog,
* value is written by the previous stage.
*/
var->mode = ir_var_auto;
+ } else {
+ /* The packing rules are used for vertex shader inputs are also used
+ * for fragment shader inputs.
+ */
+ varying_vectors += count_attribute_slots(var->type);
}
}
+
+ if (ctx->API == API_OPENGLES2 || prog->Version == 100) {
+ if (varying_vectors > ctx->Const.MaxVarying) {
+ linker_error_printf(prog, "shader uses too many varying vectors "
+ "(%u > %u)\n",
+ varying_vectors, ctx->Const.MaxVarying);
+ return false;
+ }
+ } else {
+ const unsigned float_components = varying_vectors * 4;
+ if (float_components > ctx->Const.MaxVarying * 4) {
+ linker_error_printf(prog, "shader uses too many varying components "
+ "(%u > %u)\n",
+ float_components, ctx->Const.MaxVarying * 4);
+ return false;
+ }
+ }
+
+ return true;
}
@@ -1666,9 +1693,13 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
if (prog->_LinkedShaders[i] == NULL)
continue;
- assign_varying_locations(prog,
- prog->_LinkedShaders[prev],
- prog->_LinkedShaders[i]);
+ if (!assign_varying_locations(ctx, prog,
+ prog->_LinkedShaders[prev],
+ prog->_LinkedShaders[i])) {
+ prog->LinkStatus = false;
+ goto done;
+ }
+
prev = i;
}
diff --git a/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml b/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml
index ca9a101a0..d9e540fc9 100644
--- a/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml
+++ b/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml
@@ -38,7 +38,7 @@
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
</function>
- <function name="FramebufferTextureLayerARB" alias="FramebufferTextureLayer">
+ <function name="FramebufferTextureLayerARB" alias="FramebufferTextureLayerEXT">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="texture" type="GLuint"/>
diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c
index 45e476671..263613b2c 100644
--- a/mesalib/src/mesa/state_tracker/st_format.c
+++ b/mesalib/src/mesa/state_tracker/st_format.c
@@ -608,7 +608,7 @@ struct format_mapping
* Multiple GL enums might map to multiple pipe_formats.
* The first pipe format in the list that's supported is the one that's chosen.
*/
-static struct format_mapping format_map[] = {
+static const struct format_mapping format_map[] = {
/* Basic RGB, RGBA formats */
{
{ GL_RGB10, GL_RGB10_A2, 0 },
@@ -616,7 +616,7 @@ static struct format_mapping format_map[] = {
},
{
{ 4, GL_RGBA, GL_RGBA8, 0 },
- { DEFAULT_RGBA_FORMATS, 0 }
+ { DEFAULT_RGBA_FORMATS }
},
{
{ GL_BGRA, 0 },
@@ -624,7 +624,7 @@ static struct format_mapping format_map[] = {
},
{
{ 3, GL_RGB, GL_RGB8, 0 },
- { DEFAULT_RGB_FORMATS, 0 }
+ { DEFAULT_RGB_FORMATS }
},
{
{ GL_RGB12, GL_RGB16, GL_RGBA12, GL_RGBA16, 0 },