mesa.git
13 years agointel: Add I8 and L8 to intel_mesa_format_to_rb_datatype().
Eric Anholt [Sun, 17 Apr 2011 17:44:46 +0000 (10:44 -0700)]
intel: Add I8 and L8 to intel_mesa_format_to_rb_datatype().

Fixes warnings in fbo-storage-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoRevert "intel: Add spans code for the ARB_texture_rg support."
Eric Anholt [Sat, 16 Apr 2011 03:00:38 +0000 (20:00 -0700)]
Revert "intel: Add spans code for the ARB_texture_rg support."

This reverts what remains of commit
28bab24e1698843e27d27204a1117066e7ffeabb.  It was garbage, trying to
use a MESA_FORMAT enum as a preprocessor token, and I don't know how I
thought it was even tested.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agointel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.
Eric Anholt [Sat, 16 Apr 2011 02:58:21 +0000 (19:58 -0700)]
intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.

Fixes:
ARB_texture_rg/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoswrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
Eric Anholt [Sat, 16 Apr 2011 02:55:38 +0000 (19:55 -0700)]
swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.

The GL_RED and GL_RG were tricking this code into executing, but it's
totally unprepared for a 16-bit channel and just rescaled the values
down to 0.  We don't have anything with <8bit channels alongside >8bit
channels, so disabling it should be safe.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
Eric Anholt [Sat, 16 Apr 2011 02:11:53 +0000 (19:11 -0700)]
mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.

This will replace the current (broken by trying to use an enum in the
preprocessor) spantmp2.h support I wrote for the intel driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
Eric Anholt [Fri, 15 Apr 2011 20:09:21 +0000 (13:09 -0700)]
mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
Eric Anholt [Fri, 15 Apr 2011 19:58:17 +0000 (12:58 -0700)]
mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agointel: Use Mesa core's renderbuffer accessors for depth.
Eric Anholt [Fri, 15 Apr 2011 18:58:58 +0000 (11:58 -0700)]
intel: Use Mesa core's renderbuffer accessors for depth.

Since we're using GTT mappings now (no manual detiling), there's
really nothing special to accessing these buffers, other than needing
the new RowStride field of gl_renderbuffer to accomodate padding.

Reduces the driver size by 2.7kb, and improves glean depthStencil
performance 3-10x (!)

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Add a function to set up the default renderbuffer accessors.
Eric Anholt [Fri, 15 Apr 2011 18:47:35 +0000 (11:47 -0700)]
mesa: Add a function to set up the default renderbuffer accessors.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Add a gl_renderbuffer.RowStride field like textures have.
Eric Anholt [Fri, 15 Apr 2011 18:37:23 +0000 (11:37 -0700)]
mesa: Add a gl_renderbuffer.RowStride field like textures have.

This will allow some drivers to reuse the core renderbuffer.c get/put
row functions in place of using the spantmp.h macros.  Note that
unlike textures, we use a signed integer here to allow for handling
FBO orientation.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Repack single-byte fields in gl_renderbuffer.
Eric Anholt [Fri, 15 Apr 2011 18:13:44 +0000 (11:13 -0700)]
mesa: Repack single-byte fields in gl_renderbuffer.

Cuts 8 out of 120 bytes in the struct.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Remove renderbuffer deletion debug field.
Eric Anholt [Fri, 15 Apr 2011 18:06:36 +0000 (11:06 -0700)]
mesa: Remove renderbuffer deletion debug field.

It has presumably served its purpose by now, and other object deletion
doesn't do this.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoswrast: Don't assert against glReadPixels of GL_RED and GL_RG.
Eric Anholt [Sat, 16 Apr 2011 00:50:41 +0000 (17:50 -0700)]
swrast: Don't assert against glReadPixels of GL_RED and GL_RG.

Everything appears to already be in place for this.  Fixes aborts in:
ARB_texture_rg/fbo-alphatest-formats-float
ARB_texture_rg/fbo-blending-formats-float.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agointel: Use _mesa_base_tex_format for FBO texture attachments.
Eric Anholt [Sat, 16 Apr 2011 03:28:51 +0000 (20:28 -0700)]
intel: Use _mesa_base_tex_format for FBO texture attachments.

The _mesa_base_fbo_format variant doesn't handle some texture
internalformats, such as "3".

