History log of /external/mesa3d/src/glsl/linker.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
895a5873d141c726e2e81ba53d5b757e4708fb29 24-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> glsl: Allow ir_if in the linker's move_non_declarations function.

Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements. For example,

float foo = some_boolean ? 0.0 : 1.0;

becomes:

(declare (temporary) float conditional_tmp)
(if (var_ref some_boolean)
((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))

This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).

The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations. As demonstrated above, they can be if statements too.

Other than the assertion, everything works fine. So remove it.

Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b45a68eebf3cf7227fc70082cb1e796041fc81ab)
/external/mesa3d/src/glsl/linker.cpp
877a897adc40d98c8ee5abaaf0ae16028866c766 25-Jun-2012 Eric Anholt <eric@anholt.net> glsl: Reject linking shaders with too many uniform blocks.

Part of fixing piglit maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
8ab5842a6d992956ee365c0e0232c6e6b907863e 02-May-2012 Eric Anholt <eric@anholt.net> glsl: Assign locations for uniforms in UBOs using the std140 rules.

Fixes piglit layout-std140.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
9feb403b0eb5365889cb01ca456a19247aaad502 01-May-2012 Eric Anholt <eric@anholt.net> glsl: Don't resize arrays in uniform blocks.

This is a requirement for std140 uniform blocks, and optional for
packed/shared blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
f609cf782ab5e90ddf045dc4b0da8cebf99be0d1 27-Apr-2012 Eric Anholt <eric@anholt.net> glsl: Merge the lists of uniform blocks into the linked shader program.

This attempts error-checking, but the layout isn't done yet.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
21cb5ed20d1d7984b7695395327ed0ba0b0d16e2 18-Dec-2011 Marek Olšák <maraeo@gmail.com> glsl: implement ARB_transform_feedback3 in the linker

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
8fb1e4a4628caee9e80dcbc47f8f9c772db09419 26-Jun-2012 Brian Paul <brianp@vmware.com> glsl: be more careful about counting varying vars in the linker

Previously, we were counting gl_FrontFacing, gl_FragCoord and gl_PointCoord
against the limit of varying variables. This prevented some valid shaders
from linking.

The other potential solution to this is to have the driver advertise
more varying vars or set the GLSLSkipStrictMaxVaryingLimitCheck flag.
But the above-mentioned variables aren't conventional varying attributes
so it doesn't seem right to count them.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/linker.cpp
3de1395fa5a563c13774ac1c38722c16cecc521d 04-May-2012 Eric Anholt <eric@anholt.net> glsl: Implement the GLSL 1.30+ discard control flow rule in GLSL IR.

Previously, I tried implementing this in the i965 driver, but did so
in a way that violated the intent of the spec, and broke Tropics.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
35f2fb70d3826df70fa2f53af05339137cddefc8 16-Apr-2012 Eric Anholt <eric@anholt.net> Revert "glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function."

This reverts commit 4ec449a6ed1d2cea3bf83d6518b3b352ce5daceb.

I meant to not push this one. Review found that a link error is not
mandated: it should link, but you get undefined rendering if you rely
on a missing stage.

page 42/55 section 2.11 "Vertex Shaders":

"If the program object has no vertex shader, or no program object
is currently in use, the results of vertex shader execution are
undefined."

(and similar for page 160/173 section 3.9 "Fragment Shaders" for FS,
and page 45/58 section 2.11.2 "Program Objects" for program being 0)

It turns out the commit was broken anyway, because it was missing a
"goto done", so linkstatus got smashed back to true later and the
error just showed up as a warning in the infolog.
/external/mesa3d/src/glsl/linker.cpp
4ec449a6ed1d2cea3bf83d6518b3b352ce5daceb 13-Apr-2012 Eric Anholt <eric@anholt.net> glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
1256a5dcc86014d48bdc6fd10ea5a2fa11241667 24-Mar-2012 Dave Airlie <airlied@redhat.com> glsl: add support for ARB_blend_func_extended (v3)

This adds index support to the GLSL compiler.

I'm not 100% sure of my approach here, esp without how output ordering
happens wrt location, index pairs, in the "mark" function.

Since current hw doesn't ever have a location > 0 with an index > 0,
we don't have to work out if the output ordering the hw requires is
location, index, location, index or location, location, index, index.
But we have no hw to know, so punt on it for now.

v2: index requires layout - catch and error
setup explicit index properly.

v3: drop idx_offset stuff, assume index follow location

Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/glsl/linker.cpp
82065fa20ee3f2880a070f1f4f75509b910cedde 21-Sep-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Remove ir_call::get_callee() and set_callee().

Previously, set_callee() performed some assertions about the type of the
ir_call; protecting the bare pointer ensured these checks would be run.

However, ir_call no longer has a type, so the getter and setter methods
don't actually do anything useful. Remove them in favor of accessing
callee directly, as is done with most other fields in our IR.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
d884f60861f270cdcf7d9d47765efcf1e1de30b6 20-Mar-2012 Kenneth Graunke <kenneth@whitecape.org> glsl: Convert ir_call to be a statement rather than a value.

Aside from ir_call, our IR is cleanly split into two classes:
- Statements (typeless; used for side effects, control flow)
- Values (deeply nestable, pure, typed expression trees)

Unfortunately, ir_call confused all this:
- For void functions, we placed ir_call directly in the instruction
stream, treating it as an untyped statement. Yet, it was a subclass
of ir_rvalue, and no other ir_rvalue could be used in this way.
- For functions with a return value, ir_call could be placed in
arbitrary expression trees. While this fit naturally with the source
language, it meant that expressions might not be pure, making it
difficult to transform and optimize them. To combat this, we always
emitted ir_call directly in the RHS of an ir_assignment, only using
a temporary variable in expression trees. Many passes relied on this
assumption; the acos and atan built-ins violated it.

This patch makes ir_call a statement (ir_instruction) rather than a
value (ir_rvalue). Non-void calls now take a ir_dereference of a
variable, and store the return value there---effectively a call and
assignment rolled into one. They cannot be embedded in expressions.

All expression trees are now pure, without exception.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
7449ae45974c6cfd872c1dc2e73bbccdb11d0f70 20-Nov-2011 Dave Airlie <airlied@redhat.com> glsl: fix linker error message context for frag shader output.

A later error prints this properly, fix this case to do the same.

v2: remove attribute as per Ian's suggestion
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
7feabfe23dc54960abba34755f484f786575ac49 21-Mar-2012 Brian Paul <brianp@vmware.com> glsl: propagate MaxUnrollIterations to the optimizer's loop unroller

Instead of the hard-coded value of 32. Note that MaxUnrollIterations
defaults to 32 so there's no net change. But the gallium state tracker
can override this.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
f1c1c9eabea3c38110dc4312bc6cb4319bb82130 20-Mar-2012 Eric Anholt <eric@anholt.net> glsl: Don't require gl_Position to be written in GLSL 1.40.

Fixes piglit glsl-1.40/execution/tf-no-position.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
c5ff9a8b9e3cafb3764e620add2900656c59606b 08-Mar-2012 Eric Anholt <eric@anholt.net> glsl: Hook up the current GLSL 1.30 types and builtins for 1.40.

This gets a basic #version 140 shader compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
84a1273e7fe1216a4724ab13cd061a12b48893c2 03-Feb-2012 Brian Paul <brianp@vmware.com> glsl: move array_sizing_visitor class outside of link_intrastage_shaders()

