History log of /external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cc8ff5354da0eeba5551b5d5bd12898c38e6191f 01-Sep-2012 Dave Airlie <airlied@gmail.com> glsl_to_tgsi: fix dst register for texturing fetches.

I've no idea why there isn't a piglit that triggers this behaviour,
but while enabling TBOs for softpipe and r600g, I noticed all the
integer tests failed. I tracked it back to the TXF returning a float
when it should be returning an int. This fixed it and I haven't
seen any regressions in a full piglit run on softpipe.

http://bugs.freedesktop.org/55010

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 9785ae0973cc206afc36dbc7d5b9553f92d06b47)
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
18a9979dc138adc743f4c19acde7218538614db9 23-Oct-2012 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: set correct register type for array and structure elements

This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure. Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit 170f0459a2367406d4ec838b2eebdc6ff2f84f2c)
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
a8ed00d5f13d7b016bc2ea56f130adc3fa857cc8 16-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: silence signed/unsigned comparison warning
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
8cc1860d4a55c93ce12a649c281012b37212ffbd 12-Aug-2012 Niels Ole Salscheider <niels_ole@salscheider-online.de> st/mesa: index can be negative in the PROGRAM_CONSTANT case

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
34665381713249c29b7da5028396222dfea477c2 08-Aug-2012 Vinson Lee <vlee@freedesktop.org> st/mesa: Initialize tgsi_texture_offset Padding field.

Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
2ea3ab14f2182978f471674c9dfce029d37f70a7 10-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Add a "ubo_load" expression type for fetches from UBOs.

Drivers will probably want to be able to take UBO references in a
shader like:

uniform ubo1 {
float a;
float b;
float c;
float d;
}

void main() {
gl_FragColor = vec4(a, b, c, d);
}

and generate a single aligned vec4 load out of the UBO. For intel,
this involves recognizing the shared offset of the aligned loads and
CSEing them out. Obviously that involves breaking things down to
loads from an offset from a particular UBO first. Thus, the driver
doesn't want to see

variable_ref(ir_variable("a")),

and even more so does it not want to see

array_ref(record_ref(variable_ref(ir_variable("a")),
"field1"), variable_ref(ir_variable("i"))).

where a.field1[i] is a row_major matrix.

Instead, we're going to make a lowering pass to break UBO references
down to expressions that are obvious to codegen, and amenable to
merging through CSE.

v2: Fix some partial thoughts in the ir_binop comment (review by Kenneth)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
7d65356d8a4d268dce4c933d7704d709e1cdacfa 04-Aug-2012 Vinson Lee <vlee@freedesktop.org> st/mesa: Fix a potential memory leak in get_mesa_program.

Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
82fc813ca870c4002502e098519bead7bec1a7e8 23-Jul-2012 Marek Olšák <maraeo@gmail.com> st/mesa: fix DDY opcode for FBOs

This fixes piglit/fbo-deriv.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
f40b5723f017bfb9e3819a5463184627ee727cc1 22-Jul-2012 Marek Olšák <maraeo@gmail.com> st/mesa: set the centroid qualifier in fragment shader inputs

This fixes some centroid tests in the EXT_framebuffer_multisample piglit group.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
abcdbdf9cce3c7520ee999fac3099d609960847d 25-Jun-2012 Eric Anholt <eric@anholt.net> mesa: Move the _mesa_uniform_merge_location_offset to glGetUniformLocation().

With the upcoming GL_ARB_uniform_buffer_object changes, the only
other caller that will want the cooked value is state_tracker.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
0f1f2ff8db8c19be27b9f51f07134091e109e4b2 19-Jul-2012 Paul Berry <stereotype441@gmail.com> mesa: Set gl_fragment_program::UsesKill in do_set_program_inouts.

Previously, the code for setting this flag for GLSL programs was
duplicated in three places: brw_link_shader(), glsl_to_tgsi_visitor,
and ir_to_mesa_visitor. In addition to the unnecessary duplication,
there was a performance problem on i965: brw_link_shader() set the
flag before doing its final round of optimizations, which meant that
if the optimizations managed to eliminate all the discard operations,
the flag would still be set, resulting (at least in theory) in slower
performance.

This patch consolidates all of the code that sets UsesKill for GLSL
programs into do_set_program_inouts(), which already is doing a
similar job for UsesDFdy, and which occurs after i965's final round of
optimizations.

Non-GLSL programs (ARB programs and the state tracker's glBitmap
program) are unaffected.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
b3ba0a7afa6311e12852fb1373452e480f89ea96 12-Jul-2012 José Fonseca <jfonseca@vmware.com> mesa/st: Generates TGSI that always recognizes INSTANCEID/VERTEXID as integers.

Tested by running piglit draw-instanced, and by forcing llvmpipe advertise no native
integer support, which now produces:

