OSDN Git Service

android-x86/external-mesa.git
12 years agoglsl: When lowering non-constant array indexing, respect existing conditions
Ian Romanick [Mon, 18 Jul 2011 00:33:26 +0000 (17:33 -0700)]
glsl: When lowering non-constant array indexing, respect existing conditions

If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Fixes i965 piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-col-wr
    fs-temp-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 5f83dfe5b70337bcffe215f7c32d0b862b5e7a3b)

12 years agoglsl: Rework lowering of non-constant array indexing
Ian Romanick [Mon, 18 Jul 2011 19:18:19 +0000 (12:18 -0700)]
glsl: Rework lowering of non-constant array indexing

The previous implementation could easily get tricked if the LHS of an
assignment included a non-constant index that was "inside" another
dereference.  For example:

    mat4 m[2];
    m[0][i] = vec4(0.0);

Due to the way it tracked whether the array was being assigned, it
would think that the non-constant index was in an r-value.  The new
code fixes that by tracking l-values and r-values differently.  The
index is also replaced by cloning the IR and replacing the index
variable instead of the odd way it was done before.

v2: Apply some simplifications suggested by Eric Anholt.  Making
assignment_generator::rvalue be ir_dereference instead of ir_rvalue
simplified the code a bit.

Fixes i965 piglit fs-temp-array-mat[234]-index-wr and
vs-varying-array-mat[234]-index-wr.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34691
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1731ac308631138ca98d34e8b7070c6e3f981939)

To make bisects work, this also squashes in:

glsl: Correctly return progress from lower_variable_index_to_cond_assign

lower_variable_index_to_cond_assign runs until it can't make any more
progress.  It then returns the result of the last pass which will
always be false.  This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign.  This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.

In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements.  This is easily controlled by
switch_generator::linear_sequence_max_length.  This would generate
much better code on architectures without any flow contol.

Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c1e591eed41b45c0fcf1dcac8b1b8aaeb6237a38)

12 years agoglsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
Ian Romanick [Mon, 18 Jul 2011 17:07:24 +0000 (10:07 -0700)]
glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering

Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d2296e784aa8fad81c4910dcbbf61e826ce9a06a)

12 years agoglsl: Move is_array_or_matrix outside visitor class
Ian Romanick [Mon, 18 Jul 2011 16:51:34 +0000 (09:51 -0700)]
glsl: Move is_array_or_matrix outside visitor class

There's no reason for it to be there, and another class that may not
have access to the visitor will need it soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8d5f3cef795428d7a95120416122a39c10cff11c)

12 years agoconfigure.ac: add DLOPEN_LIBS to xlib build
Marek Olšák [Mon, 25 Jul 2011 23:05:51 +0000 (01:05 +0200)]
configure.ac: add DLOPEN_LIBS to xlib build

Otherwise xlib-based llvmpipe fails to link.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 0aed27ee37860ba332df776425d89d97ca1168b2)

12 years agowayland-drm: Add copyright notice to protocol
Benjamin Franzke [Wed, 27 Jul 2011 08:04:51 +0000 (10:04 +0200)]
wayland-drm: Add copyright notice to protocol

Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.
(cherry picked from commit 79dcfb266aa6ff14ff21c0b6dddef6060b450c32)

12 years agoegl/gallium: fix build without softpipe and llvmpipe
Tobias Droste [Thu, 14 Jul 2011 20:32:58 +0000 (22:32 +0200)]
egl/gallium: fix build without softpipe and llvmpipe

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit d4d5e3a336f4c1f2208faad57a985f711b09d86d)

12 years agoFix broken merge in cherry-pick from 42cdf407
Benjamin Franzke [Wed, 27 Jul 2011 07:21:39 +0000 (09:21 +0200)]
Fix broken merge in cherry-pick from 42cdf407

Was cherry-picked to 337102684b78ce860337f8c7db446fbc2b227553.

12 years agoutil: enable S3TC support when the force_s3tc_enable env var is set to "true"
Bryan Cain [Wed, 20 Jul 2011 22:35:22 +0000 (17:35 -0500)]
util: enable S3TC support when the force_s3tc_enable env var is set to "true"

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

12 years agost/mesa: respect force_s3tc_enable environment variable
Bryan Cain [Mon, 25 Jul 2011 18:30:17 +0000 (13:30 -0500)]
st/mesa: respect force_s3tc_enable environment variable

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

