OSDN Git Service

android-x86/external-mesa.git
12 years agoandroid: ensure building with stlport ics-x86
Chih-Wei Huang [Tue, 31 Jan 2012 09:15:07 +0000 (17:15 +0800)]
android: ensure building with stlport

Without adding the include path of stlport, it may include (incorrect)
headers from the toolchain.

12 years agoandroid: enable llvm
Chia-I Wu [Wed, 23 Nov 2011 08:06:42 +0000 (16:06 +0800)]
android: enable llvm

Revert this if you do not have or want patched versions of llvm, stlport,
gralloc, and libEGL.

12 years agoandroid: no global object in gallivm
Chia-I Wu [Thu, 24 Nov 2011 10:59:56 +0000 (18:59 +0800)]
android: no global object in gallivm

Fix a race condition between threads.

12 years agoandroid: fix build issues when LLVM is enabled
Chia-I Wu [Fri, 23 Sep 2011 07:06:53 +0000 (15:06 +0800)]
android: fix build issues when LLVM is enabled

stlport's assert.h does not like gallium.

12 years agoandroid: add llvmpipe support
Chia-I Wu [Thu, 25 Aug 2011 06:03:37 +0000 (14:03 +0800)]
android: add llvmpipe support

Disabled by default.  It requires llvm, stlport, gralloc, and mesa itself to
be patched.

12 years agoandroid: advertise GL_ARB_texture_non_power_of_two
Chia-I Wu [Wed, 16 Mar 2011 09:26:22 +0000 (17:26 +0800)]
android: advertise GL_ARB_texture_non_power_of_two

It maps to DisplayHardware::NPOT_EXTENSION in SurfaceFlinger.  Does not
seem to matter when EGL_ANDROID_image_native_buffer is available.

12 years agoandroid: disable SSE translate
Chia-I Wu [Thu, 24 Mar 2011 16:59:32 +0000 (00:59 +0800)]
android: disable SSE translate

It does not support FIXED and will fail anyway.

12 years agoandroid: always flush softpipe to support SurfaceFlinger
Chia-I Wu [Fri, 1 Oct 2010 20:55:42 +0000 (16:55 -0400)]
android: always flush softpipe to support SurfaceFlinger

Just a hack.  Is this still needed?

12 years agoi915: enable GL_APPLE_texture_2D_limited_npot
Chia-I Wu [Wed, 7 Sep 2011 07:18:17 +0000 (15:18 +0800)]
i915: enable GL_APPLE_texture_2D_limited_npot

Enable GL_ARB_texture_non_power_of_two for GLESv1 to advertise
GL_APPLE_texture_2D_limited_npo.  The former is actually a superset of
the latter, but we really want to enable NPOT support in some way.

12 years agointel: add support for GL_OES_EGL_image_external
Chia-I Wu [Fri, 2 Dec 2011 03:06:32 +0000 (11:06 +0800)]
intel: add support for GL_OES_EGL_image_external

The changes to i965 are untested.

12 years agoRevert "glsl: Fix Android build"
Chih-Wei Huang [Fri, 6 Apr 2012 03:28:43 +0000 (11:28 +0800)]
Revert "glsl: Fix Android build"

This reverts commit 54f7391664d2cffe1f719d11fec1f18db672be5d.

12 years agor300g/swtcl: fix crash when back color is present in vertex shader
Marek Olšák [Wed, 4 Apr 2012 01:55:42 +0000 (03:55 +0200)]
r300g/swtcl: fix crash when back color is present in vertex shader

The shader transformation code sometimes produced invalid TGSI.
(cherry picked from commit 75f8990547903f7dde5d98319cc813f94a15aa78)

12 years agor300g/swtcl: fix polygon offset
Marek Olšák [Tue, 3 Apr 2012 23:46:31 +0000 (01:46 +0200)]
r300g/swtcl: fix polygon offset
(cherry picked from commit c3481f341021c87c86a69bcf892447e55b0687e9)

12 years agor300g/swtcl: don't expose shader subroutine support
Marek Olšák [Tue, 3 Apr 2012 21:00:18 +0000 (23:00 +0200)]
r300g/swtcl: don't expose shader subroutine support

RET in the main function doesn't work. This should be fixed in Draw, but meh.
(cherry picked from commit 3b8fe06eb629f887071d5fbe2bc50b7a0c516a25)

12 years agor300g/swtcl: don't enter u_vbuf_mgr
Marek Olšák [Sat, 31 Mar 2012 20:17:19 +0000 (22:17 +0200)]
r300g/swtcl: don't enter u_vbuf_mgr
(cherry picked from commit da2123051c3923a2953cdd96f05ad684e7d3c8c3)

12 years agor300g/swtcl: don't print an error when getting ClipVertex
Marek Olšák [Tue, 3 Apr 2012 20:37:30 +0000 (22:37 +0200)]
r300g/swtcl: don't print an error when getting ClipVertex

Draw can do it just fine.
(cherry picked from commit 5ce0598a034179eaacff96f39eaebf0ba0f30d4c)

12 years agoglsl: Fix Android build
Chad Versace [Wed, 8 Feb 2012 23:07:33 +0000 (15:07 -0800)]
glsl: Fix Android build

The build was broken by the line below, added in commit 4f82fed4.
  s_expression.cpp:26: #include <limits>

Mesa's half of the fix is to add 'external/astl/include' to the include
path. The other half of the fix requires implementing
numeric_limits<float>::infinity() in astl, for which I have patches
submitted upstream for review.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 5497cc428fa7c6670d252d34f4a67c9498ae3895)

12 years agointel: fix null dereference processing HiZ buffer
Dylan Noblesmith [Fri, 16 Mar 2012 18:38:49 +0000 (18:38 +0000)]
intel: fix null dereference processing HiZ buffer

Or technically, a near-null dereference.