Fixes:
fbo-blending-formats.
fbo-alphatest-formats
EXT_texture_sRGB/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agor300g: remove non-existing include path from SConscript
Marek Olšák [Mon, 18 Apr 2011 01:07:11 +0000 (03:07 +0200)]
r300g: remove non-existing include path from SConscript

13 years agor300g/winsys: rename r300->radeon and do a little cleanup
Marek Olšák [Mon, 18 Apr 2011 00:39:50 +0000 (02:39 +0200)]
r300g/winsys: rename r300->radeon and do a little cleanup

Renaming a few files, types, and functions.
Also make the winsys independent of r300g.

13 years agoFix mesa tarball creation again
Thierry Vignaud [Sun, 17 Apr 2011 23:25:44 +0000 (01:25 +0200)]
Fix mesa tarball creation again

Signed-off-by: Marek Olšák <maraeo@gmail.com>
13 years agor600g: disable ARB_draw_instanced
Marek Olšák [Sat, 16 Apr 2011 23:57:13 +0000 (01:57 +0200)]
r600g: disable ARB_draw_instanced

The very presence of this extension breaks things.
This should bring us closer to being able to run Unigine Heaven.

The extension will be re-enabled once gl_InstanceID is implemented.

13 years agor300g: disable ARB_draw_instanced on SWTCL chipsets.
Marek Olšák [Sun, 17 Apr 2011 22:43:19 +0000 (00:43 +0200)]
r300g: disable ARB_draw_instanced on SWTCL chipsets.

This fixes Unigine Heaven.

13 years agoi965: Quit spamming gen6 DP read/write send instructions with gen5 bits.
Eric Anholt [Fri, 15 Apr 2011 03:25:33 +0000 (20:25 -0700)]
i965: Quit spamming gen6 DP read/write send instructions with gen5 bits.

This was copy-and-paste from originally trying to get DP read/write
working reliably, and notably for other common messages (URB, sampler)
we weren't doing this.

13 years agoi965/fs: Add gen6 register spilling support.
Eric Anholt [Fri, 15 Apr 2011 02:36:28 +0000 (19:36 -0700)]
i965/fs: Add gen6 register spilling support.

