History log of /external/mesa3d/src/compiler/glsl/link_uniforms.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ca222b7c1868491ede19f2da717b39c0a54e6846 31-Jan-2017 Bartosz Tomczyk <bartosz.tomczyk86@gmail.com> glsl: fix heap-buffer-overflow

The `end+1` skips the ']', whereas the `strlen+1` includes the final
'\0' in the move to terminate the string.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit fc27181f9e51441a26b7eb4f62794b5e9a994644)
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
ae632afe4fd860f016d2e5b360d66dc4e72ce72a 09-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl: set num_images directly in shader_info

This change also removes the now duplicate NumImages field.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
076ab157ff2ed7a98b09363bce355247f4ed71e6 08-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl: move SamplerTargets to gl_program

This will help allow us to simplify the handling of samplers by
storing them in a single location rather than duplicating them in
both gl_linked_shader and gl_program.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
937523971f42f37b40badb962e575ecd8258b2d5 09-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl: set SamplersUsed directly in gl_program

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
4807a83da0e0f5e3272e85504ee3b2213ef1910a 04-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa/glsl: set num_textures per stage directly in shader_info

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
5ceedefd6c32fa31e6a35831a8a7a315e009ccc3 09-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa/glsl: remove hack to reset sampler units to zero

Now that we have the is_arb_asm flag we can just skip the
initialisation.

V2: remove hack from standalone compiler where it was never
needed since it only compiles glsl shaders.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
f5bc127b2f140213a8ceb58c4ed2d9b9a4c0449c 05-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl/i965: move ShaderStorageBlocks to gl_program

Having it here rather than in gl_linked_shader allows us to simplify
the code.

Also it is error prone to depend on the gl_linked_shader for programs
in current use because a failed linking attempt will free infomation
about the current program. In i965 we could be trying to recompile
a shader variant but may have lost some required fields.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
f62eb6c7eb22cd97c691ebdb5f25eb5fe8e9ed11 04-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl/i965: set num_ssbos directly in shader_info

Here we also remove the duplicate field in gl_linked_shader and always
get the value from shader_info instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
0e7eec1ab5f27ced1aa4b2d77c2c63512d299694 04-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl/i965: move per stage UniformBlocks to gl_program

This will help allow us to store pointers to gl_program structs in the
CurrentProgram array resulting in a bunch of code simplifications.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
b792c3897927c1d89968bc0040faef02ec976184 04-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl/i965: set num_ubos directly in shader_info

This also removes the duplicate field in gl_linked_shader, and
gets num_ubos from shader_info instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
a1da57c19c27505b9eab4792355f2f1b5c774a0a 04-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl/i965: move ImageUnits and ImageAccess fields to gl_program

Having it here rather than in gl_linked_shader allows us to simplify
the code.

Also it is error prone to depend on the gl_linked_shader for programs
in current use because a failed linking attempt will free infomation
about the current program. In i965 we could be trying to recompile
a shader variant but may have lost some required fields.

We drop the memset on ImageUnits because gl_program is already
created using rzalloc().

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
41dd6c35396434be53581b59c4b477dd95e8b774 28-Dec-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa/glsl: move subroutine metadata to gl_program

This will allow us to store gl_program rather than gl_shader_program
as the current program perstage which allows us to simplify code
that makes use of the CurrentProgram list.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
d7aee96cc65514d2acbfaf9aa714e6e163ea0d2a 12-Dec-2016 Ian Romanick <ian.d.romanick@intel.com> glsl: Trivial whitespace fixes in link_uniforms.cpp

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
ceea514d9192a71b9be87b50b2c63303a54331f9 14-Dec-2016 Ian Romanick <ian.d.romanick@intel.com> linker: Accurately mark a uniform block instance array element as used in a stage

Now that information about which array-of-arrays elements are accessed
is tracked, use that information to only mark an instance array element
as used-by-stage if, in fact, it is.

Fixes GL45-CTS.program_interface_query.uniform-block-types.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
5085b640313f806150729a197c438a0cfea35f49 12-Dec-2016 Ian Romanick <ian.d.romanick@intel.com> glsl: Use simpler visitor to determine which UBO and SSBO blocks are used

Very soon this visitor will get more complicated. The users of the
existing ir_variable_refcount visitor won't need the coming
functionality, and this use doesn't need much of the functionality of
ir_variable_refcount.