https://bugs.freedesktop.org/show_bug.cgi?id=46303
https://bugs.freedesktop.org/show_bug.cgi?id=46739

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 8d9decb75f0df564abaf9888d9fc5c77de8059cd)

12 years agodocs: Add 8.0.2 md5sums
Jakob Bornecrantz [Wed, 21 Mar 2012 19:19:45 +0000 (19:19 +0000)]
docs: Add 8.0.2 md5sums

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agodocs: Add 8.0.2 release notes
Jakob Bornecrantz [Wed, 21 Mar 2012 16:51:06 +0000 (16:51 +0000)]
docs: Add 8.0.2 release notes

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agomesa: Bump version number to 8.0.2
Jakob Bornecrantz [Tue, 20 Mar 2012 13:51:39 +0000 (13:51 +0000)]
mesa: Bump version number to 8.0.2

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agomesa: Include mesa ES mapi generated files
Jakob Bornecrantz [Tue, 20 Mar 2012 13:24:50 +0000 (13:24 +0000)]
mesa: Include mesa ES mapi generated files

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agodocs: add links to 8.0.1 release notes
Brian Paul [Wed, 21 Mar 2012 17:42:33 +0000 (11:42 -0600)]
docs: add links to 8.0.1 release notes

12 years agoi965: fixup W-tile offset computation to take swizzling into account
Daniel Vetter [Fri, 2 Mar 2012 20:38:44 +0000 (21:38 +0100)]
i965: fixup W-tile offset computation to take swizzling into account

There's even a comment in the code containing the right swizzling
computations!

Previously this has not been noticed because we need to manually
enabled swizzling on snb/ivb (kernel 3.4 will do that) and we
don't use the separate stencil on ilk (where the bios enables
swizzling). This fixes

piglit ./bin/fbo-stencil  readpixels GL_DEPTH32F_STENCIL8 -auto

on recent drm-intel-next kernels.

Also remove the comment about ivb, it's stale now.

Swizzling detection is done by allocating a temporary x-tiled
buffer object. Unfortunately kernels before v3.2 lie on snb/ivb
because they claim that swizzling is enable, but it isn't. The
kernel commit that fixes this for backport to pre-v3.2 is

commit acc83eb5a1e0ae7dbbf89ca2a1a943ade224bb84
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Sep 12 20:49:16 2011 +0200

    drm/i915: fix swizzling on gen6+

But if the kernel doesn't lie, this now works on swizzling and
not swizzling machines.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agointel: check for LLC support when reading maps
Eugeni Dodonov [Wed, 1 Feb 2012 20:24:23 +0000 (18:24 -0200)]
intel: check for LLC support when reading maps

This checks for advertised LLC support by the GPU instead of relying on
the GPU generation for detection.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
(cherry picked from commit 84e5f1c635899c657da58ca51d5e841354e9de9c)

12 years agointel: verify if hardware has LLC support
Eugeni Dodonov [Wed, 1 Feb 2012 20:06:53 +0000 (18:06 -0200)]
intel: verify if hardware has LLC support

Rely on libdrm HAS_LLC parameter to verify if hardware supports it. In
case the libdrm version does not supports this check, fallback to older
way of detecting it which assumed that GPUs newer than GEN6 have it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
(cherry picked from commit 7def293204977c41ea35198af147f743a31b1889)

12 years agoi965: Fix Gen6+ dynamic state upper bound on older kernels.
Kenneth Graunke [Wed, 29 Feb 2012 20:32:41 +0000 (12:32 -0800)]
i965: Fix Gen6+ dynamic state upper bound on older kernels.

Kernels prior to 271d81b84171d84723357ae6d172ec16b0d8139c (March 2011)
don't support relocations outside of the target buffer object.  Rather
than guarding this with a I915_PARAM_HAS_RELAXED_DELTA check, just
smash the bound to 0xfffff001 like we do on Ironlake.

This effectively gives us no upper bound check, just like we did prior
to commit 271d81b84171d84723357ae6d172ec16b0d8139c.

Daniel Vetter would also like to mention that this relies on the guard
page at the end of the GTT.

Fixes a regression since 271d81b84171d84723357ae6d172ec16b0d8139c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46766
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit b2ace06cbbbb1021e2d7ace12a985c6406821939)

12 years agomesa: add back glGetnUniform*v() overflow error reporting
Dylan Noblesmith [Thu, 22 Dec 2011 21:05:38 +0000 (21:05 +0000)]
mesa: add back glGetnUniform*v() overflow error reporting

The error was removed in:

commit 719909698c67c287a393d2380278e7b7495ae018
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Oct 18 16:01:49 2011 -0700

    mesa: Rewrite the way uniforms are tracked and handled

The GL_ARB_robustness spec doesn't say the implementation
should truncate the output, so just return after setting
the required error like it did before the above commit.

Also fixup an old comment and add an assert.

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

12 years agoi915: fallback for NPOT cubemap texture
Yuanhan Liu [Wed, 29 Feb 2012 07:04:45 +0000 (15:04 +0800)]
i915: fallback for NPOT cubemap texture

Although some hardware support NPOT cubemap, but it seems we don't know
the right layout for NPOT cubemap. Thus seems we need do fallback for
other platforms as well.

See comments inline the code for more detailed info.

v2: give a more detailed info about why we need fallback for other
    platfroms as well.

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

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit 40c995c1fd7865f1b25765aa783fdadbf948b3dd)

12 years agodarwin: Link against libxcb
Jeremy Huddleston [Sat, 17 Mar 2012 00:07:06 +0000 (17:07 -0700)]
darwin: Link against libxcb

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 90a51753c40465c1253c612e0fef2aef96441668)

12 years agodarwin: Build create_context.c
Jeremy Huddleston [Sat, 17 Mar 2012 00:03:54 +0000 (17:03 -0700)]
darwin: Build create_context.c

Fixes a build regression from: 588042a8ec4ea91a952c07a0768516fd590758f4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit f9e1295cffc3cf096611e193cca016326715e6ca)

