History log of /external/mesa3d/src/glsl/ralloc.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
94cc306e41a2565b1dc7d410713ac78a9f1edaf3 23-Oct-2012 Matt Turner <mattst88@gmail.com> ralloc: Annotate printf functions with PRINTFLIKE(...)

This is a squash of the following two commits:

ralloc: Annotate printf functions with PRINTFLIKE(...)

Catches problems such as (in the gles3 branch)

glcpp-parse.y: In function '_glcpp_parser_handle_version_declaration':
glcpp-parse.y:1990:39: warning: format '%lli' expects argument of type
'long long int', but argument 4 has type 'int' [-Wformat]

As a side-effect, remove ralloc.c's likely/unlikely macros and just use
the ones from main/compiler.h.

NOTE: This is a candidate for the release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 41b14d125196e75cdd4599a4c1069b41e7000d48)

and

src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGS

When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS
are not used. AM_CPPFLAGS should be used for includes anyway.

Fixes a build problem since 41b14d125:

CC ralloc_test-ralloc.o
In file included from ../../../src/glsl/ralloc.c:42:0:
../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory

Acked-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 67f1e7bf5f5d1482cb8684dd5a405b7bab5b1f34)
/external/mesa3d/src/glsl/ralloc.h
8292b7419d0405e94a5ea270ba710d20f0eb071f 10-Feb-2012 Kenneth Graunke <kenneth@whitecape.org> ralloc: Make rewrite_tail increase "start" by the new text's length.

Both callers of rewrite_tail immediately compute the new total string
length by adding the (known) length of the existing string plus the
length of the newly appended text. Unfortunately, callers generally
won't know the length of the new text, as it's printf-formatted.

Since ralloc already computes this length, it makes sense to add it in
and save the caller the effort. This simplifies both existing callers,
but more importantly, will allow for cheap-appending in the next commit.

v2: The link_uniforms code needs both the old and new length.
Apply the obvious fix (which sadly makes it less of a cleanup).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
/external/mesa3d/src/glsl/ralloc.h
ca95593d49a2d99a16c160c2a04acc4be007d8a4 25-Oct-2011 Kenneth Graunke <kenneth@whitecape.org> ralloc: Add new [v]asprintf_rewrite_tail functions.

This can be useful if you want to create a bunch of temporary strings
with a common prefix. For example, when iterating over uniform
structure fields, one might want to create temporary strings like
"pallete.primary", "palette.outline", and "pallette.shadow".

This could be done by overwriting the '.' with a null-byte and calling
ralloc_asprintf_append, but that incurs the cost of strlen("pallete")
every time...when this is already known.

These new functions allow you rewrite the tail of the string, given a
starting index. If the starting index is the length of the string, this
is equivalent to appending.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/ralloc.h
42fd9c2ebb8a9eecf69d6a7a2bc0d778f49285de 22-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> ralloc: a new MIT-licensed recursive memory allocator.
/external/mesa3d/src/glsl/ralloc.h
dc55254f5b23e5ad7a07c974ce772f93b4c11cb0 16-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> ralloc: Add a fake implementation of ralloc based on talloc.
/external/mesa3d/src/glsl/ralloc.h