mesa.git
12 years agosvga: check that we don't exceed temp register limit
Brian Paul [Thu, 17 Nov 2011 23:36:26 +0000 (16:36 -0700)]
svga: check that we don't exceed temp register limit

And assert on the register index in dst_register().  The dest can
only be an output or temp reg and there's more of the later.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agoscons: Update windows llvm libraries for version 3.0.
José Fonseca [Thu, 23 Feb 2012 11:50:42 +0000 (11:50 +0000)]
scons: Update windows llvm libraries for version 3.0.

12 years agoAdd a test for the compare opcode.
Alex Corscadden [Wed, 8 Sep 2010 17:42:41 +0000 (10:42 -0700)]
Add a test for the compare opcode.

This is a test for the compare opcode (CMP).  This should draw a green triangle
in the fs-test.

12 years agor600g: Fix build when libdrm is installed to non-standard dir.
Satyajit Sarangi [Mon, 20 Feb 2012 06:17:56 +0000 (01:17 -0500)]
r600g: Fix build when libdrm is installed to non-standard dir.

Signed-off-by: Satyajit Sarangi<kernel.saty@gmail.com>
Signed-off-by: Tom Stellard <tstellar@gmail.com>
12 years agoi915: Initialize swrast_texture_image structure fields.
Paul Berry [Fri, 17 Feb 2012 00:00:45 +0000 (16:00 -0800)]
i915: Initialize swrast_texture_image structure fields.

Commit 980f6f1 (mesa: move gl_texture_image::Width/Height/DepthScale
fields to swrast) moved the initialization of the Width, Height, and
DepthScale fields to _swrast_alloc_texture_image_buffer().  However,
i915 doesn't call this function because it performs its own buffer
allocation.  As a result, the Width, Height, and DepthScale fields
weren't getting initialized properly, and some operations requiring
swrast would fail.

This patch ensures that Width, Height, and DepthScale are properly
initialized by separating the code that sets them into a new function,
_swrast_init_texture_image(), which is called by
intel_alloc_texture_image_buffer() as well as
_swrast_alloc_texture_image_buffer().  It also moves the
initialization of _IsPowerOfTwo into this function.

Fixes piglit test fbo/fbo-cubemap on i915.

Partially fixes https://bugs.freedesktop.org/show_bug.cgi?id=41216

This is a candidate for the 8.0 branch.

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agointel: bump DRI_IMAGE extension version to 3
Jesse Barnes [Wed, 22 Feb 2012 17:52:09 +0000 (09:52 -0800)]
intel: bump DRI_IMAGE extension version to 3

To indicate support for the format query.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agogbm: track buffer format through DRI drivers
Jesse Barnes [Tue, 21 Feb 2012 20:53:09 +0000 (12:53 -0800)]
gbm: track buffer format through DRI drivers

GBM needs the buffer format in order to communicate with DRM and clients
for things like scanout.

So track the DRI format requested in the various back ends and use it to
return the DRI format back to GBM when requested.  GBM will then map
this into the GBM surface type (which is in turn based on the DRM fb
format list).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agotests/graw: Add a bunch of tests.
José Fonseca [Wed, 22 Feb 2012 15:22:31 +0000 (15:22 +0000)]
tests/graw: Add a bunch of tests.

These were rotting in an internal branch, but contain nothing confidential,
and would be much more useful if kept up-to-date with latest gallium
interface changes.

Several authors including Keith Whitwell, Zack Rusin, and Brian Paul.

12 years agomesa: add special case in texstore.c for GL_LUMINANCE_ALPHA src image
Brian Paul [Thu, 17 Nov 2011 23:03:35 +0000 (16:03 -0700)]
mesa: add special case in texstore.c for GL_LUMINANCE_ALPHA src image

About a 10% improvement over the swizzle-copy path.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agogallium/cso: Put the comment about shader in the code for future reference.
José Fonseca [Wed, 22 Feb 2012 08:41:19 +0000 (08:41 +0000)]
gallium/cso: Put the comment about shader in the code for future reference.

12 years agoi965/gen6: Fix near-NULL deref in setting up GS binding table for non-XFB.
Eric Anholt [Tue, 21 Feb 2012 21:17:40 +0000 (13:17 -0800)]
i965/gen6: Fix near-NULL deref in setting up GS binding table for non-XFB.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Correct the size of the state batch space allocated for binding tables.
Eric Anholt [Tue, 21 Feb 2012 21:05:57 +0000 (13:05 -0800)]
i965: Correct the size of the state batch space allocated for binding tables.