12 years agoconfigure.ac: do not check for llvm-config if llvm is disabled
Marek Olšák [Sat, 23 Jul 2011 13:57:51 +0000 (15:57 +0200)]
configure.ac: do not check for llvm-config if llvm is disabled

12 years agoconfigure: Move gbm before egl in SRC_DIRS
Benjamin Franzke [Mon, 25 Jul 2011 07:37:02 +0000 (09:37 +0200)]
configure: Move gbm before egl in SRC_DIRS

egl_dri2 built into libEGL depends on libgbm.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39515
(cherry picked from commit 42cdf4074e0f7d561b03a86255fa8f916f906bf6)

13 years agoconfigure.ac: check for libdrm_radeon only when building classic
Marek Olšák [Thu, 21 Jul 2011 20:31:24 +0000 (22:31 +0200)]
configure.ac: check for libdrm_radeon only when building classic
(cherry picked from commit 50e32fefb1140a42101b1154d3df78db4906ee38)

13 years agoglsl: Reject shaders that contain static recursion
Ian Romanick [Mon, 11 Jul 2011 17:46:01 +0000 (10:46 -0700)]
glsl: Reject shaders that contain static recursion

The GLSL 1.20 and later specs say:

    "Recursion is not allowed, not even statically. Static recursion is
    present if the static function call graph of the program contains
    cycles."

Recursion is detected and rejected both a compile-time and at
link-time.  The complie-time check happens to detect some cases that
may be removed by various optimization passes.  The spec doesn't seem
to allow this, but other vendors (e.g., NVIDIA) appear to only check
at link-time after all optimizations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 02c5ae1b3fef75d5c0a715313a69e6b95ebd5b95)

This also squashes in the following commit to make sure that bisects
in scons builds work:

glsl: Add ir_function_detect_recursion.cpp to SConscript.
(cherry picked from commit 76bccaff0c54aed10ffbc7c7dc744f1708921409)

13 years agoglsl: Make prototype_string publicly available
Ian Romanick [Fri, 8 Jul 2011 17:34:38 +0000 (10:34 -0700)]
glsl: Make prototype_string publicly available

Also clarify the documentation for one of the parameters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1ad3ba4ad954b86751bd5b6ad0a431920bff9958)

13 years agoRevert "i915: Eliminate redundant CONSTANTS updates"
Stéphane Marchesin [Thu, 7 Jul 2011 02:17:15 +0000 (19:17 -0700)]
Revert "i915: Eliminate redundant CONSTANTS updates"

This reverts commit 87641cffd97f328e846604d314c21582f426a19a.
(cherry picked from commit 3c0c6248795806bb9e66bb89a7adc8fc0cf266d7)

13 years agou_vbuf_mgr: restore buffer offsets
Chia-I Wu [Wed, 20 Jul 2011 10:52:33 +0000 (18:52 +0800)]
u_vbuf_mgr: restore buffer offsets

u_vbuf_upload_buffers modifies the buffer offsets.  If they are not
restored, and any of the vertex formats is not supported natively, the
next u_vbuf_mgr_draw_begin call will translate the vertex buffers with
incorrect buffer offsets.
(cherry picked from commit afc160e1c8f87d0a76e41f1100d528d8ab82ecc4)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
13 years agor600g: more valgrind fixes
Marek Olšák [Mon, 11 Jul 2011 02:13:35 +0000 (04:13 +0200)]
r600g: more valgrind fixes
(cherry picked from commit dc9d789d1b39f9702c179a1d60f76535352563df)

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.
(cherry picked from commit daf6604435594b2ec861a40eaf4c5a23c97c0714)

13 years agoconfigure.ac: Check for the respective libdrm_* when building gallium drivers
Marek Olšák [Thu, 21 Jul 2011 12:57:19 +0000 (14:57 +0200)]
configure.ac: Check for the respective libdrm_* when building gallium drivers

In a rare case of building gallium only, we need to
check if the required packages are available

libdrm_[intel|nouveau] - gallium[i915 i965|nouveau]

v2: r300g and r600g do not need libdrm_radeon

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit c2426bbf862850504f24e7d9765e64a75b873f3b)

Conflicts:

configure.ac

13 years agomesa: GLES2 should return different error enums for invalid fbo queries
Marek Olšák [Tue, 19 Jul 2011 01:05:07 +0000 (03:05 +0200)]
mesa: GLES2 should return different error enums for invalid fbo queries