12 years agodarwin: config file cleanups
Jeremy Huddleston [Sat, 17 Mar 2012 00:01:01 +0000 (17:01 -0700)]
darwin: config file cleanups

Set our default compiler based on what our installed XCode prefers

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 61f6aff5d9136c91ca4a16de04c7ae673e9433df)

12 years agoi965: handle gl_PointCoord for Gen4 and Gen5 platforms
Yuanhan Liu [Mon, 27 Feb 2012 07:46:32 +0000 (15:46 +0800)]
i965: handle gl_PointCoord for Gen4 and Gen5 platforms

This patch add the support of gl_PointCoord gl builtin variable for
platform gen4 and gen5(ILK).

Unlike gen6+, we don't have a hardware support of gl_PointCoord, means
hardware will not calculate the interpolation coefficient for you.
Instead, you should handle it yourself in sf shader stage.

But badly, gl_PointCoord is a FS instead of VS builtin variable, thus
it's not included in c.vue_map generated in VS stage. Thus the current
code doesn't aware of this attribute. And to handle it correctly, we
need add it to c.vue_map manually to let SF shader generate the needed
interpolation coefficient for FS shader. SF stage has it's own copy of
vue_map, thus I think it's safe to do it manually.

Since handling gl_PointCoord for gen4 and gen5 platforms is somehow a
little special, I added a lot of comments and hope I didn't overdo it ;)

v2: add a /* _NEW_BUFFERS */ comment to note the state flag dependency
    and also add the _NEW_BUFFERS dirty mask (Eric).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45975
Piglit: glsl-fs-pointcoord and fbo-gl_pointcoord

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 43af02ac731dac7d80f7e47feb0c80e4da156769)

12 years agoi915: move the FALLBACK_DRAW_OFFSET check outside the drawing rect check
Yuanhan Liu [Tue, 6 Mar 2012 06:40:32 +0000 (14:40 +0800)]
i915: move the FALLBACK_DRAW_OFFSET check outside the drawing rect check

We have to do fallback when the 'Clipped Drawing Rectangle X/Y Max'
exceed the hardware's limit no matter the drawing rectangle offset
changed or not.

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

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit cf2f9ef015c312ecaa6656519602ae535f7ce9d7)

12 years agoi915: fix wrong rendering of gl_PointSize on Pineview
Yuanhan Liu [Thu, 23 Feb 2012 06:19:19 +0000 (14:19 +0800)]
i915: fix wrong rendering of gl_PointSize on Pineview

The current code would ignore the point size specified by gl_PointSize
builtin variable in vertex shader on Pineview. This patch servers as
fixing that.

This patch fixes the following issues on Pineview:
webglc: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/rendering/point-size.html
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

v2: pick Eric's nice tip for fixing this issue in hardware rendering.
v3: the last arg of EMIT_ATTR specify the size in _byte_. (Eric)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 058fc6521e3bc483bc948cc90dc5ee3b08d6ec64)

12 years agotnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled
Yuanhan Liu [Thu, 23 Feb 2012 06:19:18 +0000 (14:19 +0800)]
tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled

We may specify the point size in a glsl vertex shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46311
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9962280c332aba4b945b73ae19862041a7053a71)

12 years agomesa: fix GL_LUMINANCE handling in glGetTexImage
Brian Paul [Fri, 9 Mar 2012 03:16:00 +0000 (20:16 -0700)]
mesa: fix GL_LUMINANCE handling in glGetTexImage

There are several cases in which we need to explicity "rebase" colors
(ex: set G=B=0) when getting GL_LUMINANCE textures:
1. If the luminance texture is actually stored as rgba
2. If getting a luminance texture, but returning rgba
3. If getting an rgba texture, but returning luminance

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

Also fixes the new piglit getteximage-luminance test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit f5d0ced242abc9e4e777bbe374585f44399b75af)

12 years agomesa: use _mesa_rebase_rgba_float/uint() in glGetTexImage code
Brian Paul [Thu, 1 Mar 2012 03:55:50 +0000 (20:55 -0700)]
mesa: use _mesa_rebase_rgba_float/uint() in glGetTexImage code

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: use _mesa_rebase_rgba_float/uint() in glReadPixels code
Brian Paul [Thu, 1 Mar 2012 03:55:50 +0000 (20:55 -0700)]
mesa: use _mesa_rebase_rgba_float/uint() in glReadPixels code

See the comments for _mesa_rebase_rgba_float() for details.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=46679

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit ad897fff7730298c21289768d9b1b55f3d166ac5)

12 years agomesa: add _mesa_rebase_rgba_float/uint() functions
Brian Paul [Thu, 1 Mar 2012 03:55:49 +0000 (20:55 -0700)]
mesa: add _mesa_rebase_rgba_float/uint() functions

These will be used by glReadPixels() and glGetTexImage() to fix issues
with reading GL_LUMINANCE and other formats.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 774c4027651436451b3486f62b9a8903f29a715b)

12 years agoutil: add mutex lock in u_debug_memory.c code
Brian Paul [Thu, 16 Feb 2012 19:25:22 +0000 (12:25 -0700)]
util: add mutex lock in u_debug_memory.c code

The linked list of memory allocations was not protected by a mutex.
This lead to sporadic failures with multi-threaded apps.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agosvga: add null vs pointer check in update_need_pipeline()
Brian Paul [Fri, 9 Mar 2012 15:16:26 +0000 (08:16 -0700)]
svga: add null vs pointer check in update_need_pipeline()

Based on a patch submitted by Vic Lee.  The other part of his patch
which checked the fs pointer wasn't needed.

This fixes a crash when clear() is called before any VS or FS is set.
But this can only happen when the driver is used without the Mesa
state tracker.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 991798822346dbb2d741b1f6d62f4bcb2c889dc8)