In the gen6 GS case, we were under-counting and so other state would
get smashed.  In the VS case, we were over-counting, so everything was
fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Fix a bad comment in gen6 sol setup.
Eric Anholt [Tue, 21 Feb 2012 21:04:12 +0000 (13:04 -0800)]
i965: Fix a bad comment in gen6 sol setup.

This was copy and paste from the VS where I had similar code.  We're
only looking at things derived from BRW_NEW_VERTEX_PROGRAM in this
block.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/gen6: Fix the size of the GS surface binding table.
Eric Anholt [Tue, 21 Feb 2012 20:56:29 +0000 (12:56 -0800)]
i965/gen6: Fix the size of the GS surface binding table.

I obviously didn't test on gen6 before pushing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agor600g: move invariant register updates into start_cs for evergreen and cayman
Marek Olšák [Wed, 8 Feb 2012 22:25:58 +0000 (23:25 +0100)]
r600g: move invariant register updates into start_cs for evergreen and cayman

12 years agor600g: move invariant register updates into start_cs for r6xx-r7xx
Marek Olšák [Fri, 3 Feb 2012 04:05:31 +0000 (05:05 +0100)]
r600g: move invariant register updates into start_cs for r6xx-r7xx

12 years agor600g: add a depth misc state which depends on occlusion queries
Marek Olšák [Thu, 2 Feb 2012 13:01:12 +0000 (14:01 +0100)]
r600g: add a depth misc state which depends on occlusion queries

This is a state which is derived from other states and is actually the first
state which doesn't correspond to any gallium state.

There are two state flags:
  bool occlusion_query_enabled
  bool flush_depthstencil_enabled

Additional flags can be added later if needed, e.g. bool hiz_enabled.
The emit function will have to figure out the register values by itself.

It basically just emits the registers when the state changes.
This commit also adds a few helper functions for writing registers directly
into a command stream.

12 years agor600g: consolidate the main draw code
Marek Olšák [Thu, 2 Feb 2012 09:04:29 +0000 (10:04 +0100)]
r600g: consolidate the main draw code

The code was almost the same for r600 and eg. What can't be consolidated is
in the *_prepare functions.

12 years agor600g: move all invariant state from draw_vbo into start_cs
Marek Olšák [Thu, 2 Feb 2012 07:27:01 +0000 (08:27 +0100)]
r600g: move all invariant state from draw_vbo into start_cs

12 years agor600g: turn init_config into a command buffer for starting a CS
Marek Olšák [Tue, 31 Jan 2012 09:50:51 +0000 (10:50 +0100)]
r600g: turn init_config into a command buffer for starting a CS

This is the first pure command buffer. It contains CS initialization
packets and emits invariant state (i.e. the registers which never or rarely
change).

The affected registers are removed from *_hw_context.c, so that both ways
of emitting commands can co-exist.

v2: emit context_control in cayman's start_cs too

12 years agoi965: Only set Last Render Target Select on the last FB write.
Kenneth Graunke [Sun, 19 Feb 2012 05:29:29 +0000 (21:29 -0800)]
i965: Only set Last Render Target Select on the last FB write.

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

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38720
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40059
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45216
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agogallium/cso: kill off non-functional shader caching
Marek Olšák [Fri, 17 Feb 2012 01:13:32 +0000 (02:13 +0100)]
gallium/cso: kill off non-functional shader caching

Suggested by José.