ES 2.0.25 page 127 says:

  If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
  querying any other pname will generate INVALID_ENUM.

See also:
b9e9df78a03edb35472c2e231aef4747e09db792

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 000896c0bb99f356e52854608a29476d3ade387c)

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 agoi965: Apply a homebrew workaround for GPU hang in OGLC api-texcoord.
Eric Anholt [Tue, 19 Jul 2011 22:06:15 +0000 (15:06 -0700)]
i965: Apply a homebrew workaround for GPU hang in OGLC api-texcoord.

The behavior of flushes in the hardware is a maze of twisty passages,
and strangely the VS constants appear to be loaded during a pipeline
flush instead of at the time of the packet emit according to the
simulator.  On moving the STATE_BASE_ADDRESS packet to where it really
needed to live (in order for data loads by other packets to be
correct), we sometimes no longer got a flush between those packets
where we apparently needed it.  This replicates the flushes implied by
a STATE_BASE_ADDRESS update, fixing the GPU hangs in OGLC and the
"engine" demo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36821
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39257
Tested-by: Keith Packard <keithp@keithp.com> (bzflag and etracer fixed)
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e5d36267d8c9536490c902f785137a7fa0637fc)

13 years agoi965: Enable the PIPE_CONTROL workaround workaround out of paranoia.
Eric Anholt [Tue, 19 Jul 2011 00:17:03 +0000 (17:17 -0700)]
i965: Enable the PIPE_CONTROL workaround workaround out of paranoia.

There's scary stuff going on in PIPE_CONTROL internals, and if the
BSpec says to do this to make PIPE_CONTROL work, I'll go ahead and do
it because we'll probably never be able to debug it after the fact.

v2: Use stall at scoreboard instead of depth stall, as noted by Ken.
(cherry picked from commit 407785d0e97abd0cc51a6e360089111973748e7c)

13 years agoi965: Avoid kernel BUG_ON if we happen to wait on the pipe_control w/a BO.
Eric Anholt [Mon, 18 Jul 2011 22:25:10 +0000 (15:25 -0700)]
i965: Avoid kernel BUG_ON if we happen to wait on the pipe_control w/a BO.

For this and occlusion queries, we're trying to avoid setting
I915_GEM_DOMAIN_RENDER for the write domain, because the data written
is definitely not going through the render cache, but we do need to
tell the kernel that the object has been written.  However, with using
I915_GEM_DOMAIN_GTT, the kernel on retiring the batchbuffer sees that
the w/a BO has a write domain of GTT, and puts it on the flushing
list.  If something tries to wait for that BO to finish rendering
(such as the AUB dumper reading the contents of BOs), we get into
wait_request (since obj->active) but with a 0 seqno (since the object
is on the flushing list, not actually on a ringbuffer), and BUG_ONs.