12 years agosvga: fix the rasterizer state resets
Zack Rusin [Sat, 3 Mar 2012 01:13:38 +0000 (20:13 -0500)]
svga: fix the rasterizer state resets

draw module calls back into the driver and sets certain parts
of the state to whatever it needs, unfortunately unless you
get the ordering of calls to draw just right you'll end up
reseting your own driver state. That's what was happening to us
draw module would under certain conditions reset our own driver
state.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 831de96db87ee1f16b60d3aff308a423fece3407)

12 years agosvga: Fix stencil op mapping
Zack Rusin [Fri, 24 Feb 2012 19:26:41 +0000 (14:26 -0500)]
svga: Fix stencil op mapping

We were inverting the meaning of the stencil op flags: in svga/d3d
the normal incr/decr wraps and the SAT ops clamp.
This fixes piglit failures (at least stencil-twoside and stencil-wrap).
We should backport this everywhere we can.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 5d9bfc4d3f117fd6d95e1818c60f4f7ea47e6929)

12 years agosvga: fix a crash happening before setting fragment shaders.
Zack Rusin [Wed, 1 Feb 2012 04:12:22 +0000 (23:12 -0500)]
svga: fix a crash happening before setting fragment shaders.

In certain situations API's will call pipe->clear which doesn't
require fragment shader, but then we'd try to verify the pipeline
and assume fragment shader was always set. This was leading to
crash when API would just call simple clear's before anything else.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit cff0eac702e0070d4d7f0e2ae5f785ec10597d4d)

12 years agomesa: Don't disable fast path for normalized types
Neil Roberts [Sun, 26 Feb 2012 01:33:40 +0000 (01:33 +0000)]
mesa: Don't disable fast path for normalized types

Mesa has a fast path for the generic fallback when using glReadPixels
for RGBA data which uses memcpy.  However it was really difficult to
hit this case because it would not be used if any transferOps are
enabled.  Any type apart from floating point or non-normalized integer
types (so any of the common types) would force enabling clamping so
the fast path could not be used.  This patch makes it ignore clamping
when determining whether to use the fast path if the data type of the
buffer is an unsigned normalized type because in that case clamping
will not have any effect anyway.

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

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d9c42097770f173804c7c7c40bf8bc6c4400673b)

12 years agosvga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.
José Fonseca [Mon, 27 Feb 2012 11:21:32 +0000 (11:21 +0000)]
svga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.

Some backends may advertise more temps than SVGA3D_TEMPREG_MAX, but the
driver is hardwired to only support up to the value defined by
SVGA3D_TEMPREG_MAX, so clamp to it.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: let GL3 buf obj queries not depend on opengl major version
Yuanhan Liu [Mon, 19 Sep 2011 10:25:54 +0000 (18:25 +0800)]
mesa: let GL3 buf obj queries not depend on opengl major version

While the ARB_map_buffer_range extension spec says nothing about these
queries -- they were added in GL 3.0 --, it seems like this could be an
error in the extension spec.  This is one of the extensions, like
ARB_framebuffer_object, that "back ports" OpenGL 3.0 functionality to
previous versions.  These extensions are supposed to provide identical
functionality to OpenGL 3.0.  The other cases of mismatches have been
determined to be bugs in the extension specs.

And tools like apitrace rely on such queries to function properly.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Brian Paul <brianp@vmware.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965: Only set Last Render Target Select on the last FB write.
Kenneth Graunke [Sun, 19 Feb 2012 05:29:29 +0000 (21:29 -0800)]
i965: Only set Last Render Target Select on the last FB write.

Fixes GPU hangs in OilRush, Trine, and Amnesia: The Dark Descent,
which all use MRT (multiple render targets).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38720
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40059
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45216
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 172bb92db1a3c317867d9cfec6f15c09c37a0f6c)

12 years agor300/compiler: Fix bug when lowering KILP on r300 cards
Tom Stellard [Tue, 14 Feb 2012 02:27:28 +0000 (21:27 -0500)]
r300/compiler: Fix bug when lowering KILP on r300 cards

KILP instruction inside IF blocks were being lowered to an unconditional
KIL.  Since r300 doesn't support branching, when the IF's were lowered
to conditional moves, the KIL would always be executed.  This is not a
problem with the mesa state tracker, because the GLSL compiler handles
lowering IF's, but this bug was appearing in the VDPAU state tracker,
which does not use the GLSL compiler.

(cherry picked from commit 342cac71669662abad3435fd13ecf28d073874c3)

12 years agogallium/rtasm: properly detect SSE and SSE2
Marek Olšák [Fri, 24 Feb 2012 18:29:48 +0000 (19:29 +0100)]
gallium/rtasm: properly detect SSE and SSE2

This should fix crashes on ancient processors.
(cherry picked from commit 74d303521e6ba41d1cbeb75edb2f834ebbe8c550)

12 years agodocs: Add 8.0.1 release md5sums
Ian Romanick [Fri, 17 Feb 2012 07:25:14 +0000 (23:25 -0800)]
docs: Add 8.0.1 release md5sums

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodocs: Add 8.0.1 release notes
Ian Romanick [Fri, 17 Feb 2012 02:55:18 +0000 (18:55 -0800)]
docs: Add 8.0.1 release notes

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa: Bump version number to 8.0.1
Ian Romanick [Fri, 17 Feb 2012 02:54:28 +0000 (18:54 -0800)]
mesa: Bump version number to 8.0.1

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agor600g: Use a fake reloc to sleep for fences
Simon Farnsworth [Tue, 14 Feb 2012 12:06:20 +0000 (12:06 +0000)]
r600g: Use a fake reloc to sleep for fences

r300g is able to sleep until a fence completes rather than busywait because
it creates a special buffer object and relocation that stays busy until the
CS containing the fence is finished.

Copy the idea into r600g, and use it to sleep if the user asked for an
infinite wait, falling back to busywaiting if the user provided a timeout.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 8cd03b933cf868ff867e2db4a0937005a02fd0e4)