To silence warnings with gcc 4.4.x on Linux and llvm-g++ 4.2 on Mac.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
d540af554adfe302387014c0f46d6ac3aaa75121 20-Jan-2012 Christoph Bumiller <e0425955@student.tuwien.ac.at> mesa: allocate transform_feedback_info::Outputs array dynamically

The nvc0 gallium driver is advertising 128 MAX_INTERLEAVED_COMPS
which made it always assert in the linker when TFB was used since
the Outputs array was smaller than that maximum.

v2: added assertions

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/glsl/linker.cpp
5a0f395bcf70e524492e766a07cf0b816b42a20d 12-Jan-2012 Eric Anholt <eric@anholt.net> glsl: Fix leak of LinkedTransformFeedback.Varyings.

I copy-and-pasted the thing I was allocating for as the context, so
the first time it would be NULL (root of a ralloc context) and they'd
chain off each other from then on.

NOTE: This is a candidate for the 8.0 branch.
/external/mesa3d/src/glsl/linker.cpp
d3150ebc8c1833322daf24b2cd47e31a5b2f8a1f 09-Jan-2012 Paul Berry <stereotype441@gmail.com> mesa: Move transform feedback error check to reduce array overflow risk.

Previous to this patch, we didn't do the limit check for
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS until the end of the
store_tfeedback_info() function, *after* storing all of the transform
feedback info in the gl_transform_feedback_info::Outputs array. This
meant that the limit check wouldn't prevent us from overflowing the
array and corrupting memory.

This patch moves the limit check to the top of tfeedback_decl::store()
so that there is no risk of overflowing the array. It also adds
assertions to verify that the checks for
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS are sufficient to avoid
array overflow.

Note: strictly speaking this patch isn't necessary, since the maximum
possible number of varyings is MAX_VARYING (16), whereas the size of
the Outputs array is MAX_PROGRAM_OUTPUTS (64), so it's impossible to
have enough varyings to overflow the array. However it seems prudent
to do the limit check before the array access in case these limits
change in the future.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
642e5b413e0890b2070ba78fde42db381eaf02e5 04-Jan-2012 Paul Berry <stereotype441@gmail.com> mesa: Fix transform feedback of unsubscripted gl_ClipDistance array.

On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), we need to handle transform feedback of gl_ClipDistance
specially, to account for the fact that the hardware represents it as
an array of vec4's rather than an array of floats.

The previous way this was accounted for (translating the request for
gl_ClipDistance[n] to a request for a component of
gl_ClipDistanceMESA[n/4]) doesn't work when performing transform
feedback on the whole unsubscripted array, because we need to keep
track of the size of the gl_ClipDistance array prior to the lowering
pass. So I replaced it with a boolean is_clip_distance_mesa, which
switches on the special logic that is needed to handle the lowered
version of gl_ClipDistance.

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]-no-subscript".

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/linker.cpp
be4e9f7a0ccb7aa0edef5e5b589bdbbfd4eab3cb 04-Jan-2012 Paul Berry <stereotype441@gmail.com> mesa: Fix computation of transform feedback num_components.

The function tfeedback_decl::num_components() was not correctly
accounting for transform feedback of whole arrays and gl_ClipDistance.
The bug was hard to notice in tests, because it only affected the
checks for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS.

This patch fixes the computation, and adds an assertion to verify
num_components() even when MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
and MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS are not exceeded.

The assertion requires keeping track of components_so_far in
tfeedback_decl::store(); this will be useful in a future patch to fix
non-multiple-of-4-sized gl_ClipDistance.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/linker.cpp
108cba21dec82a7e10962cf01f2835e7b950ff74 05-Jan-2012 Paul Berry <stereotype441@gmail.com> mesa: Fix bogus transform feedback error message when subscripting non-array.

Previous to this patch, if the client requested transform feedback
using a subscript, but the variable was not an array
(e.g. "gl_FrontColor[0]"), we would produce a bogus error message like
"Transform feedback varying gl_FrontColor[0] found, but it's an array
([] expected)".

Changed the error message to e.g. "Transfrorm feedback varying
gl_FrontColor[0] requested, but gl_FrontColor is not an array."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
33fe02111605ec8897dbc1c989c137b6e38c02f8 04-Jan-2012 Paul Berry <stereotype441@gmail.com> mesa: Fix transform feedback of unsubscripted arrays.

It is not explicitly stated in the GL 3.0 spec that transform feedback
can be performed on a whole varying array (without supplying a
subscript). However, it seems clear from context that this was the
intent. Section 2.15 (TransformFeedback) says this:

When writing varying variables that are arrays, individual array
elements are written in order.

And section 2.20.3 (Shader Variables), says this, in the description
of GetTransformFeedbackVarying:

For the selected varying variable, its type is returned into
type. The size of the varying is returned into size. The value in
size is in units of the type returned in type.

If it were not possible to perform transform feedback on an
unsubscripted array, the returned size would always be 1.

This patch fixes the linker so that transform feedback on an
unsubscripted array is supported.

Fixes piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{4,8}]-no-subscript" and
"EXT_transform_feedback/output_type *[2]-no-subscript".

Note: on back-ends that set
gl_shader_compiler_options::LowerClipDistance (for example i965),
tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]" still fail. I hope to address this in
a later patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
456279bb33e09679de61d560aeafa74bb902fe43 27-Dec-2011 Paul Berry <stereotype441@gmail.com> mesa: Fix transform feedback of gl_ClipDistance.

On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), references to gl_ClipDistance (a float[8] array) will
be converted to references to gl_ClipDistanceMESA (a vec4[2] array).

This patch modifies the linker so that requests for transform feedback
of gl_ClipDistance are similarly converted.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipDistance".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
913a5c238b76a84616917dd47c3c7f627c892e58 27-Dec-2011 Paul Berry <stereotype441@gmail.com> mesa: Make tfeedback_decl::var_name a const char *.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
2169331d40e915d0d1065477a5c81d59f222a5c8 27-Dec-2011 Paul Berry <stereotype441@gmail.com> mesa: Add gl_transform_feedback_info::ComponentOffset.

When using transform feedback, there are three circumstances in which
it is useful for Mesa to instruct a driver to stream out just a
portion of a varying slot (rather than the whole vec4):

(a) When a varying is smaller than a vec4, Mesa needs to instruct the
driver to stream out just the first one, two, or three components of
the varying slot.

(b) In the future, when we implement varying packing, some varyings
will be offset within the vec4, so Mesa will have to instruct the
driver to stream out an arbitrary contiguous subset of the components
of the varying slot (e.g. .yzw or .yz).

(c) On drivers that set gl_shader_compiler_options::LowerClipDistance,
if the client requests that an element of gl_ClipDistance be streamed
out using transform feedback, Mesa will have to instruct the driver to
stream out a single component of one of the gl_ClipDistance varying
slots.

Previous to this patch, only (a) was possible, since
gl_transform_feedback_info specified only the number of components of
the varying slot to stream out. This patch adds
gl_transform_feedback_info::ComponentOffset, which indicates which
components should be streamed out.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
1be0fd8c86cac0775fd4451eb332effc70ccdbe5 05-Jan-2012 Paul Berry <stereotype441@gmail.com> mesa: Fix extra memset in store_tfeedback_info()