Most of this is code movement to get the scratch space allocated in a
shared location.  Other than that, the only real changes are that the
old oword block messages now operate on oword-aligned areas (with new
messages for unaligned access, which we don't do), and that the
caching control is in the SFID part of the descriptor instead of
message control.

Fixes glsl-fs-convolution-1.

13 years agomesa: Fix _mesa_unpack_dudv_span_byte assertion.
Eric Anholt [Wed, 13 Apr 2011 17:50:56 +0000 (10:50 -0700)]
mesa: Fix _mesa_unpack_dudv_span_byte assertion.

It was accepting only GL_DUDV_ATI and not the specific sized format
GL_DU8DV8_ATI.  Fixes assertion failure at startup in Shadowgrounds.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoglcpp: Fix attempts to expand recursive macros infinitely (bug #32835).
Carl Worth [Fri, 15 Apr 2011 19:03:25 +0000 (12:03 -0700)]
glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).

The 095-recursive-define test case was triggering infinite recursion
with the following test case:

#define A(a, b) B(a, b)
#define C A(0, C)
C

Here's what was happening:

  1. "C" was pushed onto the active list to expand the C node

  2. While expanding the "0" argument, the active list would be
     emptied by the code at the end of _glcpp_parser_expand_token_list

  3. When expanding the "C" argument, the active list was now empty,
     so lather, rinse, repeat.

We fix this by adjusting the final popping at the end of
_glcpp_parser_expand_token_list to never pop more nodes then this
particular invocation had pushed itself. This is as simple as saving
the original state of the active list, and then interrupting the
popping when we reach this same state.

With this fix, all of the glcpp-test tests now pass.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32835
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agor600g: use some loops.
Dave Airlie [Sun, 17 Apr 2011 07:19:28 +0000 (17:19 +1000)]
r600g: use some loops.

unrolling loops is for Gentoo users, and I really want to put something
else inside these loops later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: consolidate the same piece of cut-n-paste code into a function.
Dave Airlie [Sun, 17 Apr 2011 07:11:36 +0000 (17:11 +1000)]
r600g: consolidate the same piece of cut-n-paste code into a function.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agogallium: include u_format.h for util_format_is_supported
Marcin Slusarz [Sat, 16 Apr 2011 20:15:52 +0000 (22:15 +0200)]
gallium: include u_format.h for util_format_is_supported

Without it gcc complains:
nv50_screen.c: In function ‘nv50_screen_is_format_supported’:
nv50_screen.c:48: warning: implicit declaration of function ‘util_format_is_supported’

and handles it wrongly - util_format_is_supported returns boolean, which is typedef'ed
to uchar, but function without prototype is assumed to return int.

For me nv50_screen_is_format_supported was returning true for float formats without
--enable-texture-float...

13 years agonvc0: work around what looks like a code prefetch bug
Christoph Bumiller [Sat, 16 Apr 2011 13:24:07 +0000 (15:24 +0200)]
nvc0: work around what looks like a code prefetch bug

Sounds very unlikely, but I don't have a better explanation at the
moment.
The GPU throws page faults at the first page after the code buffer
quite frequently on startup, and traces don't show us overflowing.

13 years agonv50,nvc0: add new texture and render target formats
Christoph Bumiller [Sat, 16 Apr 2011 11:24:44 +0000 (13:24 +0200)]
nv50,nvc0: add new texture and render target formats

13 years agonv50,nvc0: fix normalized RG16 and RGBA32 texture format entries
Christoph Bumiller [Sat, 16 Apr 2011 11:13:56 +0000 (13:13 +0200)]
nv50,nvc0: fix normalized RG16 and RGBA32 texture format entries

13 years agonvc0: fix viewport rectangle calculation
Christoph Bumiller [Sat, 16 Apr 2011 22:14:31 +0000 (00:14 +0200)]
nvc0: fix viewport rectangle calculation

13 years agoprog_optimize: Add simplify CMP optimization pass
Tom Stellard [Tue, 5 Apr 2011 05:07:55 +0000 (22:07 -0700)]
prog_optimize: Add simplify CMP optimization pass

This pass coverts CMP T0, T1 T2 T0 -> MOV T0, T2 when the CMP
instruction is the first instruction to write to register T0.
This pass is useful for hardware that requires a lot of lowering passes
that generate many CMP instructions.

13 years agoprog_optimize: get_src_arg_mask() respect writemask for more opcodes
Tom Stellard [Wed, 6 Apr 2011 05:38:26 +0000 (22:38 -0700)]
prog_optimize: get_src_arg_mask() respect writemask for more opcodes

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agor300/compiler: Fix incorrect presubtract conversion
Tom Stellard [Sat, 16 Apr 2011 19:39:09 +0000 (12:39 -0700)]
r300/compiler: Fix incorrect presubtract conversion

ADD instructions with constant swizzles can't be converted to
presubtract operations.

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

13 years agomesa: provide more info for glCompressedTexImage() errors
Carl-Philip Haensch [Sat, 16 Apr 2011 14:13:47 +0000 (08:13 -0600)]
mesa: provide more info for glCompressedTexImage() errors

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agomesa: move error check code in compressedteximage()
Brian Paul [Sat, 16 Apr 2011 14:03:47 +0000 (08:03 -0600)]
mesa: move error check code in compressedteximage()

This was mistakenly inside the #if FEATURE_ES block.

13 years agodocs: Reapply some of Marek's typo fixes.
José Fonseca [Sat, 16 Apr 2011 10:14:25 +0000 (11:14 +0100)]
docs: Reapply some of Marek's typo fixes.

There were some typos too.

13 years agogallium/docs: Improve min_index/max_index description.
José Fonseca [Sat, 16 Apr 2011 09:18:20 +0000 (10:18 +0100)]
gallium/docs: Improve min_index/max_index description.

13 years agodocs: Undo Marek typo fixes to original text.
José Fonseca [Sat, 16 Apr 2011 08:22:34 +0000 (09:22 +0100)]
docs: Undo Marek typo fixes to original text.

Not really typos.

13 years agotranslate: s/varient/variant/
Brian Paul [Fri, 15 Apr 2011 16:16:53 +0000 (10:16 -0600)]
translate: s/varient/variant/

13 years agovbo: init prim[] array with memset()
Brian Paul [Fri, 15 Apr 2011 14:32:56 +0000 (08:32 -0600)]
vbo: init prim[] array with memset()

This fixes a Coverity warning about uninitialized data.

13 years agovega: move ureg_destroy(ureg) after last use of ureg var
Brian Paul [Fri, 15 Apr 2011 14:31:10 +0000 (08:31 -0600)]
vega: move ureg_destroy(ureg) after last use of ureg var

13 years agost/mesa: simplify a bit of the previous patch
Brian Paul [Fri, 15 Apr 2011 14:32:12 +0000 (08:32 -0600)]
st/mesa: simplify a bit of the previous patch

Grrr, this was supposed to go in the previous commit.

13 years agost/mesa: add handling for 'PIPE_FORMAT_B8G8R8X8_UNORM' in st_fast_readpixels
Pierre-Eric Pelloux-Prayer [Thu, 14 Apr 2011 16:17:28 +0000 (18:17 +0200)]
st/mesa: add handling for 'PIPE_FORMAT_B8G8R8X8_UNORM' in st_fast_readpixels

With minor edits by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agoRevert "r300/compiler: Don't try to convert RGB to Alpha in full instructions"
Marek Olšák [Thu, 14 Apr 2011 16:48:34 +0000 (18:48 +0200)]
Revert "r300/compiler: Don't try to convert RGB to Alpha in full instructions"

This reverts commit cd2857fae16e1352f39b37f611797e66619d3fe5.

It breaks Unigine Heaven.

13 years agodocs: update relnotes-7.11
Marek Olšák [Thu, 14 Apr 2011 15:27:03 +0000 (17:27 +0200)]
docs: update relnotes-7.11

I made a glxinfo diff between 7.10 and master and added missing items
and also sorted the list.

13 years agodocs: update GL3 status
Marek Olšák [Wed, 13 Apr 2011 21:48:15 +0000 (23:48 +0200)]
docs: update GL3 status

13 years agogallium: add and use generic function for querying patented format support (v2)
Marek Olšák [Mon, 11 Apr 2011 04:23:00 +0000 (06:23 +0200)]
gallium: add and use generic function for querying patented format support (v2)

v2: Unsigned floats are allowed regardless of the configure switch.

13 years agoconfigure.ac: add an enable switch for float textures (v2)
Marek Olšák [Thu, 31 Mar 2011 23:12:41 +0000 (01:12 +0200)]
configure.ac: add an enable switch for float textures (v2)

So --enable-texture-float it is.

Hardware drivers (including the Gallium ones) should
use #ifdef TEXTURE_FLOAT_ENABLED to hide any code that may
expose floating-point renderbuffers via any interface,
public or private.

v2: Print a warning when using --enable-texture-float.

13 years agodocs: add patents.txt
Marek Olšák [Thu, 31 Mar 2011 23:12:41 +0000 (01:12 +0200)]
docs: add patents.txt

Thanks to José Fonseca for writing this.

13 years agor300g: enable A/L/LA/I float render targets
Marek Olšák [Tue, 29 Mar 2011 14:35:13 +0000 (16:35 +0200)]
r300g: enable A/L/LA/I float render targets

13 years agost/mesa: convert Mesa float formats to Gallium
Marek Olšák [Tue, 15 Feb 2011 23:40:37 +0000 (00:40 +0100)]
st/mesa: convert Mesa float formats to Gallium

Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    st/mesa: require RGBA16F and RGBA32F to be renderable
    st/mesa: fix L32F and L16F format translation
    st/mesa: also convert the R/RG float formats

commit 49a9948b6a81b7d813304d081139d98e95ba5d1a
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Fri Aug 20 10:36:17 2010 +0200

    mesa/st: enable ARB_texture_float if supported formats allow it

commit 7383632f7b6f9021b65f4973b7e7c99f0e8ce9b2
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:46 2010 +0200

    mesa/st: support ARB_texture_float internal formats

commit 7c362cc06982586c2d29fac55f6bcc4bcd1550b5
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:33 2010 +0200

    mesa/st: convert L/A/I floating point formats

13 years agogallium: add A/L/LA/I floating point formats
Luca Barbieri [Tue, 15 Feb 2011 23:40:37 +0000 (00:40 +0100)]
gallium: add A/L/LA/I floating point formats

13 years agomesa: finish up ARB_texture_float
Marek Olšák [Tue, 15 Feb 2011 23:35:44 +0000 (00:35 +0100)]
mesa: finish up ARB_texture_float

Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: handle floating-point formats in _mesa_base_fbo_format
    mesa: add ARB/ATI_texture_float, remove MESAX_texture_float

commit 123bb110852739dffadcc81ad80b005b1c4f586d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 01:35:42 2010 +0200

    mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE

13 years agomesa: add R/RG floating-point formats
Marek Olšák [Tue, 15 Feb 2011 23:35:44 +0000 (00:35 +0100)]
mesa: add R/RG floating-point formats

13 years agomesa: fix L16F and L32F format properties
Marek Olšák [Tue, 15 Feb 2011 23:35:44 +0000 (00:35 +0100)]
mesa: fix L16F and L32F format properties

13 years agoAdd expected file for 095-recursive-define test case.
Carl Worth [Thu, 14 Apr 2011 23:18:35 +0000 (16:18 -0700)]
Add expected file for 095-recursive-define test case.

It's clear enough that the current segmentation fault isn't what we
want. And it's also very easy to know what we do want here, (just
check with any functional C preprocessor such as "gcc -E").