Conflicts:

src/gallium/drivers/r600/r600_pipe.c

12 years agor600g: 128 bit formats require tile_type = 1 on cayman
Alex Deucher [Fri, 10 Feb 2012 16:02:03 +0000 (11:02 -0500)]
r600g: 128 bit formats require tile_type = 1 on cayman

Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 5e1495b2d9311fa2b320766a1d299053904bd9c3)

Conflicts:

src/gallium/drivers/r600/evergreen_state.c

12 years agor600g: fix tex tile_type offset for cayman
Alex Deucher [Fri, 10 Feb 2012 15:49:13 +0000 (10:49 -0500)]
r600g: fix tex tile_type offset for cayman

Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit acca690c259824636ef1ff684a10bd1caca4751f)

Conflicts:

src/gallium/drivers/r600/evergreen_state.c

12 years agoi965: Emit Ivybridge VS workaround flushes.
Kenneth Graunke [Thu, 19 Jan 2012 17:55:34 +0000 (09:55 -0800)]
i965: Emit Ivybridge VS workaround flushes.

I recently discovered this text in the BSpec.  It seems wise to comply,
though I haven't observed it to fix anything yet.

Fixes a regression in glean/fbo since 28cfa1fa213fe.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 709f50928e1d4df755ffb90ec9f33ba6c9605a32)

12 years agoi965/fs: Take # of components into account in try_rewrite_rhs_to_dst.
Kenneth Graunke [Tue, 14 Feb 2012 20:43:22 +0000 (12:43 -0800)]
i965/fs: Take # of components into account in try_rewrite_rhs_to_dst.

Commit dc7f449d1ac53a66e6efb56ccf2a5953418a26ca introduced a new method
for avoiding MOVs: try to rewrite the destination of the instruction
that produced the RHS so it writes into the LHS.

Unfortunately, this is not safe for swizzled texturing operations, as
they return a set of four contiguous registers.  Consider the following:

(assign (x)
        (var_ref vec_ctor_x)
        (swiz x (tex vec4 (var_ref m_sampY) (var_ref m_cordY) 0 1 ())))

In this case, the source and destination registers are equal, since
reg_offset is 0 for both.  Yet, this is only a partial move: the texture
operation generates four registers, and the LHS only covers one.

Fixes color distortion in XBMC when using GLSL shaders.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44333
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 4b274068204c7f0bacaa4639f24feb433353b861)

12 years agoi965/fs: Add a new fs_inst::regs_written function.
Kenneth Graunke [Tue, 14 Feb 2012 20:43:21 +0000 (12:43 -0800)]
i965/fs: Add a new fs_inst::regs_written function.

Certain instructions write more than one register.  Texturing, for
example, returns 4 registers.  (We set rlen to 4 even for TXS and float
shadow sampling.)  Some math functions return 2.  Most return 1.

The next commit introduces a use of this function.

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

12 years agoswrast: Only avoid empty _TexEnvPrograms
Ian Romanick [Sat, 11 Feb 2012 00:00:27 +0000 (16:00 -0800)]
swrast: Only avoid empty _TexEnvPrograms

If the generated shader for _TexEnvProgram is empty, force the use of
the fixed-function code.  Otherwise, go ahead and use the shader.
This works around a mysterious issue on i915 where fixed-function
software fallbacks are not working correctly.

This isn't really the fix we want, but it works around the issue.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
(cherry picked from commit 3e22d4e5fc32dafcb9669a9d6376323aa88e300c)

12 years agoglapi: Include GLES2 headers for ES2 extension functions
Ian Romanick [Wed, 8 Feb 2012 21:04:38 +0000 (13:04 -0800)]
glapi: Include GLES2 headers for ES2 extension functions

This fixes build errors like

In file included from glapi_dispatch.c:91:
../../../src/mapi/glapi/glapitemp.h:4641: error: no previous prototype for
'glDrawBuffersNV'

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lucas Stach <dev@lynxeye.de>
(cherry picked from commit 8f3be339850ead96f9c6200db4e0db1f74e39d13)

12 years agometa: Avoid FBO resizing/reallocating in decompress_texture_image
Anuj Phogat [Mon, 13 Feb 2012 18:48:45 +0000 (10:48 -0800)]
meta: Avoid FBO resizing/reallocating in decompress_texture_image

Reallocate/resize decompress FBO only if texture image width/height is
greater than existing decompress FBO width/height.

This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 66bf25f1a2cc8343640cdfc4242d882bc00b9e3b)

12 years agoi915: Fix type of "specoffset" variable.
Paul Berry [Sat, 11 Feb 2012 03:51:55 +0000 (19:51 -0800)]
i915: Fix type of "specoffset" variable.

Commit 2e5a1a2 (intel: Convert from GLboolean to 'bool' from
stdbool.h.) converted the "specoffset" local variable (in
intel_tris.c) from a GLboolean to a bool.  However, GLboolean was the
wrong type for specoffset--it should have been a GLuint (to match the
declaration of specoffset in struct intel_context).

This patch changes specoffset to the proper type.

Fixes piglit test general/two-sided-lighting-separate-specular.

This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45917
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 6b0a07f9ce844a8a96e2583bd37ed8453bf151c6)

12 years agostate_stracker: Fix access to uninitialized memory.
Mathias Fröhlich [Sat, 28 Jan 2012 17:55:08 +0000 (18:55 +0100)]
state_stracker: Fix access to uninitialized memory.

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

Note: This is a candidate for the 8.0 branch.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
(cherry picked from commit 1d01429c6a1ae679d0cc0cb61db1948fca5ced4c)

12 years agoi965/fs: Enable register spilling on gen7 too.
Eric Anholt [Fri, 10 Feb 2012 00:35:49 +0000 (16:35 -0800)]
i965/fs: Enable register spilling on gen7 too.