Commit 9d36c96d6ec9f2c05c8e0b9ef18c5462cddee8c1 (mesa: Fix
glGetTransformFeedbackVarying()) accidentally added an extra memset()
call to the store_tfeedback_info() function, causing
prog->LinkedTransformFeedback.NumBuffers to be erased.

This patch removes the extra memset and rearranges the other
operations in store_tfeedback_info() to be in the correct order.

Fixes piglit tests "EXT_transform_feedback/api-errors *unbound*"

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/linker.cpp
9d36c96d6ec9f2c05c8e0b9ef18c5462cddee8c1 03-Jan-2012 Eric Anholt <eric@anholt.net> mesa: Fix glGetTransformFeedbackVarying().

The current implementation was totally broken -- it was looking in an
unpopulated structure for varyings, and trying to do so using the
current list of varying names, not the list used at link time.

v2: Fix leaking of memory into the program per re-link.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/glsl/linker.cpp
ebfad9f6a125738b9bfc5d5f7d09a8b57856674a 30-Dec-2011 Paul Berry <stereotype441@gmail.com> mesa: Check that all buffers are bound in BeginTransformFeedback.

From the EXT_transform_feedback spec:

The error INVALID_OPERATION is generated by
BeginTransformFeedbackEXT if any transform feedback buffer object
binding point used in transform feedback mode does not have a
buffer object bound.

This required adding a new NumBuffers field to the
gl_transform_feedback_info struct, to keep track of how many transform
feedback buffers are required by the current program.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors interleaved_unbound
- EXT_transform_feedback/api-errors separate_unbound_0_1
- EXT_transform_feedback/api-errors separate_unbound_0_2
- EXT_transform_feedback/api-errors separate_unbound_1_2

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/linker.cpp
942d452047431f7463d3fad5e7cb92dfd81fd0ac 06-Dec-2011 Paul Berry <stereotype441@gmail.com> mesa: Record transform feedback strides/offsets in linker output.

This patch adds two new fields to the gl_transform_feedback_info
struct:

- BufferStride records the total number of components (per vertex)
that transform feedback is being instructed to store in each buffer.

- Outputs[i].DstOffset records the offset within the interleaved
structure of each transform feedback output.

These values are needed by the i965 gen6 and r600g back-ends, so it
seems better to have the linker provide them rather than force each
back-end to compute them independently.

Also, DstOffset helps pave the way for supporting
ARB_transform_feedback3, which allows the transform feedback output to
contain holes between attributes by specifying
gl_SkipComponents{1,2,3,4} as the varying name.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
/external/mesa3d/src/glsl/linker.cpp
df809ae92343bb83c162ea4c807cefb67686717d 10-Dec-2011 Marek Olšák <maraeo@gmail.com> mesa: add const flags to skip MaxVarying and MaxUniform linker checks (v2)

This is only temporary until a better solution is available.

v2: print warnings and add gallium CAPs

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
ec174a424489664626796126f937fbce3e7d8cd8 18-Nov-2011 Marek Olšák <maraeo@gmail.com> mesa: set the gl_FragDepth layout in the GLSL linker

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
92f81590456103977988ee704d2e6119ca1b989d 08-Nov-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Validate resource usage in the linker

This is also done in ir_to_mesa and st_glsl_to_tgsi, but that code
will be removed soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
871ddb919b424293894a23a8f83200fed572d6a9 05-Nov-2011 Paul Berry <stereotype441@gmail.com> glsl: Assign transform feedback varying slots in linker.

This patch modifies the GLSL linker to assign additional slots for
varying variables used by transform feedback, and record the varying
slots used by transform feedback for use by the driver back-end.

This required modifying assign_varying_locations() so that it assigns
a varying location if either (a) the varying is used by the next stage
of the GL pipeline, or (b) the varying is required by transform
feedback. In order to avoid duplicating the code to assign a single
varying location, I moved it into its own function,
assign_varying_location().

In addition, to support transform feedback in the case where there is
no fragment shader, it is now possible to call
assign_varying_locations() with a consumer of NULL.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Tested-by: Marek Olšák <maraeo@gmail.com>
/external/mesa3d/src/glsl/linker.cpp
b12b5d9ab5c0153c93ca5ad9cd93cb36e41be4eb 05-Nov-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Use app-specified fragment data location during linking

Fixes piglit's bindfragdata-link-error.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/linker.cpp
be4524aeed7fb67bdc45861d299d4c5ca99c4d6c 19-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> Delete code made dead by previous uniform related patches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/glsl/linker.cpp
719909698c67c287a393d2380278e7b7495ae018 19-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Rewrite the way uniforms are tracked and handled

Switch all of the code in ir_to_mesa, st_glsl_to_tgsi, glUniform*,
glGetUniform, glGetUniformLocation, and glGetActiveUniforms to use the
gl_uniform_storage structures in the gl_shader_program.

A couple of notes:

* Like most rewrite-the-world patches, this should be reviewed by
applying the patch and examining the modified functions.

* This leaves a lot of dead code around in linker.cpp and
uniform_query.cpp. This will be deleted in the next patches.

v2: Update the comment block (previously a FINISHME) in _mesa_uniform
about generating GL_INVALID_VALUE when an out-of-range sampler index
is specified.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/glsl/linker.cpp
f6ee7bce65697ea3c6a78a000a49af901ba77c1d 12-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Make invalidate_variable_locations available outside the compilation unit

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/glsl/linker.cpp
f37b1ad937dd2c420f4c9fd9aa5887942bd31f3f 31-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Check that initializers for global variables match

This requires tracking a couple extra fields in ir_variable:

* A flag to indicate that a variable had an initializer.

* For non-const variables, a field to track the constant value of the
variable's initializer.

For variables non-constant initalizers, ir_variable::has_initializer
will be true, but ir_variable::constant_initializer will be NULL. The
linker can use the values of these fields to check adherence to the
GLSL 4.20 rules for shared global variables:

"If a shared global has multiple initializers, the initializers
must all be constant expressions, and they must all have the same
value. Otherwise, a link error will result. (A shared global
having only one initializer does not require that initializer to
be a constant expression.)"

Previous to 4.20 the GLSL spec simply said that initializers must have
the same value. In this case of non-constant initializers, this was
impossible to determine. As a result, no vendor actually implemented
that behavior. The 4.20 behavior matches the behavior of NVIDIA's
shipping implementations.

NOTE: This is candidate for the 7.11 branch. This patch also needs
the preceding patch "glsl: Refactor generate_ARB_draw_buffers_variables
to use add_builtin_constant"

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34687
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/glsl/linker.cpp
46173f907979af0b753befdcf6992e19d8453951 31-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Fix the indentation of a block in cross_validate_globals

I suspect the indentation got messed up during a code merge.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/glsl/linker.cpp
960d722bf7db636863a05ddf9258236fccb58ecd 21-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Eliminate more dead code after demoting shader inputs and outputs

Consider the following vertex shader and fragment shader:

// vertex shader
varying vec4 v;
uniform vec4 u;

void main() { gl_Position = vec4(0.0); v = u; }

// fragment shader
void main() { gl_FragColor = vec4(0.0); }

Since the fragment shader does not use 'v', it is demoted from a
varying to a simple global variable. Once that happens, the
assignment to 'v' is useless, and it should be removed. In addition,
'u' is no longer active, and it should also be removed.

