profile/ivi/mesa.git
13 years agoi915: Fix depth texturing since 86e62b2357447b7c97f434be4834f4b50aa0764d
Eric Anholt [Mon, 11 Jul 2011 18:42:00 +0000 (11:42 -0700)]
i915: Fix depth texturing since 86e62b2357447b7c97f434be4834f4b50aa0764d

The 965 driver already had the X8_Z24 case, but 915 was missing it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi915: Use _mesa_get_format_name to describe translate_tex_format() fail.
Eric Anholt [Mon, 11 Jul 2011 18:34:56 +0000 (11:34 -0700)]
i915: Use _mesa_get_format_name to describe translate_tex_format() fail.

I don't want to go count up to what format number 29 is.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi915: Fix map/unmap mismatches from leaving INTEL_FALLBACK during TNL.
Eric Anholt [Mon, 11 Jul 2011 18:32:04 +0000 (11:32 -0700)]
i915: Fix map/unmap mismatches from leaving INTEL_FALLBACK during TNL.

The first rendering after context create didn't know of the color
buffer yet, triggering a sw fallback.  The intel_prepare_render() from
intelSpanRenderStart then found the buffer and turned off fallbacks,
but intelSpanRenderFinish was never called and things were left
mapped.  By checking buffers before making the call on whether to do
the fallback pipeline or not, we avoid the fallback change inside of
the rendering pipeline.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31561
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agointel: Use _mesa_tex_target_to_face() helper function instead of our own.
Eric Anholt [Mon, 11 Jul 2011 17:29:38 +0000 (10:29 -0700)]
intel: Use _mesa_tex_target_to_face() helper function instead of our own.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agor600g: emit SQ_LDS_RESOURCE_MGMT
Alex Deucher [Tue, 12 Jul 2011 16:00:10 +0000 (12:00 -0400)]
r600g: emit SQ_LDS_RESOURCE_MGMT

Need to be initialized to a reasonable value as
compute code may change it.

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

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agou_upload_mgr: add missing offset to src map in u_upload_buffer()
Brian Paul [Tue, 12 Jul 2011 15:47:48 +0000 (09:47 -0600)]
u_upload_mgr: add missing offset to src map in u_upload_buffer()

Fixes regression from dda8d7ac3f0e5148d9738a57f7bc03216f6514d1

13 years agost/mesa: check if _mesa_create_context() returns NULL
Emil Velikov [Mon, 11 Jul 2011 14:42:15 +0000 (15:42 +0100)]
st/mesa: check if _mesa_create_context() returns NULL

In some cases _mesa_create_context() can return NULL an in the mesa
state tracker, we do not concider the case, which may cause issues
within st_create_context_priv()

This patch adds a simple check (similar to the one in the dri drivers)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agoautoconf: Do not select Xlib when building DRI
Emil Velikov [Mon, 11 Jul 2011 14:58:29 +0000 (15:58 +0100)]
autoconf: Do not select Xlib when building DRI

As Chia-I Wu said 'There are two libGL providers, Xlib and DRI based
they cannot coexist'

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
13 years agost/mesa: choose a matching depth internal format for DrawPixels
Marek Olšák [Mon, 11 Jul 2011 21:38:49 +0000 (23:38 +0200)]
st/mesa: choose a matching depth internal format for DrawPixels

This makes it easier to hit the fast path and get a float format
when we ask for it.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoconfigure.ac: Make --{without,with}-gallium-drivers work as expected
Ian Romanick [Wed, 22 Jun 2011 18:35:27 +0000 (11:35 -0700)]
configure.ac: Make --{without,with}-gallium-drivers work as expected

This version is mostly Dan's post to the mesa-dev mailing list on
6/22/2011.

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
13 years agost/mesa: get rid of unnecessary 'goto' in DrawPixels
Marek Olšák [Mon, 11 Jul 2011 16:32:48 +0000 (18:32 +0200)]
st/mesa: get rid of unnecessary 'goto' in DrawPixels

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: derive a stencil sampler format from the actual texture format
Marek Olšák [Mon, 11 Jul 2011 17:54:27 +0000 (19:54 +0200)]
st/mesa: derive a stencil sampler format from the actual texture format

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agogallivm: Re-enable LLVMUnionTypeKind case for llvm-2.7 only.
Vinson Lee [Mon, 11 Jul 2011 21:08:24 +0000 (14:08 -0700)]
gallivm: Re-enable LLVMUnionTypeKind case for llvm-2.7 only.

LLVMUnionTypeKind is not in llvm-2.6, llvm-2.8, llvm-2.9, or llvm-3.0svn.

13 years agodri/nouveau: nv10: fix vertex format for GL_UNSIGNED_BYTE
Andrew Randrianasulu [Mon, 11 Jul 2011 20:05:13 +0000 (22:05 +0200)]
dri/nouveau: nv10: fix vertex format for GL_UNSIGNED_BYTE

Broken accidentally in f4efc256fd90beaff86321e4c6ce00f9be55092d,
the switch to rnn headers.

NV10TCL_VTXFMT_TYPE_BYTE_RGBA became U8_UNORM but B8G8R8A8_UNORM
was used instead.

13 years agonvfx: handle PIPE_CAP_SM3
David Heidelberger [Mon, 11 Jul 2011 19:50:24 +0000 (21:50 +0200)]
nvfx: handle PIPE_CAP_SM3

Signed-off-by: David Heidelberger <d.okias@gmail.com>
13 years agogallivm: Remove LLVMOpaqueKindType case with llvm-3.0.
Vinson Lee [Mon, 11 Jul 2011 19:48:06 +0000 (12:48 -0700)]
gallivm: Remove LLVMOpaqueKindType case with llvm-3.0.