It turns out the same messages work on gen7, we were just being paranoid.

Fixes the penumbra shadows mode of Lightsmark since the register
allocation fix.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 93831a54c7d4e74f353e0029164b1b3262e98806)

12 years agoi965: Report the failure message when failing to compile the fragment shader.
Eric Anholt [Thu, 9 Feb 2012 18:23:45 +0000 (10:23 -0800)]
i965: Report the failure message when failing to compile the fragment shader.

We just abort later, but at least this should result in more
informative bug reports.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a7f46eadea4555ed377928d4e3f89db4a445312e)

12 years agometa: Add pixel store/pack operations in decompress_texture_image
Anuj Phogat [Sat, 11 Feb 2012 00:27:19 +0000 (16:27 -0800)]
meta: Add pixel store/pack operations in decompress_texture_image

This patch adds the pixel store operations in decompress_texture_image().
decompress_texture_image() is used in glGetTexImage() for compressed
textures with unsigned, normalized values.

It also fixes the failures in intel oglconform pxstore-gettex due to
following sub test cases:

 - Test all mipmaps with byte swapping enabled
 - Test all small mipmaps with all allowable alignment values
 - Test subimage packing for all mipmap levels

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

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 40427025916e003cfd380c2e30df78ad2bc8fe10)

12 years agost/mesa: only resolve if number of samples is > 1
Dave Airlie [Wed, 30 Nov 2011 20:10:19 +0000 (20:10 +0000)]
st/mesa: only resolve if number of samples is > 1

Marek: this fixes a firefox crash and maybe even:
https://bugs.freedesktop.org/show_bug.cgi?id=45943

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 094eeff19946138d6306d74e9e62af5e9d192abd)

12 years agoswrast: fix span color type selection
Brian Paul [Fri, 3 Feb 2012 15:17:24 +0000 (08:17 -0700)]
swrast: fix span color type selection

Fixes a regression from commit 660ed923ded3552e023ef8c3dd9f92e6792f1bd2.
The basic idea is to look at the format of the dest renderbuffer and
choose either GLubyte or GLfloat for colors.  The previous code used
_mesa_format_to_type_and_comps() which could return a bunch types other
than ubyte/float.

Determine the datatype at renderbuffer mapping time to avoid frequent
calls to the format query functions.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45578
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45577
(cherry picked from commit bd1ae51b13535bc4438c663ffe91ded49db4890a)

12 years agoi965: Fix border color on Ironlake.
Kenneth Graunke [Thu, 9 Feb 2012 01:14:15 +0000 (17:14 -0800)]
i965: Fix border color on Ironlake.

Ironlake appears to check our pointer against the General State Base
Address upper bound, rather than ignoring the zero bound as it ought.

Unfortunately, since we leave GSBA set to zero, there is no logical
upper bound.  Set it to the maximum possible value, which should work
since our virtual addresses only go up to 2GB.

+94 piglits.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3340b47c2280346ba2f44dde44466f09d898b9d8)

12 years agomesa: fix proxy texture target initialization
Brian Paul [Thu, 9 Feb 2012 16:20:08 +0000 (09:20 -0700)]
mesa: fix proxy texture target initialization

The mapping from TEXTURE_x_INDEX to GL_TEXTURE_x was broken in
alloc_proxy_textures() because the elements in the targets[] array
were in the wrong order.

This didn't actually cause any failures since we never really use the
proxy texture's Target field.  But let's get it right.

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

12 years agoi965: Remove file i965/junk, accidentally added in 7b36c68
Chad Versace [Wed, 8 Feb 2012 17:18:46 +0000 (09:18 -0800)]
i965: Remove file i965/junk, accidentally added in 7b36c68

(cherry picked from commit b44c459cc32d0a4e70e86deae245b3097ac360a1)

12 years agoi965: Fix HiZ change compiler warning.
Eric Anholt [Wed, 8 Feb 2012 00:03:17 +0000 (16:03 -0800)]
i965: Fix HiZ change compiler warning.

(cherry picked from commit 94866ffbb8c2bb6957a763975da859b123d74b16)

12 years agoi965: Rewrite the HiZ op
Chad Versace [Thu, 26 Jan 2012 19:01:36 +0000 (11:01 -0800)]
i965: Rewrite the HiZ op

This is a combination of 4 commits. The first commit rewrites the HiZ op,
and remaining three fix bugs introduced by the rewrite.

======== commit 1 ========

i965: Rewrite the HiZ op

The HiZ op was implemented as a meta-op. This patch reimplements it by
emitting a special HiZ batch. This fixes several known bugs, and likely
a lot of undiscovered ones too.

==== Why the HiZ meta-op needed to die ====

The HiZ op was implemented as a meta-op, which caused lots of trouble. All
other meta-ops occur as a result of some GL call (for example, glClear and
glGenerateMipmap), but the HiZ meta-op was special. It was called in
places that Mesa (in particular, the vbo and swrast modules) did not
expect---and were not prepared for---state changes to occur (for example:
glDraw; glCallList; within glBegin/End blocks; and within
swrast_prepare_render as a result of intel_miptree_map).

In an attempt to work around these unexpected state changes, I added two
hooks in i965:
  - A hook for glDraw, located in brw_predraw_resolve_buffers (which is
    called in the glDraw path). This hook detected if a predraw resolve
    meta-op had occurred, and would hackishly repropagate some GL state
    if necessary. This ensured that the meta-op state changes would not
    intefere with the vbo module's subsequent execution of glDraw.
  - A hook for glBegin, implemented by brwPrepareExecBegin. This hook
    resolved all buffers before entering
    a glBegin/End block, thus preventing an infinitely recurring call to
    vbo_exec_FlushVertices. The vbo module calls vbo_exec_FlushVertices to
    flush its vertex queue in response to GL state changes.

