mesa.git
13 years agoi965: Move CLIP VP state dump to using the state_batch_list[].
Eric Anholt [Wed, 22 Jun 2011 22:56:07 +0000 (15:56 -0700)]
i965: Move CLIP VP state dump to using the state_batch_list[].

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Track the brw_state_batch() data while under INTEL_DEBUG=batch.
Eric Anholt [Wed, 22 Jun 2011 22:48:09 +0000 (15:48 -0700)]
i965: Track the brw_state_batch() data while under INTEL_DEBUG=batch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Add a type argument to brw_state_batch().
Eric Anholt [Wed, 22 Jun 2011 22:14:20 +0000 (15:14 -0700)]
i965: Add a type argument to brw_state_batch().

I want to make brw_state_dump.c handle more than just the last
statechange, so I want to keep track of what's in the batch state.  By
using AUB file numbering for most of these packets, this may be
reusable for aub dumping.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agointel: Make our context structure be a ralloc context.
Eric Anholt [Fri, 6 May 2011 02:01:25 +0000 (19:01 -0700)]
intel: Make our context structure be a ralloc context.

This will let me hang cached compiler structs off of the context
without having to worry about cleaning them up at destroy time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoconfigs: do not let llvm-config define NDEBUG in debug builds
Brian Paul [Mon, 11 Jul 2011 16:07:32 +0000 (10:07 -0600)]
configs: do not let llvm-config define NDEBUG in debug builds

Following the examples of Marek and Jose for autoconf and scons.

13 years agoir_to_mesa: typo fix in a comment.
Eric Anholt [Mon, 2 May 2011 17:45:02 +0000 (10:45 -0700)]
ir_to_mesa: typo fix in a comment.

13 years agoi965: Fix fp-dst-aliasing-[12].vpfp.
Eric Anholt [Fri, 8 Jul 2011 00:08:04 +0000 (17:08 -0700)]
i965: Fix fp-dst-aliasing-[12].vpfp.

There's no pretty way to avoid the overwriting of the src operands, so
just use a temporary destination and rely on the MOV optimization.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Fix fp-lit-src-equals-dst.
Eric Anholt [Thu, 7 Jul 2011 23:41:20 +0000 (16:41 -0700)]
i965: Fix fp-lit-src-equals-dst.

We were stomping over the source for the body of the LIT instruction
when doing the MOV of 1.0 to the uninteresting channels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoconfigure.ac: do not let llvm-config define NDEBUG in debug builds
Marek Olšák [Mon, 11 Jul 2011 12:33:21 +0000 (14:33 +0200)]
configure.ac: do not let llvm-config define NDEBUG in debug builds

Re-enables assertions in src/mesa.

13 years agoscons: Filter-out NDEBUG define from llvm-config.
José Fonseca [Mon, 11 Jul 2011 14:36:40 +0000 (15:36 +0100)]
scons: Filter-out NDEBUG define from llvm-config.

Based on a similar autoconf change from Marek.

13 years agoglx: add a few missing glXChooseFBConfig() attributes
Brian Paul [Mon, 11 Jul 2011 14:00:59 +0000 (08:00 -0600)]
glx: add a few missing glXChooseFBConfig() attributes

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38842

NOTE: This is a candidate for the 7.11 branch.

13 years agoglext.h: update to version 71
Brian Paul [Fri, 8 Jul 2011 18:59:20 +0000 (12:59 -0600)]
glext.h: update to version 71

13 years agomesa: fix assertion failure in delete_wrapper
Marek Olšák [Mon, 11 Jul 2011 13:26:51 +0000 (15:26 +0200)]
mesa: fix assertion failure in delete_wrapper

13 years agomesa: add a comment in _mesa_test_formats
Marek Olšák [Mon, 11 Jul 2011 13:18:14 +0000 (15:18 +0200)]
mesa: add a comment in _mesa_test_formats

13 years agomesa: fix assertion failure in _mesa_test_formats
Marek Olšák [Mon, 11 Jul 2011 11:53:42 +0000 (13:53 +0200)]
mesa: fix assertion failure in _mesa_test_formats

Z32_FLOAT_X24S8 has DataType of GL_NONE.

