mesa.git
8 years agodocs: Add release notes for 9.2.1 releasemesa-9.2.1
Carl Worth [Sat, 5 Oct 2013 00:01:00 +0000 (4 17:01 -0700)]
docs: Add release notes for 9.2.1 release

With the list of bugs fixed and a full list of changes.

8 years agomesa: Bump version to 9.2.1
Carl Worth [Fri, 4 Oct 2013 22:25:44 +0000 (4 15:25 -0700)]
mesa: Bump version to 9.2.1

In preparation for the 9.2.1 release, of course.

8 years agomesa: Don't return any data for GL_SHADER_BINARY_FORMATS
Ian Romanick [Thu, 5 Sep 2013 19:47:13 +0000 (5 12:47 -0700)]
mesa: Don't return any data for GL_SHADER_BINARY_FORMATS

We return 0 for GL_NUM_SHADER_BINARY_FORMATS, so
GL_SHADER_BINARY_FORMATS should not write any data to the application
buffer.

Fixes piglit test 'arb_get_program_binary-overrun shader'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0667e2c969c0931a1feee530508f8441a11bda32)

8 years agowayland-egl.pc requires wayland-client.pc.
Torsten Duwe [Tue, 10 Sep 2013 21:36:48 +0000 (10 23:36 +0200)]
wayland-egl.pc requires wayland-client.pc.

Mesa provides the wayland-egl libs and the pkgconfig file, but the headers
originate from the wayland package. Ensure everything matches, by requiring
application builds to look at the wayland headers as well.

Signed-off-by: Torsten Duwe <duwe@suse.de>
Signed-off-by: Johannes Obermayr <johannesobermayr@gmx.de>
(cherry picked from commit 3bc642cbf69b3ba71fc636d6120fc7ac0b83aecb)

8 years agost/gbm: Add $(WAYLAND_CFLAGS) for HAVE_EGL_PLATFORM_WAYLAND.
Johannes Obermayr [Tue, 10 Sep 2013 21:36:47 +0000 (10 23:36 +0200)]
st/gbm: Add $(WAYLAND_CFLAGS) for HAVE_EGL_PLATFORM_WAYLAND.

(cherry picked from commit 87ebbe1270e203259f6036edc1d846f77fdfa61b)

8 years agometa: Set correct viewport and projection in decompress_texture_image.
Kenneth Graunke [Thu, 22 Aug 2013 08:29:11 +0000 (22 01:29 -0700)]
meta: Set correct viewport and projection in decompress_texture_image.

_mesa_meta_begin() sets up an orthographic project and initializes the
viewport based on the current drawbuffer's width and height.  This is
likely the window size, since it occurs before the meta operation binds
any temporary buffers.

decompress_texture_image needs the viewport to be the size of the image
it's trying to draw.  Otherwise, it may only draw part of the image.

v2: Actually set the projection properly too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68250
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Mak Nazecic-Andrlon <owlberteinstein@gmail.com>
(cherry picked from commit 62411681da4d1b7f9417f34dbf92a3e79e24dc09)

8 years agoi965: fix bogus swizzle in brw_cubemap_normalize
Chris Forbes [Mon, 30 Sep 2013 09:10:17 +0000 (30 22:10 +1300)]
i965: fix bogus swizzle in brw_cubemap_normalize

When used with a cube array in VS, failed assertion in ir_validate:

   Assignment count of LHS write mask channels enabled not
   matching RHS vector size (3 LHS, 4 RHS).

To fix this, swizzle the RHS correctly for the writemask.

This showed up in the ARB_texture_gather tests, which exercise cube
arrays in the VS.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0d7fc10bcd2efb2f96d684b3273b4e0c0b0afef0)

8 years agomesa: check for bufSize > 0 in _mesa_GetSynciv()
Brian Paul [Sat, 14 Sep 2013 16:09:24 +0000 (14 10:09 -0600)]
mesa: check for bufSize > 0 in _mesa_GetSynciv()

The spec doesn't say GL_INVALID_VALUE should be raised for bufSize <= 0.
In any case, memcpy(len < 0) will lead to a crash, so don't allow it.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6659131be3bde0505a85e3a7d27382b273822bee)

8 years agoi965: Reenable glBitmap() after the sRGB winsys enabling.
Eric Anholt [Thu, 19 Sep 2013 15:45:07 +0000 (19 08:45 -0700)]
i965: Reenable glBitmap() after the sRGB winsys enabling.

The format of the window system framebuffer changed from ARGB8888 to
SARGB8, but we're still supposed to render to it the same as ARGB8888
unless the user flipped the GL_FRAMEBUFFER_SRGB switch.

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

8 years agomesa: Remove all traces of GL_OES_matrix_get
Ian Romanick [Fri, 13 Sep 2013 16:31:00 +0000 (13 11:31 -0500)]
mesa: Remove all traces of GL_OES_matrix_get

I believe this extension was enabled by accident.  As far as I can tell,
there has never been any code in Mesa to actually support it.  Not only
that, this extension is only useful in the common-lite profile, and Mesa
does the common profile.

This "fixes" the piglit test oes_matrix_get-api.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e1fdf389918b3488f06116c1837594d469dbaa2)

8 years agoUse -Bsymbolic when linking libEGL.so
Carl Worth [Fri, 27 Sep 2013 21:01:48 +0000 (27 14:01 -0700)]
Use -Bsymbolic when linking libEGL.so

For some reason that I don't yet fully understand, Glaze does not work with
libEGL unless libEGL is linked with -Bsymbolic.[*]

Beyond that specific reason, all of the reasons for which libGL.so is linked
with -Bsymbolic, (see the commit history), should also apply here.

[*] The specific behavior I am seeing is that when Glaze calls dlopen for
libEGL.so, ifunc resolvers within Glaze for EGL functions are called before
the dlopen returns. These resolvers cannot succeed, as they need the return
value from dlopen in order to find the functions to resolve to. I don't know
what's causing these resolvers to be called, but I have verified that linking
libEGL with -Bsymbolic causes this problematic behavior to stop.

CC: "9.1 and 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 9baf35de5cd4a0d832ee185afb709868fd55bc93)

8 years agocherry-ignore: Ignore a commit which appeared twice on master
Carl Worth [Tue, 1 Oct 2013 21:08:17 +0000 (1 14:08 -0700)]
cherry-ignore: Ignore a commit which appeared twice on master

In between the two appearances, it was reverted once.

Regardless, the two versions on master are the same, and we've already
cherry-picked one of them, so ignore the second.