To avoid the kernel bug (which I'm hoping to delete soon anyway), just
use I915_GEM_DOMAIN_INSTRUCTION like occlusion queries do.  This
doesn't result in more flushing, because we invalidate INSTRUCTION on
every batchbuffer now that we're state streaming, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dc7422405f6f3c201993251e4665bb9ec1b59db0)

13 years agoi915: Simplify intel_wpos_* with a helper function.
Eric Anholt [Wed, 13 Jul 2011 17:57:58 +0000 (10:57 -0700)]
i915: Simplify intel_wpos_* with a helper function.
(cherry picked from commit cb5e0ba2aa97df28a9faeb7ca0d2f0cdfcf4e507)

13 years agoi915: Include gl_FragCoord.w data, not just xyz.
Eric Anholt [Wed, 13 Jul 2011 17:56:37 +0000 (10:56 -0700)]
i915: Include gl_FragCoord.w data, not just xyz.

Fixes piglit fragcoord_w test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34323
(cherry picked from commit fceda4342cadc22ce86877a19bf82b86eb022d79)

13 years agoi915: Fix incorrect depth scaling when enabling/disabling depth buffers.
Eric Anholt [Tue, 12 Jul 2011 20:47:21 +0000 (13:47 -0700)]
i915: Fix incorrect depth scaling when enabling/disabling depth buffers.

We were updating our new viewport using the old buffers' _WindowMap.m.
We can do less math and avoid using that deprecated matrix by just
folding the viewport calculation right in to the driver.

Fixes piglit fbo-depthtex.
(cherry picked from commit debf751aeaf0f02b9a7fc0e242ae3b97dde8416f)

13 years agoi915: Make stencil test for no-stencil handling match depth test.
Eric Anholt [Tue, 12 Jul 2011 17:57:51 +0000 (10:57 -0700)]
i915: Make stencil test for no-stencil handling match depth test.

i915_update_draw_buffers() already handles the fallback bit for
missing stencil region, so here we just need to handle whether the GL
thinks we have stencil data or not (and disable the test if so).
(cherry picked from commit 79fee3a76b7f4f63d01266fc3a3cd6ca44d1e513)

13 years agoi915: Disable the depth test whenever we don't have a depth buffer.
Eric Anholt [Tue, 12 Jul 2011 17:48:40 +0000 (10:48 -0700)]
i915: Disable the depth test whenever we don't have a depth buffer.

We were disabling it once at the moment we changed draw buffers, but
later enabling of depth test could turn it back on.  Fixes
fbo-nodepth-test.

Note that ctx->DrawBuffer has to be checked because during context
create we get called while it's still unset.  However, we know we'll
get an intel_draw_buffer() after that, so it's safe to make a silly
choice at this point.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30080
(cherry picked from commit fc4fba52cf7e9616c70dd76b4d6bdba6582e157b)

13 years agoi915: Remove i965 paths from i915_update_drawbuffer() and i830's too.
Eric Anholt [Tue, 12 Jul 2011 17:03:41 +0000 (10:03 -0700)]
i915: Remove i965 paths from i915_update_drawbuffer() and i830's too.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 4c47fce92e381cb182b51ce6d0727c0a1365e8b0)

13 years agoi965: Remove i915 paths from brw_update_draw_buffers().
Eric Anholt [Tue, 12 Jul 2011 16:52:04 +0000 (09:52 -0700)]
i965: Remove i915 paths from brw_update_draw_buffers().

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 94efc350b4146b2fb82d45eeb78bd6be6f06fb9c)

13 years agoi965: Remove unused region calculations in brw_update_draw_buffer().
Eric Anholt [Tue, 12 Jul 2011 16:49:23 +0000 (09:49 -0700)]
i965: Remove unused region calculations in brw_update_draw_buffer().

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit c68270a26b110e97ee93d49249025d56c771cc5f)

13 years agoi965: Remove empty brw_set_draw_region.
Eric Anholt [Tue, 12 Jul 2011 16:48:08 +0000 (09:48 -0700)]
i965: Remove empty brw_set_draw_region.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 15af0f54b87ea337d419b50010037a3db8e2503c)

13 years agoi965: Remove FALLBACK() from brw_update_draw_region().
Eric Anholt [Tue, 12 Jul 2011 16:47:38 +0000 (09:47 -0700)]
i965: Remove FALLBACK() from brw_update_draw_region().

The 965 driver doesn't use these for deciding on fallbacks.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit dd898c3e89597f841a55272be1ccc07345500f60)

13 years agointel: Move intel_draw_buffers() code into each driver.
Eric Anholt [Tue, 12 Jul 2011 16:43:22 +0000 (09:43 -0700)]
intel: Move intel_draw_buffers() code into each driver.

The illusion of shared code here wasn't fooling anybody.  It was
tempting to keep i830 and i915 still shared, but I think I actually
want to make them diverge shortly.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit f34ec6169dc8b96e3958a42b51c9048c5f42ed80)

13 years agoglsl: silence warning in linker.cpp
Brian Paul [Wed, 20 Jul 2011 03:10:25 +0000 (21:10 -0600)]
glsl: silence warning in linker.cpp
(cherry picked from commit 4470ff2ebf56b22421038bc7272ef22c085b839d)

13 years agoMake it possible to use gbm with c++
Jørgen Lind [Tue, 19 Jul 2011 20:52:20 +0000 (22:52 +0200)]
Make it possible to use gbm with c++

NOTE: This is a candiate for 7.11
(cherry picked from commit 496bf3822a724127b2632596dc45648fdeda0afb)

13 years agoglsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Paul Berry [Fri, 24 Jun 2011 22:34:04 +0000 (15:34 -0700)]
glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.

Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 3097715d41da4b725b7ce9f9d5bbc0f684cbf0a6)