VERT
DCL IN[0]
DCL SV[0], INSTANCEID
DCL OUT[0], POSITION
DCL OUT[1], COLOR
DCL CONST[0..19]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
DCL TEMP[2], LOCAL
DCL ADDR[0]
0: U2F TEMP[0].x, SV[0]
1: ARL ADDR[0].x, TEMP[0].xxxx
2: MOV TEMP[1].xy, CONST[ADDR[0].x+8].xyxx
3: ADD TEMP[2].x, IN[0].xxxx, TEMP[1].xxxx
4: ADD TEMP[1].x, IN[0].yyyy, TEMP[1].yyyy
5: MUL TEMP[2], CONST[16], TEMP[2].xxxx
6: MAD TEMP[2], CONST[17], TEMP[1].xxxx, TEMP[2]
7: MAD TEMP[2], CONST[18], IN[0].zzzz, TEMP[2]
8: MAD TEMP[2], CONST[19], IN[0].wwww, TEMP[2]
9: ARL ADDR[0].x, TEMP[0].xxxx
10: MOV TEMP[1], CONST[ADDR[0].x]
11: MOV OUT[0], TEMP[2]
12: MOV OUT[1], TEMP[1]
13: END
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
7e63b613a5a067462c450338e0bdce5b5976f6f1 16-Jun-2012 Marcin Slusarz <marcin.slusarz@gmail.com> st/mesa: fix transform feedback of unsubscripted gl_ClipDistance array

gl_ClipDistance needs special treatment in form of lowering pass
which transforms gl_ClipDistance representation from float[] to
vec4[]. There are 2 implementations - at glsl linker level (enabled
by LowerClipDistance option) and at glsl_to_tgsi level (enabled
unconditionally for gallium drivers). Second implementation is
incomplete - it does not take into account transform feedback (see
commit 642e5b413e0890b2070ba78fde42db381eaf02e5 "mesa: Fix transform
feedback of unsubscripted gl_ClipDistance array" for details).

There are 2 possible fixes:
- adding transform feedback support into glsl_to_tgsi version
- ripping gl_ClipDistance support from glsl_to_tgsi and enabling
gl_ClipDistance lowering on glsl linker side

This patch implements 2nd option. All it does is:
- reverts most of the commit 59be691638200797583bce39a83f641d30d97492
"st/mesa: add support for gl_ClipDistance"
- changes LowerClipDistance to true

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{2,3,4,5,6,7,8}]-no-subscript" at least on nv50
and evergreen cards.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
1be766111005e483d56ac194c224123e72ce9831 14-Jun-2012 Paul Berry <stereotype441@gmail.com> gallium: Add support for ir_unop_f2u to tgsi backend.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
e16b0a51be7866f3856b62b295df2bcf49e02384 08-May-2012 Olivier Galibert <galibert@pobox.com> glsl: Bitwise conversion operator support in the software renderers.

TGSI doesn't need an opcode, since registers are untyped (but beware
once doubles come into the scene). Mesa IR doesn't handle native
integers, so trying to handle them there is worthless, the case
entries are only added for warning reasons.

It was only tested with softpipe, since llvmpipe doesn't support glsl
1.3 yet.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
105f307d90de92d088116516957e37267d9fe115 19-Apr-2012 Vinson Lee <vlee@freedesktop.org> st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.

Fix uninitialized scalar field defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
49468a1b2a241d5a6a1155f79b48fa6562524206 08-Dec-2011 Francisco Jerez <currojerez@riseup.net> st/mesa: Use local temporary registers.

Local makes more sense in most places because non-inline function
calls are unimplemented anyway.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
f7665ca4fc2a7bba8378d44d38059fc5dd536223 05-May-2012 Christoph Bumiller <e0425955@student.tuwien.ac.at> glsl_to_tgsi: use TGSI_OPCODE_CEIL for ir_unop_ceil

The implementation using FLR was buggy, the second negation could
get lost.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
a21df965075f6fa1bf27039490ad65b9f78548e6 24-Mar-2012 Dave Airlie <airlied@redhat.com> st/mesa: add ARB_blend_func_extended support to state tracker.

This adds the blend mode mapping, it also uses the var->index in the
glsl to tgsi convertor - this is the other half of my using 4 in the GLSL
compiler.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
70d038e46eb877ffa922003c78630eb7eb76c0f3 09-Apr-2012 Vinson Lee <vlee@freedesktop.org> st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.

Fixes uninitialized member defects reported by Coverity.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.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/mesa/state_tracker/st_glsl_to_tgsi.cpp
04e324008759282728a95a1394bac2c4c2a1a3f9 23-Feb-2012 Marek Olšák <maraeo@gmail.com> gallium: remove PIPE_SHADER_CAP_OUTPUT_READ

r600g is the only driver which has made use of it. The reason the CAP was
added was to fix some piglit tests when the GLSL pass lower_output_reads
didn't exist.

However, not removing output reads breaks the fallback for glClampColorARB,
which assumes outputs are not readable. The fix would be non-trivial
and my personal preference is to remove the CAP, considering that reading
outputs is uncommon and that we can now use lower_output_reads to fix
the issue that the CAP was supposed to workaround in the first place.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
177845daa150403311e51e3bdc27e5014d40e915 27-Jan-2012 Marek Olšák <maraeo@gmail.com> st/mesa: kill off point size clamping in vertex shaders

This fixes the gl_PointSize transform feedback test.
Point size clamping should happen at the rasterizer stage,
i.e. after the vertex and geometry shaders and transform feedback.

Drivers are expected to do this by themselves.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
1d01429c6a1ae679d0cc0cb61db1948fca5ced4c 28-Jan-2012 Mathias Fröhlich <Mathias.Froehlich@gmx.net> state_stracker: Fix access to uninitialized memory.

Fix an access to uninitialized memory pointed out by valgrind in
glsl_to_tgsi_visitor::simplify_cmp(void).