8 years agor600g: fix texture buffer object cache flushing
Marek Olšák [Thu, 19 Sep 2013 13:07:41 +0000 (19 15:07 +0200)]
r600g: fix texture buffer object cache flushing

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f7d004b9ad0deec99d465600ed7df683146b6cd7)

Conflicts:
src/gallium/drivers/r600/r600_hw_context.c

8 years agor600g: fix constant buffer cache flushing
Marek Olšák [Wed, 18 Sep 2013 20:46:25 +0000 (18 22:46 +0200)]
r600g: fix constant buffer cache flushing

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6317a3fb31014d89edff2993f3cf403f651a07f6)

Conflicts:
src/gallium/drivers/r600/r600_hw_context.c

8 years agoi965: Fix cube array coordinate normalization
Chris Forbes [Sun, 15 Sep 2013 10:25:45 +0000 (15 22:25 +1200)]
i965: Fix cube array coordinate normalization

Hardware requires the magnitude of the largest component to not exceed
1; brw_cubemap_normalize ensures that this is the case.

Unfortunately, we would previously multiply the array index for cube
arrays by the normalization factor. The incorrect array index would then
cause the sampler to attempt to access either the wrong cube, or memory
outside the cube surface entirely, resulting in garbage rendering or in
the worst case, hangs.

Alter the normalization pass to only multiply the .xyz components.

Fixes broken rendering in the arb_texture_cube_map_array-cubemap piglit,
which was recently adjusted to provoke this behavior.

V2: Fix indent.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "9.2" mesa-stable@lists.freedesktop.org
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit fe2528c0b69d5719b15d926ada9424cac7569b9c)

8 years agoi965/gen4: Fix fragment program rectangle texture shadow compares.
Eric Anholt [Wed, 18 Sep 2013 19:32:31 +0000 (18 12:32 -0700)]
i965/gen4: Fix fragment program rectangle texture shadow compares.

The rescale_texcoord(), if it does something, will return just the
GLSL-sized coordinate, leaving out the 3rd and 4th components where we
were storing our projected shadow compare and the texture projector.
Deref the shadow compare before using the shared rescale-the-coordinate
code to fix the problem.

Fixes piglit tex-shadow2drect.shader_test and txp-shadow2drect.shader_test

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69525
NOTE: This is a candidate for stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 938956ad52bc7659212b5877080967d4af0aad81)

8 years agomesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3
Ian Romanick [Mon, 9 Sep 2013 21:54:11 +0000 (9 16:54 -0500)]
mesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d38765f3c8fbd473b949177cc9698b2cd459902c)

8 years agoi965: Fix brw_vs_prog_data_compare to actually check field members.
Kenneth Graunke [Tue, 17 Sep 2013 05:39:37 +0000 (16 22:39 -0700)]
i965: Fix brw_vs_prog_data_compare to actually check field members.

&a and &b are the address of the local stack variables, not the actual
structures.  Instead of comparing the fields of a and b, we compared
...some stack memory.

Caught by Valgrind on Piglit's glsl-lod-bias test (among many others).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68233
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 4e4b0799165ae7b482da7d9af656ed8878500de1)

8 years agost/mesa: don't dereference stObj->pt if NULL
Dave Airlie [Tue, 10 Sep 2013 04:46:23 +0000 (10 14:46 +1000)]
st/mesa: don't dereference stObj->pt if NULL

It seems a user app can get us into this state, I trigger the fail
running fbo-maxsize inside virgl, it fails to create the backing
storage for the texture object, but then segfaults here when it
should fail the completeness test.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 2f508f244e8e4cb4bb2b9f813548fbf0c89b77c1)

8 years agoos: First check for __GLIBC__ and then for PIPE_OS_BSD
Andreas Boll [Wed, 11 Sep 2013 12:27:08 +0000 (11 14:27 +0200)]
os: First check for __GLIBC__ and then for PIPE_OS_BSD

Fixes FTBFS on kfreebsd-*

Debian GNU/kFreeBSD doesn't provide getprogname() since it uses stdlib.h
from glibc. Instead it provides program_invocation_short_name from glibc.

You can find the same order in src/mesa/drivers/dri/common/xmlconfig.c

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Tested-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 32637f56a5422b09ad945d21d8e60a8b990b0182)

8 years agoi965/vec4: Only zero out unused message components when there are any.
Kenneth Graunke [Mon, 9 Sep 2013 18:11:03 +0000 (9 11:11 -0700)]
i965/vec4: Only zero out unused message components when there are any.

Otherwise, coordinates with four components would result in a MOV
with a destination writemask that has no channels enabled:

mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };

At best, this is stupid: we emit code that shouldn't do anything.
Worse, it apparently causes GPU hangs (observable with Chris's
textureGather test on CubeArrays.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 6c3db2167c64ecf2366862f15f8e2d4a91f1028c)

8 years agoglsl: propagate max_array_access through function calls
Dominik Behr [Wed, 4 Sep 2013 21:40:48 +0000 (4 14:40 -0700)]
glsl: propagate max_array_access through function calls

Fixes a bug where if an uniform array is passed to a function the accesses
to the array are not propagated so later all but the first vector of the
uniform array are removed in parcel_out_uniform_storage resulting in
broken shaders and out of bounds access to arrays in
brw::vec4_visitor::pack_uniform_registers.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-and-Tested-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dominik Behr <dbehr@chromium.org>
(cherry picked from commit 0f6fce15852d3d6fb5251e42394332a62788ef67)

8 years agonv30: fix inconsistent setting of push->user_priv
Ilia Mirkin [Wed, 4 Sep 2013 06:06:05 +0000 (4 02:06 -0400)]
nv30: fix inconsistent setting of push->user_priv

It's set to &nv30->bufctx everywhere else.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 85f7df81a91b1825bf25adf3d4febcbb5e0a0d7e)

8 years agoglx: Initialize OpenGL version to 1.0
Rico Schüller [Sun, 1 Sep 2013 19:30:19 +0000 (1 21:30 +0200)]
glx: Initialize OpenGL version to 1.0

The old code in dri2_glx suffered from a typographical error that caused
the default version to be 2.1 instead of 1.2 (minimum required by the
Linux OpenGL ABI).  drisw_glx had a similar error resulting in a default
version of 0.1.

Some driver/card combinations (r200/RV280, i915/915G) don't support
OpenGL 2.1.  These create in some corner cases an indirect context
instead of a direct context when calling glXCreateContextAttribsARB().
This happens because of a bad default value.  To avoid this, just used
the default value specified by the GLX_ARB_create_context specification:

    "The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and
    GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this
    case, implementations will typically return the most recent version
    of OpenGL they support which is backwards compatible with OpenGL 1.0
    (e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility
    profile)"

