mesa.git
10 years agos/Tungsten Graphics/VMware/
José Fonseca [Fri, 17 Jan 2014 16:27:50 +0000 (16:27 +0000)]
s/Tungsten Graphics/VMware/

Tungsten Graphics Inc. was acquired by VMware Inc. in 2008.  Leaving the
old copyright name is creating unnecessary confusion, hence this change.

This was the sed script I used:

    $ cat tg2vmw.sed
    # Run as:
    #
    #   git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
    #

    # Rename copyrights
    s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
    /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
    s/TUNGSTEN GRAPHICS/VMWARE/g

    # Rename emails
    s/alanh@tungstengraphics.com/alanh@vmware.com/
    s/jens@tungstengraphics.com/jowen@vmware.com/g
    s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
    s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
    s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
    s/michel@tungstengraphics.com/daenzer@vmware.com/g
    s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
    s/zack@tungstengraphics.com/zackr@vmware.com/

    # Remove dead links
    s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g

    # C string src/gallium/state_trackers/vega/api_misc.c
    s/"Tungsten Graphics, Inc"/"VMware, Inc"/

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agotrace: Re-license trace.xsl under MIT license.
José Fonseca [Fri, 17 Jan 2014 16:15:18 +0000 (16:15 +0000)]
trace: Re-license trace.xsl under MIT license.

I was the sole author, as Tungsten Graphics employee, which was since
then acquired by VMware Inc.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agosvga: fix crash when clearing null color buffer
Brian Paul [Thu, 16 Jan 2014 21:53:27 +0000 (13:53 -0800)]
svga: fix crash when clearing null color buffer

Fixes regression since 9baa45f78b8ca7d66280e36009b6a685055d7cd6
but some of the piglit fbo-drawbuffers-none tests still don't
pass.

v2: use the right pointer type for 'h'

Reviewed-by: José Fonseca <jfonseca@vmware.com>
10 years agollvmpipe: handle NULL color buffer pointers
Brian Paul [Thu, 16 Jan 2014 02:09:56 +0000 (18:09 -0800)]
llvmpipe: handle NULL color buffer pointers

Fixes regression from 9baa45f78b8ca7d66280e36009b6a685055d7cd6

v2: incorporate a few small changes suggested by Roland.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agosoftpipe: handle NULL color buffer pointers
Brian Paul [Thu, 16 Jan 2014 01:24:02 +0000 (17:24 -0800)]
softpipe: handle NULL color buffer pointers

Fixes regression from 9baa45f78b8ca7d66280e36009b6a685055d7cd6

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agollvmpipe: fix large point rasterization with point_quad_rasterization
Roland Scheidegger [Fri, 17 Jan 2014 01:12:20 +0000 (02:12 +0100)]
llvmpipe: fix large point rasterization with point_quad_rasterization

The whole round-pointsize-to-int stuff must only be done with GL legacy
rules (no point_quad_rasterization) or all the wrong edges are lit up.
This was previously in a private branch (d3d pointsprite test complains
loudly otherwise) and got lost in a merge. However, it should certainly
apply to GL point sprite rasterization as well.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agogallium: add bits for clipping points as tris (d3d-style)
Roland Scheidegger [Thu, 9 Jan 2014 15:55:22 +0000 (16:55 +0100)]
gallium: add bits for clipping points as tris (d3d-style)

OpenGL does whole-point clipping, that is a large point is either fully
clipped or fully unclipped (the latter means it may extend beyond the
viewport as long as the center is inside the viewport). d3d9 (d3d10 has
no large points) however requires points to be clipped after they are
expanded to a rectangle. (Note some IHVs are known to ignore GL rules at
least with some hw/drivers.)
Hence add a rasterizer bit indicating which way points should be clipped
(some drivers probably will always ignore this), and add the draw interaction
this requires. Drivers wanting to support this and using draw must support
large points on their own as draw doesn't implement vp clipping on the
expanded points (it potentially could but the complexity doesn't seem
warranted), and the driver needs to do viewport scissoring on such points.

Conflicts:

src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_state_derived.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agomesa: fix GL_COLOR_SUM enum for drivers without ARB_vertex_program
Ilia Mirkin [Thu, 16 Jan 2014 18:13:28 +0000 (13:13 -0500)]
mesa: fix GL_COLOR_SUM enum for drivers without ARB_vertex_program

Commit c13970808 (mesa: GL_EXT_secondary_color is not optional) changed

CHECK_EXTENSION2(EXT_secondary_color, ARB_vetex_program, cap)

to

CHECK_EXTENSION(ARB_vertex_program, cap)

However CHECK_EXTENSION2 checks that either extension is available, not
both. Remove the extension check entirely since the intent was for it to
always be enabled.

v2: Fix glGet*(GL_COLOR_SUM) too.  Suggested by Ian.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: 9.2 10.0 <mesa-stable@lists.freedesktop.org>
10 years agollvmpipe: do constant buffer bounds checking in shaders
Zack Rusin [Thu, 19 Dec 2013 00:16:07 +0000 (19:16 -0500)]
llvmpipe: do constant buffer bounds checking in shaders