Note: This is a candidate for the 8.0 branch.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
bc1c8369384b5e16547c5bf9728aa78f8dfd66cc 23-Jan-2012 Marek Olšák <maraeo@gmail.com> st/mesa: do vertex and fragment color clamping in shaders

For ARB_color_buffer_float. Most hardware can't do it and st/mesa is
the perfect place for a fallback.
The exceptions are:
- r500 (vertex clamp only)
- nv50 (both)
- nvc0 (both)
- softpipe (both)

We also have to take into account that r300 can do CLAMPED vertex colors only,
while r600 can do UNCLAMPED vertex colors only. The difference can be expressed
with the two new CAPs.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
fdae0eaf222f271bfbc7e71d8561eb8b90685ae5 19-Jan-2012 Brian Paul <brianp@vmware.com> st/mesa: copy num_immediates field when copying the immediates array

Two assignments to num_immediates were missing in
get_pixel_transfer_visitor() and get_bitmap_visitor().
The uninitialized value led to valgrind errors and crashes in some
cases.

Added new assertions to catch future problems in this area. Also
changed num_immediates to unsigned to avoid signed/unsigned
comparison warnings.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
2449695e822421fdcaf1c66dffc12d7d705ea69d 17-Dec-2011 Marek Olšák <maraeo@gmail.com> gallium: improve the pipe_stream_output_info struct (v2)

There are 3 changes:

1) stride is specified for each buffer, not just one, so that drivers don't
have to derive it from the outputs

2) new per-output property dst_offset, which specifies the offset
into the buffer in dwords where the output should be stored,
so that drivers don't have to compute the offsets manually;
this will also be useful for gl_SkipComponents
from ARB_transform_feedback3

3) register_mask is removed, instead, there is start_component
and num_components; register_mask with non-consecutive 1s
doesn't make much sense (some hardware cannot do packing of components)

Christoph Bumiller: fixed nvc0.

v2: resolve merge conflicts in Draw and clean it up
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
9f2963b631cb2a2899fcb0eb384895fd33f9821d 12-Jan-2012 Brian Paul <brianp@vmware.com> st/mesa: fix struct vs. class compilation warning

glsl_to_tgsi_visitor is earlier defined as a class, not a struct.
Fixes MSVC warning.

NOTE: This is a candidate for the 8.0 branch.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
6a992c3288b6f7a5d94172c9ad1908e71e58233e 15-Nov-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Calculate the sampler to texture target mapping during linking

Track the calculated data in gl_shader_program instead of the
individual assembly shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
3f80b69b5f2093ffc624bb901ce34f0e289bc25d 11-Jan-2012 Dave Airlie <airlied@redhat.com> st/mesa: rename translate_texture_target, and make translate_opcode static.

As suggested by Brian.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
2f275466f78b7268e4f7ae8890eafd4243a2b8b0 11-Jan-2012 Dave Airlie <airlied@redhat.com> glsl_to_tgsi: add support for shadow cube map sampling.

This along with the TGSI support lets the piglit sampler-cube-shadow
test pass on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
c62e02000d11e29e70a1000d32cb08d9a450485f 05-Jan-2012 Dave Airlie <airlied@redhat.com> st_extensions: fixup GLSL 1.30 related enables (v3)

This just fixes up the enables for native integers and EXT_texture_integer
support in st/mesa.

It also set the MaxClipPlanes to 8.

We should consider exposing caps for MCP vs MCD, but since core
mesa doesn't care yet maybe we can wait for now.

v2: use 32-bit formats as per Marek's mail.

v3: add calim's fix for INT_DIV_TO_MUL_RCP disabling.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
cc94f0541c7729bca95f21b879c2071722ca3017 09-Jan-2012 Dave Airlie <airlied@redhat.com> st_glsl_to_tgsi: use ISSG and fixup IABS

It doesn't look like the GLSL compiler will produce sign op
for an unsigned anyways (seems insane anyways).

Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
73b26e4d12e5fa07bb96b4a30f41bd3b583776aa 07-Jan-2012 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: emit IABS for absolute value of integers
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
673535f6071e512b18ac6da622e15bdc45ebf0a0 07-Jan-2012 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix emission of boolean constants

We use 0xffffffff for true, but visit(ir_constant *) was emitting 1.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
c4529d10bed098b8d3d694f2a333f9afabbabbf9 07-Jan-2012 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: remove bad assertion
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
938490c3fe8ccce6ca96a4fcba89ffc1bcded873 02-Jan-2012 Kenneth Graunke <kenneth@whitecape.org> glsl_to_tgsi: Remove the obsolete remove_output_reads pass.

This is now handled by the GLSL compiler, so this code is dead.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
10937e651222501c0e9f4f44e6b842c261e2edfb 02-Jan-2012 Vincent Lejeune <vljn@ovi.com> glsl_to_tgsi: Use the GLSL compiler's new remove-output-reads pass.

The existing glsl_to_tgsi::remove_output_read pass did not work properly
when indirect addressing was involved; this commit replaces it with a
lowering pass that occurs before TGSI code generation.

Fixes varying-array related piglit tests.