Refactor all the default value setting to dri2_convert_glx_attribs, and
make sure the correct defaults are set in that one place.

Signed-off-by: Rico Schüller <kgbricola@web.de>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla http://bugs.winehq.org/show_bug.cgi?id=34238
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8b302e1635534bfc6ed3ad671f2428470b3a765d)

8 years agoglsl: Reallow precision qualifiers on structure members
Ian Romanick [Fri, 30 Aug 2013 21:04:18 +0000 (30 14:04 -0700)]
glsl: Reallow precision qualifiers on structure members

Changes to the grammar for GL_ARB_shading_language_420pack (commit
6eec502) moved precision qualifiers out of the type_specifier production
chain.  This caused declarations such as:

    struct S {
        lowp float f;
    };

to generate parse errors.  Section 4.1.8 (Structures) of both the GLSL
ES 1.00 spec and GLSL 1.30 specs says:

        "Member declarators may contain precision qualifiers, but may not
        contain any other qualifiers."

So, it sure seems like we shouldn't generate a parse error. :)

Instead of type_specifier, use fully_specified_type in struct members.
However, fully_specified_type allows a lot of other qualifiers that are
not allowed on structure members, so expeclitly disallow them.

Note, this makes struct_declaration look an awful lot like
member_declaration (used for interface blocks).  We may want to
(somehow) unify these rules to reduce code duplication at some point.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68753
Reported-by: Aras Pranckevicius <aras@unity3d.com>
Cc: Aras Pranckevicius <aras@unity3d.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 87252bf97b62bd536632978b9d53e4025b7db77d)

8 years agonvc0: restore viewport after blit
Maarten Lankhorst [Mon, 2 Sep 2013 15:08:48 +0000 (2 17:08 +0200)]
nvc0: restore viewport after blit

Based on calim's original fix in the nine branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ad4dc7723199b3052231f5b4aed1bd1ba1505025)

8 years agonvc0: delete compute object on screen destruction
Christoph Bumiller [Sun, 12 May 2013 14:42:45 +0000 (12 16:42 +0200)]
nvc0: delete compute object on screen destruction

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7fe159ba7442b4558d4d06ad8c236ae565f5e5d8)

8 years agonvc0: fix blitctx memory leak
Joakim Sindholt [Sun, 12 May 2013 14:17:00 +0000 (12 16:17 +0200)]
nvc0: fix blitctx memory leak

Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2a7762bdb62faa1d54c445fcec7733cf6f690ac5)

8 years agonvc0/ir: add f32 long immediate cannot saturate
Christoph Bumiller [Sun, 30 Jun 2013 13:23:15 +0000 (30 15:23 +0200)]
nvc0/ir: add f32 long immediate cannot saturate

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 53992060564bd66f167342e0864cee9406147b04)

8 years agonvc0/ir: fix use after free in texture barrier insertion pass
Tiziano Bacocco [Tue, 30 Jul 2013 20:04:49 +0000 (30 22:04 +0200)]
nvc0/ir: fix use after free in texture barrier insertion pass

Fixes crash with Amnesia: The Dark Descent.

Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7086636358b611a2bb124253e1fe870107e1cecb)

8 years agonouveau: initialise the nouveau_transfer maps
Emil Velikov [Fri, 9 Aug 2013 18:51:02 +0000 (9 19:51 +0100)]
nouveau: initialise the nouveau_transfer maps

Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit dc10251d086576a007c77b7ca7854f5fe8c7e134)

8 years agoi965/fs: Gen4: Zero out extra coordinates when using shadow compare
Chris Forbes [Tue, 27 Aug 2013 07:35:49 +0000 (27 19:35 +1200)]
i965/fs: Gen4: Zero out extra coordinates when using shadow compare

Fixes broken rendering if these MRFs contained anything other than zero.

NOTE: This is a candidate for stable branches.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f35dea05b1329b9303a11fb803897fb189ff99b4)

8 years agost/dri: do not create a new context for msaa copy
Maarten Lankhorst [Mon, 9 Sep 2013 11:02:08 +0000 (9 13:02 +0200)]
st/dri: do not create a new context for msaa copy

Commit b77316ad7594f
    st/dri: always copy new DRI front and back buffers to corresponding MSAA buffers

introduced creating a pipe_context for every call to validate, which is not required
because the callers have a context anyway.

Only exception is egl_g3d_create_pbuffer_from_client_buffer, can someone test if it
still works with NULL passed as context for validate? From examining the code I
believe it does, but I didn't thoroughly test it.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit b217d48364f368f541e53006af5dd56f664be24d)

8 years agoradeon/winsys: pad IBs to a multiple of 8 DWs
Alex Deucher [Fri, 6 Sep 2013 20:43:34 +0000 (6 16:43 -0400)]
radeon/winsys: pad IBs to a multiple of 8 DWs

This aligns the gfx, compute, and dma IBs to 8 DW boundries.
This aligns the the IB to the fetch size of the CP for optimal
performance. Additionally, r6xx hardware requires at least 4
DW alignment to avoid a hw bug.  This also aligns the DMA
IBs to 8 DW which is required for the DMA engine.  This
alignment is already handled in the gallium driver, but that
patch can be removed now that it's done in the winsys.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a81beee37e0dd7b75422448420e8e8b0b4b76c1e)

8 years agonv30: find first unused texcoord rather than bailing if first is used
Ilia Mirkin [Sun, 1 Sep 2013 16:38:52 +0000 (1 12:38 -0400)]
nv30: find first unused texcoord rather than bailing if first is used

This fixes shaders produced by supertuxkart.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 3282697621241e646247b85327c50747416a766b)

8 years agomesa: Note that 89a665e should not be picked
Ian Romanick [Wed, 11 Sep 2013 20:58:14 +0000 (11 15:58 -0500)]
mesa: Note that 89a665e should not be picked

See also:

http://lists.freedesktop.org/archives/mesa-stable/2013-September/000251.html
http://lists.freedesktop.org/archives/mesa-stable/2013-September/000252.html

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/fs: Detect GRF sources in split_virtual_grfs send-from-GRF code.
Kenneth Graunke [Wed, 28 Aug 2013 18:22:01 +0000 (28 11:22 -0700)]
i965/fs: Detect GRF sources in split_virtual_grfs send-from-GRF code.