It's possible to bind a smaller buffer as a constant buffer, than
what the shader actually uses/requires. This could cause nasty
crashes. This patch adds the architecture to pass the maximum
allowable constant buffer index to the jit to let it make
sure that the constant buffer indices are always within bounds.
The behavior follows the d3d10 spec, which says the overflow
should always return all zeros, and overflow is only defined
as access beyond the size of the currently bound buffer. Accesses
beyond the declared shader constant register size are not
considered an overflow and expected to return garbage but consistent
garbage (we follow the behavior which some wlk tests expect which
is to return the actual values from the bound buffer).

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agonv50, nvc0: initialize ctx->sample_mask to ~0
Ilia Mirkin [Sun, 12 Jan 2014 20:01:29 +0000 (15:01 -0500)]
nv50, nvc0: initialize ctx->sample_mask to ~0

Commit 95bf222603b (cso_context: Fix cso_context::sample_mask initial
value.) fixed the cso sample mask to be initialized to ~0. The cso code
is also careful not to needlessly call set_sample_mask, so we ended up
with the ctx->sample_mask never being set. This broke a number of
EXT_framebuffer_multisample piglit tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agomesa/main: Free ctx->DrawIndirectBuffer during teardown
Aaron Watry [Thu, 2 Jan 2014 17:18:09 +0000 (11:18 -0600)]
mesa/main: Free ctx->DrawIndirectBuffer during teardown

ctx->DrawIndirectBuffer wasn't being free'd in _mesa_free_buffer_objects

With this patch, "valgrind --leak-check=full glxgears" on evergreen (CEDAR)
now shows:

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 70,228 bytes in 651 blocks
        suppressed: 0 bytes in 0 blocks

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agost/dri: prevent leak of dri option default values
Aaron Watry [Wed, 18 Dec 2013 20:40:49 +0000 (14:40 -0600)]
st/dri: prevent leak of dri option default values

v2: Change comment style

CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeon: Move gfx/dma cs cleanup to r600_common_context_cleanup
Aaron Watry [Tue, 7 Jan 2014 20:45:41 +0000 (14:45 -0600)]
radeon: Move gfx/dma cs cleanup to r600_common_context_cleanup

The radeonsi code was not cleaning up either of these items leading to
leaked memory.

v2: Move cleanup to r600_common_context_cleanup instead of duplicating
    the logic for SI

CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agomesa: Eliminate parameters to dd_function_table::Scissor
Ian Romanick [Tue, 5 Nov 2013 22:22:30 +0000 (14:22 -0800)]
mesa: Eliminate parameters to dd_function_table::Scissor

The i830 and i915 drivers used them, but they didn't really need to.
They will just be annoying in future patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: Eliminate parameters to dd_function_table::DepthRange
Ian Romanick [Tue, 5 Nov 2013 22:16:05 +0000 (14:16 -0800)]
mesa: Eliminate parameters to dd_function_table::DepthRange

No driver uses them.  They will just be annoying in future patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: Eliminate parameters to dd_function_table::Viewport
Ian Romanick [Tue, 5 Nov 2013 22:01:31 +0000 (14:01 -0800)]
mesa: Eliminate parameters to dd_function_table::Viewport

No driver uses them.  They will just be annoying in future patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoradeon: Remove dead code
Ian Romanick [Tue, 5 Nov 2013 20:38:22 +0000 (12:38 -0800)]
radeon: Remove dead code

A future patch will rename some of the fields of gl_viewport_attrib, and
I don't want to update dead code that I can't test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Dave Airlie <airlied@redhat.com>
10 years agoi915: Remove spurious calls to DepthRange
Ian Romanick [Tue, 5 Nov 2013 22:34:03 +0000 (14:34 -0800)]
i915: Remove spurious calls to DepthRange

For both i830 and i915, the driver DepthRange function just calls
intelCalcViewport.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Eric Anholt <eric@anholt.net>
10 years agomesa: Add COMPRESSED_RGBA_S3TC_DXT1_EXT to COMPRESSED_TEXTURE_FORMATS for GLES
Ian Romanick [Tue, 14 Jan 2014 21:41:19 +0000 (13:41 -0800)]
mesa: Add COMPRESSED_RGBA_S3TC_DXT1_EXT to COMPRESSED_TEXTURE_FORMATS for GLES

The ES and desktop GL specs diverge here.  Yay!

In desktop OpenGL, the driver can perform online compression of
uncompressed texture data.  GL_NUM_COMPRESSED_TEXTURE_FORMATS and
GL_COMPRESSED_TEXTURE_FORMATS give the application a list of formats
that it could ask the driver to compress with some expectation of
quality.  The GL_ARB_texture_compression spec calls this "suitable for
general-purpose usage."  As noted above, this means
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT is not included in the list.