Performing extra dead code elimination after demoting shader inputs
and outputs takes care of this. This elimination must occur before
assigning uniform locations, or the declaration of 'u' cannot be
removed.

This change *breaks* the piglit test getuniform-01, but that test is
already incorrect. The test uses a vertex shader that assigns to a
user-defined varying, but it has no fragment shader. Since Mesa does
not support ARB_separate_shader_objects (we only support the EXT
version), the linker correctly eliminates the user-defined varying.
The cascading effect is that the uniform queried by the C code of the
test is also (correctly) eliminated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
/external/mesa3d/src/glsl/linker.cpp
1d5d67f8adac9f94715de9804adb536d9a7ec5ee 21-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Add uniform_locations_assigned parameter to do_dead_code opt pass

Setting this flag prevents declarations of uniforms from being removed
from the IR. Since the IR is directly used by several API functions
that query uniforms in shaders, uniform declarations cannot be removed
after the locations have been set. However, it should still be safe
to reorder the declarations (this is not tested).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
/external/mesa3d/src/glsl/linker.cpp
57f7978b1de40be6eb138d391c8d9f95b68cbf62 22-Jul-2011 Eric Anholt <eric@anholt.net> mesa: Add a flag for shader programs to allow SSO linkage in GLES2.

On converting fixed function programs to generate GLSL, the linker
became cranky that we were trying to make something that wasn't a
linked vertex+fragment program. Given that the Mesa GLES2 drivers
also support desktop GL with EXT_sso, just telling the linker to shut
up seems like the easiest solution.
/external/mesa3d/src/glsl/linker.cpp
9f0e98d1dfcf83a07a62e9c62e3dc77336789b4a 06-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Fix a slightly incorrect comment

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
523b611646ae15aa05ed37597ae9162de7290faf 18-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Use gl_shader_program::AttributeBindings for attrib locations

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
7bbcc0b832b02f9da6365ec6a86a0167cf75d8a8 30-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Delete symbol table in post-link shaders

The symbol table in the linked shaders may contain references to
variables that were removed (e.g., unused uniforms). Since it may
contain junk, there is no possible valid use. Delete it and set the
pointer to NULL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
1ad54ae0b1713e399c5db43d0eba87861075b4c7 17-Sep-2011 Paul Berry <stereotype441@gmail.com> mesa: Add a flag to indicate whether a program uses gl_ClipDistance.

GLSL 1.30 requires us to use gl_ClipDistance for clipping if the
vertex shader contains a static write to it, and otherwise use
user-defined clipping planes. Since the driver needs to behave
differently in these two cases, we need a flag to record whether the
shader has written to gl_ClipDistance.

The new flag is called UsesClipDistance. We initially store it in
gl_shader_program (since that is the data structure that is available
when we check to see whethe gl_ClipDistance was written to), and we
later copy it to a flag with the same name in gl_vertex_program, since
that is a more convenient place for the driver to access it (in i965,
at least).

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/glsl/linker.cpp
c06e32596735074536b0e613cbddb1c5fd7b367a 12-Aug-2011 Paul Berry <stereotype441@gmail.com> glsl: Implement a lowering pass for gl_ClipDistance.

In i965 GEN6+ (and I suspect most other hardware), gl_ClipDistance
needs to be laid out as a pair of vec4's (the first containing clip
distances 0-3, and the second containing clip distances 4-7).
However, it is declared in GLSL as an array of 8 floats.

This lowering pass acts at the GLSL level, modifying the declaration
of gl_ClipDistance so that it is an array of vec4's rather than an
array of floats, and renaming it to gl_ClipDistanceMESA. In addition,
it modifies all accesses to the array so that they access the
appropiate component of one of the vec4's.

Since some hardware may not internally represent gl_ClipDistance as a
pair of vec4's, this lowering pass is optional. To enable it, set the
LowerClipDistance flag in gl_shader_compiler_options to true.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
b453ba2c9f8ccb1d61a0ef50f0a40592df3366c3 12-Aug-2011 Paul Berry <stereotype441@gmail.com> glsl: Make sure gl_ClipDistance and gl_ClipVertex are not both written.

From section 7.1 (Vertex Shader Special Variables) of the GLSL 1.30
spec:

"It is an error for a shader to statically write both
gl_ClipVertex and gl_ClipDistance."

Fixes piglit test mixing-clip-distance-and-clip-vertex-disallowed.c.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
b9eb4d8a59699e233255113acafae220c3d8fe3c 09-Aug-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Implement the GL_ARB_conservative_depth extension.

It's the same as GL_AMD_conservative_depth. The specs have slight
differences in wording, but don't differ in content or behavior.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
c148ef6ddb3dbf256c26d82ed2f45f1fde55a231 04-Aug-2011 Paul Berry <stereotype441@gmail.com> glsl: validate IR after linking (debug builds only)

At least one of the invariants verified by IR validation concerns the
relative ordering of toplevel constructs in the IR: references to
global variables must come after the declarations of those global
variables.

Since linking affects the ordering of toplevel constructs in the IR,
it's possible that a bug in the linker will cause invalid IR to be
generated, even if all the pre-linked shaders are valid. (In fact,
such a bug was fixed by the previous commit.)

Bugs like this are easily masked by further optimization passes,
particularly inlining. So to make them easier to track down, this
patch addes an IR validation step right after linking, and before
final optimization occurs. The validation only occurs on debug
builds.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
379a32f42ebca9feeb024633f7774661619fd62e 28-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Make linker_{error,warning} generally available

linker_warning is a new function. It's identical to linker_error
except that it doesn't set LinkStatus=false and it prepends "warning: "
on messages instead of "error: ".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/linker.cpp
586e741ac1fa222d041990b265e820f5aa11344d 28-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Make linker_error set LinkStatus to false

Remove the other places that set LinkStatus to false since they all
immediately follow a call to linker_error. The function linker_error
was previously known as linker_error_printf. The name was changed
because it may seem surprising that a printf function will set an
error flag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/linker.cpp
02c5ae1b3fef75d5c0a715313a69e6b95ebd5b95 11-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Reject shaders that contain static recursion

The GLSL 1.20 and later specs say:

"Recursion is not allowed, not even statically. Static recursion is
present if the static function call graph of the program contains
cycles."

Recursion is detected and rejected both a compile-time and at
link-time. The complie-time check happens to detect some cases that
may be removed by various optimization passes. The spec doesn't seem
to allow this, but other vendors (e.g., NVIDIA) appear to only check
at link-time after all optimizations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
4470ff2ebf56b22421038bc7272ef22c085b839d 20-Jul-2011 Brian Paul <brianp@vmware.com> glsl: silence warning in linker.cpp
/external/mesa3d/src/glsl/linker.cpp
7eb7d67d50fccb64248d1fc6f490895048d7d32e 08-Jul-2011 Brian Paul <brianp@vmware.com> glsl: use casts to silence warning
/external/mesa3d/src/glsl/linker.cpp
d32d4f780f9dad122adb63086da266aec6e88850 28-Jun-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Assign locations for fragment shader output

Fixes an assertion failure in the piglib out-01.frag
ARB_explicit_attrib_location test. The locations set via the layout
qualifier in fragment shader were not being applied to the shader
outputs. As a result all of these variables still had a location of
-1 set.