v2: ir_array_refcount_visitor::get_variable_entry cannot return NULL, so
don't check it. Suggested by Timothy.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
2ea021a1ebb768b13c533f6bea56cdfb4a9cc3b3 02-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: use linked_shaders bitmask to iterate stages for subroutine fields

This should be faster than looping over every stage and null checking, but
will also make the code a bit cleaner when we switch to getting more fields
from gl_program rather than from gl_linked_shader as we can just copy the
pointer and not need to worry about null checking then copying.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
0303201dfb73c16751d5519cca7480fa678d429a 27-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa: fix active subroutine uniforms properly

07fe2d565b introduced a big hack in order to return
NumSubroutineUniforms when querying ACTIVE_RESOURCES for
<shader>_SUBROUTINE_UNIFORM interfaces. However this is the
wrong fix we are meant to be returning the number of active
resources i.e. the count of subroutine uniforms in the
resource list which is what the code was previously doing,
anything else will cause trouble when trying to retrieve
the resource properties based on the ACTIVE_RESOURCES count.

The real problem is that NumSubroutineUniforms was counting
array elements as separate uniforms but the innermost array
is always considered a single uniform so we fix that count
instead which was counted incorrectly in 7fa0250f9.

Idealy we could probably completely remove
NumSubroutineUniforms and just compute its value when needed
from the resource list but this works for now.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
203c8794a1debc0e45019fe945d1cc55459e6c6f 07-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> st/mesa/glsl/nir/i965: make use of new gl_shader_program_data in gl_shader_program

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
adb3a83c09c20babfa9f7f5b36bc61bbc36c9cb1 11-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: tidy up entries temporary

Here we just move initialisation of entries to where it is needed i.e.
outside the loop and after the continue checks.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
cbba5e13acc2052349f7e2d304e6dddf31fb199a 09-Nov-2016 Ian Romanick <ian.d.romanick@intel.com> linker: Remove unnecessary overload of program_resource_visitor::visit_field

It looks like I added this version as a short-hand for users that didn't
need the fuller version. I don't think there's any real utility in
that. I'm not sure what my thinking was there. Maybe if those users
overloaded the recursion function could just call the compact version to
avoid passing some parameters? None of the users do that.

Either way, having this extra overload is not useful. Delete it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
084105c213dbf4c309453b33a966aac6ae9242f3 08-Nov-2016 Ian Romanick <ian.d.romanick@intel.com> linker: Accurately track gl_uniform_block::stageref

As the linked per-stage shaders are processed, mark any block that has a
field that is accessed as referenced. When combining all the linked
shaders, combine the per-stage stageref masks.

This fixes a number of GLES CTS tests:

ES31-CTS.core.geometry_shader.program_resource.program_resource
ES32-CTS.core.geometry_shader.program_resource.program_resource
ESEXT-CTS.geometry_shader.program_resource.program_resource
piglit.gl45-cts.geometry_shader.program_resource.program_resource

However, it makes quite a few more fail:

ES31-CTS.functional.program_interface_query.buffer_variable.random.6
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.compute.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.separable_fragment.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_fragment_only_fragment.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_fragment.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_geo_fragment_only_fragment.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_geo_fragment.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_tess_fragment_only_fragment.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_tess_fragment.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_tess_geo_fragment_only_fragment.unnamed_block.float
ES31-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_tess_geo_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.random.6
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.compute.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.separable_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_fragment_only_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_geo_fragment_only_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_geo_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_tess_fragment_only_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_tess_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_tess_geo_fragment_only_fragment.unnamed_block.float
ES32-CTS.functional.program_interface_query.buffer_variable.referenced_by.vertex_tess_geo_fragment.unnamed_block.float

I have diagnosed the failures, but I'm not sure whether we or the
tests are wrong. After optimizations are applied, all of the tests
are of the form:

buffer X {
float f;
} x;

void main()
{
x.f = x.f;
}

The test then queries that x is referenced by that shader stage. We
eliminate the assignment of x.f to itself, and that removes the last
reference to x. We report that x is not referenced, and the test fails.
I do not know whether or not we are allowed to eliminate that assignment
of x.f to itself.

After discussions with the OpenGL ES group in Khronos, we believe that
Mesa's behavior is correct. I will provide patches to the CTS tests
to Khronos.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
392fabcfee489c294dad5bed0bb57a2c61322e4d 08-Nov-2016 Ian Romanick <ian.d.romanick@intel.com> linker: Slight code rearrange to prevent duplication in the next commit

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
a529acfb2bc7e4d4317e0cce0209b6f78761471c 04-Nov-2016 Ian Romanick <ian.d.romanick@intel.com> linker: Trivial coding standards fixes