In OpenGL ES, the driver never performs compression.
GL_NUM_COMPRESSED_TEXTURE_FORMATS and GL_COMPRESSED_TEXTURE_FORMATS give
the application a list of formats that the driver can receive from the
application.  It is the *complete* list of formats.  The
GL_EXT_texture_compression_s3tc spec says:

    "New State for OpenGL ES 2.0.25 and 3.0.2 Specifications

        The queries for NUM_COMPRESSED_TEXTURE_FORMATS and
        COMPRESSED_TEXTURE_FORMATS include COMPRESSED_RGB_S3TC_DXT1_EXT,
        COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT,
        and COMPRESSED_RGBA_S3TC_DXT5_EXT."

Note that the addition is only to the OpenGL ES specification!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
See-also: http://lists.freedesktop.org/archives/mesa-dev/2013-October/047439.html
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
10 years agoscons: add new shaderimage.c file to the build
Brian Paul [Wed, 15 Jan 2014 16:17:04 +0000 (09:17 -0700)]
scons: add new shaderimage.c file to the build

10 years agoclover: Fix clover::keys and ::values to deal with r-value references properly.
Francisco Jerez [Tue, 14 Jan 2014 21:03:57 +0000 (22:03 +0100)]
clover: Fix clover::keys and ::values to deal with r-value references properly.

Returning a reference is incorrect if the specified pair was a
temporary -- Instead of that, use decltype() to deduce the correct
return type qualifiers.  Fixes a crash in clCreateProgramWithBinary().

Reported-and-tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
10 years agoclover: Don't try to build programs created from a binary again.
Francisco Jerez [Tue, 14 Jan 2014 20:55:29 +0000 (21:55 +0100)]
clover: Don't try to build programs created from a binary again.

According to the spec it's allowed to call clBuildProgram() on a
program created from a user-specified binary.  We don't need to do
anything to build the program in that case.

Reported-and-tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
10 years agoclover: Add missing fields to the clover::module serialization code.
Francisco Jerez [Tue, 14 Jan 2014 20:53:57 +0000 (21:53 +0100)]
clover: Add missing fields to the clover::module serialization code.

Tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
10 years agoclover: Store map result into a temporary vector in clCreateProgramWithBinary.
Francisco Jerez [Tue, 14 Jan 2014 20:47:46 +0000 (21:47 +0100)]
clover: Store map result into a temporary vector in clCreateProgramWithBinary.

This avoids the inefficient multiple evaluation of the map result in
the code below.  It should cause no functional changes.

Tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
10 years agodocs: Mark ARB_shader_image_load_store as work in progress.
Francisco Jerez [Mon, 25 Nov 2013 00:24:32 +0000 (16:24 -0800)]
docs: Mark ARB_shader_image_load_store as work in progress.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Validate image units when the texture state changes.
Francisco Jerez [Sat, 23 Nov 2013 03:58:10 +0000 (19:58 -0800)]
mesa: Validate image units when the texture state changes.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Unbind deleted textures from the shader image units.
Francisco Jerez [Sat, 23 Nov 2013 03:54:47 +0000 (19:54 -0800)]
mesa: Unbind deleted textures from the shader image units.

From ARB_shader_image_load_store:

   If a texture object bound to one or more image units is deleted by
   DeleteTextures, it is detached from each such image unit, as though
   BindImageTexture were called with <unit> identifying the image unit
   and <texture> set to zero.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Add image parameter queries for ARB_shader_image_load_store.
Francisco Jerez [Mon, 25 Nov 2013 18:11:59 +0000 (10:11 -0800)]
mesa: Add image parameter queries for ARB_shader_image_load_store.

v2: Fix off-by-one error in index parameter bound checking.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Add ARB_shader_image_load_store to the extension table.
Francisco Jerez [Sat, 23 Nov 2013 03:47:22 +0000 (19:47 -0800)]
mesa: Add ARB_shader_image_load_store to the extension table.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agoglapi: Update dispatch XML files for ARB_shader_image_load_store.
Francisco Jerez [Fri, 22 Nov 2013 23:55:09 +0000 (15:55 -0800)]
glapi: Update dispatch XML files for ARB_shader_image_load_store.

And uncomment the relevant lines of the dispatch sanity test.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Implement the GL entry points defined by ARB_shader_image_load_store.
Francisco Jerez [Fri, 22 Nov 2013 23:56:34 +0000 (15:56 -0800)]
mesa: Implement the GL entry points defined by ARB_shader_image_load_store.

v2: Name image format classes consistently, fix array and 3D teximage
    selection with layered = GL_FALSE, make sure that the
    user-specified layer is less than the number of texture layers,
    add some asserts.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Add MESA_FORMAT_SIGNED_RG88 and _RG1616.
Francisco Jerez [Sat, 23 Nov 2013 03:49:58 +0000 (19:49 -0800)]
mesa: Add MESA_FORMAT_SIGNED_RG88 and _RG1616.