It is incorrect to assume that src[0] of a SEND-from-GRF opcode is the
GRF.  For example, FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD uses src[1] for
the GRF.

To be safe, loop over all the source registers and mark any GRFs.  We
probably won't ever have more than one, but it's simpler to just check
all three rather than attempting to bail early.

Not observed to fix anything yet, but likely to.  Parallels the bug fix
in the previous commit, which actually does fix known failures.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit a35b32025011eeac01f2e5a476dbf3ac132a61b3)

8 years agoi965/vs: Detect GRF sources in split_virtual_grfs send-from-GRF code.
Kenneth Graunke [Wed, 28 Aug 2013 18:16:27 +0000 (28 11:16 -0700)]
i965/vs: Detect GRF sources in split_virtual_grfs send-from-GRF code.

It is incorrect to assume that src[0] of a SEND-from-GRF opcode is the GRF.
VS_OPCODE_PULL_CONSTANT_LOAD_GEN7 uses an IMM as src[0], and stores the
GRF as src[1].

To be safe, loop over all the source registers and mark any GRFs.  We
probably won't ever have more than one, but it's simpler to just check
all three rather than attempting to bail early.

Fixes assertion failures in Unigine Sanctuary since we started making
register allocation rely on split_virtual_grfs working.  (The register
classes were actually sufficient, we were just interpreting an IMM as
a virtual GRF number.)

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

8 years agomesa: Don't choose S3TC for generic compression if we can't compress.
Eric Anholt [Thu, 29 Aug 2013 15:09:05 +0000 (29 08:09 -0700)]
mesa: Don't choose S3TC for generic compression if we can't compress.

If the app is asking us to do GL_COMPRESSED_RGBA, then the app obviously
doesn't have pre-compressed data to hand us.  So don't choose a storage
format that we won't actually be able to compress and store.

Fixes black screen in warzone2100 when libtxc_dxtn is not present.  Also
66 piglit tests.

NOTE: This is a candidate for the 9.2 branch.
Reported-by: Paul Wise <pabs@debian.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit bdf3f50e9a85e4c063b46ceaf23bceb07b06b82e)

8 years agomesa: Rip out more extension checking from texformat.c.
Eric Anholt [Thu, 29 Aug 2013 15:07:09 +0000 (29 08:07 -0700)]
mesa: Rip out more extension checking from texformat.c.

You should only be flagging the formats as supported if you support them
anyway.

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

8 years agoglsl: Allow precision qualifiers for sampler types
Anuj Phogat [Tue, 27 Aug 2013 01:21:03 +0000 (26 18:21 -0700)]
glsl: Allow precision qualifiers for sampler types

GLSL 1.30 doesn't allow precision qualifiers on sampler types,
but in GLSL ES, sampler types are also allowed. This seems like
an oversight (since the intention of including these in GLSL 1.30
is to allow compatibility with ES shaders).

Currently, Mesa allows "default" precision qualifiers to be set for
sampler types in GLSL (commit d5948f2). This patch makes it follow
GLSL ES rules and also allow declaring sampler variables with a
precision qualifier in GLSL 1.30 (and later). e.g.
uniform lowp sampler2D sampler;

This fixes a shader compilation error in Khronos OpenGL conformance
test "depth_texture_mipmap".

V2: Update comments.
Signed-off-by: Ian Romanick <idr@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@lists.freedesktop.org>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9c0b7be964f0cbb707ed11c2526a30eda5254d2e)

8 years agoi965: Initialize inout_offset parameter to brw_search_cache().
Paul Berry [Wed, 24 Jul 2013 16:24:51 +0000 (24 09:24 -0700)]
i965: Initialize inout_offset parameter to brw_search_cache().

Two callers of brw_search_cache() weren't initializing that function's
inout_offset parameter: brw_blorp_const_color_params::get_wm_prog()
and brw_blorp_const_color_params::get_wm_prog().

That's a benign problem, since the only effect of not initializing
inout_offset prior to calling brw_search_cache() is that the bit
corresponding to cache_id in brw->state.dirty.cache may not be set
reliably.  This is ok, since the cache_id's used by
brw_blorp_const_color_params::get_wm_prog() and
brw_blorp_blit_params::get_wm_prog() (BRW_BLORP_CONST_COLOR_PROG and
BRW_BLORP_BLIT_PROG, respectively) correspond to dirty bits that are
not used.

However, failing to initialize this parameter causes valgrind to
complain.  So let's go ahead and fix it to reduce valgrind noise.

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

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

8 years agoAdd .cherry-ignore file
Ian Romanick [Wed, 28 Aug 2013 18:37:08 +0000 (28 11:37 -0700)]
Add .cherry-ignore file

Somebody forgot -x with git-cherry-pick...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agodocs: minor fixes for 9.2 release notes
Brian Paul [Wed, 28 Aug 2013 00:57:35 +0000 (27 18:57 -0600)]
docs: minor fixes for 9.2 release notes

Fix incorrect </li> tag, fix language.

8 years agodocs: Add 9.2 release md5sums
Ian Romanick [Tue, 27 Aug 2013 23:33:48 +0000 (27 16:33 -0700)]
docs: Add 9.2 release md5sums

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: Bump version to 9.2 (final)mesa-9.2
Ian Romanick [Tue, 27 Aug 2013 22:48:55 +0000 (27 15:48 -0700)]
mesa: Bump version to 9.2 (final)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agodocs: Update release notes for 9.2
Ian Romanick [Tue, 27 Aug 2013 22:47:48 +0000 (27 15:47 -0700)]
docs: Update release notes for 9.2

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoglsl: Disallow uniform block layout qualifiers on non-uniform block vars.
Matt Turner [Mon, 26 Aug 2013 21:14:03 +0000 (26 14:14 -0700)]
glsl: Disallow uniform block layout qualifiers on non-uniform block vars.

Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68460
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoFixed and/or order mistake, resulting in compiling llvmpipe without llvm installed
Kristian Lehmann [Mon, 26 Aug 2013 19:19:50 +0000 (26 21:19 +0200)]
Fixed and/or order mistake, resulting in compiling llvmpipe without llvm installed

Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68544
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit cec7b5c5bc300d4a415939bc6a913d441c687e47)

8 years agoclover: Don't use PIPE_TRANSFER_UNSYNCHRONIZED for blocking copies
Tom Stellard [Tue, 27 Aug 2013 00:52:47 +0000 (26 17:52 -0700)]
clover: Don't use PIPE_TRANSFER_UNSYNCHRONIZED for blocking copies

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit f3e86d4a68c27f0e86d64a98469a48756c445498)

