mesa.git
12 years agost/mesa: remove st_CompressedTexSubImage1D/2D/3D()
Brian Paul [Wed, 4 Jan 2012 20:30:35 +0000 (13:30 -0700)]
st/mesa: remove st_CompressedTexSubImage1D/2D/3D()

Just use the core Mesa functions instead.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: fix indentation in st_copy_texsubimage()
Brian Paul [Wed, 4 Jan 2012 20:30:35 +0000 (13:30 -0700)]
st/mesa: fix indentation in st_copy_texsubimage()

12 years agost/mesa: remove st_TexImage(), use core Mesa code instead
Brian Paul [Wed, 4 Jan 2012 20:30:35 +0000 (13:30 -0700)]
st/mesa: remove st_TexImage(), use core Mesa code instead

The core Mesa code does the equivalent memory allocation, image mapping,
storing and unmapping.  We just need to call prep_teximage() first to
handle the 'surface_based' stuff.

The other change is to always use the level=0 mipmap image when accessing
individual mipmap level images that are stored in resources/buffers.
Apparently, we were always using malloc'd memory for individual mipmap
images, not resource buffers, before.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: refactor gl_TexImage() code into prep_teximage()
Brian Paul [Wed, 4 Jan 2012 20:30:35 +0000 (13:30 -0700)]
st/mesa: refactor gl_TexImage() code into prep_teximage()

Preparation for st_TexImage() removal/refactoring.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agointel: Re-enable GL_OES_standard_derivatives on GEN4+
Ian Romanick [Mon, 2 Jan 2012 20:48:34 +0000 (12:48 -0800)]
intel: Re-enable GL_OES_standard_derivatives on GEN4+

This extension only needs to be disabled on GEN3.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Re-allow blitting glCopyBufferSubData() on gen >= 6.
Eric Anholt [Wed, 28 Dec 2011 01:16:10 +0000 (17:16 -0800)]
intel: Re-allow blitting glCopyBufferSubData() on gen >= 6.

This was disabled a year ago due to not having a story for handling
the blitter at the time.  We're fine with using the blitter now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Fix pitch handling for linear blits.
Eric Anholt [Wed, 28 Dec 2011 01:22:30 +0000 (17:22 -0800)]
intel: Fix pitch handling for linear blits.

The new assert in intelEmitCopyBlit() gets angry if we don't align to
dwords.  Rather than make the assert have a special case for height ==
1 on the assumption that the hardware doesn't use it in that case,
just supply a correct pitch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43214
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Fix bad read/write flags on self-copies for glCopyBufferSubData().
Eric Anholt [Wed, 28 Dec 2011 00:42:44 +0000 (16:42 -0800)]
intel: Fix bad read/write flags on self-copies for glCopyBufferSubData().

We didn't consume these flags in any way that would produce a
functional difference, but we might have some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoRemove xmesa_xf86.h
Adam Jackson [Wed, 4 Jan 2012 16:32:38 +0000 (11:32 -0500)]
Remove xmesa_xf86.h

This was a leftover from libGLcore.

Signed-off-by: Adam Jackson <ajax@redhat.com>
12 years agodrisw: Fix drawable creation against non-default screens
Adam Jackson [Tue, 3 Jan 2012 19:39:28 +0000 (14:39 -0500)]
drisw: Fix drawable creation against non-default screens

We don't want to match the visual against the default screen.  If the
drawable is on a non-default screen then the appropriate visual might not
exist on the default screen.  Conversely, if the same visual is
available on multiple screens then simply selecting for the right VID is
sufficient, since the server has promised that the same visual is
compatible with multiple screens.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
12 years agomesa: remove unused _mesa_init_teximage_fields() target parameter
Brian Paul [Wed, 4 Jan 2012 00:48:12 +0000 (17:48 -0700)]
mesa: remove unused _mesa_init_teximage_fields() target parameter

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
12 years agovl/mpeg2: simple fix to get xine running again
Christian König [Wed, 4 Jan 2012 14:59:29 +0000 (15:59 +0100)]
vl/mpeg2: simple fix to get xine running again

Otherwise xines xxmc plugin will just display green blocks.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoff_fragment_shader: Don't generate swizzles for scalar combiner inputs
Ian Romanick [Fri, 23 Dec 2011 01:37:26 +0000 (17:37 -0800)]
ff_fragment_shader: Don't generate swizzles for scalar combiner inputs

There are a couple scenarios where the source could be zero and the
operand could be either SRC_ALPHA or ONE_MINUS_SRC_ALPHA.  For
example, if the source was ZERO.  This would result in something like
(0).w, and a later call to ir_validate would get angry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517

12 years agoFix read from pointer after free
Anuj Phogat [Wed, 4 Jan 2012 02:12:06 +0000 (18:12 -0800)]
Fix read from pointer after free

Coverity reported a read from pointer after free defect in
src/mesa/drivers/dri/intel/intel_mipmap_tree.c. Bug# 44205
In intel_miptree_all_slices_resolve() function, i = i->next was
executing after freeing i. I have defined a temporary variable
(next) to store the value of i->next before freeing i

Reported-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoconfigure.ac: fix typo from 3ef3ba4d2
Matt Turner [Wed, 4 Jan 2012 02:58:37 +0000 (21:58 -0500)]
configure.ac: fix typo from 3ef3ba4d2