Including pack/unpack and texstore code.  ARB_shader_image_load_store
requires support for the GL_RG8_SNORM and GL_RG16_SNORM formats, which
map to MESA_FORMAT_SIGNED_GR88 and MESA_FORMAT_SIGNED_GR1616 on
little-endian hosts, and MESA_FORMAT_SIGNED_RG88 and
MESA_FORMAT_SIGNED_RG1616 respectively on big-endian hosts -- only the
former were already present, add support for the latter.

Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Add MESA_FORMAT_ABGR2101010.
Francisco Jerez [Sat, 23 Nov 2013 03:49:29 +0000 (19:49 -0800)]
mesa: Add MESA_FORMAT_ABGR2101010.

Including pack/unpack and texstore code.  This texture format is a
requirement for ARB_shader_image_load_store.

Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Add driver interface for ARB_shader_image_load_store.
Francisco Jerez [Sat, 23 Nov 2013 05:16:06 +0000 (21:16 -0800)]
mesa: Add driver interface for ARB_shader_image_load_store.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Add state data structures required for ARB_shader_image_load_store.
Francisco Jerez [Sat, 23 Nov 2013 05:15:26 +0000 (21:15 -0800)]
mesa: Add state data structures required for ARB_shader_image_load_store.

v2: Increase MAX_IMAGE_UNITS to what i965 wants and add a separate
    MAX_IMAGE_UNIFORMS define, clarify a couple of comments.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Define helper function to get the number of texture layers.
Francisco Jerez [Sat, 7 Dec 2013 22:35:04 +0000 (23:35 +0100)]
mesa: Define helper function to get the number of texture layers.

And to check if it can have layers at all.  This will be used by the
implementation of ARB_shader_image_load_store.

v2: Fix constness of texobj argument, use assert and return reasonable
    default rather than calling unreachable() in default switch case.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: use signed temporary variable to store _ColorDrawBufferIndexes
Emil Velikov [Wed, 15 Jan 2014 11:39:24 +0000 (11:39 +0000)]
st/mesa: use signed temporary variable to store _ColorDrawBufferIndexes

The temporary variable used to store _ColorDrawBufferIndexes must be
signed (GLint), otherwise the following conditional will be incorrectly
evaluated. Leading to crashes in the driver/mesa or accessing/writing
to arbitrary memory location. The bug dates back to 2009.

Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoautomake: include the git sha in the opengl version string for oot builds
Emil Velikov [Mon, 13 Jan 2014 01:56:39 +0000 (01:56 +0000)]
automake: include the git sha in the opengl version string for oot builds

Acked-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agomesa: use signed temporary variable to store _ColorDrawBufferIndexes
Emil Velikov [Sun, 12 Jan 2014 22:42:05 +0000 (22:42 +0000)]
mesa: use signed temporary variable to store _ColorDrawBufferIndexes

_ColorDrawBufferIndexes is defined as GLint* and using a GLuint*
will result in the first part of the conditional to be evaluated to
true always.

Unintentionally introduced by the following commit, this will result
in a driver segfault if one is using an old version of the piglit test

    bin/clearbuffer-mixed-format -auto -fbo

commit 03d848ea1003abefd8fe51a5b4a780527cd852af
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Wed Dec 4 00:27:20 2013 +0100

    mesa: fix interpretation of glClearBuffer(drawbuffer)

    This corresponding piglit tests supported this incorrect behavior instead of
    pointing at it.

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agonouveau: add framebuffer validation callback
Ilia Mirkin [Wed, 15 Jan 2014 00:50:33 +0000 (19:50 -0500)]
nouveau: add framebuffer validation callback

Fixes assertions when trying to attach textures to fbs with formats not
supported by the render engines.

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

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agoclover: Use cl_ulong in the maximum allocation size calculation to avoid overflow.
Francisco Jerez [Tue, 14 Jan 2014 20:38:11 +0000 (21:38 +0100)]
clover: Use cl_ulong in the maximum allocation size calculation to avoid overflow.

10 years agoi965: Emit 3DSTATE_VF on Broadwell too.
Kenneth Graunke [Tue, 12 Nov 2013 02:30:32 +0000 (18:30 -0800)]
i965: Emit 3DSTATE_VF on Broadwell too.

It's not just for Haswell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Disable workaround flush for push constants on Broadwell.
Kenneth Graunke [Sat, 9 Nov 2013 06:21:29 +0000 (22:21 -0800)]
i965: Disable workaround flush for push constants on Broadwell.

If it wasn't necessary for Haswell, it's likely not to be necessary for
Broadwell either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Enable native ETC texture support on Broadwell.
Kenneth Graunke [Thu, 19 Dec 2013 23:15:01 +0000 (15:15 -0800)]
i965: Enable native ETC texture support on Broadwell.

Broadwell, like Baytrail, has native ETC texture support.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoilo: handle NULL renderbuffers correctly
Chia-I Wu [Tue, 14 Jan 2014 08:02:34 +0000 (16:02 +0800)]
ilo: handle NULL renderbuffers correctly

Renderbuffers may be NULL since 9baa45f78b8ca7d66280e36009b6a685055d7cd6.