13 years agoRevert "WIP r600g: depth_buffer_float renderbuffer support on evergreen"
Marek Olšák [Mon, 11 Jul 2011 02:17:37 +0000 (04:17 +0200)]
Revert "WIP r600g: depth_buffer_float renderbuffer support on evergreen"

This reverts commit 91a52dae97379d118965567b5c11e393996baeb9.

Pushed accidentally.

13 years agor600g: more valgrind fixes
Marek Olšák [Mon, 11 Jul 2011 02:13:35 +0000 (04:13 +0200)]
r600g: more valgrind fixes

13 years agor600g: zero memory of ioctl parameters
Marek Olšák [Mon, 11 Jul 2011 02:01:06 +0000 (04:01 +0200)]
r600g: zero memory of ioctl parameters

Fixes valgrind warning.

13 years agomesa: implement packing of DEPTH_STENCIL & FLOAT_32_UNSIGNED_INT_24_8_REV combo
Marek Olšák [Sun, 10 Jul 2011 23:39:53 +0000 (01:39 +0200)]
mesa: implement packing of DEPTH_STENCIL & FLOAT_32_UNSIGNED_INT_24_8_REV combo

Tested with the new piglit fbo-depthstencil test.

13 years agoWIP r600g: depth_buffer_float renderbuffer support on evergreen
Marek Olšák [Tue, 21 Jun 2011 21:22:37 +0000 (23:22 +0200)]
WIP r600g: depth_buffer_float renderbuffer support on evergreen

13 years agoswrast: fix depth/stencil blits when there's no colorbuffer
Marek Olšák [Sun, 10 Jul 2011 18:03:05 +0000 (20:03 +0200)]
swrast: fix depth/stencil blits when there's no colorbuffer

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

13 years agomesa: return early if mask is cleared to zero in BlitFramebuffer
Marek Olšák [Sun, 10 Jul 2011 18:01:33 +0000 (20:01 +0200)]
mesa: return early if mask is cleared to zero in BlitFramebuffer

From ARB_framebuffer_object:
    If a buffer is specified in <mask> and does not exist in both the
    read and draw framebuffers, the corresponding bit is silently
    ignored.

13 years agodocs: update GL3 status
Marek Olšák [Wed, 29 Jun 2011 00:10:55 +0000 (02:10 +0200)]
docs: update GL3 status

13 years agor600g: depth_buffer_float support on r600-r700
Marek Olšák [Mon, 20 Jun 2011 17:40:41 +0000 (19:40 +0200)]
r600g: depth_buffer_float support on r600-r700

13 years agogallium/util: handle Z32F_FLOAT_S8X24_USCALED in pipe_tile_raw_to_rgba
Marek Olšák [Tue, 21 Jun 2011 19:14:07 +0000 (21:14 +0200)]
gallium/util: handle Z32F_FLOAT_S8X24_USCALED in pipe_tile_raw_to_rgba

And make pipe_put_tile_rgba_format no-op like the other Z formats.

13 years agogallium/util: implement software Z32F_S8X24 depth-stencil clear
Marek Olšák [Fri, 24 Jun 2011 21:39:51 +0000 (23:39 +0200)]
gallium/util: implement software Z32F_S8X24 depth-stencil clear

13 years agogallium/util: implement pack functions for Z32F and Z32F_S8X24
Marek Olšák [Fri, 24 Jun 2011 21:38:36 +0000 (23:38 +0200)]
gallium/util: implement pack functions for Z32F and Z32F_S8X24

13 years agost/mesa: implement read/draw/copypixels for Z32F and Z32F_S8X24
Marek Olšák [Mon, 27 Jun 2011 17:09:24 +0000 (19:09 +0200)]
st/mesa: implement read/draw/copypixels for Z32F and Z32F_S8X24

13 years agost/mesa: initial ARB_depth_buffer_float support
Marek Olšák [Wed, 1 Jun 2011 13:49:33 +0000 (15:49 +0200)]
st/mesa: initial ARB_depth_buffer_float support