8 years agoradeonsi: Also set the depth component mask bit for stencil-only exports
Michel Dänzer [Fri, 23 Aug 2013 12:55:45 +0000 (23 14:55 +0200)]
radeonsi: Also set the depth component mask bit for stencil-only exports

The stencil values come out wrong without this for some reason.

50 more little piglits.

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 46fd81e586f0c1a76ab66b9a7558783c481f111e)

8 years agomesa: Set query->EverBound in glQueryCounter().
Kenneth Graunke [Fri, 23 Aug 2013 17:35:34 +0000 (23 10:35 -0700)]
mesa: Set query->EverBound in glQueryCounter().

glIsQuery is supposed to return false for names returned by glGenQueries
until their first use.  BeginQuery is a use, but QueryCounter is also a
use.

From the ARB_timer_query spec:
"A timer query object is created with the command

      void QueryCounter(uint id, enum target);

 [...] If <id> is an unused query object name, the
 name is marked as used [...]"

Fixes Piglit's spec/ARB_timer_query/query-lifetime.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 7950315583244f03a58ac00d7b0516860475914c)

8 years agonv30: add forgotten PIPE_CAP_CUBE_MAP_ARRAY cap to list
Ilia Mirkin [Mon, 19 Aug 2013 10:49:45 +0000 (19 06:49 -0400)]
nv30: add forgotten PIPE_CAP_CUBE_MAP_ARRAY cap to list

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bac6efe8e33115263fc7f1637671b303ea0b4243)

8 years agogallium/osmesa: Link, not copy, the shared library to the LIB_DIR.
Jon Severinsson [Fri, 23 Aug 2013 09:19:01 +0000 (23 11:19 +0200)]
gallium/osmesa: Link, not copy, the shared library to the LIB_DIR.

Just like all other mesa libraries...

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit b47bde00790c4d4cef107c8cd33ed17a08415caf)

8 years agogallium/osmesa: Always link with the c++ linker.
Jon Severinsson [Fri, 23 Aug 2013 09:19:00 +0000 (23 11:19 +0200)]
gallium/osmesa: Always link with the c++ linker.

Just like all other gallium targets...

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit aeb9c9e4b01af8a70432a961931abde5adf06c42)

8 years agogallium/osmesa: Make and install an osmesa.pc.
Jon Severinsson [Fri, 23 Aug 2013 09:18:59 +0000 (23 11:18 +0200)]
gallium/osmesa: Make and install an osmesa.pc.

As of "2f142d59 build: Add --enable-gallium-osmesa flag." the pkgconfig
file from classic osmesa is no longer installed when building gallium
osmesa, so copy it to gallium osmesa and install the copy instead.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit c8111904304a878a3d5831b453255f04e1ddcf56)

8 years agomesa: Fix assertion error with glDebugMessageControl
Timothy Arceri [Wed, 21 Aug 2013 06:18:00 +0000 (21 00:18 -0600)]
mesa: Fix assertion error with glDebugMessageControl

enums were being converted twice resulting in incorrect values.
The extra conversion has been removed and the redundant assert is
removed also.

Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit f0072e3c6b0bd46d8ebf7ac0a2cf1bf63dc370e8)

8 years agomesa: Specify a better GL_MAX_SERVER_WAIT_TIMEOUT limit.
Kenneth Graunke [Wed, 7 Aug 2013 19:56:37 +0000 (7 12:56 -0700)]
mesa: Specify a better GL_MAX_SERVER_WAIT_TIMEOUT limit.

The previous value of (GLuint64) ~0 has some problems:

GL_MAX_SERVER_WAIT_TIMEOUT is supposed to be a GLuint64 value, but has
to be queried via GetInteger64v(), which returns a GLint64.  This means
that some applications are likely to treat it as a signed integer, where
~0 means -1.  Negative values are nonsensical and problematic.

When interpreted correctly, ~0 translates to about 0.58 million years,
which seems rather excessive.

This patch changes it to 0x1fff7fffffff, which is about 1.11 years.
This is still plenty long, and is the same as both an int64 and uint64.
Applications that accidentally store it in a 32-bit int/unsigned also
get a non-negative value, which is again the same as both int and
unsigned.  This value was suggested by Ian Romanick.

v2: Add the ULL prefix on the constant (suggested by Ian).

Fixes Piglit's spec/!OpenGL 3.2/get-integer-64v.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit a27180d0d8666c75befe5c5b26e6d7122b41588b)

8 years agomesa: Bump version to 9.2-rc2mesa-9.2-rc2
Ian Romanick [Thu, 22 Aug 2013 22:21:55 +0000 (22 15:21 -0700)]
mesa: Bump version to 9.2-rc2

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoglsl: Give a warning, not an error, for UBO qualifiers on non-matrices.
Ian Romanick [Thu, 15 Aug 2013 18:24:11 +0000 (15 11:24 -0700)]
glsl: Give a warning, not an error, for UBO qualifiers on non-matrices.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59648
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit dded321f92e4727584a98b71d7aaa15d4f01fb24)

8 years agoglsl: Remove ubo_qualifiers_allowed variable.
Matt Turner [Thu, 15 Aug 2013 18:14:00 +0000 (15 11:14 -0700)]
glsl: Remove ubo_qualifiers_allowed variable.

No longer used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 921ef55a72dd07a6db0f170767d4a278c46d9ae6)

8 years agoglsl: Drop duplicate error messages.
Matt Turner [Thu, 15 Aug 2013 17:46:46 +0000 (15 10:46 -0700)]
glsl: Drop duplicate error messages.

This same message is printed in the validate_matrix_layout_for_type
function.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 77373e020ecc1b156802a583745dc6ce16e91c9e)

8 years agoglsl: Rename ubo_qualifiers_valid to ubo_qualifiers_allowed.
Matt Turner [Thu, 15 Aug 2013 18:05:57 +0000 (15 11:05 -0700)]
glsl: Rename ubo_qualifiers_valid to ubo_qualifiers_allowed.

The variable means that UBO qualifiers are allowed in a particular
context (e.g., not allowed in a struct field declaration), rather than a
particular set of UBO qualifiers are valid.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 1a45db97058d63b742993d0fcf0e5df44e2aa1c6)

8 years agoi965: Fix misapplication of gles3 srgb workaround
Chad Versace [Wed, 21 Aug 2013 00:36:24 +0000 (20 17:36 -0700)]
i965: Fix misapplication of gles3 srgb workaround

Fixes inconsistent failure of gles2conform/GL2Tests/glUniform/glUniform.test
under gnome-shell. What follows is a description of the bug and its fix.

