mesa.git
12 years agoglx/dri2: Implement glx_screen_vtable::create_context_attribs for DRISW contexts
Ian Romanick [Thu, 1 Dec 2011 22:05:13 +0000 (14:05 -0800)]
glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRISW contexts

This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRISW
version 3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx/dri: Add utility function dri2_convert_glx_attribs
Ian Romanick [Thu, 1 Dec 2011 21:52:53 +0000 (13:52 -0800)]
glx/dri: Add utility function dri2_convert_glx_attribs

This converts all of the GLX data from glXCreateContextAttribsARB to
the values expected by the DRI driver interfaces.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agost/mesa: Reject forward-looking contexts
Ian Romanick [Thu, 1 Dec 2011 19:31:28 +0000 (11:31 -0800)]
st/mesa: Reject forward-looking contexts

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodri_util: Mostly stub implementation of dri2CreateContextAttribs
Ian Romanick [Thu, 1 Dec 2011 02:05:36 +0000 (18:05 -0800)]
dri_util: Mostly stub implementation of dri2CreateContextAttribs

This adds the function and modifies dri2CreateNewContextForAPI to call
it.  At this point only version 2 of the DRI2 API is advertised to the
loader.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Add extension strings for GLX_ARB_create_context and GLX_ARB_create_context_profile
Ian Romanick [Wed, 30 Nov 2011 19:12:56 +0000 (11:12 -0800)]
glx: Add extension strings for GLX_ARB_create_context and GLX_ARB_create_context_profile

Note that these extensions are not automatically enabled for screens
capable of direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Connect glXCreateContextAttribsARB to glXGetProcAddress
Ian Romanick [Wed, 30 Nov 2011 19:12:49 +0000 (11:12 -0800)]
glx: Connect glXCreateContextAttribsARB to glXGetProcAddress

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Initial implementation of glXCreateContextAttribsARB
Ian Romanick [Wed, 30 Nov 2011 18:33:37 +0000 (10:33 -0800)]
glx: Initial implementation of glXCreateContextAttribsARB

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx/dri2: Implement glx_screen_vtable::create_context_attribs for DRI2 contexts
Ian Romanick [Wed, 30 Nov 2011 21:15:08 +0000 (13:15 -0800)]
glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRI2 contexts

This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRI2 version
3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Implement glx_screen_vtable::create_context_attribs for indirect contexts
Ian Romanick [Wed, 30 Nov 2011 21:10:17 +0000 (13:10 -0800)]
glx: Implement glx_screen_vtable::create_context_attribs for indirect contexts

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Add glx_screen_vtable::create_context_attribs
Ian Romanick [Wed, 30 Nov 2011 21:06:59 +0000 (13:06 -0800)]
glx: Add glx_screen_vtable::create_context_attribs

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Use __glX_send_client_info with XCB
Ian Romanick [Tue, 29 Nov 2011 18:57:43 +0000 (10:57 -0800)]
glx: Use __glX_send_client_info with XCB

__glX_send_client_info only supports XCB, so use that instead of
__glXClientInfo when USE_XCB is defined.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Add __glX_send_client_info super function
Ian Romanick [Tue, 29 Nov 2011 01:50:07 +0000 (17:50 -0800)]
glx: Add __glX_send_client_info super function