13 years agomesa: implement depth/stencil renderbuffer wrapper accessors for Z32F_X24S8
Marek Olšák [Fri, 1 Jul 2011 00:04:34 +0000 (02:04 +0200)]
mesa: implement depth/stencil renderbuffer wrapper accessors for Z32F_X24S8

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: implement generatemipmap for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Marek Olšák [Tue, 21 Jun 2011 12:18:25 +0000 (14:18 +0200)]
mesa: implement generatemipmap for GL_FLOAT_32_UNSIGNED_INT_24_8_REV

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: implement texstore for DEPTH32F_STENCIL8
Marek Olšák [Tue, 21 Jun 2011 03:17:51 +0000 (05:17 +0200)]
mesa: implement texstore for DEPTH32F_STENCIL8

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: implement texstore for DEPTH_COMPONENT32F
Marek Olšák [Tue, 21 Jun 2011 11:36:27 +0000 (13:36 +0200)]
mesa: implement texstore for DEPTH_COMPONENT32F

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: implement depth unpacking for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Marek Olšák [Tue, 21 Jun 2011 03:09:24 +0000 (05:09 +0200)]
mesa: implement depth unpacking for GL_FLOAT_32_UNSIGNED_INT_24_8_REV

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: implement stencil unpacking for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Marek Olšák [Tue, 21 Jun 2011 03:06:36 +0000 (05:06 +0200)]
mesa: implement stencil unpacking for GL_FLOAT_32_UNSIGNED_INT_24_8_REV

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: implement texfetch functions for depth_buffer_float
Marek Olšák [Mon, 20 Jun 2011 01:07:16 +0000 (03:07 +0200)]
mesa: implement texfetch functions for depth_buffer_float

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: initial ARB_depth_buffer_float support
Marek Olšák [Wed, 1 Jun 2011 13:48:51 +0000 (15:48 +0200)]
mesa: initial ARB_depth_buffer_float support

Using GL_NONE as DataType of Z32_FLOAT_X24S8, not sure what I should put there.
The spec says the type is n/a.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agor600g: LIT: clamp negative src.y to 0
Vadim Girlin [Sun, 10 Jul 2011 17:19:38 +0000 (13:19 -0400)]
r600g: LIT: clamp negative src.y to 0

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39083

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agost/dri: remove unused variables
Marek Olšák [Sun, 10 Jul 2011 15:40:38 +0000 (17:40 +0200)]
st/dri: remove unused variables

13 years agost/egl: fix linking errors
Chia-I Wu [Sat, 9 Jul 2011 17:27:20 +0000 (01:27 +0800)]
st/egl: fix linking errors

Add symbols referenced by src/glx/dri2.c.

13 years agointel: Recognize all depth formats in get_teximage_readbuffer.
Kenneth Graunke [Sat, 9 Jul 2011 09:46:03 +0000 (02:46 -0700)]
intel: Recognize all depth formats in get_teximage_readbuffer.

The existing code was missing GL_DEPTH_COMPONENT32, resulting in it
wrongly returning the color buffer instead of the depth buffer.

Fixes an issue in PlaneShift 0.5.7 when casting spells.  The game calls
CopyTexSubImage2D on buffers with a GL_DEPTH_COMPONENT32 internal
format, which (prior to this patch) resulted in an attempt to copy
ARGB8888 to X8_Z24.

Instead of adding the missing enumeration directly, convert the code to
use _mesa_is_depth_format() and _mesa_is_depthstencil_format() as these
should catch any newly added depth formats in the future.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agor600g: Get rid of some superfluous braces.
Henri Verbeet [Sat, 9 Jul 2011 15:19:00 +0000 (17:19 +0200)]
r600g: Get rid of some superfluous braces.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
13 years agor600g: Check for Evergreen chip class instead of Cedar family in r600_context_flush().
Henri Verbeet [Sat, 9 Jul 2011 15:19:00 +0000 (17:19 +0200)]
r600g: Check for Evergreen chip class instead of Cedar family in r600_context_flush().

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
13 years agor600g: Store the chip class directly in r600_bc.
Henri Verbeet [Sat, 9 Jul 2011 15:18:59 +0000 (17:18 +0200)]
r600g: Store the chip class directly in r600_bc.