We don't provide shader caching in CSO. Most of the time the api provides
object semantics for shaders anyway, and the cases where it doesn't
(eg mesa's internall-generated texenv programs), it will be up to
the state tracker to implement their own specialized caching.

12 years agogallium/util: remove u_simple_screen
Marek Olšák [Fri, 17 Feb 2012 00:54:37 +0000 (01:54 +0100)]
gallium/util: remove u_simple_screen

Deprecated and unused.

12 years agogallium: remove unused winsys pointers in pipe_screen and pipe_context
Marek Olšák [Fri, 17 Feb 2012 00:49:49 +0000 (01:49 +0100)]
gallium: remove unused winsys pointers in pipe_screen and pipe_context

A winsys is already a private object of a driver.

12 years agointel: Silence valgrind warning for getparam ioctl argument.
Eric Anholt [Thu, 16 Feb 2012 19:30:49 +0000 (11:30 -0800)]
intel: Silence valgrind warning for getparam ioctl argument.

It was concerned that the 4 pad bytes on LP64 were uninitialized.

12 years agoi965: Rename the original binding table to mention that it's the WM now.
Eric Anholt [Wed, 15 Feb 2012 22:24:37 +0000 (14:24 -0800)]
i965: Rename the original binding table to mention that it's the WM now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Split the gen6 GS binding table to a separate table.
Eric Anholt [Wed, 15 Feb 2012 22:15:14 +0000 (14:15 -0800)]
i965: Split the gen6 GS binding table to a separate table.

Improves VS state change microbenchmark performance by 7.08729% +/-
1.22289% (n=10) on gen7, because we don't upload the 64 dwords of
unused binding table any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Split the VS binding table to a separate table.
Eric Anholt [Wed, 15 Feb 2012 21:33:07 +0000 (13:33 -0800)]
i965: Split the VS binding table to a separate table.

This is a step toward making the samplers/binding tables reflect
sampler uniform mappings instead of embedding those in the programs.
No significant performance difference on the microbenchmark (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/gen6+: Avoid recomputing whether we use noperspective.
Eric Anholt [Wed, 15 Feb 2012 20:57:25 +0000 (12:57 -0800)]
i965/gen6+: Avoid recomputing whether we use noperspective.

Improves VS state change microbenchmark performance 2.38246% +/-
1.15046% (n=20).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/gen7: Skip checking if we need a GS program for now.
Eric Anholt [Wed, 15 Feb 2012 18:55:02 +0000 (10:55 -0800)]
i965/gen7: Skip checking if we need a GS program for now.

We always say no.  Improves VS state change microbenchmark performance
7.68747% +/- 1.40826% (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Compute required barycentric interp modes once at FS compile time.
Eric Anholt [Wed, 15 Feb 2012 05:48:43 +0000 (21:48 -0800)]
i965: Compute required barycentric interp modes once at FS compile time.

Improves VS state change microbenchmark performance 1.78817% +/-
0.556878% (n=25).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Move VUE map computation to once at VS compile time.
Eric Anholt [Mon, 13 Feb 2012 18:08:23 +0000 (10:08 -0800)]
i965: Move VUE map computation to once at VS compile time.

With this and the previous patch, 640x480 nexuiz is running 0.169118%
+/- 0.0863696% faster (n=121).  On a VS state change microbenchmark,
performance is increased 8.28645% +/- 0.460478% (n=52).

v2: Fix CACHE_NEW_VS comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Make the userclip flag for the VUE map come from VS prog data.
Eric Anholt [Mon, 13 Feb 2012 18:00:14 +0000 (10:00 -0800)]
i965: Make the userclip flag for the VUE map come from VS prog data.

This reduces recomputation of state based on non-clipping-related
transform changes, and is a step toward removing VUE map
recomputation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: fix issues with texture border and array textures
Anuj Phogat [Wed, 15 Feb 2012 23:40:51 +0000 (15:40 -0800)]
mesa: fix issues with texture border and array textures

For a 1D texture array, the border only applies to the width.  For a 2D
texture array the border applies to the width and height but not the depth.
Sucha cases were  not handled correctly in _mesa_init_teximage_fields().

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoradeon/r600g: fix virtual address space allocation
Jerome Glisse [Tue, 21 Feb 2012 17:34:54 +0000 (12:34 -0500)]
radeon/r600g: fix virtual address space allocation

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
12 years agollvmpipe: Remove lp_test_sincos.
José Fonseca [Tue, 21 Feb 2012 16:04:54 +0000 (16:04 +0000)]
llvmpipe: Remove lp_test_sincos.

Completely replaced by lp_test_arit.

12 years agovl: add support for bob deinterlacing
Christian König [Fri, 10 Feb 2012 13:32:16 +0000 (14:32 +0100)]
vl: add support for bob deinterlacing

v2: return VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE
    for unknown picture structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: Use transfer_inline_write to upload ycbcr data
Christian König [Fri, 10 Feb 2012 11:56:27 +0000 (12:56 +0100)]
st/vdpau: Use transfer_inline_write to upload ycbcr data

Uses less code and looks at least a bit cleaner than mapping manually.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: remove unnecessary tracing and adjust tracing levels a bit
Christian König [Fri, 10 Feb 2012 11:34:22 +0000 (12:34 +0100)]
st/vdpau: remove unnecessary tracing and adjust tracing levels a bit

Tracing function entry/exits is a bit pointless
when VDPAU_TRACE=1 does the same thing.

v2: use WARN instead of ERR for application problems

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agogallivm: Fix TGSI_OPCODE_ARR's translation.
José Fonseca [Mon, 20 Feb 2012 20:49:03 +0000 (20:49 +0000)]
gallivm: Fix TGSI_OPCODE_ARR's translation.

Like TGSI_OPCODE_ARL, destination should be an integer.

This fixes invalid LLVM IR on an internal state tracker (currently Mesa
never emits this opcode).

In the future consider making ADDR register also a integer-as-float array,
like all other register kinds, or simply replace ADDR & ARR/ARL with
integer temp and instructions.

Reviewed-by: Dave Airlie <airlied@redhat.com>
12 years agost/egl: Move drm_display_authenticate into HAVE_WAYLAND_BACKEND section.
Vinson Lee [Sat, 18 Feb 2012 19:16:18 +0000 (11:16 -0800)]
st/egl: Move drm_display_authenticate into HAVE_WAYLAND_BACKEND section.

Fixes this GCC warning.
native_drm.c:153:1: warning: ‘drm_display_authenticate’ defined but not
used [-Wunused-function]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agollvmpipe: Don't assume vector is 4 wide in lp_build_sin()/lp_build_cos()
José Fonseca [Fri, 17 Feb 2012 16:22:18 +0000 (16:22 +0000)]
llvmpipe: Don't assume vector is 4 wide in lp_build_sin()/lp_build_cos()

Reviewed-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: check for no state change in glPrimitiveRestartIndex()
Brian Paul [Mon, 20 Feb 2012 02:50:32 +0000 (19:50 -0700)]
mesa: check for no state change in glPrimitiveRestartIndex()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: check for no state change in Enable/DisableVertexAttribArray()
Brian Paul [Mon, 20 Feb 2012 02:50:31 +0000 (19:50 -0700)]
mesa: check for no state change in Enable/DisableVertexAttribArray()

Avoid setting dirty state flags when enabling or disabling a vertex
attribute arrays when there's no change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: add missing return after _mesa_error() in update_array()
Brian Paul [Mon, 20 Feb 2012 02:50:31 +0000 (19:50 -0700)]
mesa: add missing return after _mesa_error() in update_array()

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agor300g: Fix build when libdrm is installed to non-standard dir
Tom Stellard [Mon, 20 Feb 2012 00:37:30 +0000 (19:37 -0500)]
r300g: Fix build when libdrm is installed to non-standard dir

12 years agoi965: Make the dummy fragment shader work in SIMD16 mode.
Kenneth Graunke [Sat, 18 Feb 2012 21:08:29 +0000 (13:08 -0800)]
i965: Make the dummy fragment shader work in SIMD16 mode.

If you're resorting to the dummy shader, you've probably already turned
off SIMD16 mode.  But if you didn't, it would die in a fire.

We could either fail to compile in SIMD16 mode...or just fix it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Fix GPU hangs in the dummy fragment shader.
Kenneth Graunke [Sat, 18 Feb 2012 20:59:40 +0000 (12:59 -0800)]
i965: Fix GPU hangs in the dummy fragment shader.

The dummy FB write failed to specify EOT and a message length, causing
the GPU to hang.  Now we can enjoy "everyone's favorite color" again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agost/vega: Remove unused variable.
Vinson Lee [Sat, 18 Feb 2012 08:32:53 +0000 (00:32 -0800)]
st/vega: Remove unused variable.

Fixes this GCC warning.
mask.c: In function ‘mask_layer_fill’:
mask.c:387:12: warning: variable ‘alpha_color’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agost/glx: Remove unused variables.
Vinson Lee [Sat, 18 Feb 2012 08:18:52 +0000 (00:18 -0800)]
st/glx: Remove unused variables.

Fixes these GCC warnings.
glx_api.c: In function ‘choose_visual’:
glx_api.c:678:8: warning: variable ‘trans_value’ set but not used
[-Wunused-but-set-variable]
glx_api.c:677:8: warning: variable ‘trans_type’ set but not used
[-Wunused-but-set-variable]
glx_api.c:663:8: warning: variable ‘min_ci’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agodraw: add missing streamout state setup for draw/llvm.
Dave Airlie [Sat, 18 Feb 2012 12:43:37 +0000 (12:43 +0000)]
draw: add missing streamout state setup for draw/llvm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agovbo: Eliminate short-circuiting in invalid-start case.
Kenneth Graunke [Wed, 8 Feb 2012 13:08:24 +0000 (05:08 -0800)]
vbo: Eliminate short-circuiting in invalid-start case.

Now that we have a index_range_invalid flag, we can just use that rather
than calling vbo_validated_drawrangeelements directly and returning.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agovbo: Rework checking of 'end' against _MaxElement.
Kenneth Graunke [Wed, 8 Feb 2012 13:08:23 +0000 (05:08 -0800)]
vbo: Rework checking of 'end' against _MaxElement.

This failed to take basevertex into account:

If basevertex < 0:
   (end + basevertex) might actually be in-bounds while 'end' is not.
   We would have clamped in this case when we probably shouldn't.
   This could break application drawing.

If basevertex > 0:
   'end' might be in-bounds while (end + basevertex) might not.
   We would have failed to clamp in this place.  There's a comment
   indicating the TNL module depends on max_index being in-bounds;
   if so, it would likely break horribly.

Rather than trying to clamp correctly in the face of basevertex, simply
delete the clamping code and indicate that we don't have a valid range.
This causes _tnl_vbo_draw_prims to use vbo_get_minmax_indices() to
compute the actual bounds, which is much safer.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
12 years agovbo: Ignore invalid element ranges which are outside VBO bounds.
Kenneth Graunke [Wed, 8 Feb 2012 13:08:22 +0000 (05:08 -0800)]
vbo: Ignore invalid element ranges which are outside VBO bounds.

Some applications, such as Regnum Online, appear to pass invalid
start/end values to glDrawRangeElements.  In particular, the 'start'
index sometimes exceeds the maximum array element.  This is clearly
invalid behavior, and although the spec isn't clear, seems to result
in undefined, implementation-specific behavior.

This patch takes the conservative approach and simply ignores the range,
while issuing a warning indicating that the application is broken and
should be fixed.

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45214
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44701
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40361
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28138
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
12 years agovbo: Remove pedantic warning about 'end' beind out of bounds.
Kenneth Graunke [Wed, 8 Feb 2012 13:08:21 +0000 (05:08 -0800)]
vbo: Remove pedantic warning about 'end' beind out of bounds.

The application supplied [start, end] range is merely a conservative
hint of the ranges of index values inside the index buffer.  There is no
requirement that all vertices in the range [start, end] be referenced.

Passing an 'end' value larger than the maximum legal index is perfectly
acceptible; applications can legally pass 0xffffffff when they don't
have a tighter bound readily available.

Thus, the warning doesn't indicate a correctness issue; it could only
indicate a performance issue.  However, it does not even do that.

glDrawRangeElements is designed to optimize non-VBO vertex data uploads
by providing an upper bound on the size of buffers a driver would need
to allocate.  With VBOs, the data is already in an uploaded buffer, so
the range doesn't help.

The clincher is: we only know _MaxElement for VBOs.  For user-space
arrays, we just set it to 2,000,000,000 (see mesa/main/varray.h:63.)
So we can only check this in the case where it is not useful.

Many applications, including the Unigine demos, currently trigger this
warning, which suggests the applications are buggy when they're actually
fine.  Eliminating the warning should confuse users less while not
actually losing any benefit to application developers.

NOTE: This is a candidate for release branches.

Suggested-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
12 years agointel: Fix rendering from textures after RenderTexture().
Eric Anholt [Fri, 10 Feb 2012 20:54:25 +0000 (12:54 -0800)]
intel: Fix rendering from textures after RenderTexture().

There's a serious trap for drivers: RenderTexture() does not indicate
that the texture is currently bound to the draw buffer, despite
FinishRenderTexture() signaling that the texture is just now being
unbound from the draw buffer.

We were acting as if RenderTexture() *was* the start of rendering and
that we could make texturing incoherent with the current contents of
the renderbuffer.  This caused intel oglconform sRGB
Mipmap.1D_textures to fail, because we got a call to TexImage() and
thus RenderTexture() on a texture bound to a framebuffer that wasn't
the draw buffer, so we skipped validating the new image into the
texture object used for rendering.

We can't (easily) make RenderTexture() indicate the start of drawing,
because both our driver and gallium are using it as the moment to set
up the renderbuffer wrapper used for things like MapRenderbuffer().
Instead, postpone the setup of the workaround render target miptree
until update_renderbuffer time, so that we no longer need to skip
validation of miptrees used as render targets.  As a bonus, this
should make GL_NV_texture_barrier possible.

(This also fixes a regression in the gen4 small-mipmap rendering since
3b38b33c1648b07e75dc4d8340758171e109c598, which switched
set_draw_offset from image->mt to irb->mt but didn't move the irb->mt
replacement up before set_draw_offset).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44961
NOTE: This is a candidate for the 8.0 branch.

12 years agointel: Improve the fallback debug for framebuffer status checks.
Eric Anholt [Fri, 10 Feb 2012 20:24:50 +0000 (12:24 -0800)]
intel: Improve the fallback debug for framebuffer status checks.

12 years agomesa: Only end render-to-texture at bind time for drawbuffers.
Eric Anholt [Fri, 10 Feb 2012 20:05:16 +0000 (12:05 -0800)]
mesa: Only end render-to-texture at bind time for drawbuffers.

If we're only starting for new draw buffers, why would we end for old
read buffers along with draw buffers?

12 years agogallivm: fetch immediates to correct type (v2)
Dave Airlie [Mon, 6 Feb 2012 18:48:17 +0000 (18:48 +0000)]
gallivm: fetch immediates to correct type (v2)

Fetch float/uint/int immediates.

v2: bitcast to uint/int to floats as per Jose's suggestions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: enable stores of integer types. (v2) + fix ARL
Dave Airlie [Mon, 6 Feb 2012 15:37:56 +0000 (15:37 +0000)]
gallivm: enable stores of integer types. (v2) + fix ARL

Infer from the operand the type of value to store.
MOV is untyped but we use the float store path.

v2: make MOV use float store path.

I've had to squash merge the ARL fix to be stored
as an integer in here to avoid regressions in a number
of piglit tests.

From now on ARL stores to an integer just like HW does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: enable fetch for integer opcodes. (v2)
Dave Airlie [Mon, 6 Feb 2012 15:35:05 +0000 (15:35 +0000)]
gallivm: enable fetch for integer opcodes. (v2)

The infers the type of data required using the opcode,
and casts the input to the appropriate type.

So far this only handles non-indirect constant and temporaries.

v2: as per Jose suggestion, fetch immediates via floats

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: add uint/int bld to the base builder. (v2)
Dave Airlie [Mon, 6 Feb 2012 15:28:45 +0000 (15:28 +0000)]
gallivm: add uint/int bld to the base builder. (v2)

These are used inside the action handlers for the integer opcodes.

v2: use uint_bld/int_bld, drop higher level uint_bld.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: fix build gather to take a bld context
Dave Airlie [Tue, 7 Feb 2012 09:52:00 +0000 (09:52 +0000)]
gallivm: fix build gather to take a bld context

Then pass the correct build context to it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: pass build context to exec_mask_store.
Dave Airlie [Mon, 6 Feb 2012 13:35:46 +0000 (13:35 +0000)]
gallivm: pass build context to exec_mask_store.

For now just pass the current context, but when we want to
store int or unsigned we need to pass those later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agotgsi: add source/destination type from opcodes. (v2)
Dave Airlie [Tue, 24 Jan 2012 11:55:14 +0000 (11:55 +0000)]
tgsi: add source/destination type from opcodes. (v2)

These two functions produce the src/dst types for an opcode.

MOV is special since it can be used to mov float->float and int->int,
so just return VOID.

v2: use a new enum for the opcode type as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: Initialize x86 disassembler on x86_64 too.
José Fonseca [Fri, 17 Feb 2012 17:22:23 +0000 (17:22 +0000)]
gallivm: Initialize x86 disassembler on x86_64 too.

12 years agollvmpipe: Test lp_test_arit with LP_NATIVE_VECTOR_WIDTH.
José Fonseca [Fri, 17 Feb 2012 16:17:28 +0000 (16:17 +0000)]
llvmpipe: Test lp_test_arit with LP_NATIVE_VECTOR_WIDTH.

Instead of assuming 4 wide vectors.

12 years agollvmpipe: Specify lp_test_arit's target precision per function.
José Fonseca [Fri, 17 Feb 2012 16:10:22 +0000 (16:10 +0000)]
llvmpipe: Specify lp_test_arit's target precision per function.

12 years agollvmpipe: Add a negation test to lp_test_arit.
José Fonseca [Fri, 17 Feb 2012 15:57:54 +0000 (15:57 +0000)]
llvmpipe: Add a negation test to lp_test_arit.

12 years agodocs: News and release notes link for 8.0.1
Ian Romanick [Fri, 17 Feb 2012 07:31:28 +0000 (23:31 -0800)]
docs: News and release notes link for 8.0.1

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodocs: Add 8.0.1 release md5sums
Ian Romanick [Fri, 17 Feb 2012 07:25:14 +0000 (23:25 -0800)]
docs: Add 8.0.1 release md5sums

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

12 years agodocs: Add 8.0.1 release notes
Ian Romanick [Fri, 17 Feb 2012 02:55:18 +0000 (18:55 -0800)]
docs: Add 8.0.1 release notes

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

12 years agor300g: don't use pipe_screen::winsys
Marek Olšák [Fri, 17 Feb 2012 00:39:48 +0000 (01:39 +0100)]
r300g: don't use pipe_screen::winsys

12 years agor300g: don't use pipe_context::winsys
Marek Olšák [Fri, 17 Feb 2012 00:26:21 +0000 (01:26 +0100)]
r300g: don't use pipe_context::winsys

12 years agomesa: Update the version string to 8.1-devel
Ian Romanick [Thu, 16 Feb 2012 23:28:29 +0000 (15:28 -0800)]
mesa: Update the version string to 8.1-devel

The numeric version was updated in 46883e0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodocs: replace gitweb link with cgit link
Brian Paul [Thu, 16 Feb 2012 20:35:02 +0000 (13:35 -0700)]
docs: replace gitweb link with cgit link

12 years agomesa: add missing texture integer test in glTexSubImage()
Brian Paul [Wed, 15 Feb 2012 22:29:29 +0000 (15:29 -0700)]
mesa: add missing texture integer test in glTexSubImage()

If the texture format is integer, the incoming user data must also be
integer (and similarly for non-integer textures).

NOTE: This is a candidate for the stable branches.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agor600g: remove the workaround for quads and provoking vertex
Marek Olšák [Thu, 16 Feb 2012 13:45:35 +0000 (14:45 +0100)]
r600g: remove the workaround for quads and provoking vertex

12 years agor600g: remove redundant r600_context::vs_so_stride_in_dw
Marek Olšák [Thu, 2 Feb 2012 14:04:13 +0000 (15:04 +0100)]
r600g: remove redundant r600_context::vs_so_stride_in_dw

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

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

Fixes a regression in glean/fbo since 28cfa1fa213fe.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.
Eric Anholt [Mon, 13 Feb 2012 21:36:06 +0000 (13:36 -0800)]
mesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.

Fixes (with the previous commit) piglit GL_ARB_multisample/pushpop.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Fix push/pop of multisample coverage invert.
Eric Anholt [Mon, 13 Feb 2012 21:24:39 +0000 (13:24 -0800)]
mesa: Fix push/pop of multisample coverage invert.

In the table of of push/pop attributes, this one doesn't fall under
the enable group.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoswrast: Only avoid empty _TexEnvPrograms
Ian Romanick [Sat, 11 Feb 2012 00:00:27 +0000 (16:00 -0800)]
swrast: Only avoid empty _TexEnvPrograms

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

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

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

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

This fixes build errors like

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lucas Stach <dev@lynxeye.de>
12 years agost/mesa: fix typo: s/patent/parent/
Brian Paul [Mon, 13 Feb 2012 23:14:44 +0000 (16:14 -0700)]
st/mesa: fix typo: s/patent/parent/

12 years agost/mesa: remove unused st_equal_formats() function
Brian Paul [Tue, 14 Feb 2012 15:47:28 +0000 (08:47 -0700)]
st/mesa: remove unused st_equal_formats() function

It was incomplete and didn't take byte swapping into account either.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: use _mesa_format_matches_format_and_type() in decompress_with_blit()
Brian Paul [Tue, 14 Feb 2012 15:46:03 +0000 (08:46 -0700)]
st/mesa: use _mesa_format_matches_format_and_type() in decompress_with_blit()

st_equal_formats() is no longer used now.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove INLINE qualifiers
Brian Paul [Mon, 13 Feb 2012 22:41:57 +0000 (15:41 -0700)]
st/mesa: remove INLINE qualifiers

from st_get/create_texture_sampler_view_from stobj() functions.
No real value in these cases.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: simplify st_create_texture_sampler_view()
Brian Paul [Mon, 13 Feb 2012 21:51:14 +0000 (14:51 -0700)]
st/mesa: simplify st_create_texture_sampler_view()

Implement in terms of st_create_texture_sampler_view_format().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove unused st_get_texture_sampler_view()
Brian Paul [Mon, 13 Feb 2012 21:49:08 +0000 (14:49 -0700)]
st/mesa: remove unused st_get_texture_sampler_view()

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: use private pipe_sampler_view in decompress_with_blit()
Brian Paul [Mon, 13 Feb 2012 21:48:36 +0000 (14:48 -0700)]
st/mesa: use private pipe_sampler_view in decompress_with_blit()

Similar to the previous commit.  Also fix incorrect setting of the
sampler view's state after it's created.  We need to specify the
first/last_level fields in the template instead.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: use private pipe_sampler_view in st_render_mipmap()
Brian Paul [Mon, 13 Feb 2012 21:46:11 +0000 (14:46 -0700)]
st/mesa: use private pipe_sampler_view in st_render_mipmap()

Rather than the one in st_texture_object.  This sampler view really has
no connection to the one used for rendering.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: use z32f_x24s8 struct in format pack/unpack code
Brian Paul [Mon, 13 Feb 2012 17:06:54 +0000 (10:06 -0700)]
mesa: use z32f_x24s8 struct in format pack/unpack code

And remove needless & 0xff in _mesa_pack_uint_24_8_depth_stencil_row().
As suggested by José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agost/mesa: assorted clean-ups in st_cb_fbo.c
Brian Paul [Sun, 12 Feb 2012 23:48:14 +0000 (16:48 -0700)]
st/mesa: assorted clean-ups in st_cb_fbo.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove st_framebuffer_renderbuffer()
Brian Paul [Sun, 12 Feb 2012 23:44:51 +0000 (16:44 -0700)]
st/mesa: remove st_framebuffer_renderbuffer()

Just use _mesa_framebuffer_renderbuffer().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove st_get_default_texture()
Brian Paul [Sun, 12 Feb 2012 23:30:28 +0000 (16:30 -0700)]
st/mesa: remove st_get_default_texture()

Just use _mesa_get_fallback_texture() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: fix _mesa_get_fallback_texture() to handle all texture targets
Brian Paul [Wed, 4 Jan 2012 21:55:32 +0000 (14:55 -0700)]
mesa: fix _mesa_get_fallback_texture() to handle all texture targets

Previously, this function only handled 2D textures.

The fallback texture is used when we try to sample from an incomplete
texture object.  GLSL says sampling an incomplete texture should return
(0,0,0,1).

v2: use a 1-texel texture image, per José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: improve assertion/check for stencil format
Brian Paul [Sun, 12 Feb 2012 23:17:53 +0000 (16:17 -0700)]
st/mesa: improve assertion/check for stencil format

12 years agogallium: fix some comments in p_state.h
Brian Paul [Sat, 11 Feb 2012 03:32:40 +0000 (20:32 -0700)]
gallium: fix some comments in p_state.h

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack code
Brian Paul [Mon, 13 Feb 2012 15:49:34 +0000 (08:49 -0700)]
mesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack code

Added in _mesa_pack_uint_24_8_depth_stencil_row().  This could be hit
by something like glDrawPixels(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8)
into a MESA_FORMAT_Z32_FLOAT_X24S8 buffer.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>