Signed-off-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
367b83f890f6f7922bc8f9aa528ab50f55674e9e 27-Dec-2011 Paul Berry <stereotype441@gmail.com> gallium: Make use of gl_transform_feedback_info::ComponentOffset.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
59be691638200797583bce39a83f641d30d97492 02-Jan-2012 Bryan Cain <bryancain3@gmail.com> st/mesa: add support for gl_ClipDistance
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
d4bf5cefb0943a196c603360187493e270a66442 22-Dec-2011 Vadim Girlin <vadimgirlin@gmail.com> glsl_to_tgsi: v2 Invalidate and revalidate uniform backing storage

If glUniform1i and friends are going to dump data directly in
driver-allocated, the pointers have to be updated when the storage
moves. This should fix the regressions seen with commit 7199096.

I'm not sure if this is the only place that needs this treatment. I'm
a little uncertain about the various functions in st_glsl_to_tgsi that
modify the TGSI IR and try to propagate changes about that up to the
gl_program. That seems sketchy to me.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

v2:

Revalidate when shader_program is not NULL.
Update the pointers for all _LinkedShaders.
Init glsl_to_tgsi_visitor::shader_program to NULL in the
get_pixel_transfer_visitor & get_bitmap_visitor.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
fc7ac4da7dfb64aa192ef8cff44cb762beace4c1 02-Jan-2012 Christoph Bumiller <e0425955@student.tuwien.ac.at> glsl-to-tgsi: handle ir_unop_round_even
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
09497e020a11cc893d06691751faf57c1e762839 02-Jan-2012 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced()
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
3788b4b5c942b2346bf122486b687c632ab7eac4 10-Dec-2011 Dave Airlie <airlied@redhat.com> glsl_to_tgsi: make sure copied instructions don't lose texture target. (v2)

The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code,
due to 0 texture target, this makes sure the texture target is copied over
correctly when we copy instructions around.

v2: drive-by fix bitmap on the way past.

This avoids the assertion, have to contemplate fixing things as per the spec
later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
c05fafa4a0fd93d4264c46578e23a83ecf2b481e 09-Dec-2011 Marek Olšák <maraeo@gmail.com> st/mesa: implement EXT_transform_feedback and ARB_transform_feedback2
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
3b15f5046c36fb2d32a4c5f36e77b74efcb539b2 13-Dec-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix typo in comment
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
d24b44c37d51051ff153b4f04e529f2bea6630db 13-Dec-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: emit both operands of shift and bitwise operations

Fixes these operations when native integers are enabled.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
72cb103cf518c86d8d094380d9f8e16650a0060b 10-Dec-2011 Dave Airlie <airlied@redhat.com> st/mesa: move frag depth up a level.

This fixes the segfault, and seems to put this closer to where other
properties are being set. Hopefully it still conforms.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
06f217d80f3d1318da4974bf7b31ea7edcf5eb0b 18-Nov-2011 Marek Olšák <maraeo@gmail.com> gallium: implement ARB_conservative_depth

This adds a new TGSI property to represent the GLSL layout qualifier in TGSI.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
20b0daf82de91fd57b7e8d825786789149f6358d 08-Dec-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix a bug in eliminate_dead_code_advanced()

The bug, reported to me by Vadim Girlin on IRC, was causing overzealous
elimination of code in parallel if statements such as the following:

if (x) {
r = false;
}
if (y) {
r = true;
}

Before this commit, the assignment inside the first if block would be
misdetected as dead code and removed.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
dca6a28a14f22d77273d79d44f57b0d853c0242d 31-Oct-2011 Mathias Fröhlich <Mathias.Froehlich@web.de> mesa: Make gl_program::InputsRead 64 bits.

Make gl_program::InputsRead a 64 bits bitfield.
Adapt the intel and radeon driver to handle a 64 bits
InputsRead value.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
915bcc29d415a506d30ad743cde7c98fcb512ba0 15-Nov-2011 Vadim Girlin <vadimgirlin@gmail.com> st/mesa: use PIPE_SHADER_CAP_OUTPUT_READ

Don't replace outputs with temps when the driver supports reading outputs.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.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/mesa/state_tracker/st_glsl_to_tgsi.cpp
fa704cc558ab321792b364dab43f1e960513bed0 08-Nov-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Remove resource count checks from ir_to_mesa and st_glsl_to_tgsi

These checks are now performed by the linker.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
da1544b39ebdf9b24414dcee214a5ccf76e74a77 11-Nov-2011 Christoph Bumiller <e0425955@student.tuwien.ac.at> st/mesa: fix system value to semantic mapping

Broken by addition of SYSTEM_VALUE_VERTEX_ID in
919c53e87a1f6f5322bc1f1486bb3e6b954b00d5.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
8f9fc8b9d208cf601d126721709315aa3c1c2024 14-Nov-2011 José Fonseca <jfonseca@vmware.com> mesa/st: Flush stdout after pritingin the GLSL.

Otherwise it gets all garbled with stderr.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.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/mesa/state_tracker/st_glsl_to_tgsi.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/mesa/state_tracker/st_glsl_to_tgsi.cpp
794c5158b0a0b2978ebae6fdc2747e6febcd42c1 04-Nov-2011 José Fonseca <jfonseca@vmware.com> mesa/st: Be nice with the stack -- use malloc for large structures/arrays.

st_translate_program's data was taking 51K off the stack, causing stack
overflow on Windows.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
8cd0873d319cefce74164147c9855e81f051d1e1 22-Oct-2011 Chia-I Wu <olv@lunarg.com> st/mesa: add support for GL_OES_EGL_image_external