Instead of deriving it from the family again.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
13 years agor600g: Replace the CHIPREV_* defines with the chip_class enum.
Henri Verbeet [Sat, 9 Jul 2011 15:18:59 +0000 (17:18 +0200)]
r600g: Replace the CHIPREV_* defines with the chip_class enum.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
13 years agor600g: Get rid of the superfluous family field from r600_shader.
Henri Verbeet [Sat, 9 Jul 2011 15:18:59 +0000 (17:18 +0200)]
r600g: Get rid of the superfluous family field from r600_shader.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
13 years agor600g: Store the chip class in r600_pipe_context.
Henri Verbeet [Sat, 9 Jul 2011 15:18:59 +0000 (17:18 +0200)]
r600g: Store the chip class in r600_pipe_context.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
13 years agor600g: Fix the type of the family field in r600_pipe_context.
Henri Verbeet [Sat, 9 Jul 2011 15:18:59 +0000 (17:18 +0200)]
r600g: Fix the type of the family field in r600_pipe_context.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
13 years agoi965/gen4: Fix GPU hangs since the program streaming change.
Eric Anholt [Fri, 8 Jul 2011 22:30:48 +0000 (15:30 -0700)]
i965/gen4: Fix GPU hangs since the program streaming change.

This was tricky.  We were doing a use-before-initialize of
grf_reg_count, but the value usually got overwritten anyway -- when we
didn't have to do a relocation (typical), or on gen5 when we didn't
have relocations at all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38771
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/gen7: Remove gratuitous dirty flags from WM and PS state.
Kenneth Graunke [Sat, 9 Jul 2011 03:17:50 +0000 (20:17 -0700)]
i965/gen7: Remove gratuitous dirty flags from WM and PS state.

Commit b46dc45ceef3deb17ba2b0b4300eeb93e9cf7833 claimed that
NEW_POLYGONSTIPPLE is gratuitous, but somehow just changed comments
and whitespace instead of actually removing the flag.

While we're at it, 3DSTATE_PS doesn't appear to need NEW_LINE or
NEW_POLYGON either (those are in 3DSTATE_WM).  Also, 3DSTATE_WM
doesn't appear to need BRW_NEW_NR_WM_SURFACES or BRW_NEW_CURBE_OFFSETS
either (those are in 3DSTATE_PS).

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agor600g: introduce r600_bc_src_toggle_neg helper and fix SUB & LRP
Vadim Girlin [Fri, 8 Jul 2011 02:19:37 +0000 (06:19 +0400)]
r600g: introduce r600_bc_src_toggle_neg helper and fix SUB & LRP

SUB & LRP instructions should toggle NEG bit instead of setting it,
otherwise e.g. "SUB a,b,-1" is translated as "ADD a,b,-1"

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
13 years agor600g: introduce r600_bc_src_set_abs helper and fix LOG
Vadim Girlin [Fri, 8 Jul 2011 02:19:36 +0000 (06:19 +0400)]
r600g: introduce r600_bc_src_set_abs helper and fix LOG

LOG instruction should use absolute values of source operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
13 years agor600g: RSQ: clear NEG for operand
Vadim Girlin [Wed, 6 Jul 2011 01:29:09 +0000 (05:29 +0400)]
r600g: RSQ: clear NEG for operand

Need to clear NEG bit because it applies after ABS, e.g. "RSQ ..., -1"
uses -|1| as operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
13 years agor600g: LIT: swap MUL_LIT operands to fix 0^0
Vadim Girlin [Wed, 6 Jul 2011 01:29:08 +0000 (05:29 +0400)]
r600g: LIT: swap MUL_LIT operands to fix 0^0

For 0^0 case result of "LOG_CLAMPED ...,0" is -MAX_FLOAT, and then result of
"MUL_LIT ...,0,-MAX_FLOAT,..." is -MAX_FLOAT instead of 0 because of special
src1 checks for -MAX_FLOAT. So swap src0/1:
"MUL_LIT ...,-MAX_FLOAT,0,..." to get expected 0, then result of
"EXP_IEEE ...,0" is 1 as expected for LIT.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
13 years agoGLX/DRI2: handle swap event swap count wrapping
Jesse Barnes [Fri, 6 May 2011 17:31:24 +0000 (10:31 -0700)]
GLX/DRI2: handle swap event swap count wrapping