Add the desired output as an expected file so that the test suite
gives useful output, (showing the omitted output and the segfault),
rather than just reporting "No such file" for the expected file.

13 years agoglcpp: Simplify calling convention of parser's active_list functions
Carl Worth [Thu, 14 Apr 2011 22:35:41 +0000 (15:35 -0700)]
glcpp: Simplify calling convention of parser's active_list functions

These were all written as generic list functions, (accepting and returning
a list to act upon). But they were only ever used with parser->active as
the list. By simply accepting the parser itself, these functions can update
parser->active and now return nothing at all. This makes the code a bit
more compact.

And hopefully the code is no less readable since the functions are also
now renamed to have "_parser_active" in the name for better correlation
with nearby tests of the parser->active field.

13 years agoglcpp: Add --valgrind option to the glcpp-test utility
Carl Worth [Thu, 14 Apr 2011 21:55:52 +0000 (14:55 -0700)]
glcpp: Add --valgrind option to the glcpp-test utility

The common case for this test suite is to quickly test that everything
returns the correct results. In this case, the second run of the test
suite under valgrind was just annoying, (and the user would often
interrupt it).

Now, do what is wanted in the common case by default (just run the
test suite), and require a run with "glcpp-test --valgrind" in order
to test with valgrind.

13 years agoAdd an expected file for 084-unbalanced-parentheses
Carl Worth [Thu, 14 Apr 2011 21:38:56 +0000 (14:38 -0700)]
Add an expected file for 084-unbalanced-parentheses