This may need some more work for pre-3.0 contexts. The problem is
dealing with generic outputs that lack a layout qualifier. There is
no way for the application to specify a location
(glBindFragDataLocation is not supported) or query the location
assigned by the linker (glGetFragDataLocation is not supported).

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
/external/mesa3d/src/glsl/linker.cpp
de77324d8f14951e4dc17f570e49451a0cd33121 09-Jun-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Reject shaders that use too many varyings

Previously it was up to the driver or later code generator to reject
these shaders. It turns out that nobody did this.

This will need changes to support geometry shaders.

NOTE: This is a candidate for the stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37743
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/linker.cpp
f18a086326b2bc832a3c181e6bbec6a62e1b3fcd 24-Apr-2011 Bryan Cain <bryancain3@gmail.com> glsl: Fix typos in comments.
/external/mesa3d/src/glsl/linker.cpp
89d81ab16c05818b290ed735c1343d3abde449bf 25-Jan-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Calcluate Mesa state slots in front-end instead of back-end

This should be the last bit of infrastructure changes before
generating GLSL IR for assembly shaders.

This commit leaves some odd code formatting in ir_to_mesa and brw_fs.
This was done to minimize whitespace changes / reindentation in some
loops. The following commit will restore formatting sanity.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
/external/mesa3d/src/glsl/linker.cpp
497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f 10-Feb-2011 Ian Romanick <ian.d.romanick@intel.com> Use C-style system headers in C++ code to avoid issues with std:: namespace
/external/mesa3d/src/glsl/linker.cpp
25b36e8ff81a9c951085d6dd802a7534db476f5a 16-Feb-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Fix off-by-one error implicit array sizing

Arrays are zero based. If the highest element accessed is 6, the
array needs to have 7 elements.

Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
/external/mesa3d/src/glsl/linker.cpp
ce9171f9d8e0e2c2422fdddb198f8d548381b7ea 04-Feb-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Generate link errors when ES shaders are missing stages

ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.
/external/mesa3d/src/glsl/linker.cpp
819d57fce94b20fa0d34da6f037f0a53c4a5bdc2 13-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Introduce a new "const_in" variable mode.

This annotation is for an "in" function parameter for which it is only legal
to pass constant expressions. The only known example of this, currently,
is the textureOffset functions.

This should never be used for globals.
/external/mesa3d/src/glsl/linker.cpp
d3073f58c17d8675a2ecdd5dfa83e5520c78e1a8 21-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> Convert everything from the talloc API to the ralloc API.
/external/mesa3d/src/glsl/linker.cpp
addae33d6b8574971b82283ab890524480054a1d 27-Jan-2011 Chad Versace <chad.versace@intel.com> glsl: Raise linking error if gl_FragDepth layout is inconsistent

From the AMD_conservative_depth spec:
If gl_FragDepth is redeclared in any fragment shader in a program, it
must be redeclared in all fragment shaders in that program that have
static assignments to gl_FragDepth. All redeclarations of gl_FragDepth in
all fragment shaders in a single program must have the same set of
qualifiers.
/external/mesa3d/src/glsl/linker.cpp
0f4b2a0a23650d8f773c53d84cb2ead1f6d4fc8e 25-Jan-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Propagate max_array_access while linking functions

Update the max_array_access of a global as functions that use that
global are pulled into the linked shader.

Fixes piglit test glsl-fs-implicit-array-size-01 and bugzilla #33219.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
/external/mesa3d/src/glsl/linker.cpp
c87e9ef4d291b3fc18f7af2c7a7646b9a860f4af 25-Jan-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Set sizes for non-global arrays as well

Previously only global arrays with implicit sizes would be patched.
This causes all arrays that are actually accessed to be sized.

Fixes piglit test glsl-fs-implicit-array-size-02.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
/external/mesa3d/src/glsl/linker.cpp
e256e4743c3f8f924f0d191759d9428f33f3e329 19-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl, i965: Remove unnecessary talloc includes.

These are already picked up by ir.h or glsl_types.h.
/external/mesa3d/src/glsl/linker.cpp
61428dd2ab66017f80dc4f3b0793e741d93a6d47 11-Jan-2011 Chad Versace <chad.versace@intel.com> glsl: At link-time, check that globals have matching centroid qualifiers

Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
/external/mesa3d/src/glsl/linker.cpp
cb2b547a4771ddf56975ede566dbf3a8f5389689 14-Dec-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Allow built-in arrays to have different sizes between shader stages