When intel_update_renderbuffers() allocates a miptree for a winsys
renderbuffer, it propagates the renderbuffer's format to become also the
miptree's format.

If the winsys color buffer format is SARGB, then, in the first call to
eglMakeCurrent, intel_gles3_srgb_workaround() changes the renderbuffer's
format to ARGB. That is, it changes the format from sRGB to non-sRGB.
However, it changes the renderbuffer's format *after*
intel_update_renderbuffers() has allocated the renderbuffer's miptree.
Therefore, when eglMakeCurrent returns, the miptree format (SARGB)
differs from the renderbuffer format (ARGB).

If the X server reallocates the color buffer,
intel_update_renderbuffers() will create a new miptree for the
renderbuffer. The new miptree's format (ARGB) will differ from old
miptree's format (SARGB). This mismatch between old and new miptrees
causes bugs.

Fix the bug by moving intel_gles3_srgb_workaround() to occur *before*
intel_update_renderbuffers().

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67934
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit ce8639a766d0c36e676eea6f55135d9dccf1cb90)

8 years agoradeonsi: Fix y/z/w component values of TGSI_SEMANTIC_FOG pixel shader inputs
Michel Dänzer [Wed, 21 Aug 2013 16:00:35 +0000 (21 18:00 +0200)]
radeonsi: Fix y/z/w component values of TGSI_SEMANTIC_FOG pixel shader inputs

They are defined as constant 0.0/0.0/1.0.

Three more little piglits.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 237cb074cb0efa50633f35e737122471957747b2)

8 years agobuild: Add --enable-gallium-osmesa flag.
Matt Turner [Tue, 20 Aug 2013 21:16:17 +0000 (20 14:16 -0700)]
build: Add --enable-gallium-osmesa flag.

The Gallium implementation is apparently not ready for regular
consumption, so as much as I hate adding more build-time options, here's
another.

Acked-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2f142d596f6d950499d5e25d26e011a675c9670c)

8 years agoi965: Don't copy propagate bitcasts with source modifiers.
Matt Turner [Thu, 8 Aug 2013 23:41:48 +0000 (8 16:41 -0700)]
i965: Don't copy propagate bitcasts with source modifiers.

Previously, copy propagation would cause bitcast_f2u(abs(float)) to
be performed in a single step, but the application of source modifiers
(abs, neg) happens after type conversion, leading to incorrect results.

That is, for bitcast_f2u(abs(float)) we would in fact generate code to
do abs(bitcast_f2u(float)).

For example, whereas bitcast_f2u(abs(float)) might result in a register
argument such as
   (abs)g2.2<0,1,0>UD

v2: Set interfered = true and break in register_coalesce instead of
    returning false.

Reviewed-by: Paul Berry <stereoytpe441@gmail.com>
(cherry picked from commit 9c48ae751ab28f35eb878551d24c071be0ce11b0)

8 years agoi965: Emit MOVs for neg/abs.
Matt Turner [Thu, 8 Aug 2013 20:50:01 +0000 (8 13:50 -0700)]
i965: Emit MOVs for neg/abs.

Necessary to avoid combining a bitcast and a modifier into a single
operation. Otherwise if safe, the MOV should be removed by
copy-propagation or register coalescing.

With this and the next patch, there are only four changes in shader-db:
all a single extra instruction. The code does something like
   mov a.w, -b.x
and copy propagation doesn't work because it only handles no-op
swizzles. Seems acceptable, given the known limitation of our copy
propagation.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereoytpe441@gmail.com>
(cherry picked from commit 0ae9ca12a887a5aca47edc2a6a99eac4235bf4b0)

8 years agoosmesa: Symlink shared library to LIB_DIR
Armin K [Wed, 21 Aug 2013 14:44:00 +0000 (21 08:44 -0600)]
osmesa: Symlink shared library to LIB_DIR

Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit 63ac68bae398884b3b704eccf58a8a9fe8aac9e6)

8 years agoglapi/gen: build temporary files in the build directory
Maarten Lankhorst [Wed, 21 Aug 2013 16:34:59 +0000 (21 18:34 +0200)]
glapi/gen: build temporary files in the build directory

Writing to the source directory can cause multiple parallel builds
from the same source to fail. Create the temporary files in the
build directory.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 10aa3677cc032df9cc1509c4e45f553be378a7f9)

8 years agomesa: Never advertise _S3TC compressed formats
Ian Romanick [Mon, 19 Aug 2013 21:27:31 +0000 (19 14:27 -0700)]
mesa: Never advertise _S3TC compressed formats

The NVIDIA driver doesn't expose them, and piglit's
arb_texture_compression-invalid-formats expects them to not be there.

This, with the previous commit, fixes piglit
arb_texture_compression-invalid-formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f53b634807140268b40b063a2a966ad2701df7be)

8 years agomesa: Only advertise GL_ETC1_RGB8_OES in ES contexts
Ian Romanick [Mon, 19 Aug 2013 20:16:54 +0000 (19 13:16 -0700)]
mesa: Only advertise GL_ETC1_RGB8_OES in ES contexts

There is no extension for this format in desktop GL, so an application
can't give the format back to glCompressedTexImage2D.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 40550c8cedbcca508fb05baa7b7d480e6a60c51f)

8 years agoglsl: Track existence of default float precision in GLSL ES fragment shaders
Ian Romanick [Fri, 9 Aug 2013 22:17:18 +0000 (9 15:17 -0700)]
glsl: Track existence of default float precision in GLSL ES fragment shaders

This is required by the spec, and it's a bit tricky because the default
precision is scoped.  As a result, I'm slightly abusing the symbol
table.

Fixes piglit no-default-float-precision.frag tests and the piglit
default-precision-nested-scope-0[1234].frag tests that are currently on
the piglit mailing list for review.

On IRC I got confirmation from cwabbot that ARM (Mali T6xx and T400)
enforces this requirement and from kusma that NVIDIA (Tegra2) enforces
this requirement.  We should be safe from regressing shipping
applications.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cabd45773b58d6aa48202da1cdd8cf1a6b856c53)

8 years agoglsl: Merge precision qualifiers too
Ian Romanick [Fri, 9 Aug 2013 23:01:04 +0000 (9 16:01 -0700)]
glsl: Merge precision qualifiers too

We never noticed this before because we previously didn't enfoce GLSL ES
fragement shader requirements that precision be defined.  There may also
have been some interaction here with the addition of
GL_ARB_shading_language_420pack, but it doesn't appear to me that it
added any new bugs (just perhaps uncovered some old ones).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 73e2d69792fba229e52ea47165592d086e650c45)