To pipe drivers, external textures are just 2D textures.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
cf45949d6a896651a5f3864d3b195e26d59eee74 26-Oct-2011 Paul Berry <stereotype441@gmail.com> mesa: Expose GLSL interpolation qualifiers in gl_fragment_program.

This patch makes GLSL interpolation qualifiers visible to drivers via
the array InterpQualifier[] in gl_fragment_program, so that they can
easily be used by driver back-ends to select the correct interpolation
mode.

Previous to this patch, the GLSL compiler was using the enum
ir_variable_interpolation to represent interpolation types. Rather
than make a duplicate enum in core mesa to represent the same thing, I
moved the enum into mtypes.h and renamed it to be more consistent with
the other enums defined there.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.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/mesa/state_tracker/st_glsl_to_tgsi.cpp
35ffe94a340cf4e0ebe810a1d576113f96ea9dee 19-Oct-2011 José Fonseca <jfonseca@vmware.com> mesa/st: Backport WPOS adjustment fixes from st_mesa_to_tgsi.c to st_glsl_to_tgsi.cpp.

This is a trivial verbatim copy of the code from Christoph Bumiller's commit
f986a6560f3ee9a79b89e9409e3a9ac52b53315c.

Fixes fdo 39939 and 39942.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
58a7461e1672935e7d30780a4dd40c00abbc28a5 11-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> glsl_to_tgsi: Use _mesa_generate_parameters_list_for_uniforms

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
bbbb8345ab9df2d634dc2a34d257ee2cbf930292 11-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> ir_to_mesa: Move some things outside the 'extern "C"' blocks

Having a few of these includes or forward declarations inside the
'extern "C"' block can cause problems later. Specifically, it
prevents C++ linkage functions from being added to ir_to_mesa.h and
makes G++ angry if 'struct foo' is seen both inside and outside an
'extern "C"'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
a9e5528f09a835b66771ba4d3f08ff7fd51e08a6 13-Oct-2011 Brian Paul <brianp@vmware.com> st/mesa: kill instruction if writemask=0 in eliminate_dead_code_advanced()

This fixes a bug where we'd wind up emitting an invalid instruction like
MOVE R[0]., R[1]; - note the empty/zero writemask. If we don't write to
any dest register channels, cull the instruction.

v2: simply change/fix the existing test for instruction culling.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
e2bdef53807d0f23c2a1ff326ea8190cb57aa90a 21-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Simplify calling Driver.ProgramStringNotify after previous refactors

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
de772c402215b956ab3aa0875330fc1bf7cdf95b 21-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Use gl_shader_program::_LinkedShaders instead of FragmentProgram

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
39348bf79fb247eec895c93e52f23afe138be46a 20-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Use gl_shader_program::_LinkedShaders instead of GeometryProgram

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
010cc547ca8c1fb2107106b0ad0de560780ce9aa 20-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Use gl_shader_program::_LinkedShaders instead of VertexProgram

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
35613afee3e038b70ada210b2dfbbc9abc883f4f 19-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Remove unused gl_program::Attributes

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
cd76f114e608ffb93a03ac3ffc3e11876d6a057e 16-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Remove unused field gl_program::Varying

Lots of things set and copy this field around, but nothing uses it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
6da8c21124152c68fb968b196895f2c881a24280 19-Sep-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: implement ir_binop_all_equal and ir_binop_any_nequal for native integers
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
10dbd029279dda1689410d8ef2bc5aba64dd5958 02-Sep-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: use UARL instead of I2F and ARL

Since TGSI now has a UARL opcode that takes an integer as the source, it is
no longer necessary to hack around the lack of an integer ARL opcode using I2F.
UARL is only emitted when native integers are enabled; ARL is still used
otherwise.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
9edd0b5ddf406ef089edebd12999ff2a26774ca3 05-Sep-2011 Marek Olšák <maraeo@gmail.com> glsl_to_tgsi: fix shadow2DArray comparison

v2: adjust the assertion, add a comment
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
0dc575c6f6157867accf749a06ec745617ea64ac 04-Sep-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fixes for native integers and integer booleans

This fixes all but one of the piglit regressions from enabling native integers
in softpipe. The change to fix the last regression is still being discussed.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
0a33ac5413d6217a30b70d4ec6e11389872616d0 30-Aug-2011 Marek Olšák <maraeo@gmail.com> glsl_to_tgsi: fix more potential shader reference leaks

The last one has been pointed out by Ian.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
2083a276eb270b748d1c2668eb9faa5aadc8e700 26-Aug-2011 Dave Airlie <airlied@redhat.com> tgsi: add support for texture offsets to the TGSI IR. (v2)

This adds tokens for texture offsets, to store 4 * swizzled vec 3
for use in TXF and other opcodes.

It also contains TGSI exec changes for softpipe to use this code,
along with GLSL->TGSI support for TXF.

v2: add some more comments, add back padding I removed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
488fe51cf823ccd137c667f1e92dd86f8323b723 01-Sep-2011 Bryan Cain <bryancain3@gmail.com> mesa: Replace the EmitNoIfs compiler flag with a MaxIfDepth flag.

This is a better, more fine-grained way of lowering if statements. Fixes the
game And Yet It Moves on nv50.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
478034f34a59969103237eb78bc82f9e70fe81c2 28-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl: Use a separate div_to_mul_rcp lowering flag for integers.