10 years agoilo: disable HiZ for misaligned levels
Chia-I Wu [Tue, 14 Jan 2014 06:51:51 +0000 (14:51 +0800)]
ilo: disable HiZ for misaligned levels

We need to disable HiZ for non-8x4 aligned levels, except for level 0, layer
0.  For the very first layer we can adjust Width and Height fields of
3DSTATE_DEPTH_BUFFER to make it aligned.

Specifically, add ILO_TEXTURE_HIZ and set the flag only for properly aligned
levels.  ilo_texture_can_enable_hiz() is updated to check for the flag.

In tex_layout_validate(), align the depth bo to 8x4 so that we can adjust
Width/Height of 3DSTATE_DEPTH_BUFFER without introducing out-of-bound access.

Finally in rectlist blitter, add the ability to adjust 3DSTATE_DEPTH_BUFFER.

10 years agoilo: use a helper to determine if HiZ is enabled
Chia-I Wu [Tue, 14 Jan 2014 05:50:12 +0000 (13:50 +0800)]
ilo: use a helper to determine if HiZ is enabled

Add ilo_texture_can_enable_hiz and replace all checks for tex->hiz.bo by calls
to ilo_texture_can_enable_hiz().

10 years agoilo: decide on hiz first in texture allocation
Chia-I Wu [Sun, 12 Jan 2014 17:03:15 +0000 (01:03 +0800)]
ilo: decide on hiz first in texture allocation

Add tex_layout_init_hiz() before tex_layout_init_format() to decide whether
HiZ should be enabled.

On GEN6, because of layer offsetting, HiZ is enabled only when the texture is
non-mipmapped and non-array.  PIPE_USAGE_STAGING is also taken as a hint to
disable HiZ.

10 years agoilo: emit gen7_wa_pipe_control_wm_max_threads_stall on Haswell
Chia-I Wu [Fri, 10 Jan 2014 05:46:08 +0000 (13:46 +0800)]
ilo: emit gen7_wa_pipe_control_wm_max_threads_stall on Haswell

Rename the workaround, as it is for 3DSTATE_PS instead of 3DSTATE_WM, and emit
it on Haswell too.

This does not fix any app, but an assertion failure.

10 years agoilo: use HALIGN_4 on GEN7 for depth buffers
Chia-I Wu [Tue, 14 Jan 2014 07:15:07 +0000 (15:15 +0800)]
ilo: use HALIGN_4 on GEN7 for depth buffers

The comment was no longer true since 6642381e7513926b847d6bc10bf590e1c0c54859.

10 years agoilo: OOM for HiZ is fatal on GEN6
Chia-I Wu [Tue, 14 Jan 2014 05:34:29 +0000 (13:34 +0800)]
ilo: OOM for HiZ is fatal on GEN6

On GEN6, HiZ and Separate Stencil Buffer must be enabled at the same time.

10 years agoilo: fix a HiZ bo leakage
Chia-I Wu [Tue, 14 Jan 2014 05:33:22 +0000 (13:33 +0800)]
ilo: fix a HiZ bo leakage

Dereference the HiZ bo when the texture is destroyed.

10 years agoilo: simplify ilo_texture_set_slice_flags()
Chia-I Wu [Fri, 10 Jan 2014 05:50:52 +0000 (13:50 +0800)]
ilo: simplify ilo_texture_set_slice_flags()

Call ilo_texture_get_slice() for the last slice so that we can get rid of the
duplicated assert().

10 years agoegl-static: Fix build error.
Vinson Lee [Mon, 13 Jan 2014 23:51:50 +0000 (15:51 -0800)]
egl-static: Fix build error.

Fix build regression introduced with commit
786af2f963925df2c2a6fb60b29a83e8340f03c7.

egl_pipe.c:46:38: fatal error: radeonsi/radeonsi_public.h: No such file or directory
 #include "radeonsi/radeonsi_public.h"
                                      ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73578
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agoradeonsi: Rename the commonly occurring rscreen variable.
Andreas Hartmetz [Sat, 11 Jan 2014 15:01:11 +0000 (16:01 +0100)]
radeonsi: Rename the commonly occurring rscreen variable.

The "r" stands for R600.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename the commonly occurring rctx/r600 variables.
Andreas Hartmetz [Sat, 11 Jan 2014 15:00:50 +0000 (16:00 +0100)]
radeonsi: Rename the commonly occurring rctx/r600 variables.

The "r" stands for R600.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600_trace_emit->si_trace_emit.
Andreas Hartmetz [Sat, 11 Jan 2014 14:59:13 +0000 (15:59 +0100)]
radeonsi: Rename r600_trace_emit->si_trace_emit.

I had previously considered that unsafe.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename R600->SI in some remaining defines.
Andreas Hartmetz [Sat, 11 Jan 2014 14:56:47 +0000 (15:56 +0100)]
radeonsi: Rename R600->SI in some remaining defines.