8 years agoglsl: Pass type to is_valid_default_precision_type instead of name
Ian Romanick [Fri, 9 Aug 2013 22:15:45 +0000 (9 15:15 -0700)]
glsl: Pass type to is_valid_default_precision_type instead of name

This is used by the next patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b15b62c54c0e3c10aaf8573a62acfcdc93979b0d)

8 years agobuild: fix out-of-tree builds in gallium/auxiliary
Ross Burton [Tue, 6 Aug 2013 18:09:39 +0000 (6 19:09 +0100)]
build: fix out-of-tree builds in gallium/auxiliary

The rules were writing files to e.g. util/u_indices_gen.py, but in an
out-of-tree build this directory doesn't exist in the build directory.  So,
create the directories just in case.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit 76feef0823df75a36f264f48ec843dd863fd5b89)

8 years agoradeonsi: Always pre-load separate VGPRs for centroid vs. center interpolation
Michel Dänzer [Mon, 19 Aug 2013 13:45:32 +0000 (19 15:45 +0200)]
radeonsi: Always pre-load separate VGPRs for centroid vs. center interpolation

The LLVM R600 backend currently always uses separate VGPRs for these.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68162
(Centroid interpolation is identical to center interpolation without
multisampling, so the shader hardware was only pre-loading one set of
interpolation coefficients, and the pixel shader code was using
uninitialized values as the centroid interpolation coefficients)

Cc: mesa-stable@lists.freedesktop.org
Tested-by: Laurent Carlier <lordheavym@gmail.com>
(cherry picked from commit be301f707e8c6ba3bb0574e64a0a4f1653af8fb7)

8 years agogallium/osmesa: add same checks to OSMesaMakeCurrent as the other osmesa
Maarten Lankhorst [Tue, 20 Aug 2013 10:35:28 +0000 (20 12:35 +0200)]
gallium/osmesa: add same checks to OSMesaMakeCurrent as the other osmesa

Fixes a opengl crash in wine.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit 86751cbddfa762a6dbd01fd07102ba91bb90b8e5)

8 years agogallium/osmesa: link against static libglapi library too to get the gl exports
Maarten Lankhorst [Tue, 20 Aug 2013 08:44:53 +0000 (20 10:44 +0200)]
gallium/osmesa: link against static libglapi library too to get the gl exports

This should fix missing symbols in a osmesa built against shared glapi
osmesa build. All opengl exports were missing that are defined in the
static glapi, so link against both to fix this.

I could swear I've done this before, maybe there was a glitch in the matrix.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47824
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit 603160d4c0ff3b5ec594aed4ee7f8e161626946d)

8 years agodocs: Add md5sums to 9.1.5 release notes
Andreas Boll [Fri, 2 Aug 2013 07:58:34 +0000 (2 09:58 +0200)]
docs: Add md5sums to 9.1.5 release notes
(cherry picked from commit 38903db4398e2b3a6f8ddd09d82974a2d843f1a7)

8 years agodocs: Fix a typo in the 9.1.6 release notes
Andreas Boll [Fri, 2 Aug 2013 07:42:03 +0000 (2 09:42 +0200)]
docs: Fix a typo in the 9.1.6 release notes
(cherry picked from commit 7eaaf6243406d5cca7e0713b693b4e0026c20819)

8 years agodocs: Add md5sums to 9.1.6 release notes
Carl Worth [Thu, 1 Aug 2013 22:45:04 +0000 (1 15:45 -0700)]
docs: Add md5sums to 9.1.6 release notes
(cherry picked from commit 7f2f63409a6c030130aab71b9a7528ea4e5252b1)

8 years agodocs: Import 9.1.6 release notes, add news item.
Carl Worth [Thu, 1 Aug 2013 22:12:25 +0000 (1 15:12 -0700)]
docs: Import 9.1.6 release notes, add news item.
(cherry picked from commit 964b89e42a7d66202f38f39ceccd1776b72f52fd)

8 years agoget-pick-list: Allow for non-whitespace between "CC:" and "mesa-stable"
Carl Worth [Wed, 31 Jul 2013 22:49:48 +0000 (31 15:49 -0700)]
get-pick-list: Allow for non-whitespace between "CC:" and "mesa-stable"

We recently proposed a new syntax for stable-patch nominations such as:

CC: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
and this has already appeared in the wild.

So we extend the regular expression to pick this up as well.
(cherry picked from commit c6f3036179dc187770caa741da0aa073b807b1cf)

8 years agoget-pick-list.sh: Include commits mentionining "CC: mesa-stable..." in pick list
Carl Worth [Tue, 30 Jul 2013 19:36:37 +0000 (30 12:36 -0700)]
get-pick-list.sh: Include commits mentionining "CC: mesa-stable..." in pick list

We recently adopted a new convention that patches can be nominated for the
stable branch by including a line in the commit message as follows:

CC: mesa-stable@lists.freedesktop.org
This is a convenient syntax as "git send-email" will notice this line and
automatically copy the resulting patch email to the mesa-stable mailing list.

Here we extend the regular expression in the get-pick-list.sh script to also
notice this pattern, (as well as the traditional "NOTE: This patch is a
candidate..." form.
(cherry picked from commit 122d8d2f5a28030f2397d61d49f3873c8db6a987)

8 years agomesa: Bump version to 9.2-rc1mesa-9.2-rc1
Ian Romanick [Mon, 19 Aug 2013 23:49:02 +0000 (19 16:49 -0700)]
mesa: Bump version to 9.2-rc1

8 years agoglsl: Use alignment of container record for its first field
Ian Romanick [Sat, 17 Aug 2013 07:27:43 +0000 (17 00:27 -0700)]
glsl: Use alignment of container record for its first field

The first field of a record in a UBO has the aligment of the record
itself.

Fixes piglit vs-struct-pad, fs-struct-pad, and (with the patch posted to
the piglit list that extends the test) layout-std140.

NOTE: The bit of strangeness with the version of visit_field without the
record_type poitner is because that method is pure virtual in the base
class.  The original implementation of the class did this to ensure
derived classes remembered to implement that flavor.  Now they can
implement either flavor but not both.  I don't know a C++ way to enforce
that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68195
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
(cherry picked from commit 574e4843e9e26aa6affa31c80ac42f745b68268b)

8 years agoglsl: Add new overload of program_resource_visitor::visit_field method
Ian Romanick [Sat, 17 Aug 2013 06:30:43 +0000 (16 23:30 -0700)]
glsl: Add new overload of program_resource_visitor::visit_field method

The outer-most record is passed into the visit_field method for
the first field.  In other words, in the following structure:

    struct S1 {
        vec4 v;
        float f;
    };

    struct S {
        S1 s1;
        S1 s2;
    };

    uniform Ubo {
        S s;
    };

s.s1.v would get record_type = S (because s1.v is the first non-record
field in S), and s.s2.v would get record_type = S1.  s.s1.f and s.s2.f
would get record_type = NULL becuase they aren't the first field of
anything.

This new overload isn't used yet, but the next patch will add several
uses.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
(cherry picked from commit 5ac884fd9f213baed1de52eb7d17b86455c48a02)

8 years agoglsl: Disallow embedded structure definitions
Ian Romanick [Tue, 13 Aug 2013 16:15:01 +0000 (13 09:15 -0700)]
glsl: Disallow embedded structure definitions

Continue to allow them in GLSL 1.10 because the spec allows it.
Generate an error in all other versions because the specs specifically
disallow it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d9bb8b7b56ce65bbf6909419aa6d3d69ccd34c08)