13 years agoglsl: Changed extension enable bits to bools.
Paul Berry [Fri, 24 Jun 2011 19:33:30 +0000 (12:33 -0700)]
glsl: Changed extension enable bits to bools.

These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9c4445de6e69d021491361d884bf172c05189d61)

13 years agoprog_optimize: fix a warning that a variable may be uninitialized
Marek Olšák [Fri, 15 Jul 2011 18:57:39 +0000 (20:57 +0200)]
prog_optimize: fix a warning that a variable may be uninitialized

(cherry picked from commit dade65505bdf62da448479e316cc7f4f2da22417)
Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Bump version to 7.11-rc2
Ian Romanick [Tue, 19 Jul 2011 21:20:21 +0000 (14:20 -0700)]
mesa: Bump version to 7.11-rc2

13 years agomesa: remove depend files from tarballs
Brian Paul [Tue, 19 Jul 2011 15:29:48 +0000 (09:29 -0600)]
mesa: remove depend files from tarballs

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoglsl: Correctly handle function matching when there are multiple inexact matches
Kenneth Graunke [Tue, 14 Jun 2011 23:28:32 +0000 (16:28 -0700)]
glsl: Correctly handle function matching when there are multiple inexact matches

This is a squash cherry pick commit of:

    glsl: Find the "closest" signature when there are multiple matches.

    Previously, ir_function::matching_signature had a fatal bug: if a
    function had more than one non-exact match, it would simply return NULL.

    This occured, for example, when looking for max(uvec3, uvec3):
    - max(vec3, vec3)   -> score 1 (found first)
    - max(ivec3, ivec3) -> score 1 (found second...used to return NULL here)
    - max(uvec3, uvec3) -> score 0 (exact match...the right answer)

    This did not occur for max(ivec3, ivec3) since the second match found
    was an exact match.

    The new behavior is to return a match with the lowest score.  If there
    is an exact match, that will be returned.  Otherwise, a match with the
    least number of implicit conversions is chosen.

    Fixes piglit tests max-uvec3.vert and glsl-inexact-overloads.shader_test.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 60eb63a855cb89962f2d5bb91e238ff2d1ab8702)

    glsl: Suppress warning from matching_signature change.

    gcc isn't smart enough to see that we only look at matched_score after
    we've initialized it (because match != NULL happens at the same time)
    (cherry picked from commit b043409adfa6ffa6dc78331258de52f7fa6d59aa)

    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>
    (cherry picked from commit 7304909d6537e00252347a10d0bae54ffd77ff91)

13 years agoglsl: Ensure that sampler declarations are always uniform or "in" parameters.
Paul Berry [Tue, 12 Jul 2011 19:03:02 +0000 (12:03 -0700)]
glsl: Ensure that sampler declarations are always uniform or "in" parameters.

This brings us into compliance with page 17 (page 22 of the PDF) of
the GLSL 1.20 spec:

    "[Sampler types] can only be declared as function parameters or
    uniform variables (see Section 4.3.5 "Uniform"). ... [Samplers]
    cannot be used as out or inout function parameters."

The spec isn't explicit about whether this rule applies to
structs/arrays containing shaders, but the intent seems to be to
ensure that it can always be determined at compile time which sampler
is being used in each texture lookup.  So to avoid creating a
loophole, the rule needs to apply to structs/arrays containing shaders
as well.