Create a new GLX drawable struct to track client related info, and add a
wrap counter to it drawable and track it as we receive events.  This
allows us to support the full 64 bits of the event structure we pass to
the client even though the server only gives us a 32 bit count.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
13 years agoDRI2/GLX: use new swap event types
Jesse Barnes [Thu, 5 May 2011 20:09:16 +0000 (13:09 -0700)]
DRI2/GLX: use new swap event types

Use the new swap event type so we get valid SBC values.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
13 years agoglsl: Lower break instructions when necessary at the end of a loop.
Paul Berry [Sat, 2 Jul 2011 00:29:35 +0000 (17:29 -0700)]
glsl: Lower break instructions when necessary at the end of a loop.

Normally lower_jumps.cpp doesn't need to lower a break instruction
that occurs at the end of a loop, because all back-ends can produce
proper GPU instructions for a break instruction in this "canonical"
location.  However, if other break instructions within the loop are
already being lowered, then a break instruction at the end of the loop
needs to be lowered too, since after the optimization is complete a
new conditional break will be inserted at the end of the loop.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_breaks_6.

13 years agoglsl: In lower_jumps.cpp, lower both branches of a conditional.
Paul Berry [Fri, 1 Jul 2011 22:33:36 +0000 (15:33 -0700)]
glsl: In lower_jumps.cpp, lower both branches of a conditional.

Previously, lower_jumps.cpp would break out of its loop after lowering
a jump instruction in just the then- or else-branch of a conditional,
and it would fail to lower a jump instruction occurring in the other
branch.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_returns_4.

13 years agoglsl: Use foreach_list in lower_jumps.cpp
Paul Berry [Fri, 1 Jul 2011 19:36:23 +0000 (12:36 -0700)]
glsl: Use foreach_list in lower_jumps.cpp

The visitor class in lower_jumps.cpp never removes or replaces the
instruction being visited, but it frequently alters or removes the
instructions that follow it.  Therefore, to make sure the altered IR
is visited, it needs to iterate through exec_lists using foreach_list
rather than visit_exec_list().

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Also, certain invariants assumed by lower_jumps.cpp may fail to hold,
causing assertion failures.

Fixes unit tests test_lower_pulled_out_jump,
test_lower_unified_returns, test_lower_guarded_conditional_break,
test_lower_return_non_void_at_end_of_loop, and test_lower_returns_3.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoglsl: lower unconditional returns and continues in loops.
Paul Berry [Sat, 2 Jul 2011 01:26:05 +0000 (18:26 -0700)]
glsl: lower unconditional returns and continues in loops.

Previously, lower_jumps.cpp would only lower return and continue
statements that appeared inside conditionals.  This patch makes it
lower unconditional returns and continue statements that occur inside
a loop.

Such unconditional flow control statements would be unlikely to be
explicitly coded by a reasonable user, however they might arise as a
result of other optimizations.

Without this patch, lower_jumps.cpp might not lower certain return and
continue statements, causing some backends to fail.

Fixes unit tests test_lower_return_void_at_end_of_loop and
test_remove_continue_at_end_of_loop.

13 years agoglsl: Lower unconditional return statements.
Paul Berry [Fri, 1 Jul 2011 19:14:07 +0000 (12:14 -0700)]
glsl: Lower unconditional return statements.

Previously, lower_jumps.cpp only lowered return statements that
appeared inside of an if statement.