8 years agometa: Add default precision qualifier to all fragement shaders
Ian Romanick [Fri, 9 Aug 2013 23:25:17 +0000 (9 16:25 -0700)]
meta: Add default precision qualifier to all fragement shaders

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5fb1dd51f3845985b9389987a1c6337e7fafeabc)

8 years agoglsl: Add default precision qualifiers for ES builtins
Ian Romanick [Fri, 9 Aug 2013 22:02:49 +0000 (9 15:02 -0700)]
glsl: Add default precision qualifiers for ES builtins

Once the compiler proplerly checks for default precision qualifiers,
these shaders will cease to compile.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5ac247a73e78c6df7a3980c84e6207c3da601987)

8 years agoglsl: don't eliminate texcoords that can be set by GL_COORD_REPLACE
Marek Olšák [Fri, 9 Aug 2013 20:34:45 +0000 (9 22:34 +0200)]
glsl: don't eliminate texcoords that can be set by GL_COORD_REPLACE

Tested by examining generated TGSI shaders from piglit/glsl-routing.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
Tested-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit d13003f544417db6de44c65a0c118bd2b189458a)

8 years agonv50: allow non-nv12 buffers to be created, just pass them through to vl
Ilia Mirkin [Sat, 17 Aug 2013 14:53:09 +0000 (17 10:53 -0400)]
nv50: allow non-nv12 buffers to be created, just pass them through to vl

Since we expose non-NV12 formats as supported when there is no decoer
profile selected, make sure that those formats are actually allowed to
be allocated.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a8346a2f52d08233d376db3aa8205d0b2cc74318)

8 years agometa: Fix blitting a framebuffer with renderbuffer attachment
Anuj Phogat [Mon, 5 Aug 2013 21:27:47 +0000 (5 14:27 -0700)]
meta: Fix blitting a framebuffer with renderbuffer attachment

This patch fixes a case of framebuffer blitting with renderbuffer
as color attachment and GL_LINEAR filter. Meta implementation of
glBlitFrambuffer() converts source color buffer to a texture and
uses it to do the scaled blitting in to destination buffer. Using
the exact source rectangle to create the texture does incorrect
linear filtering along the edges. This patch makes the changes to
extend the texture edges by one pixel in x, y directions. This
ensures correct linear filtering.
It fixes failing piglit fbo-attachments-blit-scaled-linear test.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit d944a6144f6ee6a0b24126ce72de280db90038c9)

8 years agonv30: remove no-longer-used formats from table
Ilia Mirkin [Thu, 15 Aug 2013 23:52:48 +0000 (15 19:52 -0400)]
nv30: remove no-longer-used formats from table

Commit 14ee790df77 removed the formats from the vtxfmt_table but forgot
to also update the info_table.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c1a6f59b20dab380b77ad1375062f9987cad9183)

8 years agoi965: Force X-tiling for 128 bpp formats on Sandybridge.
Kenneth Graunke [Tue, 13 Aug 2013 22:03:12 +0000 (13 15:03 -0700)]
i965: Force X-tiling for 128 bpp formats on Sandybridge.

128 bpp formats are not allowed to be Y-tiled on any architectures
except Gen7.

+11 Piglits on Sandybridge (mostly regression fixes since the
switch to Y-tiling).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63867
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64261
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c189840b21e176d87cbb382e64e848061b8c7b06)

8 years agomesa/program: remove useless YYID
Laurent Carlier [Fri, 16 Aug 2013 17:51:49 +0000 (16 10:51 -0700)]
mesa/program: remove useless YYID

This fixes the build with Bison 3.0. Also works with Bison 2.7.1.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5ffa28df4e4cc22481b4ed41c78632f35765f41d)

8 years agomesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts
Ian Romanick [Wed, 7 Aug 2013 18:15:41 +0000 (7 11:15 -0700)]
mesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts

It is only in OpenGL compatibility-style contexts where generic
attribute 0 and GL_VERTEX_ARRAY have a bizzare, aliasing relationship.
Moreover, it is only in OpenGL compatibility-style contexts and OpenGL
ES 1.x where one of these attributes provokes the vertex.  In all other
APIs each implicit call to glArrayElement provokes a vertex regardless
of which attributes are enabled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Robert Bragg <robert@sixbynine.org>
Cc: "9.0 9.1 9.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55503
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66292
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67548
(cherry picked from commit 41eef83cc030e7087b79b0070d00fbc56538fb81)

8 years agoi915,i965: Fix memory leak in try_pbo_upload (v2)
Vinson Lee [Fri, 2 Aug 2013 06:04:27 +0000 (1 23:04 -0700)]
i915,i965: Fix memory leak in try_pbo_upload (v2)

Fixes "Resource leak" defect reported by Coverity.
Tested on Haswell, no Piglit regressions.

v2: Apply to i965, not just i915. (chadv)

CC: "9.2, 9.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 035bf2198368d3fa69387788a63039d71319f0bf)

8 years agoradeonsi: Don't leave gaps between position exports from vertex shader
Michel Dänzer [Wed, 7 Aug 2013 16:14:16 +0000 (7 18:14 +0200)]
radeonsi: Don't leave gaps between position exports from vertex shader

If the vertex shader exports clip distances but not point size, use
position exports 1/2 instead of 2/3 for the clip distances. Fixes
geometry corruption in that case.

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

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit b00269aa5887b88d2e037d6bfa374779902f8743)