Using multiply and reciprocal for integer division involves potentially
lossy floating point conversions. This is okay for older GPUs that
represent integers as floating point, but undesirable for GPUs with
native integer division instructions.

TGSI, for example, has UDIV/IDIV instructions for integer division,
so it makes sense to handle this directly. Likewise for i965.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Bryan Cain <bryancain3@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
b2064ff3115afa075021902ecd35f4a5a772dc9e 25-Aug-2011 Marek Olšák <maraeo@gmail.com> glsl_to_tgsi: fix a reference leak on an error path
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
c8fed01c732fa20e1ae035ed5f7b6156a5d6ffe9 24-Aug-2011 Marek Olšák <maraeo@gmail.com> glsl_to_tgsi: remove unused code
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
5f3de17ef0f8b6280a6bf331ea6686a260f0d0d4 25-Aug-2011 Dave Airlie <airlied@redhat.com> glsl_to_tgsi: add TXF support. (v2)

This adds texelFetch support to translate from GLSL to TGSI TXF opcode.

I've tested this works with an r600g and softpipe backend.

v2: drop comments, fix title,

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
515d9e88801e2e1e2a7ac74ccd43f8fedfb80a96 24-Aug-2011 Dave Airlie <airlied@redhat.com> glsl_to_tgsi: implement TXS/TXQ. (v2)

GLSL uses TXS, call the gallium TXQ opcode.

v2: fix indent from 4->3.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
79a486ead92e4493b2de1fedf0c8cb5de47003cd 23-Aug-2011 Kai Wasserbäch <kai@dev.carbon-project.org> Change return type of try_emit_* methods to bool.

Ian Romanick explained (Message-Id: <4E528973.6080902@freedesktop.org>),
that the return type of non-API methods shouldn't use GLboolean but a
standard C++ bool.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
1e3bcbdf31f09666ba358f35ff9486faee3642ca 25-Feb-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Add a new ir_txs (textureSize) opcode to ir_texture.

One unique aspect of TXS is that it doesn't have a coordinate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
7a5d28908c03c5ce38da3f041d23bfd103a5becd 22-Aug-2011 Kenneth Graunke <kenneth@whitecape.org> glsl_to_tgsi: Fix a few more struct vs. class warnings.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
5379a70d3fabd9cf92a615647f81289d33ae9468 20-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: emit a MAD(b, -a, b) for !a && b

This is a port of commit ff2cfb8989cd to glsl_to_tgsi.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
c721d7b7bc70503d2ebb6c742be96371b68bd152 20-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix typo
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
9098953ee6e0699e13e35183c817ecf40363d538 20-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: implement ir_binop_all_equal using DP4 w/SGE

This is a port of commit ba01df11c4d0 to glsl_to_tgsi with integer support
added.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
f3dce133f0422c42ca61f07f488237107efc30e6 20-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLT

Implement the any() part of the operation the same way regular ir_unop_any
is implemented.

This is a port of commit e7bf096e8b04 to glsl_to_tgsi, with added integer
support.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
a43f68810a347f3e952a0bc401be6edb91e1baea 20-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: implement ir_unop_any using DP4 w/saturate or DP4 w/SLT

This is a port of commit 92ca560d68e8 to glsl_to_tgsi, with integer support
added.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
c15eb5569bf76c5dc41327017b92a5d960207b97 18-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: make glsl_to_tgsi_visitor::emit_dp return the instruction
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
691cc0e3a8716a2cdb7271765cd7d4c7465066eb 17-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: implement ir_binop_logic_or using an add w/saturate or add w/SLT

Logical-or is implemented using addition (followed by clamping to [0,1]) on
values of 0.0 and 1.0. Replacing the logical-or operators with addition gives
a + b which has a result on the range [0, 2].

Previously a SNE instruction was used to clamp the resulting logic value to
[0,1]. In a fragment shader, using a saturate on the add has the same effect.
Adding the saturate to the add is free, so (at least) one instruction is
saved. In a vertex shader, using an SLT on the negation of the add result has
the same effect. Many older shader architectures do not support the SNE
instruction. It must be emulated using two SLT instructions and an ADD. On
these architectures, the single SLT saves two instructions.

Note that SNE is still used when integers are used for boolean values, since
there is no such thing as an integer saturate, and older shader architectures
without SNE don't support integers.

This is a port of commit 41f8ffe5e07c to glsl_to_tgsi with integer support
added.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
8c31bc704826d46cad65c4d65b4b70de7144205a 17-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: implement ir_unop_logic_not using 1-x

Since our logic values are 0.0 (false) and 1.0 (true), 1.0 - x accurately
implements logical not.

This is a port of commit 6ad08989d7c1 to glsl_to_tgsi.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
01d81dedc795005ed235856ce762bb1981655716 15-Aug-2011 Kenneth Graunke <kenneth@whitecape.org> mesa, glsl_to_tgsi: Add new gl_context::NativeIntegers flag.

Previously, native integer support was based on whether the driver
advertised GLSL 1.30 or not. However, drivers that natively support
integers may wish to do so for older GLSL versions as well. Adding this
new opt-in flag allows them to do so.

Currently disabled by default on all drivers, which was the existing
behavior (no drivers currently implement GLSL 1.30).