This function picks the correct client-info protocol (based on the
server's GLX version and set of extensions) and sends it to the
server.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl-to-tgsi: handle ir_unop_round_even
Christoph Bumiller [Mon, 2 Jan 2012 20:11:45 +0000 (21:11 +0100)]
glsl-to-tgsi: handle ir_unop_round_even

12 years agoglsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced()
Bryan Cain [Mon, 2 Jan 2012 20:07:38 +0000 (14:07 -0600)]
glsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced()

12 years agoswrast: Remove dead code in _swrast_clear_depth_buffer()
Paul Berry [Thu, 29 Dec 2011 18:15:43 +0000 (10:15 -0800)]
swrast: Remove dead code in _swrast_clear_depth_buffer()

This code was generating the gcc warning:

  variable ‘clearValue’ set but not used [-Wunused-but-set-variable]

Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agoradeon: move declarations before code
Brian Paul [Mon, 2 Jan 2012 18:55:40 +0000 (11:55 -0700)]
radeon: move declarations before code

12 years agoradeon: add casts to silence warnings
Brian Paul [Mon, 2 Jan 2012 18:55:39 +0000 (11:55 -0700)]
radeon: add casts to silence warnings

12 years agoradeon: remove unused tex image function prototypes
Brian Paul [Mon, 2 Jan 2012 18:55:39 +0000 (11:55 -0700)]
radeon: remove unused tex image function prototypes

12 years agomesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functions
Brian Paul [Mon, 2 Jan 2012 18:55:39 +0000 (11:55 -0700)]
mesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functions

The were always zero.  When doing a sub-texture replacement we account
for the dstX/Y/Zoffsets when we map the texture image.  So no need to
pass them into the texstore code anymore.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: pass xoffset, yoffset = 0 to _mesa_texstore()
Brian Paul [Mon, 2 Jan 2012 18:55:39 +0000 (11:55 -0700)]
intel: pass xoffset, yoffset = 0 to _mesa_texstore()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Silence gcc warning about uninitialized "inst" in assert() case.
Eric Anholt [Fri, 30 Dec 2011 07:48:24 +0000 (23:48 -0800)]
i965: Silence gcc warning about uninitialized "inst" in assert() case.

12 years agoi965: Silence gcc warning from resizing EU store changes.
Eric Anholt [Fri, 30 Dec 2011 02:12:09 +0000 (18:12 -0800)]
i965: Silence gcc warning from resizing EU store changes.

12 years agovl: seperate shader buffers from components
Christian König [Thu, 22 Dec 2011 14:43:50 +0000 (15:43 +0100)]
vl: seperate shader buffers from components

Buffers for shader based decoding can now be
released without its component still being around.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Acked-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
12 years agor300g: inline r300_resource_set_properties
Marek Olšák [Sat, 31 Dec 2011 13:05:47 +0000 (14:05 +0100)]
r300g: inline r300_resource_set_properties

12 years agor300g: rework resource_copy_region, not changing pipe_resource
Marek Olšák [Thu, 29 Dec 2011 17:18:38 +0000 (18:18 +0100)]
r300g: rework resource_copy_region, not changing pipe_resource

Changing pipe_resource was wrong, because it can be used by other contexts
at the same time. This fixes the last possible race condition in r300g
that I know of.

This also fixes blitting NPOT compressed textures. Random pixels sometimes
appeared at the right-hand edge of the texture.

Finally, this removes r300_texture_desc::stride_in_pixels. It makes little
sense with sampler views and surfaces being able to override width0, height0,
and the format entirely.

12 years agou_blitter: expose functions for setting default views and surfaces for copying
Marek Olšák [Thu, 29 Dec 2011 17:07:22 +0000 (18:07 +0100)]
u_blitter: expose functions for setting default views and surfaces for copying

And more importantly, don't call u_sampler_view_default_template etc.
it was a source of bugs.

12 years agost_glsl_to_tgsi: translate interp mode for front/back color
Dave Airlie [Sat, 31 Dec 2011 13:48:19 +0000 (13:48 +0000)]
st_glsl_to_tgsi: translate interp mode for front/back color

this fixes a bunch of interpolation tests on softpipe at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agosoftpipe: reorder LIT to fix fp-lit-src-equals-dst
Dave Airlie [Sat, 31 Dec 2011 13:17:23 +0000 (13:17 +0000)]
softpipe: reorder LIT to fix fp-lit-src-equals-dst

This reorders the LIT operation like the r600 one to fix the
fp-lit-src-equals-dst piglit test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agollvmpipe: fix blending for intensity formats
Dave Airlie [Fri, 30 Dec 2011 20:10:26 +0000 (20:10 +0000)]
llvmpipe: fix blending for intensity formats

This fixes the piglit fbo-blending-formats test for standard, ARB_texture_float
and EXT_texture_snorm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agost/mesa: remove stImage->base.Face/Level assignments in st_TexImage()
Brian Paul [Fri, 30 Dec 2011 23:39:24 +0000 (16:39 -0700)]
st/mesa: remove stImage->base.Face/Level assignments in st_TexImage()

This fixes a regresssion (broken cube maps) caused by the
ctx->Driver.TexImage parameter simplification commit.  The target var
is always GL_TEXTURE_CUBE_MAP at this point so the Face field was always
getting set to zero.

These field assignments aren't needed anyway since core Mesa sets them.

12 years agou_format: fix latc fetches.
Dave Airlie [Fri, 30 Dec 2011 21:17:07 +0000 (21:17 +0000)]
u_format: fix latc fetches.

This fixes the latc fetches for llvmpipe, fixes
fbo-generatemipmap-formats GL_ARB_texture_compression
fbo-generatemipmap-formats GL_ATI_texture_compression_3dc
fbo-generatemipmap-formats GL_EXT_texture_compression_latc

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
12 years agou_format/rgtc: fix alpha values in returned texels.
Dave Airlie [Fri, 30 Dec 2011 20:29:08 +0000 (20:29 +0000)]
u_format/rgtc: fix alpha values in returned texels.

This fixes fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc
on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoglsl: fix usage of potentially undefined data_end union
Alexander von Gluck [Fri, 30 Dec 2011 15:48:43 +0000 (08:48 -0700)]
glsl: fix usage of potentially undefined data_end union

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/glx/xlib: check for null attrib_list in glXCreateContextAttribsARB()
Brian Paul [Fri, 30 Dec 2011 15:38:49 +0000 (08:38 -0700)]
st/glx/xlib: check for null attrib_list in glXCreateContextAttribsARB()

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

12 years agomesa: simplify Driver.GetCompressedTexImage() parameters
Brian Paul [Fri, 30 Dec 2011 15:24:56 +0000 (08:24 -0700)]
mesa: simplify Driver.GetCompressedTexImage() parameters

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: simplify Driver.CompressedTex[Sub]Image function parameters
Brian Paul [Fri, 30 Dec 2011 15:24:56 +0000 (08:24 -0700)]
mesa: simplify Driver.CompressedTex[Sub]Image function parameters

As with previous commits, the target, level and texObj info can be
obtained through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: simplify Driver.TexImage() parameters
Brian Paul [Fri, 30 Dec 2011 15:24:55 +0000 (08:24 -0700)]
mesa: simplify Driver.TexImage() parameters

As with TexSubImage(), the target, level and texObj values can be obtained
through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: simplify Driver.TexSubImage() parameters
Brian Paul [Fri, 30 Dec 2011 15:24:55 +0000 (08:24 -0700)]
mesa: simplify Driver.TexSubImage() parameters

There's no need to pass the target, level and texObj parameters since
they can be easily obtained from the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agost/mesa: remove TexSubImage code, use core mesa routines instead.
Brian Paul [Fri, 30 Dec 2011 15:24:55 +0000 (08:24 -0700)]
st/mesa: remove TexSubImage code, use core mesa routines instead.

Since the move to Map/UnmapTextureImage, the core mesa routines are
equivalent to what the state tracker was doing.

The TexImage functions can be replaced too, but there's a few differences
that will need to be handled.

12 years agou_format: fix inv_swizzles generation
Dave Airlie [Fri, 30 Dec 2011 10:52:16 +0000 (10:52 +0000)]
u_format: fix inv_swizzles generation

inv_swizzles is used in lp_tile_soa.py to create lp_tile_soa.c, we overwrite swizzles if they are already set.

This results in the i8 format getting alpha instead of red, and the l8 format
getting blue instead of red.

Fixes fbo-alphatest-formats, fbo-alphatest-formats ARB_texture_float,
and fbo-alphatest-formats EXT_texture_snorm on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: Manage fences per screen rather than per context.
Michel Dänzer [Fri, 30 Dec 2011 09:45:31 +0000 (10:45 +0100)]
r600g: Manage fences per screen rather than per context.

A fence is a screen object and can outlive the context it was created from.
The previous code would access freed memory in that case, resulting in
various problems.

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

Probably fixes: https://bugs.freedesktop.org/show_bug.cgi?id=43993

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agoi915g: Allocate tmp for KILP
Stéphane Marchesin [Fri, 30 Dec 2011 09:33:26 +0000 (01:33 -0800)]
i915g: Allocate tmp for KILP

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=44297

12 years agovbo: introduce vbo_sizeof_ib_type() function
Yuanhan Liu [Wed, 28 Dec 2011 05:54:42 +0000 (13:54 +0800)]
vbo: introduce vbo_sizeof_ib_type() function

introduce vbo_sizeof_ib_type() function to return the index data type
size. I see some place use switch(ib->type) to get the index data type,
which is sort of duplicate.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agollvmpipe: Remove useless draw_install_pstipple_stage call.
Stéphane Marchesin [Thu, 29 Dec 2011 01:34:56 +0000 (17:34 -0800)]
llvmpipe: Remove useless draw_install_pstipple_stage call.

It is #ifdef'd out, and is already called unconditionnaly a couple lines above.

Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
12 years agointel: Fix memory leak in intel_miptree_create()
Chad Versace [Tue, 27 Dec 2011 18:10:05 +0000 (10:10 -0800)]
intel: Fix memory leak in intel_miptree_create()

On failure, intel_miptree_create() needs to *release* the miptree, not
just free it, so that the stencil_mt gets released too.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965/fs: Allow constant propagation into IF with embedded compare.
Eric Anholt [Mon, 19 Dec 2011 17:20:57 +0000 (09:20 -0800)]
i965/fs: Allow constant propagation into IF with embedded compare.

This saves a couple of instructions on most programs with control
flow.  More interestingly, 6 shaders from unigine sanctuary now fit
into 16-wide without register spilling.

12 years agointel: Drop the batchbuffer flush on glRenderbufferStorage().
Eric Anholt [Sat, 17 Dec 2011 00:22:33 +0000 (16:22 -0800)]
intel: Drop the batchbuffer flush on glRenderbufferStorage().

There's nothing batchbuffer-related here.  State updates by the caller
will trigger re-emitting of any new hardware state.

12 years agointel: Drop the batchbuffer flush on glFramebufferRenderbuffer().
Eric Anholt [Fri, 16 Dec 2011 21:43:26 +0000 (13:43 -0800)]
intel: Drop the batchbuffer flush on glFramebufferRenderbuffer().

There should be nothing special about this call compared to other
callers of intel_draw_buffer().

12 years agointel: Make the batchbuffer flush debug more useful.
Eric Anholt [Fri, 16 Dec 2011 21:42:39 +0000 (13:42 -0800)]
intel: Make the batchbuffer flush debug more useful.

We were printing out the line triggering the flush, but a variety of
different causes just printed the line number for intel_flush()'s call
of intel_batchbuffer_flush().  Plumb the line numbers from the caller
of intel_flush() on through.

12 years agointel: Fix performance regression in Lightsmark since HiZ changes.
Eric Anholt [Fri, 16 Dec 2011 21:18:55 +0000 (13:18 -0800)]
intel: Fix performance regression in Lightsmark since HiZ changes.

Since the refactor in d7b33309fe160212f2eb73f471f3aedcb5d0b5c1, depth
in the miptree changed from 1 to 6, so we always decided it didn't
match, and we would relayout to something that would still not
"match".

Improves performance 23.8% (+/- 1.1%, n=4)

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

12 years agointel: Don't consider miptrees for other texture targets to match.
Eric Anholt [Wed, 21 Dec 2011 23:15:09 +0000 (15:15 -0800)]
intel: Don't consider miptrees for other texture targets to match.

We would have done a relayout at validate time, but it's senseless to
store into a miptree if it's going to force relayout.

12 years agomesa: Use __builtin_ffsll on Mac OS X.
Vinson Lee [Wed, 28 Dec 2011 08:36:51 +0000 (00:36 -0800)]
mesa: Use __builtin_ffsll on Mac OS X.

Fixes this GCC warning.
arrayobj.c: In function '_mesa_update_array_object_max_element':
arrayobj.c:310: warning: implicit declaration of function 'ffsll'

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoi915g: Add missing draw_flush call.
Stéphane Marchesin [Wed, 28 Dec 2011 20:35:41 +0000 (12:35 -0800)]
i915g: Add missing draw_flush call.

Fixes a bunch of corruption bugs, especially some missing clipped triangles.

12 years agomesa: Re-add main/bitset.h to fix classic nouveau build failure.
José Fonseca [Wed, 28 Dec 2011 11:03:34 +0000 (11:03 +0000)]
mesa: Re-add main/bitset.h to fix classic nouveau build failure.

bitset.h is still used by classic nouveau -- see `git grep '\<BITSET_'`
-- and the state stored is too big to fit in 64bit integers (it requires
approximately 87 bits), so there is no obvious alternative here.

This effecively reverts commit 196800d79829a420073f762fac90090a7b416d2d.

12 years agomesa: Remove now unused main/bitset.h.
Mathias Fröhlich [Wed, 28 Dec 2011 06:14:51 +0000 (07:14 +0100)]
mesa: Remove now unused main/bitset.h.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.
Mathias Fröhlich [Tue, 27 Dec 2011 09:45:46 +0000 (10:45 +0100)]
mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.

Since commit 82b9661894315362f857192439bdcbc9db090387 and
34eae1c72a9b3a8eb0634cda52fca0208cd2f40d vbo support
is mandatory for all drivers. So, remove the remaining
FEATURE_ARB_vertex_buffer_object guards.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: Convert to use GLbitfield64 directly.
Mathias Fröhlich [Thu, 22 Dec 2011 19:12:20 +0000 (20:12 +0100)]
mesa: Convert to use GLbitfield64 directly.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agoradeon: Convert to use GLbitfield64 directly.
Mathias Fröhlich [Thu, 22 Dec 2011 19:12:20 +0000 (20:12 +0100)]
radeon: Convert to use GLbitfield64 directly.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agonouveau: Convert to use GLbitfield64 directly.
Mathias Fröhlich [Thu, 22 Dec 2011 19:12:20 +0000 (20:12 +0100)]
nouveau: Convert to use GLbitfield64 directly.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agoi915: Convert to use GLbitfield64 directly.
Mathias Fröhlich [Thu, 22 Dec 2011 19:12:20 +0000 (20:12 +0100)]
i915: Convert to use GLbitfield64 directly.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agomesa: Convert RENDERINPUTS* macros to GLbitfield64.
Mathias Fröhlich [Thu, 22 Dec 2011 19:12:20 +0000 (20:12 +0100)]
mesa: Convert RENDERINPUTS* macros to GLbitfield64.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agoi915g: Only apply the optimization to output vars.
Stéphane Marchesin [Fri, 23 Dec 2011 02:17:54 +0000 (18:17 -0800)]
i915g: Only apply the optimization to output vars.

This is a bit overkill, but otherwise we need to rename subsequent uses, which is a future TODO.
Reported by CME.

12 years agoi965/vs: Properly clear cur_value when propagating direct copies.
Kenneth Graunke [Sat, 24 Dec 2011 04:24:46 +0000 (20:24 -0800)]
i965/vs: Properly clear cur_value when propagating direct copies.

Consider the following code:

MOV A.x, B.x
MOV B.x, C.x

After the first line, cur_value[A][0] == B, indicating that A.x's
current value came from register B.

When processing the second line, we update cur_value[B][0] to C.
However, for drect copies, we fail to reset cur_value[A][0] to NULL.
This is necessary because the value of A is no longer the value of B.

Fixes Counter-Strike: Source in Wine (where the menu rendered completely
black in DX9 mode), completely white textures in Civilization V, and the
new Piglit test glsl-vs-copy-propagation-1.shader_test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42032
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/vs: Fix incorrect subscript when resetting copy propagation records.
Kenneth Graunke [Sat, 24 Dec 2011 03:57:08 +0000 (19:57 -0800)]
i965/vs: Fix incorrect subscript when resetting copy propagation records.

In this code, 'i' loops over the number of virtual GRFs, while 'j' loops
over the number of vector components (0 <= j <= 3).

It can't possibly be correct to see if bit 'i' is set in the destination
writemask, as it will have values much larger than 3.  Clearly this is
supposed to be 'j'.

Found by inspection.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Create mock implementation of GL_OES_EGL_image_external
Chad Versace [Thu, 22 Dec 2011 02:34:19 +0000 (18:34 -0800)]
i965: Create mock implementation of GL_OES_EGL_image_external

In Android IceCreamSandwich, SurfaceFlinger requires GL_OES_image_external
for basic compositing tasks. Without the extension, SurfaceFlinger fails
to start.

Despite the incompleteness of the extension's implementation introduced by
this patch, it is good enough to enable SurfaceFlinger and to unblock the
people who need to begin testing Mesa on IceCreamSandwich.

To enable the extension, set the environment variable
MESA_EXTENSION_OVERRIDE="+GL_OES_EGL_image_external". Ideally, Android
should set this in init.rc.

WARNING: This implementation of GL_OES_EGL_image_external is not complete.
Some of it is even incorrect. When we begin to really implement
GL_OES_EGL_image_external, much of the patch will need reverting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agometa: Disable GL_TEXTURE_EXTERNAL_OES in meta_begin()
Chad Versace [Thu, 22 Dec 2011 02:34:18 +0000 (18:34 -0800)]
meta: Disable GL_TEXTURE_EXTERNAL_OES in meta_begin()

If the meta flag MESA_META_TEXTURE is present, then disable the texture
target GL_TEXTURE_EXTERNAL_OES.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agomklib: tab cleanup, no functional change
Alexander von Gluck [Tue, 27 Dec 2011 16:18:18 +0000 (09:18 -0700)]
mklib: tab cleanup, no functional change

Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agomesa: fpclassify is available on Haiku
Alexander von Gluck [Tue, 27 Dec 2011 16:15:36 +0000 (09:15 -0700)]
mesa: fpclassify is available on Haiku

Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agoglu: remove BeOS define as BeOS is not longer a target platform
Alexander von Gluck [Tue, 27 Dec 2011 16:11:39 +0000 (09:11 -0700)]
glu: remove BeOS define as BeOS is not longer a target platform

Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agogallium: use Mesa pthread_barrier_t on Haiku, as it is incomplete under Haiku
Alexander von Gluck [Tue, 27 Dec 2011 16:02:59 +0000 (09:02 -0700)]
gallium: use Mesa pthread_barrier_t on Haiku, as it is incomplete under Haiku

Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agogallium/u_pack: fix l8/i8 pack color ub
Dave Airlie [Sat, 24 Dec 2011 19:30:26 +0000 (19:30 +0000)]
gallium/u_pack: fix l8/i8 pack color ub

just noticed this in passing, not sure it actually fixes any issus.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agovbo: Clean up recalculate_input_bindings.
Mathias Fröhlich [Tue, 1 Nov 2011 10:53:46 +0000 (11:53 +0100)]
vbo: Clean up recalculate_input_bindings.

Now the gl_array_object's layout matches the one used in
recalculate_input_bindings. Make use of this and remove the
bind_array_obj function.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agomklib: Add Haiku build support
Alexander von Gluck [Mon, 26 Dec 2011 23:23:03 +0000 (16:23 -0700)]
mklib: Add Haiku build support

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agoFix build with LLVM >= r145623.
Johannes Obermayr [Mon, 19 Dec 2011 22:11:46 +0000 (23:11 +0100)]
Fix build with LLVM >= r145623.

This is a workaround for https://bugs.freedesktop.org/show_bug.cgi?id=43861.

Actually the issue which makes -pedantic failing should be solved.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agoswrast: assert _swrast_map_teximage() x, y is multiple of block size
Brian Paul [Mon, 26 Dec 2011 21:49:57 +0000 (14:49 -0700)]
swrast: assert _swrast_map_teximage() x, y is multiple of block size

12 years agoswrast: replace assertion with conditional in _swrast_map_teximage()
Brian Paul [Mon, 26 Dec 2011 21:49:57 +0000 (14:49 -0700)]
swrast: replace assertion with conditional in _swrast_map_teximage()

Just in case we ran out of memory when trying to allocate the texture
memory.

12 years agomesa: fix signed/unsigned comparison warnings
Brian Paul [Mon, 26 Dec 2011 21:45:42 +0000 (14:45 -0700)]
mesa: fix signed/unsigned comparison warnings

12 years agovbo: signal _NEW_ARRAY when transitioning between glBegin/End, glDrawArrays
Brian Paul [Mon, 26 Dec 2011 21:43:07 +0000 (14:43 -0700)]
vbo: signal _NEW_ARRAY when transitioning between glBegin/End, glDrawArrays

This fixes a regression seen with the isosurf demo when switching between
glBegin/End and glDrawArrays (do it several times).  The problem was the
driver wasn't getting _NEW_ARRAY when the arrays were subtly changed:
(vertex3f, normal3f) vs. (normal3f, vertex3f).

This patch fixes that by signaling _NEW_ARRAY whenever we transition
between glBegin/End and glDrawArrays mode and display lists.

The patch also fixes up the initialization of the map_vp_none[] array
to stop putting strange values in the last five elements of the array.

v2: remove DRAW_ELEMENTS, don't distinguish between glDrawArrays and
glDrawElements

v3: add DRAW_DISPLAY_LIST for the display list case, just to be safe.

Reviewed-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Tested-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: remove leftovers from color indexed rendering.
Mathias Fröhlich [Mon, 26 Dec 2011 20:45:56 +0000 (21:45 +0100)]
mesa: remove leftovers from color indexed rendering.

Remove gl_light::_dli and gl_light::_sli.
Both are only used for a value previously used in
color indexed rendering. Also both variables are only used
and never written.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: remove unused _mesa_copy_materials.
Mathias Fröhlich [Mon, 26 Dec 2011 20:45:56 +0000 (21:45 +0100)]
mesa: remove unused _mesa_copy_materials.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agovl: call decode_bitstream only once
Christian König [Thu, 22 Dec 2011 14:24:46 +0000 (15:24 +0100)]
vl: call decode_bitstream only once

Submit all bitstreams at once to decode_bitstream.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
12 years agoi965: increase the brw eu instruction store size dynamically
Yuanhan Liu [Wed, 21 Dec 2011 07:38:44 +0000 (15:38 +0800)]
i965: increase the brw eu instruction store size dynamically

Here is the final patch to enable dynamic eu instruction store size:
increase the brw eu instruction store size dynamically instead of just
allocating it statically with a constant limit. This would fix something
that 'GL_MAX_PROGRAM_INSTRUCTIONS_ARB was 16384 while the driver would
limit it to 10000'.

v2: comments from ken, do not hardcode the eu limit to (1024 * 1024)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: call next_insn() before referencing a instruction by index
Yuanhan Liu [Wed, 21 Dec 2011 07:32:02 +0000 (15:32 +0800)]
i965: call next_insn() before referencing a instruction by index

A single next_insn may change the base address of instruction store
memory(p->store), so call it first before referencing the instruction
store pointer from an index.

This the final prepare work to enable the dynamic store size.

v2: comments from Ken, define emit_endif as bool type

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: get the jmp distance by instruction index
Yuanhan Liu [Wed, 21 Dec 2011 07:10:40 +0000 (15:10 +0800)]
i965: get the jmp distance by instruction index

If dynamic instruction store size is enabled, while after the brw_JMPI()
and before the brw_land_fwd_jump() function, the eu instruction store
base address(p->store) may change. Thus, the safe way to reference the
jmp instruction is by index instead of by the instruction address.

v2: comments from Eric, don't change the prototype of brw_JMPI

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: let the if_stack just store the instruction index
Yuanhan Liu [Wed, 21 Dec 2011 06:51:59 +0000 (14:51 +0800)]
i965: let the if_stack just store the instruction index

If dynamic instruction store size is enabled, while after
the brw_IF/ELSE() and before the brw_ENDIF() function, the
eu instruction store base address(p->store) may change.

Thus let if_stack just store the instruction index. This is
somehow more flexible and safe than store the instruction
memory address.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agor600g: fix a warning that a variable may be uninitialized
Marek Olšák [Sun, 25 Dec 2011 08:37:06 +0000 (09:37 +0100)]
r600g: fix a warning that a variable may be uninitialized

12 years agogallium: remove PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS
Marek Olšák [Sat, 17 Dec 2011 20:09:30 +0000 (21:09 +0100)]
gallium: remove PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS

It's the same as PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: use a cast wrapper function to get st_transform_feedback_object
Marek Olšák [Sun, 25 Dec 2011 08:28:22 +0000 (09:28 +0100)]
st/mesa: use a cast wrapper function to get st_transform_feedback_object

12 years agost/mesa: DrawTFB should use the vertex count from the last call of EndTFB
Marek Olšák [Sat, 17 Dec 2011 13:41:43 +0000 (14:41 +0100)]
st/mesa: DrawTFB should use the vertex count from the last call of EndTFB

From ARB_transform_feedback2:
    ... the vertex count used for the rendering operation is
    set by the previous EndTransformFeedback command.

12 years agor300g: mapping buffers for read should be unsynchronized
Marek Olšák [Sat, 24 Dec 2011 10:43:10 +0000 (11:43 +0100)]
r300g: mapping buffers for read should be unsynchronized

The GPU never uses them for write.

12 years agowinsys/radeon: move managing GEM domains back to drivers
Marek Olšák [Sat, 24 Dec 2011 07:15:40 +0000 (08:15 +0100)]
winsys/radeon: move managing GEM domains back to drivers

This partially reverts commit 363ff844753c46ac9c13866627e096b091ea81f8.

It caused severe performance drops in Nexuiz. Reported by Phoronix.

Tested by me on r300g and by IRC people on r600g.

12 years agoi965 gen6: Fix incorrect order of dwords in gen6_update_sol_indices()
Paul Berry [Fri, 23 Dec 2011 21:56:07 +0000 (13:56 -0800)]
i965 gen6: Fix incorrect order of dwords in gen6_update_sol_indices()

When updating SOL indices, we were accidentally putting the starting
index in dword 1 and the SVBI number to increment in dword 2--these
should be reversed.  Usually both of these values are zero, so we
didn't see any problem.  However, if a transform feedback operation
spans multiple batch buffers, the starting index will be nonzero.

Fixes piglit test "EXT_transform_feedback/intervening-read output".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965 gen6: Fix transform feedback of triangle strips.
Paul Berry [Fri, 23 Dec 2011 15:57:01 +0000 (07:57 -0800)]
i965 gen6: Fix transform feedback of triangle strips.

When rendering triangle strips, vertices come down the pipeline in the
order specified, even though this causes alternate triangles to have
reversed winding order.  For example, if the vertices are ABCDE, then
the GS is invoked on triangles ABC, BCD, and CDE, even though this
means that triangle BCD is in the reverse of the normal winding order.
The hardware automatically flags the triangles with reversed winding
order as _3DPRIM_TRISTRIP_REVERSE, so that face culling and two-sided
coloring can be adjusted to account for the reversed order.

In order to ensure that winding order is correct when streaming
vertices out to a transform feedback buffer, we need to alter the
ordering of BCD to BDC when the first provoking vertex convention is
in use, and to CBD when the last provoking vertex convention is in
use.

To do this, we precompute an array of indices indicating where each
vertex will be placed in the transform feedback buffer; normally this
is SVBI[0] + (0, 1, 2), indicating that vertex order should be
preserved.  When the primitive type is _3DPRIM_TRISTRIP_REVERSE, we
change this order to either SVBI[0] + (0, 2, 1) or SVBI[0] + (1, 0,
2), depending on the provoking vertex convention.

Fixes piglit tests "EXT_transform_feedback/tessellation
triangle_strip" on Gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate texstore functions
Brian Paul [Sat, 24 Dec 2011 15:54:27 +0000 (08:54 -0700)]
mesa: consolidate texstore functions

The code for storing 1D, 2D and 3D tex images (whole or sub-images) was
all pretty similar.  This consolidates those six paths.

v2: rework switch statement to catch unexpected targets

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: fix _mesa_store_texsubimage2d() for GL_TEXTURE_1D_ARRAY
Brian Paul [Sat, 24 Dec 2011 15:54:27 +0000 (08:54 -0700)]
mesa: fix _mesa_store_texsubimage2d() for GL_TEXTURE_1D_ARRAY

For 1D arrays, map each slice separately.  Note that this was handled
correctly in _mesa_store_teximage2d() but not here.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: update comment for MapTextureImage()
Brian Paul [Sat, 24 Dec 2011 15:54:27 +0000 (08:54 -0700)]
mesa: update comment for MapTextureImage()

12 years agoswrast: rewrite glDrawPixels(GL_DEPTH) with zoom
Brian Paul [Sat, 24 Dec 2011 15:54:27 +0000 (08:54 -0700)]
swrast: rewrite glDrawPixels(GL_DEPTH) with zoom

This gets rid of another renderbuffer->PutRow() call and _DepthBuffer
usage.  We always work with 32-bit uint Z values now.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: stop using _DepthBuffer in triangle code
Brian Paul [Sat, 24 Dec 2011 15:54:27 +0000 (08:54 -0700)]
swrast: stop using _DepthBuffer in triangle code

The only consequence is we can only use the occlusion_zless_16_triangle()
function with MESA_FORMAT_Z16.

12 years agomesa: remove gl_renderbuffer::PutRowRGB()
Brian Paul [Sat, 24 Dec 2011 15:54:26 +0000 (08:54 -0700)]
mesa: remove gl_renderbuffer::PutRowRGB()

No longer used anywhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: stop using PutRowRGB() in triangle code
Brian Paul [Sat, 24 Dec 2011 15:54:26 +0000 (08:54 -0700)]
swrast: stop using PutRowRGB() in triangle code

Reviewed-by: Eric Anholt <eric@anholt.net>