llvm-3.0svn r134829 removed LLVMOpaqueKindType from enum LLVMTypeKind in
include/llvm-c/Core.h.

13 years agoglsl: Reject ambiguous function calls (multiple inexact matches).
Kenneth Graunke [Sat, 9 Jul 2011 07:20:34 +0000 (00:20 -0700)]
glsl: Reject ambiguous function calls (multiple inexact matches).

According to the GLSL 1.20 specification, "it is a semantic error if
there are multiple ways to apply [implicit] conversions [...] such that
the call can be made to match multiple signatures."

Fixes a regression caused by 60eb63a855cb89962f2d5bb91e238ff2d1ab8702,
which implemented the wrong policy of finding a "closest" match.
However, this is not a revert, since the original code failed to
continue looking for an exact match once it found two inexact matches.

It's OK to have multiple inexact matches if there's also an exact match.

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38971
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/gen7: Add support for gl_PointCoord.
Kenneth Graunke [Wed, 29 Jun 2011 22:18:55 +0000 (15:18 -0700)]
i965/gen7: Add support for gl_PointCoord.

This is exactly analogous to Eric's Gen6 change in commit
6861a701772eac3a6a7d3136d03efa7ac7e5c026.  His explanation:

"This is just like PointSprite overrides, but it's always on for that
 attribute."

Fixes glsl-fs-pointcoord and gtf/point_sprites.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 7.11 branch.

13 years agoi965/gen7: Fix point sprite texture coordinate overrides.
Kenneth Graunke [Wed, 29 Jun 2011 22:11:22 +0000 (15:11 -0700)]
i965/gen7: Fix point sprite texture coordinate overrides.

This is exactly analogous to Eric's Gen6 change in commit
f304bb8a5d040d99db47a65813d216d11c66fb47.  His explanation:

"We were assuming that the input attribute n to the FS was
 FRAG_ATTRIB_TEXn, which happened to be true often enough for our
 testcases."

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 7.11 branch.

13 years agoi965/gen7: Refactor SF setup a bit to handle overrides in one place.
Kenneth Graunke [Wed, 29 Jun 2011 22:05:52 +0000 (15:05 -0700)]
i965/gen7: Refactor SF setup a bit to handle overrides in one place.

This is exactly analogous to Eric's Gen6 change in commit
e7280b16d634e1f434bebbce83996b3d30d0419c.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 7.11 branch.

13 years agoi965/gen4: Add a stub dumper for CC unit state, which is different from gen6.
Eric Anholt [Fri, 8 Jul 2011 21:15:57 +0000 (14:15 -0700)]
i965/gen4: Add a stub dumper for CC unit state, which is different from gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/gen4: Add state dumping for unit state using state_batch_list[].
Eric Anholt [Fri, 8 Jul 2011 21:09:47 +0000 (14:09 -0700)]
i965/gen4: Add state dumping for unit state using state_batch_list[].

This is just barely more pretty-printing than we previously had, but
at least it doesn't leave out unit states in the log.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/gen6: Add state dumping for the VS constants.
Eric Anholt [Fri, 8 Jul 2011 20:35:42 +0000 (13:35 -0700)]
i965/gen6: Add state dumping for the VS constants.

This is quite a bit of spam, but I think it's useful to have in a full
INTEL_DEBUG=batch dump.  And a lot of this spam on glxgears is just
because we're awful at handling our constants :/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/gen6: Add state dumping for the scissor packet.
Eric Anholt [Fri, 8 Jul 2011 20:02:28 +0000 (13:02 -0700)]
i965/gen6: Add state dumping for the scissor packet.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: When dumping programs, dump the whole cache. But don't by default.
Eric Anholt [Thu, 23 Jun 2011 00:11:00 +0000 (17:11 -0700)]
i965: When dumping programs, dump the whole cache.  But don't by default.

The previous brw_state_dump output was rather useless -- last used
program per batch, and just the hex.  Now we dump all programs (since
we don't know which were used), and disassemble them.  But that's a
ton of spam, and usually when looking into program contents we use
INTEL_DEBUG={vs,wm,misc,other} and when looking into state updates we
use INTEL_DEBUG=batch, so this dump usually just massively clutters up
the output.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Dump the binding table using state_batch_list[].
Eric Anholt [Thu, 23 Jun 2011 00:01:03 +0000 (17:01 -0700)]
i965: Dump the binding table using state_batch_list[].

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Dump the surface, sampler, and sdc state using state_batch_list[].
Eric Anholt [Wed, 22 Jun 2011 23:53:06 +0000 (16:53 -0700)]
i965: Dump the surface, sampler, and sdc state using state_batch_list[].

Now, for example, INTEL_DEBUG=batch tex-border-1 shows all the
texturing state involved.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Dump brw_state_batch data in an easier format for cross-referencing.
Eric Anholt [Wed, 22 Jun 2011 23:10:56 +0000 (16:10 -0700)]
i965: Dump brw_state_batch data in an easier format for cross-referencing.

Now that we're using state base addresses for most things, we're less
interested in the absolute address of the state, and more in its
offset from the state base address (start of batchbuffer).  Also,
reorder the printout so it looks more like the batchbuffer dump.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Map the batch once for dumping all our state batch structs.
Eric Anholt [Wed, 22 Jun 2011 23:12:29 +0000 (16:12 -0700)]
i965: Map the batch once for dumping all our state batch structs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Move the new gen6 state structs to using state_batch_list[].
Eric Anholt [Wed, 22 Jun 2011 23:03:05 +0000 (16:03 -0700)]
i965: Move the new gen6 state structs to using state_batch_list[].

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Move the SF VP state dump to using the state_batch_list[]
Eric Anholt [Wed, 22 Jun 2011 22:58:50 +0000 (15:58 -0700)]
i965: Move the SF VP state dump to using the state_batch_list[]

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
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>