v2: Revert the unreachable to assert in
parcel_out_uniform_storage::visit_field. Suggested by Ilia.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
63e822157498356e5c777aee7000e9ee925df47b 25-Sep-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: move some uniform linking code to new link_assign_uniform_storage()

This makes link_assign_uniform_locations() easier to follow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
ab67b6afdfb423200cb03a711eda89abe4e80fb2 25-Sep-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: move some uniform linking code to new link_setup_uniform_remap_tables()

This makes link_assign_uniform_locations() easier to follow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
08c5b10ae904231d887f9b6c37694c0e03939a28 16-Aug-2016 Thomas Helland <thomashelland90@gmail.com> mesa/glsl: Move string_to_uint_map into the util folder

This clears the last bits of the usecases of the hash table
located in mesa/program, allowing us to remove it.

V2: Rebase on top of changes to Makefile.sources

Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
42ba435fd16c3372dbc47f6b52deb309a1873b25 16-Aug-2016 Thomas Helland <thomashelland90@gmail.com> mesa: Remove unused hash table includes

This should prevent us from rebuilding the world.

Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
51f912786f420fcfa50a3d3f1b36794cb2714be2 02-Jul-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: stop allocating memory for UBOs during linking

This just stops counting and assigning a storage location for
these uniforms, the count is only used to create the uniform storage.

These uniform types don't use this storage.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
1fb8c6df884c2a17cf980c4ea32db4c214903b55 30-Jun-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl/mesa: split gl_shader in two

There are two distinctly different uses of this struct. The first
is to store GL shader objects. The second is to store information
about a shader stage thats been linked.

The two uses actually share few fields and there is clearly confusion
about their use. For example the linked shaders map one to one with
a program so can simply be destroyed along with the program. However
previously we were calling reference counting on the linked shaders.

We were also creating linked shaders with a name even though it
is always 0 and called the driver version of the _mesa_new_shader()
function unnecessarily for GL shader objects.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
8c3ecde0e18977f49b804226d7c28483e025cbcd 02-Jun-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: stop allocating memory for SSBOs and builtins

This just stops counting and assigning a storage location for
these uniforms, the count is only used to create the uniform storage.

These uniform types don't use this storage.

Reviewed-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
78659ade404a0761968ab5240c812e4c3119d669 11-May-2016 Dave Airlie <airlied@redhat.com> glsl: use enum glsl_interface_packing in more places. (v2)

Although the glsl_types.h stores this in a bitfield,
we should hide that from everyone else. Hide the cast
in an accessor method and use the enum everywhere.

This makes things a bit nicer in gdb, and improves type
safety.

v2: fix a few pieces of interface I missed that caused some
piglit regressions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
78399cf17031ea8fe401769bb92a60b0ac7001ea 19-May-2016 Ian Romanick <ian.d.romanick@intel.com> glsl/linker: Silence unused parameter warning

The parameter is required for the interface.

glsl/link_uniforms.cpp:689:61: warning: unused parameter ‘record_type’ [-Wunused-parameter]
bool row_major, const glsl_type *record_type,
^

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
6d1a59d15b31a0d03b8e741784dfc8b433435ba8 27-Apr-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: move uniform block validation to link_uniform_blocks.cpp

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
f1293b2f9bc3a45c71941931edb5148d7b5f5a27 02-Apr-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: fully split apart buffer block arrays

With this change we create the UBO and SSBO arrays separately from the
beginning rather than putting them into a combined array and splitting
it apart later.

A bug is with UBO and SSBO stage reference querying is also fixed as
we now use the block index to lookup the references in the separate arrays
not the combined buffer block array.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
070e5a740545a93a75fa5c79a79b50f472cb8e16 02-Apr-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: rename var and simplify if

is_ubo_var is true for both UBOs and SSBOs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
0fbd073dc284f952ea7df691941a65ddc89b7554 02-Apr-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: store ubo or ssbo index in block index

Previously we store the buffer block index i.e the index of a combined
ubo/ssbo list.