Fixes pitlit test glsl-link-varying-TexCoord (bugzilla #31650).
/external/mesa3d/src/glsl/linker.cpp
002cd2c8d439729227c79093bdbf8a269e72c19f 08-Dec-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Fix regressions caused by previous commit

That's what I get for not running piglit before pushing.

Don't try to patch types of unsized arrays when linking fails.

Don't try to patch types of unsized arrays that are shared between
shader stages.
/external/mesa3d/src/glsl/linker.cpp
6f53921c4b9dea8439a851eaa9a4df3791e5649a 08-Dec-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Ensure that unsized arrays have a size after linking

Fixes piglit test case glsl-vec-array (bugzilla #31908).

NOTE: This bug does not affect 7.9, but I think this patch is a
candiate for the 7.9 branch anyway.
/external/mesa3d/src/glsl/linker.cpp
7528f143dfb77e3e0486006676e990964392aebf 17-Nov-2010 Chad Versace <chad.versace@intel.com> glsl: Fix linker bug in cross_validate_globals()

Cause linking to fail if a global has mismatching invariant qualifiers.

See https://bugs.freedesktop.org/show_bug.cgi?id=30261
/external/mesa3d/src/glsl/linker.cpp
2da02e75b17dcfb2efc3ce053c48339109bc0f26 17-Nov-2010 Kenneth Graunke <kenneth@whitecape.org> glsl/linker: Free any IR discarded by optimization passes.

Previously, IR for a linked shader was allocated directly out of the
gl_shader object - meaning all of it lived as long as the shader.

Now, IR is allocated out of a temporary context, and any -live- IR is
reparented/stolen to (effectively) the gl_shader. Any remaining IR can
be freed.

NOTE: This is a candidate for the 7.9 branch.
/external/mesa3d/src/glsl/linker.cpp
001eee52d461233b1e1d6ed3577965e9bcb209e8 05-Nov-2010 Eric Anholt <eric@anholt.net> glsl: Make the symbol table's add_variable just use the variable's name.
/external/mesa3d/src/glsl/linker.cpp
e8f5ebf313da3ce33ccbbcf9b72946853035fbdd 05-Nov-2010 Eric Anholt <eric@anholt.net> glsl: Make the symbol table's add_function just use the function's name.
/external/mesa3d/src/glsl/linker.cpp
cc90e62d70d91fb16abcd66c61c211c0fd573339 20-Oct-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Improve handling of unread/unwritten shader inputs/outputs

Previously some shader input or outputs that hadn't received location
assignments could slip through. This could happen when a shader
contained user-defined varyings and was used with either
fixed-function or assembly shaders.

See the piglit tests glsl-[fv]s-user-varying-ff and
sso-user-varying-0[12].

NOTE: this is a candidate for the 7.9 branch.
/external/mesa3d/src/glsl/linker.cpp
f29ff6efa6db63c9b554076a2ec6addcba1f737e 15-Oct-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Trivial indention fix
/external/mesa3d/src/glsl/linker.cpp
3322fbaf3b5e305ce00c1d08c26965bb98e0cef0 14-Oct-2010 Ian Romanick <ian.d.romanick@intel.com> glsl: Slightly change the semantic of _LinkedShaders

Previously _LinkedShaders was a compact array of the linked shaders
for each shader stage. Now it is arranged such that each slot,
indexed by the MESA_SHADER_* defines, refers to a specific shader
stage. As a result, some slots will be NULL. This makes things a
little more complex in the linker, but it simplifies things in other
places.

As a side effect _NumLinkedShaders is removed.

NOTE: This may be a candidate for the 7.9 branch. If there are other
patches that get backported to 7.9 that use _LinkedShader, this patch
should be cherry picked also.
/external/mesa3d/src/glsl/linker.cpp
4a45595cf3d6a238bb4d528d30139392618b39df 14-Oct-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Reject shaders that have unresolved function calls

This really amounts to just using the return value from
link_function_calls. All the work was being done, but the result was
being ignored.

Fixes piglit test link-unresolved-funciton.

NOTE: this is a candidate for the 7.9 branch.
/external/mesa3d/src/glsl/linker.cpp
f9995b30756140724f41daf963fa06167912be7f 12-Oct-2010 Kristian Høgsberg <krh@bitplanet.net> Drop GLcontext typedef and use struct gl_context instead
/external/mesa3d/src/glsl/linker.cpp
68a4fc9d5a9dd3b61472451d659275531253b67d 08-Oct-2010 Ian Romanick <ian.d.romanick@intel.com> glsl: Add linker support for explicit attribute locations
/external/mesa3d/src/glsl/linker.cpp
4b5489dd6f6d21c9d2e3f3d6d6467dcd429264a2 08-Oct-2010 Ian Romanick <ian.d.romanick@intel.com> glsl: Fail linking if assign_attribute_locations fails
/external/mesa3d/src/glsl/linker.cpp
586b4b500fed64fb724beb3753bc190cd1c676e0 28-Sep-2010 Eric Anholt <eric@anholt.net> glsl: Also update implicit sizes of varyings at link time.

Otherwise, we'll often end up with gl_TexCoord being 0 length, for
example. With ir_to_mesa, things ended up working out anyway, as long
as multiple implicitly-sized arrays weren't involved.
/external/mesa3d/src/glsl/linker.cpp
2b95525429935474ee4b507348507da45adc6872 21-Sep-2010 Brian Paul <brianp@vmware.com> glsl2: fix typo in error msg
/external/mesa3d/src/glsl/linker.cpp
e591c4625cae63660c5000fbab366e40fe154ab0 05-Sep-2010 Luca Barbieri <luca@luca-barbieri.com> glsl: add several EmitNo* options, and MaxUnrollIterations

This increases the chance that GLSL programs will actually work.

Note that continues and returns are not yet lowered, so linking
will just fail if not supported.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
f412fac5b46eb274cbed8e62234d5dbfd859f1fe 05-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Move is_builtin flag back to ir_function_signature.

This effectively reverts b6f15869b324ae64a00d0fe46fa3c8c62c1edb6c.

In desktop GLSL, defining a function with the same name as a built-in
hides that built-in function completely, so there would never be
built-in and user function signatures in the same ir_function.

However, in GLSL ES, overloading built-ins is allowed, and does not
hide the built-in signatures - so we're back to needing this.
/external/mesa3d/src/glsl/linker.cpp
5a81d057dbbf9f4b8fbeee471df70603009c8d6b 31-Aug-2010 Kenneth Graunke <kenneth@whitecape.org> linker: Fix assertion and cross-version checks for version 100.

Fixes an assert (min_version >= 110) which was no longer correct, and
also prohibits linking ES2 shaders with non-ES2 shaders. I'm not
positive this is correct, but the specification doesn't seem to say.
/external/mesa3d/src/glsl/linker.cpp
c47b289972a6c5ca0e30ff5618418e5ca91bd1ec 04-Sep-2010 Török Edvin <edwintorok@gmail.com> glsl2: check for _NumLinkedShaders being 0

Otherwise spring 0.82+.4.0 crashes when starting a game
because prog->_LinkedShaders[0] is NULL.

This also fixes piglit test cases glsl-link-empty-prog-0[12].
/external/mesa3d/src/glsl/linker.cpp
df869d916308759fbacb227f60b1b6eda73131e2 31-Aug-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Handle varying arrays, matrices, and arrays of matrices

Fixes piglit test case glsl-array-varying-01.
/external/mesa3d/src/glsl/linker.cpp
a2711d69686a6c7f2cabe174cfefeefc718ce335 30-Aug-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Treat sized and unsized array types as the same

If two shaders contain variables declared with array types that have
the same base type but one is sized and the other is not, linking
should succeed. I'm not super pleased with the way this is
implemented, and I am more convinced than ever that we need more
linker tests. We especially need "negative" tests.

Fixes bugzilla #29697 and piglit test glsl-link-array-01.
/external/mesa3d/src/glsl/linker.cpp
b6f15869b324ae64a00d0fe46fa3c8c62c1edb6c 21-Aug-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Move is_built_in flag from ir_function_signature to ir_function.

Also rename it to "is_builtin" for consistency.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/linker.cpp
0924ba0c3496160a134d37cec800f902ae805b9c 24-Aug-2010 Eric Anholt <eric@anholt.net> ir_to_mesa: Convert this code to using linker.cpp's uniform locations.

Fixes: glsl-fs-uniform-array-4.
/external/mesa3d/src/glsl/linker.cpp
45388b5467d66a887e9c76b66ae126ec07d4125a 24-Aug-2010 Eric Anholt <eric@anholt.net> glsl: Make uniform linking generate separate uniforms for struct members.

This is a step towards making the linker code usable as our uniform
setup, instead of having it wedged into ir_to_mesa.cpp.
/external/mesa3d/src/glsl/linker.cpp
bfd7c9ac228c7ed8aec04c3b3aa33f40ee00b035 23-Aug-2010 Chia-I Wu <olv@lunarg.com> glsl: Include main/core.h.

Make glsl include only main/core.h from core mesa.
/external/mesa3d/src/glsl/linker.cpp
18a60239001c27ff98739865d5fc70fd3d011b2e 23-Aug-2010 Eric Anholt <eric@anholt.net> glsl: Count function call outvals as writing to variables for linker checks.

Fixes: glsl-vs-position-outval. Bug #28138 (regnum online)
/external/mesa3d/src/glsl/linker.cpp
a721abfbd1724e83381b46fc670bb38fbde76f69 23-Aug-2010 Eric Anholt <eric@anholt.net> glsl: Trim the size of uniform arrays to the maximum element used.

Fixes glsl-getactiveuniform-array-size.
/external/mesa3d/src/glsl/linker.cpp
f1d5a9419784e939da1a4bcc482567f315da541a 19-Aug-2010 Eric Anholt <eric@anholt.net> glsl: Also strdup the names of uniform list entries for >vec4 types.

Fixes double-free since the fix to free all of the uniform list.
/external/mesa3d/src/glsl/linker.cpp
5d0f430e8ed01db29d11d22e4b6c3760d8c39f8f 18-Aug-2010 Eric Anholt <eric@anholt.net> mesa: Free old linked shaders when relinking new shaders.
/external/mesa3d/src/glsl/linker.cpp
40e114b5dc60c5e196a86e33c2436b099ed9f392 17-Aug-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Demote user-defined varyings in the VS-only case

Fixes piglit test case glsl-vs-ff-frag and bugzilla #29623.
/external/mesa3d/src/glsl/linker.cpp
45d97dd6d5467d96acee1ba33052836b45668564 16-Aug-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Include compiler.h to avoid spurious warnings about INLINE
/external/mesa3d/src/glsl/linker.cpp
2f4fe151681a6f6afe1d452eece6cf4144f44e49 10-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Move the common optimization passes to a helper function.

These are passes that we expect all codegen to be happy with. The
other lowering passes for Mesa IR are moved to the Mesa IR generator.
/external/mesa3d/src/glsl/linker.cpp
c33e78f62bed762d8e5987e111a6e0424dc26c76 13-Aug-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Assign attrib location 0 if gl_Vertex is not used

If gl_Vertex is not used in the shader, then attribute location 0 is
available for use.

Fixes piglit test case glsl-getattriblocation (bugzilla #29540).
/external/mesa3d/src/glsl/linker.cpp
5854d4583c6e8885185e12a0636f77489a62e24c 10-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))

All the current HW backends transform subtract to adding the negation,
so I haven't bothered peepholing it back out in Mesa IR. This allows
some subtract of subtract to get removed in ir_algebraic.
/external/mesa3d/src/glsl/linker.cpp
8bebbeb7c5b26ec9166a4644a2c051238d18509b 10-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Add constant propagation.

Whereas constant folding evaluates constant expressions at rvalue
nodes, constant propagation tracks constant components of vectors
across execution to replace (possibly swizzled) variable dereferences
with constant values, triggering possible constant folding or reduced
variable liveness.
/external/mesa3d/src/glsl/linker.cpp
8d61a23b1a1d0d4b21f0fab64f6d863a8ee3d7f1 06-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Don't assert in a couple of places when encountering sampler arrays.

Fixes glean shaderAPI.
/external/mesa3d/src/glsl/linker.cpp
bc4034b243975089c06c4415d4e26edaaaec7a46 06-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Add a pass to convert exp and log to exp2 and log2.

Fixes ir_to_mesa handling of unop_log, which used the weird ARB_vp LOG
opcode that doesn't do what we want. This also lets the multiplication
coefficients in there get constant-folded, possibly.

Fixes:
glsl-fs-log
/external/mesa3d/src/glsl/linker.cpp
7f7eaf0285d011f7cc7e1a63133184a50b24ecaa 05-Aug-2010 Eric Anholt <eric@anholt.net> ir_structure_splitting: New pass to chop structures into their components.

This doesn't do anything if your structure goes through an uninlined
function call or if whole-structure assignment occurs. As such, the
impact is limited, at least until we do some global copy propagation
to reduce whole-structure assignment.
/external/mesa3d/src/glsl/linker.cpp
2e853ca23c8670246dd4efcee0706f68097652f7 05-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Add a pass for removing unused functions.

For a shader involving many small functions, this avoids running
optimization across all of them after they've been inlined
post-linking.

Reduces the runtime of linking and running a fragment shader from Yo
Frankie from 1.6 seconds to 0.9 seconds (-44.9%, +/- 3.3%).
/external/mesa3d/src/glsl/linker.cpp
046bef235744e891e4a48076e1a3ff9a61a63092 05-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Remove the shader_in/shader_out tracking separate from var->mode.

I introduced this for ir_dead_code to distinguish function parameter
outvals from varying outputs. Only, since ast_to_hir's
current_function is unset when setting up function parameters (they're
needed for making the function signature in the first place), all
function parameter outvals were marked as shader outputs anyway. This
meant that an inlined function's cloned outval was marked as a shader
output and couldn't be dead-code eliminated. Instead, since
ir_dead_code doesn't even look at function parameters, just use
var->mode.

The longest Mesa IR coming out of ir_to_mesa for Yo Frankie drops from
725 instructions to 636.
/external/mesa3d/src/glsl/linker.cpp
e3a90b8e38b1d0de9f473caca96779e215071315 05-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Use linked ir_constant_variable after linking, instead of unlinked.
/external/mesa3d/src/glsl/linker.cpp
b6ceddc371d026dc30f2cc0f377bc0214e11d768 04-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Don't try to assign locations for samplers during linking.

Mesa will do the mapping at _mesa_add_sampler() time. Fixes assertion
failures in debug builds, which might have caught real problems with
multiple samplers linked in a row.
/external/mesa3d/src/glsl/linker.cpp
8273bd46877e2ea2b8a02b87a11c68102d07e1f2 04-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Make the clone() method take a talloc context.

In most cases, we needed to be reparenting the cloned IR to a
different context (for example, to the linked shader instead of the
unlinked shader), or optimization before the reparent would cause
memory usage of the original object to grow and grow.
/external/mesa3d/src/glsl/linker.cpp
31747155ea3a24190277b125bd188ac8689af719 28-Jul-2010 Aras Pranckevicius <aras@unity3d.com> glsl2: Give the path within src/mesa/ for headers instead of relying on -I.
/external/mesa3d/src/glsl/linker.cpp
f6b03f323500c71fc20c0d64c618d9aa73ced5b4 01-Aug-2010 Eric Anholt <eric@anholt.net> glsl2: Do algebraic optimizations after linking as well.

Linking brings in inlining of builtins, so we weren't catching the
(rcp(/sqrt(x)) -> rsq(x)) without it.
/external/mesa3d/src/glsl/linker.cpp
784695442c415cf0be882434a25671ecfb635d34 31-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Add new tree grafting optimization pass.
/external/mesa3d/src/glsl/linker.cpp
62c4763b707e2227409f81b09dd5cf6e4410ea6a 29-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Fix spelling of "sentinel."
/external/mesa3d/src/glsl/linker.cpp
b706283c79de41caf775b0bb15b3c849932f2574 28-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Fail linking where the FS reads a varying that the VS doesn't write.

Fixes:
glsl1-varying read but not written
glsl1-varying var mismatch
/external/mesa3d/src/glsl/linker.cpp
a6c7606ab6e2ba8b4fc253e93a83ca2f18a874b4 28-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Unmark unwritten varyings as varying.

This fixes an assertion failure in ir_to_mesa, and the varying won't
take up varying space.
/external/mesa3d/src/glsl/linker.cpp
59c45e9e6cf80be149c6e5d94763e98312f49be2 27-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Actually use the linked dead code eliminator.

I managed to revert the change from unlinked at some point while
cleaning up the changes. glsl-fs-raytrace-bug27060 drops from 389
instructions to 370.
/external/mesa3d/src/glsl/linker.cpp
bf6ad0ab3d3940ca642c388444f7ddae91eefffc 27-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Use ir_dead_code's linked version after linking.

glsl-fs-raytrace-bug27060 goes from 485 Mesa IR instructions to 389
before Mesa IR optimization.
/external/mesa3d/src/glsl/linker.cpp
afe125e0a18ac3886c45c7e6b02b122fb2d327b5 27-Jul-2010 Eric Anholt <eric@anholt.net> Merge remote branch 'origin/master' into glsl2

This pulls in multiple i965 driver fixes which will help ensure better
testing coverage during development, and also gets past the conflicts
of the src/mesa/shader -> src/mesa/program move.

Conflicts:
src/mesa/Makefile
src/mesa/main/shaderapi.c
src/mesa/main/shaderobj.h
d5be2acae379783c4aa31243e0a88a9e67e6ca7e 20-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Link built-in functions instead of including them in every shader

This is an invasive set of changes. Each user shader tracks a set of other
shaders that contain built-in functions. During compilation, function
prototypes are imported from these shaders. During linking, the
shaders are linked with these built-in-function shaders just like with
any other shader.
/external/mesa3d/src/glsl/linker.cpp
a7ba9a7919110fd619b0e792368aa1f3534080fe 20-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Do post-link lowering and optimization

The lowering code should probably be moved elsewhere.
/external/mesa3d/src/glsl/linker.cpp
7e2aa91507a5883e33473e0a94215ee3985baad1 20-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> glsl2: Add and use new variable mode ir_var_temporary

This is quite a large patch because breaking it into smaller pieces
would result in the tree being intermitently broken. The big changes
are:

* Add the ir_var_temporary variable mode

* Change the ir_variable constructor to take the mode as a
parameter and correctly specify the mode for all ir_varables.

* Change the linker to not cross validate ir_var_temporary
variables.

* Change the linker to pull all ir_var_temporary variables from
global scope into 'main'.
/external/mesa3d/src/glsl/linker.cpp
cd6764ed6ec5ae1a4bce636feaf9d4b18ff3ccf3 17-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Remove the FINISHME comment for intrastage linking
/external/mesa3d/src/glsl/linker.cpp
1a03a644d2f933fbbbe535e584a92fdf1ad619f1 17-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Remove redundant check for 'main' in shaders

This is now handled in link_intrastage_shaders.
/external/mesa3d/src/glsl/linker.cpp
25f51d3b9b8c36c41cd23d2797b6a06f6e27ff86 17-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Track and validate GLSL versions used in shaders
/external/mesa3d/src/glsl/linker.cpp
de415b7f4b1278f10097f4af80886bc82912dd92 14-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Add comment about bug in initializer handling
/external/mesa3d/src/glsl/linker.cpp
8fe8a814b0c746f0f655a67f8755f9dee858d230 14-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: First bits of intrastage, intershader function linking

This handles the easy case of linking a function in a different
compilation unit that doesn't call any functions or reference any
global variables.
/external/mesa3d/src/glsl/linker.cpp
3880d07f4bde3f3743bad6e0f5966276c476fb21 14-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Remove some unnecessary includes
/external/mesa3d/src/glsl/linker.cpp
303c99f12fd1234a763147f9e081f2544433fc77 19-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Use foreach_list_safe in move_non_declarations

The node being processed may be removed from the list and put in a
different list. Not using the safe version caused list processing to
change streams after moving a node.
/external/mesa3d/src/glsl/linker.cpp
9303e358cb3062f62c39961ebd4708bf63db03c1 19-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Move global instructions from the linked shader first

For the shader containing 'main', use the linked shader (i.e., the
clone of the original shader that contained main) as the source for
global instructions to move into main.
/external/mesa3d/src/glsl/linker.cpp
c10a68522c400d48553dbd473b9778140842d9dd 13-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: When linking makes a variable not a varying output, make it ir_var_auto.

This almost fixes glsl-unused-varying, except that the used varying
gets assigned to the first varying slot (position).
/external/mesa3d/src/glsl/linker.cpp
4e6a3e0d2d148747002ab9e9c1dffe63e912c688 13-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> glsl2: Remove unnecessary casts of clone return values
/external/mesa3d/src/glsl/linker.cpp
31a97868fc14d4c57681c35021571b4b61f29e20 13-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Merge global-scope instructions into main

Find instructions in all shaders that are not contained in a function
(i.e., initializers for global variables). "Move" these instructions
to the top of the main function in the linked shader. As a
side-effect, many global variables will also be copied into the linked
shader.
/external/mesa3d/src/glsl/linker.cpp
15ce87e9f2d4f66ef87af693a284b3cc9fd870c1 10-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Detect the shader that contains "main" during intrastage linking
/external/mesa3d/src/glsl/linker.cpp
13f782c4ae4e38e64ec4fe87a1c24597a5e894c3 30-Jun-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Implement first bits of intrastage linking

This currently involves an ugly hack so that every link doesn't result
in all the built-in functions showing up as multiply defined. As soon
as the built-in functions are stored in a separate compilation unit,
ir_function_signature::is_built_in can be removed.
/external/mesa3d/src/glsl/linker.cpp
e2e5d0def490ed03970efa0a7468fef0623ae617 30-Jun-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Refactor cross_validate_uniforms into cross_validate_globals

The later, more generic function will be used in the intra-stage linker.
/external/mesa3d/src/glsl/linker.cpp
3fb878722ed53d79eedb9fe68972ef32b79575d4 09-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Stub-out intrastage linker
/external/mesa3d/src/glsl/linker.cpp
35c89204e597e6d4d3e8b8c665ce1c51d6dde4d7 08-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Use bit-0 instead of VERT_BIT_GENERIC0

Uses of the bits for allocation are offset by 16, and
VERT_BIT_GENERIC0 already has the 16 offset. As a result, it was
preventing the wrong thing from being allocated.
/external/mesa3d/src/glsl/linker.cpp
97eba76b8c5fe60738716c4dce9404de417a7d34 30-Jun-2010 Eric Anholt <eric@anholt.net> glsl2: Allow a fragment shader to not write a color.

I can't find any text justifying this check, and it caused a
reasonable-looking shader in glsl-bug-22603 (which writes only
gl_FragDepth) to fail.
/external/mesa3d/src/glsl/linker.cpp
ef5f1948316664055c1444d12076c7d86589a8b9 30-Jun-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Don't dynamically allocate slots for linked shaders

The can be at most one shader per stage. There are currently only two
stages. There is zero reason to dynamically size this array.
/external/mesa3d/src/glsl/linker.cpp
982e3798d8b9bfec7ff3f37c52687036b36bc153 30-Jun-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Don't automatically allocate VERT_ATTRIB_GENERIC0
/external/mesa3d/src/glsl/linker.cpp
849e18153cd91d812f694b806a84008498860bc3 30-Jun-2010 Eric Anholt <eric@anholt.net> glsl2: Use Mesa's gl_shader_program instead of our own struct glsl_program.

This avoids more allocation and shuffling of data around.
/external/mesa3d/src/glsl/linker.cpp
16b68b1952d0da14b9ce8306efa64988ce46b4b7 30-Jun-2010 Eric Anholt <eric@anholt.net> glsl2: Move our data from a glsl_shader* on the side to the main gl_shader *.

This saves recompiling at link time. gl_shader->ir is made a pointer
so that we don't have to bring exec_list into mtypes.h.
/external/mesa3d/src/glsl/linker.cpp
3d6012303c3ce24c75d209267e6914f706d025c5 25-Jun-2010 Eric Anholt <eric@anholt.net> glsl2: Wrap includes of C interfaces with extern "C".
/external/mesa3d/src/glsl/linker.cpp
29285882676388aacff123e8bdf025904abf8ea9 25-Jun-2010 Eric Anholt <eric@anholt.net> glsl2: Move the compiler to the subdirectory it will live in in Mesa.
/external/mesa3d/src/glsl/linker.cpp