The expected file here captures the current behavior of glcpp (which
is to generate an obscure "syntax error, unexpected $end" diagnostic
for this case).

It would certainly be better for glcpp to generate a nicer diagnostic,
(such as "missing closing parenthesis in function-like macro
definition" or so), but the current behavior is at least correct, and
expected. So we can make the test suite more useful by marking the
current behavior as expected.

13 years agoAdd an expected file for 094-divide-by-zero-short-circuit
Carl Worth [Thu, 14 Apr 2011 21:35:11 +0000 (14:35 -0700)]
Add an expected file for 094-divide-by-zero-short-circuit

The expected file here captures the current behavior of glcpp (which
is to generate a division-by-zero error) for this case.

It's easy to argue that it should be short-circuiting the evaluation
and not generating the diagnostic (which happens to be what gcc does).
But it doesn't seem like we should force this behavior on our
pre-processor, (and, as always, the GLSL specification of the
pre-processor is too vague on this point).

13 years agoAdd an expected file for 093-divide-by-zero
Carl Worth [Thu, 14 Apr 2011 21:29:34 +0000 (14:29 -0700)]
Add an expected file for 093-divide-by-zero

This test is behaving just fine already---it's generating an informative
diagnostic, ("error: division by 0 in preprocessor directive"), so adding
this in the expected file makes things pass.

13 years agomesa/st: Avoid spurious transfers when creating fbo textures without image data.
José Fonseca [Thu, 14 Apr 2011 14:22:49 +0000 (15:22 +0100)]
mesa/st: Avoid spurious transfers when creating fbo textures without image data.

We could actually try to do an early return both for gallium textures and
malloc memory textures, but I'm not sure exactly which situations
stImage->pt is NULL, and whether texImage->Data == NULL would be acceptible
or not.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: add support for GL_RGBA + GL_UNSIGNED_INT_8_8_8_8 in st_fast_readpixels
pepp [Wed, 13 Apr 2011 11:03:31 +0000 (13:03 +0200)]
st/mesa: add support for GL_RGBA + GL_UNSIGNED_INT_8_8_8_8 in st_fast_readpixels

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Expose ATI_draw_buffers.
Eric Anholt [Wed, 13 Apr 2011 19:02:54 +0000 (12:02 -0700)]
mesa: Expose ATI_draw_buffers.

This is the same as ARB_draw_buffers (which derived from it), except
for s/ARB/ATI/.  The glapi bits were already in place, and what was
missing was just the ARB_fp part.  The new Humble Bundle game "trine"
tries to use this extension without checking that it's exposed, which
this works around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36182
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agomesa: Add support for OPTION ATI_draw_buffers to ARB_fp.
Eric Anholt [Wed, 13 Apr 2011 19:07:31 +0000 (12:07 -0700)]
mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.

Tested by piglit ati_draw_buffers-arbfp.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agomesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.
Eric Anholt [Wed, 13 Apr 2011 18:09:55 +0000 (11:09 -0700)]
mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.

Fixes fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34321
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965/fs: Constant-fold immediates in src0 of SEL instructions.
Eric Anholt [Sat, 9 Apr 2011 18:29:59 +0000 (08:29 -1000)]
i965/fs: Constant-fold immediates in src0 of SEL instructions.

This is like what we do for add/mul, but we have to invert the
predicate to choose the other source instead.

This removes 5 extra moves of constants in nexuiz shaders.  No
statistically significant performance difference on my Sandybridge
laptop (n=5).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965/fs: Constant-fold immediates in src0 of CMP instructions.
Eric Anholt [Sat, 9 Apr 2011 18:22:42 +0000 (08:22 -1000)]
i965/fs: Constant-fold immediates in src0 of CMP instructions.

This is like what we do with add/mul, but we also have to flip the
conditional test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoglsl: Perform type checking on "^^" operands.
Eric Anholt [Sun, 10 Apr 2011 00:57:17 +0000 (14:57 -1000)]
glsl: Perform type checking on "^^" operands.

We were letting any old operand through, which generally resulted in
assertion failures later.

Fixes array-logical-xor.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoglsl: When we've emitted a semantic error for ==, return a bool constant.
Eric Anholt [Sat, 9 Apr 2011 22:54:34 +0000 (12:54 -1000)]
glsl: When we've emitted a semantic error for ==, return a bool constant.

This prevents later errors (including an assertion failure) from
cascading the failure.

Fixes invalid-equality-04.vert.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33303
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
13 years agoglsl: Semantically check the RHS of `||' even when short-circuiting.
Eric Anholt [Sat, 9 Apr 2011 20:27:02 +0000 (10:27 -1000)]
glsl: Semantically check the RHS of `||' even when short-circuiting.

We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant false case.

Fixes glslparsertest/glsl2/logic-02.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoglsl: Semantically check the RHS of `&&' even when short-circuiting.
Eric Anholt [Sat, 9 Apr 2011 20:27:02 +0000 (10:27 -1000)]
glsl: Semantically check the RHS of `&&' even when short-circuiting.

We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant true case.

Fixes glslparsertest/glsl2/logic-01.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoglsl: Avoid cascading errors when looking for a scalar boolean and failing.
Eric Anholt [Sun, 10 Apr 2011 01:59:20 +0000 (15:59 -1000)]
glsl: Avoid cascading errors when looking for a scalar boolean and failing.

By always using a boolean, we should generally avoid further
complaints.  The failure case I see is logic_not, where the user might
understandably make the mistake of using `!' on a boolean vector (like
a piglit case did recently!), and then get a further complaint that
the new boolean type doesn't match the bvec it gets assigned to.

Fixes invalid-logic-not-06.vert (assertion failure when the bad type
ends up in an expression and ir_constant_expression gets angry).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33314
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoglsl/opt_cpe: Reenable opt_copy_propagation_elements.cpp pass.
Eric Anholt [Sun, 3 Apr 2011 03:19:20 +0000 (20:19 -0700)]
glsl/opt_cpe: Reenable opt_copy_propagation_elements.cpp pass.

13 years agoglsl/opt_cpe: Fix a crash when a kill kills for two reasons.
Eric Anholt [Fri, 8 Apr 2011 17:54:50 +0000 (07:54 -1000)]
glsl/opt_cpe: Fix a crash when a kill kills for two reasons.

Fixes glsl-copy-propagation-loop-2 when this optimization pass is
re-enabled.

Reported-by: David Lamparter <equinox@diac24.net>
13 years agoglsl/opt_cpe: Kill when the assignment isn't something we recognize.
Eric Anholt [Sun, 3 Apr 2011 03:17:17 +0000 (20:17 -0700)]
glsl/opt_cpe: Kill when the assignment isn't something we recognize.

A few GLES2 tests tripped over this when using array dereferences to
hit channels on the LHS (see piglit test
glsl-copy-propagation-vector-indexing).  We wouldn't find the
ir_dereference_variable, and assume that that meant that it wasn't an
assignment to a scalar/vector, and thus not notice that the variable
had been changed.

13 years agosvga: defined QSZ in terms of SVGA3D_MAX_DRAW_PRIMITIVE_RANGES
Brian Paul [Wed, 13 Apr 2011 15:50:48 +0000 (09:50 -0600)]
svga: defined QSZ in terms of SVGA3D_MAX_DRAW_PRIMITIVE_RANGES

13 years agosvga: define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES and update comments
Brian Paul [Wed, 13 Apr 2011 15:52:16 +0000 (09:52 -0600)]
svga: define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES and update comments

13 years agost/mesa: minor clean-ups in update_textures()
Brian Paul [Wed, 13 Apr 2011 13:37:03 +0000 (07:37 -0600)]
st/mesa: minor clean-ups in update_textures()

13 years agomesa: 80-column wrapping and whitespace fixes
Brian Paul [Wed, 13 Apr 2011 13:35:25 +0000 (07:35 -0600)]
mesa: 80-column wrapping and whitespace fixes

13 years agomesa: fix some comments in sampler object code
Brian Paul [Wed, 13 Apr 2011 13:35:25 +0000 (07:35 -0600)]
mesa: fix some comments in sampler object code

13 years agoi965: Change assertion condition from implicit to explicit
Chad Versace [Thu, 7 Apr 2011 16:09:38 +0000 (09:09 -0700)]
i965: Change assertion condition from implicit to explicit

... because grokking explicit assertions requires fewer neurons.

In brw_misc_state.c:emit_depthbuffer, change assertion condition
    tiling != I915_TILING_X && tiling != I915_TILING_NONE
to
    tiling == I915_TILING_Y

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
13 years agoi965: Define BRW_DEPTHFORMAT_D24_UNORM_X8_UINT
Chad Versace [Sun, 27 Mar 2011 15:44:50 +0000 (08:44 -0700)]
i965: Define BRW_DEPTHFORMAT_D24_UNORM_X8_UINT

This depth format was added in Gen5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
13 years agoi965: Document brw_context.state.depth_region
Chad Versace [Thu, 7 Apr 2011 23:32:23 +0000 (16:32 -0700)]
i965: Document brw_context.state.depth_region

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
13 years agoi965: Remove unnecessary release/reference of brw_context.state.depth_region
Chad Versace [Thu, 7 Apr 2011 22:44:24 +0000 (15:44 -0700)]
i965: Remove unnecessary release/reference of brw_context.state.depth_region

Release the old depth region and reference the new one *only* if it has
changed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
13 years agoi965: Add comments about URB size units and limits.
Kenneth Graunke [Tue, 12 Apr 2011 22:21:21 +0000 (15:21 -0700)]
i965: Add comments about URB size units and limits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agoi965: Never enable the GS on Gen6.
Kenneth Graunke [Mon, 11 Apr 2011 18:00:03 +0000 (11:00 -0700)]
i965: Never enable the GS on Gen6.

Prior to Gen6, we use the GS for breaking down quads, quad-strips,
and line loops.  On Gen6, earlier stages already take care of this,
so we never need the GS.

Since this code is likely completely untested, remove it for now.
We can write new code when enabling real geometry shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoRevert "i965: Reinstate max-index paranoia"
Chris Wilson [Tue, 12 Apr 2011 18:13:22 +0000 (19:13 +0100)]
Revert "i965: Reinstate max-index paranoia"

This reverts commit b4cbd2b312d53a50603e2cda925711bc9def4517.

It looked like a safe sanity check. It missed the issue of the start of
the buffer not being at 0, but even that was not enough to explain why
setting the max vertex index caused glyphs to be dropped from the game
'Achron'.

Instead, the issue appears to be related to the use of the vertex bias
and so we would need to re-emit the max-index every time we adjusted the
bias, so re-emitting the relocations and defeating the original
optimisation.

Reported-and-tested-by: Thomas Jones <thomas.jones@utoronto.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35163
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agoegl/wayland: Update to per-surface frame events
Benjamin Franzke [Wed, 16 Mar 2011 12:49:38 +0000 (13:49 +0100)]
egl/wayland: Update to per-surface frame events

13 years agonouveau_vieux: fix build since sampler objects merge
Dave Airlie [Tue, 12 Apr 2011 11:20:48 +0000 (21:20 +1000)]
nouveau_vieux: fix build since sampler objects merge

13 years agost/wgl: Prevent spurious framebuffer sizes when the window is minimized.
José Fonseca [Thu, 7 Apr 2011 18:15:55 +0000 (19:15 +0100)]
st/wgl: Prevent spurious framebuffer sizes when the window is minimized.

When the window is minimized GetClientRect will return zeros.

Instead of creating a 1x1 framebuffer, simply preserve the current window
size, until the window is restored or maximized again.

13 years agost/wgl: Fix debug output format specifiers of stw_framebuffer_get_size().
José Fonseca [Thu, 7 Apr 2011 17:20:38 +0000 (18:20 +0100)]
st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size().

13 years agosvga: Rebind framebuffer and tss bindings strictly when necessary.
José Fonseca [Thu, 7 Apr 2011 15:54:37 +0000 (16:54 +0100)]
svga: Rebind framebuffer and tss bindings strictly when necessary.

The earlier change to ensure rendertargets and textures are always
rebound at every command buffer start had the downside of making
successive flushes no longer no-ops, as a command buffer with merely
the rebinding commands were being unnecessarily sent to the vGPU.

This change only re-emits the bindings when necessary, by keeping track
of the need to rebind outside of the dirty state update mechanism.

13 years agotexstore: fix regression stricter check for memcpy path for unorm88 and unorm1616
Hans de Goede [Sun, 10 Apr 2011 20:21:03 +0000 (22:21 +0200)]
texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616

According to https://bugs.freedesktop.org/show_bug.cgi?id=34280
commit 5d1387b2da3626326410804026f8b92f1a121fdc causes the font corruption
problems people have been seeing under various apps and gnome-shell on r200
cards.

This commit changed (loosened) the check for using the memcpy path in the
former al88 / al1616 texstore functions, which are now also used to
store rg texures. This patch restores the old strict check in case of
al textures. I've no idea why this fixes things, since I don't know the
code in question at all. But after seeing the bisect in bfdo34280 point
to this commit, I gave this fix a try and it fixes the font issues seen on
r200 cards.

[airlied:
r200 has no native working A8, so it does an internal storage format of AL88
however srcFormat == internalFormat == ALPHA when we get to this point,
so it copies, but it wants to store into an AL88 not ALPHA so fails,
I'll also push a piglit test for this on r200].

Many thanks to Nicolas Kaiser who did all the hard work of tracking this down!

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years ago ir_to_mesa: silence signed/unsigned comparison warnings
Brian Paul [Tue, 12 Apr 2011 03:29:06 +0000 (21:29 -0600)]
 ir_to_mesa: silence signed/unsigned comparison warnings

13 years agoconfigs: add r600 dir to DRI_DIRS
Brian Paul [Tue, 12 Apr 2011 03:23:14 +0000 (21:23 -0600)]
configs: add r600 dir to DRI_DIRS

13 years agor600: silence various compiler warnings
Brian Paul [Tue, 12 Apr 2011 03:22:54 +0000 (21:22 -0600)]
r600: silence various compiler warnings

13 years agoMerge branch 'arb_sampler_objects'
Brian Paul [Tue, 12 Apr 2011 03:19:41 +0000 (21:19 -0600)]
Merge branch 'arb_sampler_objects'

13 years agoRevert "i965: clear global offset to zero in m0.2 for VS DP read."
Zou Nan hai [Tue, 12 Apr 2011 02:52:50 +0000 (10:52 +0800)]
Revert "i965:   clear global offset to zero in m0.2 for VS DP read."

This reverts commit 66b66295d0bc856c69fdcccc22575580c7ecee16.
it was already fixed by commit 9d60a7ce08a67eb8b79c60f829d090ba4a37ed7e

13 years agoi965: Remove hint_gs_always and resulting dead code
Ian Romanick [Sat, 9 Apr 2011 01:06:35 +0000 (18:06 -0700)]
i965: Remove hint_gs_always and resulting dead code

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>