Fixes several dEQP-GLES31.functional tests:
- program_interface_query.uniform.block_index.block_array
- program_interface_query.uniform.block_index.named_block
- program_interface_query.uniform.block_index.unnamed_block
- program_interface_query.uniform.random.10
- program_interface_query.uniform.random.15
- program_interface_query.uniform.random.22
- program_interface_query.uniform.random.24
- program_interface_query.uniform.random.26
- program_interface_query.uniform.random.28
- program_interface_query.uniform.random.3
- program_interface_query.uniform.random.31
- program_interface_query.uniform.random.38
- program_interface_query.uniform.random.5

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94116
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
8765a9e0fe2987caa6af7473cbc4c55754621806 11-Mar-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: generate named interface block names correctly

Firstly this updates the named interface lowering pass to store the
interface without the arrays removed.

Note we need to remove the arrays in the interface/varying matching
code to not regress things but in future this should be fixed
futher as it would seem we currently successfully match interface
blocks with differnt array sizes.

Since we now know if the interface was an array we can reduce the
IR flags from_named_ifc_block_array and from_named_ifc_block_nonarray
to just from_named_ifc_block.

Next rather than having a different code path for named interface
blocks in program_resource_visitor we just make use of the one used
by UBOs this allows us to now handle arrays of arrays correctly.

Finally we add a new param to the recursion function
named_ifc_member this is because we only want to process a single
member at a time. Note that this is also the glsl_struct_field
from the original ifc type before lowering rather than the type
from the lowered variable. This fixes a bug in Mesa where we would
generate the names like WithInstArray[0].g[0][0] when it should be
WithInstArray[0].g[0] for the following interface.

out WithInstArray {
float g[3];
} instArray[2];

Reviewed-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
86d87d10474d1c5c5683acb28d4491e877432a90 27-Mar-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa: remove initialized field from uniform storage

The only place this was used was in a gallium debug function that
had to be manually enabled.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
8683d54d2be82519c31e087e17dd936d13fa9d07 23-Mar-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: reduce buffer block duplication

This reduces some of the craziness required for handling buffer
blocks. The problem is each shader stage holds its own information
about a block in memory, we were copying that information to a
program wide list but the per stage information remained meaning
when a binding was updated we needed to update all versions of it.

This changes the per stage blocks to instead point to a single
version of the block information in the program list.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
e2415e84677c6e071f7bb7b002bd703bea500020 24-Feb-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: replace remaining tabs in link_uniforms.cpp

Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
96527c3cf29acaa74a0e7b8624f29e514a76e42e 08-Jan-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: copy explicit offset to uniform storage

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
65dfb3048e8291675ca33581aeff8921f7ea509d 11-Feb-2016 Plamena Manolova <plamena.manolova@intel.com> compiler/glsl: Fix uniform location counting.

This patch moves the calculation of current uniforms to
link_uniforms, which makes use of UniformRemapTable which
stores all the reserved uniform locations.

Location assignment for implicit uniforms now tries to use
any gaps left in the table after the location assignment
for explicit uniforms. This gives us more space to store more
uniforms.

Patch is based on earlier patch with following changes/additions:

1: Move the counting of explicit locations to
check_explicit_uniform_locations and then pass
the number to link_assign_uniform_locations.
2: Count the number of empty slots in UniformRemapTable
and store them in a list_head.
3: Try to find an empty slot for implicit locations from
the list, if that fails resize UniformRemapTable.

Fixes following CTS tests:
ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max
ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max-array

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93696
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
565aa69970ccb0e92c9d5773c43d9b49e7bdb8e4 14-Feb-2016 Kenneth Graunke <kenneth@whitecape.org> glsl: Fix overflow of ImageAccess[] array.

The ImageAccess array is statically sized to MAX_IMAGE_UNIFORMS:

GLenum ImageAccess[MAX_IMAGE_UNIFORMS];

There was no bounds checking ensuring we don't overflow. Passing in a
shader with too many uniforms would cause writes to extend into other
fields, such as sh->NumImages.

Later linker checks already handle reporting an error when there are too
many images, so just avoid corrupting structures here.

This rearranges the logic a bit to look more like the sampler case.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
23e24e27ac6044a6f669531a3ebf31ff25ae4a1e 04-Feb-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl: simplify setting of image access qualifiers

Cc: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp
eb63640c1d38a200a7b1540405051d3ff79d0d8a 17-Jan-2016 Emil Velikov <emil.velikov@collabora.com> glsl: move to compiler/

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
/external/mesa3d/src/compiler/glsl/link_uniforms.cpp