Fixes piglit tests on i965 with INTEL_GLSL_VERSION=130 set:
- spec/glsl-1.10/fs-uniform-int-110.shader_test
- spec/glsl-1.30/fs-uniform-int-130.shader_test
(it was doubly converting the data)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
718b894dbb585af52dd24defb2e8c130216e5485 17-Aug-2011 Brian Paul <brianp@vmware.com> st/mesa: fix incorrect loop over instruction src regs

The array of src regs is of size 3, not 4.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
e6c64800cc8833fb4083a556c839b51e8ac84a8b 09-Aug-2011 Henri Verbeet <hverbeet@gmail.com> glsl_to_tgsi: improve assignment hack

Fixes StarCraft 2 and Fallout 3 in Wine.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
5164244df02f33d6ad9e0a286f4b6d6af2dfbc75 05-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: replace open-coded swizzle_for_size()

This is a port of commit 4c7e215c7bb to glsl_to_tgsi.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
b44648c9186d403abaeeeb3190d6759f951a49e4 05-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: try to avoid emitting a MOV_SAT to saturate an expression tree

This is a port of commit 62722d9 to glsl_to_tgsi, with minor aesthetic
changes (moved the declaration and assignment of new_inst inside the if block).
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
6e7942936c5de59f509779b6f7620d80d2fbc21a 05-Aug-2011 Marek Olšák <maraeo@gmail.com> st/mesa: remove unused-but-set variables in st_glsl_to_tgsi.cpp
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
4683529048ee133481b2d8f1cae1685aa1736f9a 04-Aug-2011 Bryan Cain <bryancain3@gmail.com> Merge branch 'glsl-to-tgsi'

Conflicts:
src/mesa/state_tracker/st_atom_pixeltransfer.c
src/mesa/state_tracker/st_program.c
b7e89115310628310bf458a33f2df2bf23384cf3 02-Aug-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: remove debugging printf
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
189e9f12c7d3a82d7dd28695935a83e4319bb267 27-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: copy reladdr in st_src_reg(st_dst_reg) constructor

This is a glsl_to_tgsi port of commit f7cd9a858c04.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
3e7fce9773ec332665326a785b6ed1fcf5bd578e 27-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: add each relative address to the previous

This is a glsl_to_tgsi port of commit d6e1a8f71437.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
10d31cb307f90a08fafed5c67945ffe53d279940 27-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: lower all ir_quadop_vector expressions

Unlike Mesa IR, TGSI doesn't have a SWZ opcode.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
3354a5b56398f90fc36ab14b6444aae27b50e859 27-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: rework immediate tracking to not use gl_program_parameter_list
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
f751730ad003bb19ce85bc4d0abddaf40edde6c1 22-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: update comments
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
a2c3b9f38d81f363bd62abc87dc3abef2beeba95 22-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: make coding style more consistent
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
0da994a9f15b461d16cf88ce16dc07e98dfada6f 21-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: make assignment hack safer

Fixes an assertion failure in piglit test glsl-texcoord-array.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
7732822c833ee22e259af3f8bd2bfb57c986612e 21-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: separate immediates from array constants during IR translation

Before, if any uniform or constant array was accessed with indirect
addressing, st_translate_program() would emit uniform constants in the place
of immediates. This behavior was unavoidable with ir_to_mesa/mesa_to_tgsi, but
glsl_to_tgsi can work around it since the GLSL IR backend and the TGSI
emission are both inside the state tracker.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
87f8d8547db9b947ae847c509a464e06d0ac6c64 11-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix mistakes in get_pixel_transfer_visitor()

I noticed these issues while working on get_bitmap_visitor().
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
5f0b4b0e9d376f9ec1cb5ae08c36052f4f51ac37 11-Jul-2011 Bryan Cain <bryancain3@gmail.com> st/mesa, glsl_to_tgsi: support glBitmap with a GLSL fragment shader active
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
c0dcab2882a4731dccd363a40c3ebcabc88b9c5d 09-Jul-2011 Bryan Cain <bryancain3@gmail.com> st/mesa, glsl_to_tgsi: support glDrawPixels/glCopyPixels with a GLSL fragment shader active

Since this was previously implemented using Mesa IR and _mesa_combine_programs,
this commit adds a new code path that works with glsl_to_tgsi.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
33e0c47b05c8fbae9d7af57ba65b612825b5db60 04-Jul-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: replace MAX_PROGRAM_TEMPS (256) with MAX_TEMPS (4096)
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
9c2810103d107d1e5ef8bd8b57819d12264f664a 28-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: always run copy_propagate() and eliminate_dead_code_advanced()

These two passes are written to handle indirect addressing properly.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
4c8b6a286887628e5fc35306189a4c4a83c482ea 28-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix mistake in new dead code elimination pass

The conditions of IF opcodes were not being counted as reads, which sometimes
led to the condition register being wrong or undefined.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
f00406b68c07f97b11e873c04917cafdb1a67462 28-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: improve assignment handling

This is a hack, but it's better than emitting an unnecessary MOV instruction
and hoping the optimization passes clean it up.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
71cbc9e3c4c9ef6090ee31e87601ae64af26321e 25-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: improve eliminate_dead_code_advanced()
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
3bd06e5b82b438041f50e2469be9ea68bf3b4300 25-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: use the correct writemask in try_emit_mad() and try_emit_sat()
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
194732fd7299481dd57815f46a594d155260ce17 25-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: use a more specific condition for gl_FragDepth hack in generating assignments