Unfortunately, these hooks were not sufficient. The meta-op state changes
still interacted badly with glPopAttrib (as discovered in bug 44927) and
with swrast rendering (as discovered by debugging gen6's swrast fallback
for glBitmap). I expect there are more undiscovered bugs. Rather than play
whack-a-mole in a minefield, the sane approach is to replace the HiZ
meta-op with something safer.

==== How it was killed ====

This patch consists of several logical components:
  1. Rewrite the HiZ op by replacing function gen6_resolve_slice with
     gen6_hiz_exec and gen7_hiz_exec. The new functions do not call
     a meta-op, but instead manually construct and emit a batch to "draw"
     the HiZ op's rectangle primitive. The new functions alter no GL
     state.
  2. Add fields to brw_context::hiz for the new HiZ op.
  3. Emit a workaround flush when toggling 3DSTATE_VS.VsFunctionEnable.
  4. Kill all dead HiZ code:
     - the function gen6_resolve_slice
     - the dirty flag BRW_NEW_HIZ
     - the dead fields in brw_context::hiz
     - the state packet manipulation triggered by the now removed
       brw_context::hiz::op
     - the meta-op workaround in brw_predraw_resolve_buffers (discussed
       above)
     - the meta-op workaround brwPrepareExecBegin (discussed above)

Note: This is a candidate for the 8.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reported-by: xunx.fang@intel.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44927
Reported-by: chao.a.chen@intel.com
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 7b36c68ba6899c7f30fd56b7ef07a78b027771ac)

======== commit 2 ========

i965/gen7: Fix GPU hangs from the HiZ op.

The wm max threads is in the same dword as the dispatch enable.  The
hardware gets super angry if you set max threads to 0, even if you
aren't dispatching threads.
(cherry picked from commit e5b225afbd581ccf5d61e9d6c566e26e74abe91e)

======== commit 3 ========

i965/gen7: Fix the length of the DS state packet in the HiZ op.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit cdcfaa64e3a237517a1e1c913e8ea18d8bc5fa63)

======== commit 4 ========

i965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit a7750c9fb5db9d76318c35a901f5359bf586cddf)

12 years agodocs: remove link to the GLSL compiler page
Brian Paul [Fri, 10 Feb 2012 01:06:47 +0000 (18:06 -0700)]
docs: remove link to the GLSL compiler page

The page is terribly out of date.

12 years agodocs: add VMware link
Brian Paul [Fri, 10 Feb 2012 01:06:06 +0000 (18:06 -0700)]
docs: add VMware link

12 years agodocs: update info about supported systems, GPUs, APIs
Brian Paul [Fri, 10 Feb 2012 01:05:52 +0000 (18:05 -0700)]
docs: update info about supported systems, GPUs, APIs

Add link to Intel's Linux graphics page, etc.

12 years agodocs: add news item for 8.0 release
Brian Paul [Thu, 9 Feb 2012 22:52:13 +0000 (15:52 -0700)]
docs: add news item for 8.0 release

12 years agodocs: Add 8.0 MD5 checksums
Ian Romanick [Thu, 9 Feb 2012 22:28:58 +0000 (14:28 -0800)]
docs: Add 8.0 MD5 checksums

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa: Bump version number to 8.0 (final)
Ian Romanick [Thu, 9 Feb 2012 22:26:15 +0000 (14:26 -0800)]
mesa: Bump version number to 8.0 (final)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa: fix maximum allowed proxy texture size condition
Anuj Phogat [Thu, 26 Jan 2012 03:05:45 +0000 (19:05 -0800)]
mesa: fix maximum allowed proxy texture size condition

width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type + 2 * border.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1) + 2 * border

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case:
max_values negative.textureSize.textureCube
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ea228d97f811092b9ffcb90565184a7a8f089477)

12 years agodri: Add Unigine Tropics as an app that requires the GLSL warn workaround.
Eric Anholt [Mon, 30 Jan 2012 21:30:53 +0000 (13:30 -0800)]
dri: Add Unigine Tropics as an app that requires the GLSL warn workaround.

I wasn't seeing it be needed because of the previous bug.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
(cherry picked from commit b8c9252570d126e06607cd28b14f0fe3a2ffe4cf)

12 years agodri: Fix typo in xml file that made all applications use the workaround.
Eric Anholt [Mon, 30 Jan 2012 21:29:07 +0000 (13:29 -0800)]
dri: Fix typo in xml file that made all applications use the workaround.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
(cherry picked from commit 4dd2743d4542bedd935134d351e528ad574f7ee5)

12 years agodri: Add a default drirc to be installed to provide application workarounds.
Eric Anholt [Wed, 25 Jan 2012 22:22:03 +0000 (14:22 -0800)]
dri: Add a default drirc to be installed to provide application workarounds.

Specifially, this being present works around a bug in Unigine
Sanctuary on i965 which previously resulted in bad rendering.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ff2497dca39d688bbceba9f524a61e99d93a9607)

NOTE: Compared to ff2497d this does not install the default drirc.
The pre-automake build system is sufficiently braindamaged to make
this exceptionally difficult.

12 years agovbo: fix a building error
Chih-Wei Huang [Thu, 2 Feb 2012 12:23:57 +0000 (20:23 +0800)]
vbo: fix a building error

Signed-off-by: Marek Olšák <maraeo@gmail.com>
NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit f8be4f33d31d004bfcf090fa7d4aa37b750e43af)

12 years agoglsl: Add error case for switch() with two default cases.
Eric Anholt [Mon, 30 Jan 2012 17:50:35 +0000 (09:50 -0800)]
glsl: Add error case for switch() with two default cases.

Fixes piglit switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agoglsl: Throw an error when faced with a duplicated switch() case label.
Eric Anholt [Mon, 30 Jan 2012 16:50:14 +0000 (08:50 -0800)]
glsl: Throw an error when faced with a duplicated switch() case label.