Without this patch, lower_jumps.cpp might not lower certain return
statements, causing some back-ends to fail (as in bug #36669).

Fixes unit test test_lower_returns_1.

13 years agoglsl: Refactor logic for determining whether to lower return statements.
Paul Berry [Fri, 1 Jul 2011 18:59:32 +0000 (11:59 -0700)]
glsl: Refactor logic for determining whether to lower return statements.

Previously, do_lower_jumps.cpp determined whether to lower return
statements in ir_lower_jumps_visitor::should_lower_jumps().  Moved
this logic to ir_lower_jumps_visitor::visit(ir_function_signature *),
so that it can be used in determining whether to lower a return
statement at the end of a function.

13 years agoglsl: Add explanatory comments to lower_jumps.cpp.
Paul Berry [Wed, 29 Jun 2011 17:28:40 +0000 (10:28 -0700)]
glsl: Add explanatory comments to lower_jumps.cpp.

No functional change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoglsl: Make ir_reader able to read plain (return) statements.
Paul Berry [Wed, 29 Jun 2011 22:30:40 +0000 (15:30 -0700)]
glsl: Make ir_reader able to read plain (return) statements.

Previously ir_reader was only able to handle return of non-void.

This patch is necessary in order to allow optimization passes to be
tested in isolation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoglsl: Remove unused function prototypes.
Paul Berry [Tue, 5 Jul 2011 18:29:40 +0000 (11:29 -0700)]
glsl: Remove unused function prototypes.

No functional change.  Remove prototypes for do_mod_to_fract() and
do_sub_to_add_neg(), which haven't existed since November 2010.

13 years agogallivm: Fix build with llvm-3.0
Gustaw Smolarczyk [Wed, 6 Jul 2011 21:12:11 +0000 (23:12 +0200)]
gallivm: Fix build with llvm-3.0

LLVM 3.0svn changes pretty rapidly. The change in
Target->createMCInstPrinter() signature which inspired commits
40ae214067673edbda79371969d1730b6194d83e and
92e29dc5b0474c073b0f05d60629fc6c3decfca4 has been reverted.

Signed-off-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: handle float formats in st_format_datatype
Marek Olšák [Mon, 27 Jun 2011 16:57:59 +0000 (18:57 +0200)]
st/mesa: handle float formats in st_format_datatype

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: use the first non-VOID channel in st_format_datatype
Marek Olšák [Mon, 27 Jun 2011 17:01:25 +0000 (19:01 +0200)]
st/mesa: use the first non-VOID channel in st_format_datatype

Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa/st: Fix piglit read-front with new drawable invalidation v2
Thomas Hellstrom [Fri, 8 Jul 2011 06:26:29 +0000 (08:26 +0200)]
mesa/st: Fix piglit read-front with new drawable invalidation v2

When the state tracker adds a front buffer, nothing triggers a validate
drawable call, since the state tracker manager is never notified.

Force a validate drawable call by invalidating the framebuffer's stamp, so
that the window system's renderbuffer (if any) is picked up.

This fixes bug 38988
https://bugs.freedesktop.org/show_bug.cgi?id=38988

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
13 years agoi915g: Make the optimizer more generic.
Stéphane Marchesin [Fri, 8 Jul 2011 04:58:31 +0000 (21:58 -0700)]
i915g: Make the optimizer more generic.

13 years agointel: add null src pointer check in intel_region_reference()
Brian Paul [Thu, 7 Jul 2011 23:29:28 +0000 (17:29 -0600)]
intel: add null src pointer check in intel_region_reference()

Fixes segfault when running cubemap demo on i945.  This happened
when intel_region_reference() was called in i915_set_draw_region()
with depth_region=NULL.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglsl: use casts to silence warning
Brian Paul [Thu, 7 Jul 2011 22:47:59 +0000 (16:47 -0600)]
glsl: use casts to silence warning

13 years agoscons: Generate libGL.so.1.5 and libGL.so.1 symlinks.
José Fonseca [Thu, 7 Jul 2011 22:41:06 +0000 (23:41 +0100)]
scons: Generate libGL.so.1.5 and libGL.so.1 symlinks.

In build/xxx/src/gallium/targets/libgl-xlib/SConscript

13 years agointel: Fix use of freed buffer if glBitmap is called after a swap.
Eric Anholt [Wed, 6 Jul 2011 18:31:00 +0000 (11:31 -0700)]
intel: Fix use of freed buffer if glBitmap is called after a swap.

Regions looked up from the framebuffer are invalid after
intel_prepare_render().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30266
Tested-by: Thomas Jones <thomas.jones@utoronto.ca>
13 years agointel: Remove dead comment about software clears -- it's handled just above.
Eric Anholt [Thu, 7 Jul 2011 15:59:07 +0000 (08:59 -0700)]
intel: Remove dead comment about software clears -- it's handled just above.

13 years agoi915: Fix leak of ViewportMatrix data on context destroy.
John [Wed, 29 Jun 2011 18:45:04 +0000 (11:45 -0700)]
i915: Fix leak of ViewportMatrix data on context destroy.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217

13 years agointel: Remove gratuitous context checks in intel_delete_renderbuffer().
Eric Anholt [Wed, 29 Jun 2011 18:37:35 +0000 (11:37 -0700)]
intel: Remove gratuitous context checks in intel_delete_renderbuffer().

Even if we don't have a current context, if we're freeing the rb we
should free its region (and BO).  The renderbuffer unreference checks
appear to be just cargo-cult from the region unreference code.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
Reviewed-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Remove now trivial intel_renderbuffer_set_{hiz_,}region().
Eric Anholt [Wed, 29 Jun 2011 18:26:32 +0000 (11:26 -0700)]
intel: Remove now trivial intel_renderbuffer_set_{hiz_,}region().

As a result of this cleanup, a bug in
intel_process_dri2_buffer_no_separate_stencil() became quite apparent.
We were associating the NULL pointer after an unreference with the
STENCIL attachment -- clarify the logic and attach the right region.

Reviewed-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Rely on intel_region_reference()'s support of *dst != NULL.
Eric Anholt [Wed, 29 Jun 2011 18:14:23 +0000 (11:14 -0700)]
intel: Rely on intel_region_reference()'s support of *dst != NULL.

Reviewed-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Allow intel_region_reference() with *dst != NULL.
Eric Anholt [Wed, 29 Jun 2011 18:09:49 +0000 (11:09 -0700)]
intel: Allow intel_region_reference() with *dst != NULL.

This should help us avoid leaking regions in region reference code by
making the API more predictable.

Reviewed-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Mark MESA_FORMAT_X8_Z24 as always supported.
Eric Anholt [Wed, 15 Jun 2011 19:02:12 +0000 (12:02 -0700)]
intel: Mark MESA_FORMAT_X8_Z24 as always supported.

This prevents developer surprise at seeing a GL_DEPTH_COMPONENT
texture have stencil bits, and avoids the metaops path accidentally
copying stencil bits around in glCopyTexImage(GL_DEPTH_COMPONENT) (and
being broken because swrast's glReadPixels(GL_UNSIGNED_INT_24_8) is
broken).

Acked-by: Chad Versace <chad@chad-versace.us>
13 years agoi965: Remove unused structures for command packets.
Kenneth Graunke [Thu, 30 Jun 2011 07:15:34 +0000 (00:15 -0700)]
i965: Remove unused structures for command packets.

We simply emit these using OUT_BATCH and bitshifting, as it results in
better compiled code than packed structures.  Since our documentation
is public, it's not terribly useful to keep these around for reference.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Convert system instruction pointer to OUT_BATCH style.
Kenneth Graunke [Thu, 30 Jun 2011 07:11:39 +0000 (00:11 -0700)]
i965: Convert system instruction pointer to OUT_BATCH style.

Also rename it from CMD_STATE_INSN_POINTER to CMD_STATE_SIP to match the
documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Convert PIPELINE_SELECT to OUT_BATCH style.
Kenneth Graunke [Thu, 30 Jun 2011 07:05:49 +0000 (00:05 -0700)]
i965: Convert PIPELINE_SELECT to OUT_BATCH style.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Emit 3DSTATE_VF_STATISTICS in OUT_BATCH style.
Kenneth Graunke [Thu, 30 Jun 2011 07:00:36 +0000 (00:00 -0700)]
i965: Emit 3DSTATE_VF_STATISTICS in OUT_BATCH style.

This is a little different from most because it's a single DWord;
there's no length field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Convert 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP to OUT_BATCH style.
Kenneth Graunke [Thu, 30 Jun 2011 06:50:05 +0000 (23:50 -0700)]
i965: Convert 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP to OUT_BATCH style.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agomesa: Fix the BindSampler unit limit.
Henri Verbeet [Sun, 3 Jul 2011 22:57:43 +0000 (00:57 +0200)]
mesa: Fix the BindSampler unit limit.

I'm not sure about this one. The current code actually follows the spec, but
considering the spec is supposed to be written against GL 3.2 I'd say the spec
is broken. I filled out a spec feedback form over a month ago, but either the
form is broken, or nobody cares.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agomesa: Fix a couple of TexEnv unit limits.
Henri Verbeet [Sun, 3 Jul 2011 22:57:42 +0000 (00:57 +0200)]
mesa: Fix a couple of TexEnv unit limits.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agomesa: Use the Elements macro for the sampler index assert in validate_samplers().
Henri Verbeet [Sun, 3 Jul 2011 22:57:42 +0000 (00:57 +0200)]
mesa: Use the Elements macro for the sampler index assert in validate_samplers().

This is probably nicer if the array size ever changes.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agomesa: Allow sampling from units >= MAX_TEXTURE_UNITS in shaders.
Henri Verbeet [Sun, 3 Jul 2011 22:57:42 +0000 (00:57 +0200)]
mesa: Allow sampling from units >= MAX_TEXTURE_UNITS in shaders.

The total number of units used by a shader is limited to MAX_TEXTURE_UNITS,
but the actual indices are only limited by MAX_COMBINED_TEXTURE_IMAGE_UNITS,
since they're shared between vertex and fragment shaders.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agomesa: Check the texture against all units in unbind_texobj_from_texunits().
Henri Verbeet [Sun, 3 Jul 2011 22:57:42 +0000 (00:57 +0200)]
mesa: Check the texture against all units in unbind_texobj_from_texunits().

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agonv50,nvc0: use screen instead of context for flush notifier
Christoph Bumiller [Thu, 7 Jul 2011 12:58:29 +0000 (14:58 +0200)]
nv50,nvc0: use screen instead of context for flush notifier

Context may become NULL and we still have to be able to flush
pending fences.

13 years agonv50: more formats for nv50_resource_copy_region conversion path
Christoph Bumiller [Tue, 28 Jun 2011 14:06:56 +0000 (16:06 +0200)]
nv50: more formats for nv50_resource_copy_region conversion path

It's not supposed to do conversion, but st sometimes asks us to.
Sometimes conversion is even wrong (e.g. between UNORM and SRGB).

This should now include all formats the 2D engine supports.

13 years agoi915g: Apply optimization to ADDS/MUL and only if we're not saturating.
Stéphane Marchesin [Thu, 7 Jul 2011 07:15:05 +0000 (00:15 -0700)]
i915g: Apply optimization to ADDS/MUL and only if we're not saturating.

13 years agost/xa: Fix up error reporting. Disable component alpha.
Thomas Hellstrom [Thu, 7 Jul 2011 08:18:24 +0000 (10:18 +0200)]
st/xa: Fix up error reporting. Disable component alpha.

Component alpha is temporarily disabled since it seems a bit buggy.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
13 years agost/xa: Fix render to xa_format_a8, which is backed by a gallium L8 texture
Thomas Hellstrom [Wed, 6 Jul 2011 19:58:33 +0000 (21:58 +0200)]
st/xa: Fix render to xa_format_a8, which is backed by a gallium L8 texture

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
13 years agoi915g: move code after declaration
Brian Paul [Wed, 6 Jul 2011 23:18:32 +0000 (17:18 -0600)]
i915g: move code after declaration

13 years agolinker: Assign locations for fragment shader output
Ian Romanick [Tue, 28 Jun 2011 00:59:58 +0000 (17:59 -0700)]
linker: Assign locations for fragment shader output

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

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

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
13 years agoglsl: Don't choke when printing an anonymous function parameter
Ian Romanick [Sat, 25 Jun 2011 00:30:41 +0000 (17:30 -0700)]
glsl: Don't choke when printing an anonymous function parameter

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoir_to_mesa: Allocate temporary instructions on the visitor's ralloc context
Ian Romanick [Sat, 25 Jun 2011 00:12:31 +0000 (17:12 -0700)]
ir_to_mesa: Allocate temporary instructions on the visitor's ralloc context

And don't delete them.  Let ralloc clean them up.  Deleting the
temporary IR leaves dangling references in the prog_instruction.  That
results in a bad dereference when printing the IR with MESA_GLSL=dump.

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>