This reduces the number of instructions in the fragment shader of
glsl-fs-atan-2 from 174 to 146 with EmitNoIfs enabled.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
41472f7809dcff114223b8fadc5b97baff6060a9 25-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: add a better, more advanced dead code elimination pass
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
7ec7dd4fb6ae6c8aa29988754476e1212eb986ef 24-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: remove handling of XPD opcode in compile_tgsi_instruction()

The opcode is never emitted by the glsl_to_tgsi_visitor, so its special case in
compile_tgsi_instruction() was dead code.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
8b881ad1c3d9dd3c96afbdbb608a7240d40e9c92 24-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: use swizzle_for_size for src reg in conditional moves

This prevents the copy propagation pass from being confused by undefined
channels and thus missing optimization opportunities.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
8c50f18b29637470539d05ccc32b0cae0092aeac 21-Jun-2011 Emil Velikov <emil.l.velikov@gmail.com> glsl_to_tgsi: execute merge_registers() after eliminate_dead_code()

Fixes a regression unintentionally introduced by "glsl_to_tgsi: fix shaders with
indirect addressing of temps" that caused missing leaves in 3dmark01 test 4 (Nature)
and missing/displaced textures on human models in Counter-Strike: Source.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Bryan Cain <bryancain3@gmail.com>
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
29d21417e38aed0f0710d3692df320728aef90b1 17-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: implement simplify_cmp pass needed by r300g
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
552cc48fca9b932fceb3d8fa7f9d0067f46b67c2 16-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix compile error with g++ 4.6
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
1141c3f4c4014e3c2834db65b96a3ba7cc78744a 16-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl: remove glsl_type::get_vec4_type()

Thanks to Kenneth Graunke for pointing out that glsl_type::get_instance(base, 4, 1)
is the same as glsl_type::get_vec4_type(base).

The function was only used in st_glsl_to_tgsi, and this commit replaces that usage
with get_instance.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
bf1cee9f24022e3da96d84fdc6baaa050d3eadf1 15-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: finish some loose ends
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
b2c067e3075414703a7ebad439d4290c27cab46a 15-Jun-2011 Bryan Cain <bryancain3@gmail.com> glsl-to-tgsi: fix piglit tests

This commit fixes all of the piglit tests regressed by "mesa, glsl_to_tgsi: add
native support for integers in shaders" on softpipe.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
b191382c60bdcfeb7f424b23aa6ab63de81e2f08 14-Jun-2011 Bryan Cain <bryancain3@gmail.com> mesa, glsl_to_tgsi: add native support for integers in shaders

Disabled by default on all drivers. To enable it, change ctx->GLSLVersion to 130
in st_extensions.c. Currently, softpipe is the only driver with integer support.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
6d89abadbcd68bbe9e08f041412549f8dc1fc73c 18-May-2011 Bryan Cain <bryancain3@gmail.com> mesa: support boolean and integer-based parameters in prog_parameter

The functionality is not used by anything yet, and the glUniform functions will
need to be reworked before this can reach its full usefulness. It is
nonetheless a step towards integer support in the state tracker and classic drivers.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
16d7a717d592524e4d62fec4173cb9523f7a1453 03-May-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: fix shaders with indirect addressing of temps

Fixes several Piglit tests, although it's a step backwards for optimization.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
56dc2c176c3ef0d4d5abea54ff4035b062262286 02-May-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: use TGSI opcodes when converting from GLSL IR

Before, the translator used Mesa IR opcodes (a holdover from ir_to_mesa) and
converted them to TGSI opcodes during TGSI emission.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
3b0858f1aed83e2d90449f042d625c86ac7b93ed 01-May-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: support DDY (ir_unop_dFdy)
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
a6705aa5ca151278ed1e596b68a327afd1405b9e 01-May-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: lower noise opcodes when converting from GLSL IR, not when generating TGSI
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
5768ed6429937940bd48f5de4f8383273952880a 01-May-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: define the sampler objects used

Fixes the Nexuiz title screen and the water in 0 A.D.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
556bd82ce1227a568d69dfa0c22841986267d39f 30-Apr-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: remove a bad assertion

It was triggered by Alien Arena.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
c341d3cfd0ddbabf6274212b7f0da1a25854a673 30-Apr-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: remove reads to output registers

Fixes a regression in 0 A.D. introduced by 809a11c77073e999fd47.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
44867da3543ca54ef245695cef72a6e305451d93 30-Apr-2011 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: stop generating Mesa IR

Before, it was still generating unused Mesa IR as a remnant of ir_to_mesa, and
depended on some of the information from it.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
f379d8f73063a4c4d6cf379318c6b37118d46bfa 26-Apr-2011 Bryan Cain <bryancain3@gmail.com> st/mesa: Add a GLSL IR to TGSI translator.

It is still a work in progress at this point, but it produces working and
reasonably well-optimized code.

Originally based on ir_to_mesa and st_mesa_to_tgsi, but does not directly use
Mesa IR instructions in TGSI generation, instead generating TGSI from the
intermediate class glsl_to_tgsi_instruction. It also has new optimization
passes to replace _mesa_optimize_program.
/external/mesa3d/src/mesa/state_tracker/st_glsl_to_tgsi.cpp