12 years agost/mesa: use SINT/UINT formats for VertexAttribIPointer
Christoph Bumiller [Tue, 3 Jan 2012 22:00:31 +0000 (23:00 +0100)]
st/mesa: use SINT/UINT formats for VertexAttribIPointer

Reviewed-by: Dave Airlie <airlied@redhat.com>
v2: added assertion that packed formats are not pure integer

12 years agotgsi/softpipe: disable FAST_MATH
Dave Airlie [Tue, 3 Jan 2012 10:38:38 +0000 (10:38 +0000)]
tgsi/softpipe: disable FAST_MATH

In the interest of softpipe preferring correctness over speed and passing more
piglit tests, set this to off by default. For speed you really want llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agosoftpipe: remove the 32bits limitation on depth(-stencil) formats
Morgan Armand [Wed, 7 Dec 2011 20:30:48 +0000 (21:30 +0100)]
softpipe: remove the 32bits limitation on depth(-stencil) formats

This patch remove the 32bits limitation. As a side effect, it bring the support for the GL_ARB_depth_buffer_float extension.
No regression have been found on piglit, and all tests for GL_ARB_depth_buffer_float pass successfully.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallium: use Haiku provided debug_printf in OS.h
Alexander von Gluck [Tue, 3 Jan 2012 15:10:42 +0000 (08:10 -0700)]
gallium: use Haiku provided debug_printf in OS.h

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agoglsl_to_tgsi: v2 Invalidate and revalidate uniform backing storage
Vadim Girlin [Thu, 22 Dec 2011 14:35:35 +0000 (18:35 +0400)]
glsl_to_tgsi: v2 Invalidate and revalidate uniform backing storage

If glUniform1i and friends are going to dump data directly in
driver-allocated, the pointers have to be updated when the storage
moves.  This should fix the regressions seen with commit 7199096.

I'm not sure if this is the only place that needs this treatment.  I'm
a little uncertain about the various functions in st_glsl_to_tgsi that
modify the TGSI IR and try to propagate changes about that up to the
gl_program.  That seems sketchy to me.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
v2:

Revalidate when shader_program is not NULL.
Update the pointers for all _LinkedShaders.
Init glsl_to_tgsi_visitor::shader_program to NULL in the
get_pixel_transfer_visitor & get_bitmap_visitor.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoglx: Hack around versions of XCB that lack GLX_ARB_create_context support
Ian Romanick [Tue, 3 Jan 2012 01:44:31 +0000 (17:44 -0800)]
glx: Hack around versions of XCB that lack GLX_ARB_create_context support

A lot of tests in 'make check' will fail under these circumstances,
but at least the build should work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: XCB is no longer optional for GLX or DRI
Ian Romanick [Tue, 3 Jan 2012 01:44:30 +0000 (17:44 -0800)]
mesa: XCB is no longer optional for GLX or DRI

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agointel: include version.h in intel_screen.c to silence warning
Brian Paul [Mon, 2 Jan 2012 22:20:04 +0000 (15:20 -0700)]
intel: include version.h in intel_screen.c to silence warning

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodri_util: Fix order of error and data parameters to dri2CreateContextAttribs
Ian Romanick [Mon, 2 Jan 2012 21:38:11 +0000 (13:38 -0800)]
dri_util: Fix order of error and data parameters to dri2CreateContextAttribs

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agor600g: add missing colorswaps for r8 uint/sint.
Dave Airlie [Mon, 2 Jan 2012 20:44:30 +0000 (20:44 +0000)]
r600g: add missing colorswaps for r8 uint/sint.

fixes some warnings in GL3.0 tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agotests/glx: Add unit tests for GLX_ARB_create_context GLX protocol
Ian Romanick [Fri, 16 Dec 2011 02:45:27 +0000 (18:45 -0800)]
tests/glx: Add unit tests for GLX_ARB_create_context GLX protocol

This adds a new tests directory at the top-level and some extra build
infrastructure.  The tests use the Google C++ Testing Framework, and
they will only be built if configure can detect its availability.  The
tests are automatically wired-in to run with 'make check'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoglx: Don't use 'new' as a function parameter name
Ian Romanick [Tue, 29 Nov 2011 01:47:59 +0000 (17:47 -0800)]
glx: Don't use 'new' as a function parameter name

Using 'new' as a function parameter name prevents including
glxclient.h the unit tests (future patch) that use the Google C++
Testing Framework.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Enable GLX_EXT_create_context_es2_profile
Ian Romanick [Fri, 2 Dec 2011 22:45:11 +0000 (14:45 -0800)]
glx: Enable GLX_EXT_create_context_es2_profile

This extension is only enabled if the underlying driver advertises
support for OpenGL ES 2.0.  This happens either through the getAPIMask
function in version 2 of the DRI2 extension or implicity through
version 2 of the DRISW extension.

Since there is no OpenGL ES 2.0 protocol, this extension is marked as
only available with direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodri2: Add plumbing to get context version requirements and flags to drivers
Ian Romanick [Thu, 1 Dec 2011 22:06:58 +0000 (14:06 -0800)]
dri2: Add plumbing to get context version requirements and flags to drivers

This adds support for DRI_DRI2 version 3 to all of the DRI2 drivers.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
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>