Fixes piglit tests spec/glsl-1.10/compiler/samplers/*.frag, and fixes
bug 38987.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38987
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f07221056e1822187546b76387714b3172f9b2c5)

13 years agoglsl: Move type_contains_sampler() into glsl_type for later reuse.
Paul Berry [Mon, 11 Jul 2011 23:44:13 +0000 (16:44 -0700)]
glsl: Move type_contains_sampler() into glsl_type for later reuse.

The new location, as a member function of glsl_type, is more
consistent with queries like is_sampler(), is_boolean(), is_float(),
etc.  Placing the function inside glsl_type also makes it available to
any code that uses glsl_types.
(cherry picked from commit ddc1c96390b685bb95f7431e862c3a64fcefa085)

13 years agolinker: Only over-ride built-ins when a prototype has been seen
Ian Romanick [Wed, 29 Jun 2011 21:52:10 +0000 (14:52 -0700)]
linker: Only over-ride built-ins when a prototype has been seen

The GLSL spec says:

    "If a built-in function is redeclared in a shader (i.e., a
    prototype is visible) before a call to it, then the linker will
    only attempt to resolve that call within the set of shaders that
    are linked with it."

This patch enforces this behavior.  When a function call is processed
a flag is set in the ir_call to indicate whether the previously seen
prototype is the built-in or not.  At link time a call will only bind
to an instance of a function that matches the "want built-in" setting
in the ir_call.

This has the odd side effect that first call to abs() in the shader
below will call the built-in and the second will not:

float foo(float x) { return abs(x); }
float abs(float x) { return -x; }
float bar(float x) { return abs(x); }

This seems insane, but it matches what the spec says.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31744
(cherry picked from commit 66f4ac988d5053c9782d1390541b04f4d9c50078)

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>
(cherry picked from commit db311b45beb60630ad3e3c803631c2b6c1472347)

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>
(cherry-picked from commit 186e37c75454965e1a58298e878a9585f4866749)

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>
(cherry-picked from commit 147d0102952b7c0b16906c08da2ae447ec68185a)

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>
(cherry-picked from commit 5edb3ddf4191b31b4a4e43a85fe1bfbd62a8cb17)

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).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry-picked from commit 57b57f6d1c3689a3a44222cb169bfd3e3142a68d)

13 years agoglx: Avoid calling __glXInitialize() in driReleaseDrawables().
Henri Verbeet [Sun, 17 Jul 2011 22:42:27 +0000 (00:42 +0200)]
glx: Avoid calling __glXInitialize() in driReleaseDrawables().

This fixes a regression introduced by commit
a26121f37530619610a78a5fbe5ef87e44047fda (fd.o bug #39219).

Since the __glXInitialize() call should be unnecessary anyway, this is
probably a nicer fix for the original problem too.

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

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: padfoot@exemail.com.au
(cherry picked from commit 0f20e2e18f902b4319851643e1775a18c2aacb3d)

13 years agointel: Fix stencil buffer to be W tiled
Chad Versace [Mon, 18 Jul 2011 07:37:45 +0000 (00:37 -0700)]
intel: Fix stencil buffer to be W tiled

Until now, the stencil buffer was allocated as a Y tiled buffer, because
in several locations the PRM states that it is. However, it is actually
W tiled. From the PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section
4.5.2.1 W-Major Format:
    W-Major Tile Format is used for separate stencil.

The GTT is incapable of W fencing, so we allocate the stencil buffer with
I915_TILING_NONE and decode the tile's layout in software.

This fix touches the following portions of code:
    - In intel_allocate_renderbuffer_storage(), allocate the stencil
      buffer with I915_TILING_NONE.
    - In intel_verify_dri2_has_hiz(), verify that the stencil buffer is
      not tiled.
    - In the stencil buffer's span functions, the tile's layout must be
      decoded in software.

This commit mutually depends on the xf86-video-intel commit
    dri: Do not tile stencil buffer
    Author: Chad Versace <chad@chad-versace.us>
    Date:   Mon Jul 18 00:38:00 2011 -0700

On Gen6 with separate stencil enabled, fixes the following Piglit tests:
    bugs/fdo23670-drawpix_stencil
    general/stencil-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-readpixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-copypixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels
    spec/EXT_packed_depth_stencil/readpixels-24_8

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f7dbcba280e4397cadb14f230aa925b4143cdde4)

13 years agor600g: fix corner case checks for the queries
Vadim Girlin [Sat, 16 Jul 2011 00:58:58 +0000 (04:58 +0400)]
r600g: fix corner case checks for the queries

13 years agonv50,nvc0: add correct storage type for Z32_FLOAT
Christoph Bumiller [Mon, 18 Jul 2011 11:48:19 +0000 (13:48 +0200)]
nv50,nvc0: add correct storage type for Z32_FLOAT

13 years agonv50,nvc0: don't advertise unaligned texture format support
Christoph Bumiller [Mon, 11 Jul 2011 09:31:18 +0000 (11:31 +0200)]
nv50,nvc0: don't advertise unaligned texture format support

Because we don't support them.
For instance, R32G32B32 is not R32G32B32X32 as was assumed.

Add support for R8G8B8X8_UNORM instead of R8G8B8_UNORM surfaces.

13 years agor600g: fix queries and predication
Vadim Girlin [Fri, 15 Jul 2011 03:22:20 +0000 (07:22 +0400)]
r600g: fix queries and predication

Use all zpass data for predication instead of the last block only.
Use query buffer as a ring instead of reusing the same area
for each new BeginQuery. All query buffer offsets are in bytes
to simplify offsets math.

13 years agor600c/g: add new NI pci ids
Alex Deucher [Fri, 15 Jul 2011 14:55:02 +0000 (10:55 -0400)]
r600c/g: add new NI pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 years agotargets/egl-static: fix a linking error
Chia-I Wu [Wed, 13 Jul 2011 07:25:46 +0000 (15:25 +0800)]
targets/egl-static: fix a linking error

rbug is always linked in and it needs libpthread.
(cherry picked from commit 5fe5d236c26b3b2428bc7395304e40cf21d3d3e1)

13 years agoi915: Add support for gl_FragData[0] for output color.
Eric Anholt [Tue, 12 Jul 2011 22:31:39 +0000 (15:31 -0700)]
i915: Add support for gl_FragData[0] for output color.

We advertised ARB_draw_buffers, but either fell back to software when
using this output, or assertion failed.  Fixes glsl-fs-fragdata-1, and
failures in some webgl conformance tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39024
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34906
(cherry picked from commit 556a47a2621073185be83a0a721a8ba93392bedb)

13 years agoi915: Fix NPOT compressed textures on 915.
Eric Anholt [Mon, 11 Jul 2011 23:50:06 +0000 (16:50 -0700)]
i915: Fix NPOT compressed textures on 915.

We were failing at rounding, misplacing the non-baselevels.  Fixes:
3DFX_texture_compression_FXT1/fbo-generate-mipmaps
ARB_texture_compression/fbo-generate-mipmaps
EXT_texture_compression_s3tc/fbo-generate-mipmaps

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f2fd0d63046c41559c5dfca9ebdc5d33c0ae4177)

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>
(cherry picked from commit 6e6b38860488a0b2b282866f095cea9860503a14)

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>
(cherry picked from commit 46a7639174d2c55c30ec24b179cbef059fb3ca43)

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>
(cherry picked from commit e3ea5bc08e32119d05bce543c07c61ce93869e60)

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>
(cherry picked from commit 007c2d6cd2f6b206564689ac12a3e51aaae242bc)

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>
(cherry picked from commit 036b74a7f8adc745c7af089129f070b8e5b8f4bd)
(cherry picked from commit d8f65c07e9f3a5948c8bee95482bcab651b33c01)

13 years agoglsl: Fix make clean for dricore.
Eric Anholt [Wed, 6 Jul 2011 04:59:33 +0000 (21:59 -0700)]
glsl: Fix make clean for dricore.
(cherry picked from commit abbbd14dd440cfbbe8b42279cf95c30eec5b495d)

13 years agoi965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
Eric Anholt [Sun, 19 Jun 2011 19:04:46 +0000 (12:04 -0700)]
i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.

This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
(cherry picked from commit a09c5c2e3053c48a33134cf28229105bfef52e6f)

13 years agoi965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
Eric Anholt [Sun, 19 Jun 2011 18:33:40 +0000 (11:33 -0700)]
i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.

The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.
(cherry picked from commit cd7bfd5d44f543246faa7ad6ff2f8309189be963)

13 years agoi915g: don't try to check if a NULL buffer is busy.
Stéphane Marchesin [Wed, 13 Jul 2011 18:59:10 +0000 (11:59 -0700)]
i915g: don't try to check if a NULL buffer is busy.

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 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.
(cherry picked from commit d60880db35fd11d9348ce4b2bfbcc9325d2ebf91)

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
(cherry picked from commit bb0d5cae002f288f822dc9c90e6cd4eaf660c464)

13 years agoconfigure: Require libudev for drm & wayland egl platforms
Benjamin Franzke [Sat, 2 Jul 2011 11:46:42 +0000 (13:46 +0200)]
configure: Require libudev for drm & wayland egl platforms

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 7ed1826e2e2a5b5c4840821c92ef7273efe32e24)

13 years agoconfigure: Fix typo in gbm check for egl drm platform
Benjamin Franzke [Sat, 2 Jul 2011 11:46:09 +0000 (13:46 +0200)]
configure: Fix typo in gbm check for egl drm platform

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 9b8cd499303d9bcb60f40ef14553cb38cea6a897)

13 years agoconfigure: Enable st/gbm if st/egl has drm platform
Benjamin Franzke [Sat, 2 Jul 2011 11:45:14 +0000 (13:45 +0200)]
configure: Enable st/gbm if st/egl has drm platform

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b18b2994eff2f51588abe29c7a2209220c9ee9c5)

13 years agoegl_dri2: Fix compilation if udev devel files are not installed
Benjamin Franzke [Sat, 2 Jul 2011 11:41:35 +0000 (13:41 +0200)]
egl_dri2: Fix compilation if udev devel files are not installed

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b2d6375e6a64ac12f35f8a611ebf2016e4a6dd42)

13 years agoegl: Fix Terminate with shared gbm screens
Benjamin Franzke [Mon, 27 Jun 2011 08:23:34 +0000 (10:23 +0200)]
egl: Fix Terminate with shared gbm screens

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 992680c8b46d72cbc61888b8439d815bff42986c)

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.
(cherry picked from commit d1214cca084f277b5acc913490d354edbd4b990f)

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.
(cherry picked from commit 83478e5d5944e1fc320e8cfb10ba75055bbea3fd)

13 years agor600g: LIT: clamp negative src.y to 0
Vadim Girlin [Sat, 9 Jul 2011 15:39:43 +0000 (19:39 +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 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>
(cherry picked from commit d03fdc4cdefdfdc5b59547945704c6037a5061c7)

13 years agomesa: Fix the parsers build rule so that 'make tarballs' can work
Ian Romanick [Sat, 9 Jul 2011 01:47:21 +0000 (18:47 -0700)]
mesa: Fix the parsers build rule so that 'make tarballs' can work

You'd think that with all the commit messages about adding stuff to
tarballs or fixing 'make tarballs' that someone would have noticed
that it was completely broken for 4 months (3158cc7).

13 years agomesa: Bump version to 7.11-rc1
Ian Romanick [Sat, 9 Jul 2011 01:26:39 +0000 (18:26 -0700)]
mesa: Bump version to 7.11-rc1

13 years agoglsl: Fix depth unbalancing problem in if-statement flattening
Ian Romanick [Thu, 2 Jun 2011 19:42:48 +0000 (12:42 -0700)]
glsl: Fix depth unbalancing problem in if-statement flattening

Previously, if max_depth were 1, the following code would see the
first if-statement (correctly) not get flattened, but the second
if-statement would (incorrectly) get flattened:

void main()
{
    if (a)
        gl_Position = vec4(0);

    if (b)
        gl_Position = vec4(1);
}

This is because the visit_leave(ir_if*) method would not decrement the
depth before returning on the first if-statement.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d2c6cef18aa37d197eb323a0795969d271d02819)

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 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
(cherry picked from commit 7eb7d67d50fccb64248d1fc6f490895048d7d32e)

13 years agogallivm: Fix build with llvm-3.0
Brian Paul [Fri, 8 Jul 2011 14:03:40 +0000 (08:03 -0600)]
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>
(cherry picked from commit fc98444bd58960e6cab28423365923bc7e7af3e1)

Conflicts:

src/gallium/auxiliary/gallivm/lp_bld_debug.cpp

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>
(cherry picked from commit 7de28e80dcd4239a780b0f5fdc6e61e6e56a68aa)

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>
(cherry picked from commit 292148dc4b18958d4447df7596311bd2f09fd44f)

13 years agoi915g: Improve flushing using heuristics.
Stéphane Marchesin [Wed, 6 Jul 2011 09:19:48 +0000 (02:19 -0700)]
i915g: Improve flushing using heuristics.

13 years agoi915g: Move back to the old method for target format fixup.
Stéphane Marchesin [Mon, 4 Jul 2011 02:43:19 +0000 (19:43 -0700)]
i915g: Move back to the old method for target format fixup.

Conflicts:

src/gallium/drivers/i915/i915_state_emit.c

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>
(cherry picked from commit 066bee64e1611093c7e641ba77bbd43f70d08cec)

13 years agoglsl: permit explicit locations on fragment shader outputs, not inputs
Paul Berry [Tue, 28 Jun 2011 16:42:24 +0000 (09:42 -0700)]
glsl: permit explicit locations on fragment shader outputs, not inputs

From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
(cherry picked from commit b078aad8ab22d840456688480a8c27d4664297ce)

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>
(cherry picked from commit d32d4f780f9dad122adb63086da266aec6e88850)