Mesa (master): 26 new commits
Ian Romanick
idr at kemper.freedesktop.org
Thu Dec 6 20:14:37 UTC 2012
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=76f13f80e6ac7dcc7747b22eb513acbe1c2a5760
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Mon Nov 19 22:36:28 2012 -0800
glsl: Add missing semicolon in the grammar
This may not be strictly necessary, but every other rule in the grammar ends
with a semicolon. It also appears that this was supposed to be commited with
the original patch that changed this rule, but the wrong version of the patch
was accidentally pushed.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=62c0938639401dbf75c61ed7f6f10fd860994cfd
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Fri Nov 9 12:26:42 2012 -0800
glsl: Allow layout qualifiers in GLSL 3.00 ES
Note that while 'packed' is a reserved word in GLSL ES, row_major is not.
This means that we have to use the string-based matching for that.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=486f9556548292e776781e85052ec4122180891d
Author: Paul Berry <stereotype441 at gmail.com>
Date: Sat Aug 4 15:42:33 2012 -0700
glsl: Create builtin function profiles for GLSL 3.00 ES.
Nearly all of the builtin functions in GLSL 3.00 ES are already
implemented in Mesa; this patch enables them.
A few functions are not implemented yet; those have been commented
out, with a FIXME comment to act as a reminder of what still needs to
be implemented. Here is the complete list: packSnorm2x16,
unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16,
unpackHalf2x16.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a69f66353010d3fe8c666bd4adee26139f32efa
Author: Paul Berry <stereotype441 at gmail.com>
Date: Mon Aug 6 14:36:31 2012 -0700
glsl: add determinant() functions.
These functions are defined in GLSL 1.50 and GLES 3.00 ES.
The formulas have been extracted from the existing implementation of
inverse().
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4d6d22100abf4512865c316f3ad6a3bd25dd28c1
Author: Paul Berry <stereotype441 at gmail.com>
Date: Sat Aug 4 10:43:53 2012 -0700
glsl: Make builtin function profiles for GLSL ES use "es" in the filename.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8dec1bfedd27ae45632b0e08fb5996ff60d042b6
Author: Paul Berry <stereotype441 at gmail.com>
Date: Sat Aug 4 10:29:49 2012 -0700
glsl: Add builtin variables for GLSL 3.00 ES.
This patch also adds assertions so that when we add new GLSL versions,
we'll notice that we need to update the builtin variables.
[v2, idr]: s/Frab/Frag/ Noticed by Eric.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d7949eefcba39d48edd8af53f2d88d58f8cd5381
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 13:38:57 2012 -0700
glsl: Populate built-in types correctly for GLSL 3.00 ES.
This patch implements all of the built-in types for GLSL 3.00 ES.
This is almost exactly the same as the set of built-in types for GLSL
1.30, except ate 1D samplers are skipped, and samplerCubeShadow is
added.
This patch also addes an assertion so that when we add new GLSL
versions, we'll notice that we need to update the types.
In review, Eric noted:
"This change looks correct. The overall interaction of profiles is
getting ugly, though. I'm imagining a restructure of the symbol
table population so that there's a big list of types, and each
#version has a nice list of strings of type names copy and pasted
out of its spec."
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e10a5c5e46e8fe91d206dee360ba12b7dc916b3
Author: Paul Berry <stereotype441 at gmail.com>
Date: Sat Aug 4 10:00:20 2012 -0700
glsl: Make {Min,Max}ProgramTexelOffset available to compiler.
These constants need to be made available to shaders in GLSL 3.00 ES.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=15ba2a582539a3a2bd624fb2ae7bac6a4cc8589a
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 17:51:02 2012 -0700
glsl: Fix linker checks for GLSL ES 3.00.
This patch updates the following linker checks to do the right thing
in GLSL 3.00 ES:
- Failing to write to gl_Position is allowed in GLSL 1.40+ as well as
GLSL 3.00 ES.
- It is an error to write to both gl_ClipVertex and gl_ClipDistance in
GLSL 1.30+. This does not apply to GLSL 3.00 ES.
- GLSL 3.00 ES uses the same varying counting rules as GLSL 1.00 ES.
- In GLSL 1.30 and GLSL 3.00 ES, "discard" terminates the shader.
- In GLSL 1.00 ES and GLSL 3.00 ES, both a fragment and a vertex
shader must be present.
[v2, idr]: Fix minro typo in a comment. Noticed by Ken.
[v3, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=91c92bb6fbacdf713e36a9702fbc2ab4d203152c
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 17:50:43 2012 -0700
glsl: Record in gl_shader_program whether the program uses GLSL ES.
Previously we recorded just the GLSL version (or the max version, if
GLSL 1.10 and GLSL 1.20 programs were linked together).
[v2, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9f34dc304eaed868122fece2ed26760af95ba81
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 17:49:44 2012 -0700
glsl: Clean up shading language mixing check for GLSL 3.00 ES.
Previously, we prohibited mixing of shading language versions if
min_version == 100 or max_version >= 130. This was technically
correct (since desktop GLSL 1.30 and beyond prohibit mixing of shading
language versions, as does GLSL 1.00 ES), but it was confusing. Also,
we asserted that all shading language versions were between 1.00 and
1.40, which was unnecessary (since the parser already checks shading
language versions) and doesn't work for GLSL 3.00 ES.
This patch changes the code to explicitly check that (a) ES shaders
aren't mixed with desktop shaders, (b) shaders aren't mixed between ES
versions, and (c) shaders aren't mixed between desktop GLSL versions
when at least one shader is GLSL 1.30 or greater. Also, it removes
the unnecessary assertion.
[v2, idr]: Slightly tweak the is_es_prog detection to occur outside the loop
instead of doing something special on the first loop iteration. Suggested by
Ken.
[v3, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c150e876b4bd8af1a0f0d7d8a76e9900045ac6be
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 17:47:49 2012 -0700
glsl: Record in gl_shader whether the shader uses GLSL ES.
Previously we recorded just the GLSL version, with the knowledge that
100 means GLSL 1.00 ES. With the advent of GLSL 3.00 ES, this is
going to get more complex, and eventually will probably become
ambiguous (GLSL 4.00 already exists, and GLSL 4.00 ES is likely to be
created some day).
To reduce confusion, this patch simply records whether the shader is
GLSL ES as an explicit boolean.
[v2, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b4aeddfb3cdae95d69e7f46eac87514f372f531
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 11:17:30 2012 -0700
glsl/parser: Handle "#version 300 es" directive.
Note that GLSL 1.00 is selected using "#version 100", so "#version 100
es" is prohibited.
v2: Check for GLES3 before allowing '#version 300 es'
v3: Make sure a correct language_version is set in
_mesa_glsl_parse_state::process_version_directive.
Signed-off-by: Paul Berry <stereotype441 at gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=629b9edc99a0b662cf907b9e068be2fd6ac5ae26
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 11:02:55 2012 -0700
glsl/parser: Extract version directive processing into a function.
Version directive handling is going to have to be used within two
parser rules, one for desktop-style version directives (e.g. "#version
130") and one for the new ES-style version directive (e.g. "#version
300 es"), so this patch moves it to a function that can be called from
both rules.
No functional change.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a03c2c7ab958f024eb77d986285ae294ad459706
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 13:21:54 2012 -0700
glsl/preprocessor: Handle "#version 300 es" directive.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2152df51c0c8546b003f187f2af3ad51df8a41a1
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 13:06:45 2012 -0700
glsl/preprocessor: Extract version directive processing into a function.
Version directive handling is going to have to be used within two
parser rules, one for desktop-style version directives (e.g. "#version
130") and one for the new ES-style version directive (e.g. "#version
300 es"), so this patch moves it to a function that can be called from
both rules.
No functional change.
[mattst88] v2: Use intmax_t instead of int for version argument. Would
otherwise write garbage after #version since PRIiMAX was reading 64-bits
instead of 32.
[idr] v3: A later commit fixes the caller of
_glcpp_parser_handle_version_declaration to pass the correct number of
parameters. Fix it in the patch that changes the interface instead.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4a24745b84be49b0ede285ef795847ebca70916
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 08:18:12 2012 -0700
glsl: Enable GLSL ES 3.00 features inherited from desktop GLSL.
This patch turns on the following features for GLSL ES 3.00:
- Array constructors, whole array assignment, and array comparisons.
- Second and third operands of ?: may be arrays.
- Use of "in" and "out" qualifiers on globals.
- Bitwise and modulus operators.
- Integral vertex shader inputs.
- Range-checking of literal integers.
- array.length method.
- Function calls may be constant expressions.
- Integral varyings must be qualified with "flat".
- Interpolation and centroid qualifiers may not be applied to vertex
shader inputs.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=534ec62152e70ed8f6467feaf07b2db2197e11b1
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 08:17:55 2012 -0700
glsl: parse GLSL ES 3.00 keywords correctly.
GLSL ES 3.00 adds the following keywords over GLSL 1.00: uint,
uvec[2-4], matNxM, centroid, flat, smooth, various samplers, layout,
switch, default, and case.
Additionally, it reserves a large number of keywords, some of which
were already reserved in versions of desktop GL that Mesa supports,
some of which are new to Mesa.
A few of the reserved keywords in GLSL ES 3.00 are keywords that are
supported in all other versions of GLSL: attribute, varying,
sampler1D, sampler1DShador, sampler2DRect, and sampler2DRectShadow.
This patch updates the lexer to handle all of the new keywords
correctly when the language being parsed is GLSL 3.00 ES.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=948e5dda67caa49fa9fc7cdc4649343eaf305b49
Author: Paul Berry <stereotype441 at gmail.com>
Date: Wed Aug 1 19:04:59 2012 -0700
glsl: Rework lexer keyword handling in preparation for GLSL 3.00 ES.
This patch expands the lexer KEYWORD macro to take two additional
arguments: the GLSL ES versions in which the given keyword was first
reserved, and supported, respectively. This will allow us to
trivially add support for GLSL 3.00 ES keywords, even though the set
of GLSL 3.00 ES keywords is neither a subset or a superset of the
keywords corresponding to any desktop GLSL version.
The new KEYWORD macro makes use of the
_mesa_glsl_parse_state::is_version() function, so it accepts 0 as
meaning "unsupported" (rather than 999, which we used previously).
Note that a few keywords ("packed" and "row_major") are supported
*either* when GLSL 1.40 is in use or when ARB_uniform_buffer_obj
support is enabled. Previously, we handled these by cleverly taking
advantage of the fact that the KEYWORD macro didn't parenthesize its
arguments in the usual way. Now they are handled more
straightforwardly, with a new macro, KEYWORD_WITH_ALT.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d9bba6e43ab45c8eb758b4e29f4ed085a9398c9
Author: Paul Berry <stereotype441 at gmail.com>
Date: Sun Aug 5 09:57:01 2012 -0700
glsl: Make use of new _mesa_glsl_parse_state::check_version() function.
Previous to this patch, we were not very consistent about the errors
we generate when a shader tried to use a feature that is prohibited in
the current GLSL version. Some error messages failed to mention the
GLSL version currently in use (or did so inaccurately), and some error
messages failed to mention the first GLSL version in which the given
feature is allowed.
This patch reworks all of the error checks to use the check_version()
function, which produces error messages in a standard form
(approximately "$FEATURE forbidden in $CURRENT_GLSL_VERSION
($REQUIRED_GLSL_VERSION required).").
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3ded7fe628d5a842f2fae0da355a4034cff27cf
Author: Paul Berry <stereotype441 at gmail.com>
Date: Wed Aug 1 14:50:05 2012 -0700
glsl: Make use of new _mesa_glsl_parse_state::is_version() function.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5d0fd3270f028cd93efa5301c998be034826a102
Author: Paul Berry <stereotype441 at gmail.com>
Date: Wed Aug 1 19:09:24 2012 -0700
glsl: Add GLSL version query functions.
With the advent of GLSL 3.00 ES, the version checks we perform in the
GLSL compiler (to determine which language features are present) will
become more complicated. To reduce the complexity, this patch adds
functions check_version() and is_version() to _mesa_glsl_parse_state.
These functions take two version numbers: a desktop GLSL version and a
GLSL ES version, and return a boolean indicating whether the GLSL
version being compiled is at least the required version. So, for
example, is_version(130, 300) returns true if the GLSL version being
compiled is at least desktop GLSL 1.30 or GLSL 3.00.
The check_version() function additionally produces an error message if
the version check fails, informing the user of which GLSL version(s)
support the given feature.
[v2, idr]: Add PRINTFLIKE annotation to the new method. The numbering of th
parameters is correct because GCC is silly.
[v3, idr]: Fix copy-and-paste error in the comment before
_mesa_glsl_parse_state::is_version. Noticed by Ken.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc9f9d8e66ac3ec934a82d25da7b76902f775802
Author: Paul Berry <stereotype441 at gmail.com>
Date: Thu Aug 2 06:45:30 2012 -0700
glsl: Compute version_string on the fly.
Fixes a bug where version_string would be left uninitialized if no
GLSL "#version" directive was used.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d9bfaa104ed4debeff6c7d69daf4d9cc85cadb8d
Author: Paul Berry <stereotype441 at gmail.com>
Date: Wed Aug 1 18:36:57 2012 -0700
glsl: Make a function to express a GLSL version ir human-readable form.
This will be useful in generating more helpful error messages,
especially with the addition of GLSL 3.00 ES support.
[v2, idr]: Rename ctx parameter to mem_ctx
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=53e572f15cb394a8d4f2cd5856dd2a06b6ccd3f0
Author: Paul Berry <stereotype441 at gmail.com>
Date: Wed Aug 1 17:44:02 2012 -0700
glsl: Simplify symbol table version checking.
Previously, we stored the GLSL language version in the
glsl_symbol_table struct. But this was unnecessary--all
glsl_symbol_table needs to know is whether functions and variables
have separate namespaces (they do in GLSL 1.10 only).
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a93ba306878693d9157d204743a82becbd5d53e
Author: Paul Berry <stereotype441 at gmail.com>
Date: Mon Aug 6 10:22:44 2012 -0700
mesa: Add ARB_ES3_compatibility flag.
Adding this now makes it easier to develop and test GLES3 features, since we
can do initial development and testing using desktop GL. Later GLSL compiler
patches check for either ctx->Extensions.ARB_ES3_compatibility or
_mesa_is_gles3 to allow certain features (i.e., "#version 300 es").
[v2, idr]: Just edits to the commit message.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Acked-by: Carl Worth <cworth at cworth.org>
More information about the mesa-commit
mailing list