I had previously considered that unsafe.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename radeonsi->si remaining identifiers in si_uvd.c.
Andreas Hartmetz [Tue, 7 Jan 2014 02:18:42 +0000 (03:18 +0100)]
radeonsi: Rename radeonsi->si remaining identifiers in si_uvd.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si remaining identifiers in si_state_draw.c.
Andreas Hartmetz [Tue, 7 Jan 2014 02:18:25 +0000 (03:18 +0100)]
radeonsi: Rename r600->si remaining identifiers in si_state_draw.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si remaining identifiers in si_resource.c.
Andreas Hartmetz [Tue, 7 Jan 2014 02:14:05 +0000 (03:14 +0100)]
radeonsi: Rename r600->si remaining identifiers in si_resource.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si remaining identifiers in si_query.c.
Andreas Hartmetz [Tue, 7 Jan 2014 02:12:19 +0000 (03:12 +0100)]
radeonsi: Rename r600->si remaining identifiers in si_query.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si remaining identifiers in si_pipe.c.
Andreas Hartmetz [Tue, 7 Jan 2014 02:07:55 +0000 (03:07 +0100)]
radeonsi: Rename r600->si remaining identifiers in si_pipe.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si remaining identifier in si_hw_context.c.
Andreas Hartmetz [Tue, 7 Jan 2014 01:59:28 +0000 (02:59 +0100)]
radeonsi: Rename r600->si remaining identifier in si_hw_context.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename radeonsi->si remaining identifiers in si_compute.c.
Andreas Hartmetz [Tue, 7 Jan 2014 01:53:26 +0000 (02:53 +0100)]
radeonsi: Rename radeonsi->si remaining identifiers in si_compute.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si remaining identifiers in si_blit.c.
Andreas Hartmetz [Tue, 7 Jan 2014 01:51:35 +0000 (02:51 +0100)]
radeonsi: Rename r600->si remaining identifiers in si_blit.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si for functions in si_pipe.h.
Andreas Hartmetz [Tue, 7 Jan 2014 01:40:22 +0000 (02:40 +0100)]
radeonsi: Rename r600->si for functions in si_pipe.h.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si for functions in si.h.
Andreas Hartmetz [Tue, 7 Jan 2014 01:14:42 +0000 (02:14 +0100)]
radeonsi: Rename r600->si for functions in si.h.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si for functions in si_resource.h.
Andreas Hartmetz [Tue, 7 Jan 2014 01:05:57 +0000 (02:05 +0100)]
radeonsi: Rename r600->si for functions in si_resource.h.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si for structs in si_resource.h.
Andreas Hartmetz [Tue, 7 Jan 2014 00:55:08 +0000 (01:55 +0100)]
radeonsi: Rename r600->si for structs in si_resource.h.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si for structs in si.h.
Andreas Hartmetz [Tue, 7 Jan 2014 00:51:30 +0000 (01:51 +0100)]
radeonsi: Rename r600->si for structs in si.h.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Rename r600->si for structs in si_pipe.h.
Andreas Hartmetz [Sat, 11 Jan 2014 14:47:07 +0000 (15:47 +0100)]
radeonsi: Rename r600->si for structs in si_pipe.h.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Apply si_* file naming scheme.
Andreas Hartmetz [Sat, 4 Jan 2014 17:44:33 +0000 (18:44 +0100)]
radeonsi: Apply si_* file naming scheme.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoUse AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config.
Michał Górny [Sat, 28 Dec 2013 14:22:09 +0000 (15:22 +0100)]
Use AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config.

This should help with cross-compiling and multilib when $CHOST-specific
llvm-config is expected rather than build host default one.

It will help us a bit in Gentoo where we've started using
i686-pc-linux-gnu-llvm-config for 32-bit multilib LLVM.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73100
CC: "10.0" <mesa-stable@lists.freedesktop.org>
10 years agoconfigure: Disable xvmc by default
Tom Stellard [Mon, 6 Jan 2014 02:49:03 +0000 (18:49 -0800)]
configure: Disable xvmc by default

The xvmc unit tests are failing on r300g and r600g.

Reviewed-by: Vinson Lee <vlee@freedesktop.org>
10 years agoglsl: Remove exec_list iterators now that nothing uses them.
Kenneth Graunke [Fri, 22 Nov 2013 11:42:06 +0000 (03:42 -0800)]
glsl: Remove exec_list iterators now that nothing uses them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Replace iterators in ir_reader.cpp with ad-hoc list walking.
Kenneth Graunke [Sat, 11 Jan 2014 01:08:33 +0000 (17:08 -0800)]
glsl: Replace iterators in ir_reader.cpp with ad-hoc list walking.

These can't use foreach_list since they want to skip over the first few
list elements.  Just doing the ad-hoc list walking isn't too bad.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Use a new foreach_two_lists macro for walking two lists at once.
Kenneth Graunke [Sat, 11 Jan 2014 00:39:17 +0000 (16:39 -0800)]
glsl: Use a new foreach_two_lists macro for walking two lists at once.

When handling function calls, we often want to walk through the list of
formal parameters and list of actual parameters at the same time.
(Both are guaranteed to be the same length.)