The error message I chose matches gcc's error.  Fixes piglit
switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agoglsl: Add other missing error location information for switch statements.
Eric Anholt [Mon, 30 Jan 2012 17:46:09 +0000 (09:46 -0800)]
glsl: Add other missing error location information for switch statements.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agoglsl: Add missing location info to case labels.
Eric Anholt [Mon, 30 Jan 2012 17:41:55 +0000 (09:41 -0800)]
glsl: Add missing location info to case labels.

Otherwise, the upcoming error messages said the location was 0:0(0).

NOTE: This is a candidate for the 8.0 branch.

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

12 years agoglsl: Throw the required error when a case label is a non-constant.
Eric Anholt [Sat, 28 Jan 2012 19:43:22 +0000 (11:43 -0800)]
glsl: Throw the required error when a case label is a non-constant.

It's not quite spelled out in the spec text, but the grammar indicates
that only constant values are allowed as switch() case labels (and
only constant values make sense, anyway).

Fixes piglit glsl-1.30/compiler/switch-statement/switch-case-uniform-int.vert.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agoglsl: Save and restore the whole switch state for nesting.
Eric Anholt [Sat, 28 Jan 2012 19:26:02 +0000 (11:26 -0800)]
glsl: Save and restore the whole switch state for nesting.

This stuffs them all in a struct for sanity.  Fixes piglit
glsl-1.30/execution/switch/fs-uniform-nested.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agomesa: Fix the error message function names for glFlushMappedBufferRange().
Eric Anholt [Mon, 30 Jan 2012 21:20:27 +0000 (13:20 -0800)]
mesa: Fix the error message function names for glFlushMappedBufferRange().

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 27af00eac8c574c2fc145e333d1c0ade1fd91cda)

12 years agomesa: Fix bad-enum/no-buffer error handling for buffer object functions.
Eric Anholt [Thu, 26 Jan 2012 00:30:26 +0000 (16:30 -0800)]
mesa: Fix bad-enum/no-buffer error handling for buffer object functions.

For all the extension entrypoints using the get_buffer() helper, they
wanted the same error handling.  In some cases, the error was doing
the same error return whether target was a bad enum, or a user buffer
wasn't bound.

(Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero
buffer being bound for MapBufferRange, though it does for
FlushMappedBufferRange.  This appears to be an oversight).

Fixes piglit GL_ARB_copy_buffer/negative-bound-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit f20fb80a916d9f88dbc7efc43d4c31e038cb70c6)

12 years agoglsl: Avoid ralloc_stealing a long-lived object to a short-lived parent
Carl Worth [Thu, 2 Feb 2012 19:29:51 +0000 (11:29 -0800)]
glsl: Avoid ralloc_stealing a long-lived object to a short-lived parent

In commit 6ecee54a9aecc120cb68b02f7e14dcac86b9eca2 a call to
talloc_reference was replaced with a call to talloc_steal. This was in
preparation for moving to ralloc which doesn't support reference
counting.

The justification for talloc_steal within token_list_append in that
commit is that the tokens are being copied already. But the copies are
shallow, so this does not work.

Fortunately, the lifetime of these tokens is easy to understand. A
token list for "replacements" is created and stored in a hash table
when a function-like macro is defined. This list will live until the
macro is #undefed (if ever).

Meanwhile, a shallow copy of the list is created when the macro is
used and the list expanded. This copy is short-lived, so is unsuitable
as a new parent.

So we can just let the original, longer-lived owner continue to own
the underlying objects and things will work.

This fixes bug #45082:

"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
failed." when using a macro in GLSL
https://bugs.freedesktop.org/show_bug.cgi?id=45082

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for stable release branches.
(cherry picked from commit cd2e2187cb45accb13bf89ef297324332c46f379)

12 years agomesa: reference shared state in glPushAttrib(GL_TEXTURE_BIT)
Brian Paul [Wed, 1 Feb 2012 01:24:07 +0000 (18:24 -0700)]
mesa: reference shared state in glPushAttrib(GL_TEXTURE_BIT)

This fixes a dangling texture object pointer bug hit via wglShareLists().
When we push the GL_TEXTURE_BIT state we may push references to the default
texture objects which are owned by the gl_shared_state object.  We don't
want to accidentally delete that shared state while the attribute stack
references shared objects.  So keep a reference to it.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit a1471e4877515e2ce4fcc129c4ce26f5c306b193)

12 years agomesa: use new _mesa_reference_shared_state() function
Brian Paul [Wed, 1 Feb 2012 01:23:03 +0000 (18:23 -0700)]
mesa: use new _mesa_reference_shared_state() function

This cleans up the reference counting of shared context state.
The next patch will use this to fix an actual bug.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 361cd53a77dd48fbf2a0321446c0b7c07365bff9)

12 years agoi965: Add a driconf option to force GLSL extension behavior to "warn".
Eric Anholt [Wed, 25 Jan 2012 22:13:13 +0000 (14:13 -0800)]
i965: Add a driconf option to force GLSL extension behavior to "warn".

This can be used to work around broken application behavior, like in
Unigine where it attempts to use texture arrays without declaring
either "#extension GL_EXT_texture_array : enable" or "#version 130".

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 642247883fb9e6dce9bad724f7f6503321e0ef6f)

12 years agomesa: Add a flag for forcing all GLSL extensions to "warn".
Eric Anholt [Wed, 18 Jan 2012 20:14:09 +0000 (12:14 -0800)]
mesa: Add a flag for forcing all GLSL extensions to "warn".

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b9e27cc1426e3242a003fa5ae91fab330694009a)

12 years agoi965/vs: Avoid allocating registers in to the gen7 MRF hack region.
Eric Anholt [Fri, 27 Jan 2012 20:59:24 +0000 (12:59 -0800)]
i965/vs: Avoid allocating registers in to the gen7 MRF hack region.

This is the corresponding fix to the previous one for the FS, but I
don't have a particular test for it.

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 9195191e50429d9cf25e6498f9fb108758ac2be6)