Previously, we used a pattern of:

   exec_list_iterator 1st_iter = <1st list>.iterator();
   foreach_iter(exec_list_iterator, 2nd_iter, <2nd list>) {
      ...
      1st_iter.next();
   }

This was awkward, since you had to manually iterate through one of
the two lists.

This patch introduces a foreach_two_lists macro which safely walks
through two lists at the same time, so you can simply do:

   foreach_two_lists(1st_node, <1st list>, 2nd_node, <2nd list>) {
      ...
   }

v2: Rename macro from foreach_list2 to foreach_two_lists, as suggested
    by Ian Romanick.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Statically cast parameter exec_node to ir_variable.
Kenneth Graunke [Sat, 11 Jan 2014 00:13:54 +0000 (16:13 -0800)]
glsl: Statically cast parameter exec_node to ir_variable.

Formal function parameters are always ir_variable objects, not an
arbitrary ir_instruction.  So there's no need to dynamically cast here.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Cast ir_call parameters to ir_rvalue, not ir_instruction.
Kenneth Graunke [Sat, 23 Nov 2013 17:51:52 +0000 (09:51 -0800)]
glsl: Cast ir_call parameters to ir_rvalue, not ir_instruction.

A function call's parameters are always rvalues.  ir_rvalue may not
always be a subclass of ir_instruction in the future, so we should use
the right one.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Replace foreach_iter and iter.remove() with foreach_list_safe.
Kenneth Graunke [Sat, 11 Jan 2014 00:46:26 +0000 (16:46 -0800)]
glsl: Replace foreach_iter and iter.remove() with foreach_list_safe.

foreach_list_safe allows you to safely remove the current node.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Convert piles of foreach_iter to foreach_list_safe.
Kenneth Graunke [Fri, 22 Nov 2013 10:10:15 +0000 (02:10 -0800)]
glsl: Convert piles of foreach_iter to foreach_list_safe.

In these cases, we edit the list (or at least might be), so we use the
foreach_list_safe variant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Convert piles of foreach_iter to the newer foreach_list macro.
Kenneth Graunke [Fri, 22 Nov 2013 09:25:42 +0000 (01:25 -0800)]
glsl: Convert piles of foreach_iter to the newer foreach_list macro.

foreach_iter and exec_list_iterators have been deprecated for some time now;
we just hadn't ever bothered to convert code to the newer foreach_list
and foreach_list_safe macros.

In these cases, we aren't editing the list, so we can use foreach_list
rather than foreach_list_safe.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: Ensure that all necessary state is re-emitted if we run out of aperture.
Paul Berry [Sat, 11 Jan 2014 02:56:14 +0000 (18:56 -0800)]
i965: Ensure that all necessary state is re-emitted if we run out of aperture.

Prior to this patch, if we ran out of aperture space during
brw_try_draw_prims(), we would rewind the batch buffer pointer
(potentially throwing some state that may have been emitted by
brw_upload_state()), flush the batch, and then try again.  However, we
wouldn't reset the dirty bits to the state they had before the call to
brw_upload_state().  As a result, when we tried again, there was a
danger that we wouldn't re-emit all the necessary state.  (Note: prior
to the introduction of hardware contexts, this wasn't a problem
because flushing the batch forced all state to be re-emitted).

This patch fixes the problem by leaving the dirty bits set at the end
of brw_upload_state(); we only clear them after we have determined
that we don't need to rewind the batch buffer.

Cc: 10.0 9.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agor600g: fix glClearBuffer by handling PIPE_CLEAR_COLORi flags correctly
Marek Olšák [Wed, 8 Jan 2014 12:56:30 +0000 (13:56 +0100)]
r600g: fix glClearBuffer by handling PIPE_CLEAR_COLORi flags correctly

also restructure the code

10 years agor600g: handle NULL colorbuffers correctly on R600-R700
Marek Olšák [Wed, 8 Jan 2014 17:13:24 +0000 (18:13 +0100)]
r600g: handle NULL colorbuffers correctly on R600-R700

10 years agor600g: handle NULL colorbuffers correctly on Evergreen
Marek Olšák [Wed, 8 Jan 2014 12:31:59 +0000 (13:31 +0100)]
r600g: handle NULL colorbuffers correctly on Evergreen

10 years agoradeonsi: handle NULL colorbuffers correctly
Marek Olšák [Wed, 8 Jan 2014 00:25:14 +0000 (01:25 +0100)]
radeonsi: handle NULL colorbuffers correctly

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agogallium/util: easy fixes for NULL colorbuffers
Marek Olšák [Wed, 8 Jan 2014 00:07:20 +0000 (01:07 +0100)]
gallium/util: easy fixes for NULL colorbuffers

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: bind NULL colorbuffers as specified by glDrawBuffers
Marek Olšák [Wed, 8 Jan 2014 00:09:15 +0000 (01:09 +0100)]
st/mesa: bind NULL colorbuffers as specified by glDrawBuffers

An example why it is required:

    Let's say there's a fragment shader writing to gl_FragData[0..1].
    The user calls: glDrawBuffers(2, {GL_NONE, GL_COLOR_ATTACHMENT0});

    That means gl_FragData[0] is unused and gl_FragData[1] is written
    to GL_COLOR_ATTACHMENT0.

st/mesa was skipping the GL_NONE draw buffer, therefore gl_FragData[0]
was written to GL_COLOR_ATTACHMENT0, which was wrong.

This commit fixes it, but drivers must also be fixed not to crash when
binding NULL colorbuffers. There is also a new set of piglit tests for this.

The MSAA state also had to be fixed not to crash when reading fb->cbufs[0].

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: handle GL_NONE draw buffers correctly in glClear
Marek Olšák [Wed, 8 Jan 2014 00:23:43 +0000 (01:23 +0100)]
mesa: handle GL_NONE draw buffers correctly in glClear

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: use sRGB formats for MSAA resolving if destination is sRGB
Marek Olšák [Tue, 7 Jan 2014 21:00:20 +0000 (22:00 +0100)]
st/mesa: use sRGB formats for MSAA resolving if destination is sRGB

Copied from the i965 driver, including the big comment.

Cc: 9.2 10.0 <mesa-stable@lists.freedesktop.org>
10 years agost/mesa: check depth and stencil writemask before clearing
Marek Olšák [Fri, 27 Dec 2013 18:10:03 +0000 (19:10 +0100)]
st/mesa: check depth and stencil writemask before clearing

10 years agost/mesa: always prefer pipe->clear over clear_with_quad (v2)
Marek Olšák [Fri, 6 Dec 2013 17:58:52 +0000 (18:58 +0100)]
st/mesa: always prefer pipe->clear over clear_with_quad (v2)

v2: clear depth and stencil together

10 years agost/egl: Flush resources before presentation
Martin Andersson [Thu, 26 Dec 2013 09:33:28 +0000 (10:33 +0100)]
st/egl: Flush resources before presentation

Fixes wayland regression on r600g due to fast clear introduced by commit
edbbfac6.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agodri: set yInverted default to GL_TRUE
Tapani Pälli [Wed, 8 Jan 2014 13:17:59 +0000 (15:17 +0200)]
dri: set yInverted default to GL_TRUE

yInverted is used by EGL_NOK_texture_from_pixmap to indicate that
window system rendering is y-inverted compared to OpenGL texture
representation. This extension is only known to be used with X11
window system where sane default is GL_TRUE.

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

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
10 years agoegl_dri2: call dri2_add_configs_for_visuals after extensions set
Tapani Pälli [Wed, 8 Jan 2014 13:17:58 +0000 (15:17 +0200)]
egl_dri2: call dri2_add_configs_for_visuals after extensions set

dri2_add_config makes decisions based on NOK_texture_from_pixmap so
it needs to be enabled before calling dri2_add_configs_for_visuals.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
10 years agomesa: Set the correct error in _mesa_BeginConditionalRender
Ian Romanick [Thu, 9 Jan 2014 22:08:55 +0000 (14:08 -0800)]
mesa: Set the correct error in _mesa_BeginConditionalRender

Piglit was recently changed to expect the correct error code (piglit
commit 271b998), so it started failing on Mesa.  This corrects that
failing and adds some spec quotations to justify the errrors set.

The code was rearranged a little bit to match the order listed in the
spec.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Delete duplicate write_timestamp function.
Kenneth Graunke [Wed, 11 Dec 2013 22:55:45 +0000 (14:55 -0800)]
i965: Delete duplicate write_timestamp function.

brw_queryobj.c needs a version of write_timestamp that works on all
generations for the QueryCounter() driver hook.  So there's no point in
duplicating it in gen6_queryobj.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Fix clears of layered framebuffers with mismatched layer counts.
Paul Berry [Tue, 7 Jan 2014 14:29:47 +0000 (06:29 -0800)]
i965: Fix clears of layered framebuffers with mismatched layer counts.

Previously, Mesa enforced the following rule (from
ARB_geometry_shader4's list of criteria for framebuffer completeness):

  * If any framebuffer attachment is layered, all attachments must have
    the same layer count.  For three-dimensional textures, the layer count
    is the depth of the attached volume.  For cube map textures, the layer
    count is always six.  For one- and two-dimensional array textures, the
    layer count is simply the number of layers in the array texture.
    { FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB }

However, when ARB_geometry_shader4 was adopted into GL 3.2, this rule
was dropped; GL 3.2 permits different attachments to have different
layer counts.  This patch brings Mesa in line with GL 3.2.

In order to ensure that layered clears properly clear all layers, we
now have to keep track of the maximum number of layers in a layered
framebuffer.

Fixes the following piglit tests in spec/!OpenGL 3.2/layered-rendering:
- clear-color-all-types 1d_array mipmapped
- clear-color-all-types 1d_array single_level
- clear-color-mismatched-layer-count
- framebuffer-layer-count-mismatch

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>