mesa.git
12 years agost/mesa: use u_surface_default_template() helper
Brian Paul [Sat, 11 Feb 2012 01:46:07 +0000 (18:46 -0700)]
st/mesa: use u_surface_default_template() helper

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove redundant memset(surface_template,0)
Brian Paul [Sat, 11 Feb 2012 01:43:17 +0000 (18:43 -0700)]
st/mesa: remove redundant memset(surface_template,0)

The subsequent u_surface_default_template() call does that for us.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove st_renderbuffer::stride
Brian Paul [Sat, 11 Feb 2012 01:40:02 +0000 (18:40 -0700)]
st/mesa: remove st_renderbuffer::stride

It was only used for software buffers and easily computed.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove st_renderbuffer::format
Brian Paul [Sat, 11 Feb 2012 01:34:25 +0000 (18:34 -0700)]
st/mesa: remove st_renderbuffer::format

We only used it in a few places that can implemented differently.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: fix comment typos in fbobject.c
Brian Paul [Fri, 10 Feb 2012 23:22:33 +0000 (16:22 -0700)]
mesa: fix comment typos in fbobject.c

12 years agoi965/fs: Take # of components into account in try_rewrite_rhs_to_dst.
Kenneth Graunke [Tue, 14 Feb 2012 20:43:22 +0000 (12:43 -0800)]
i965/fs: Take # of components into account in try_rewrite_rhs_to_dst.

Commit dc7f449d1ac53a66e6efb56ccf2a5953418a26ca introduced a new method
for avoiding MOVs: try to rewrite the destination of the instruction
that produced the RHS so it writes into the LHS.

Unfortunately, this is not safe for swizzled texturing operations, as
they return a set of four contiguous registers.  Consider the following:

(assign (x)
        (var_ref vec_ctor_x)
        (swiz x (tex vec4 (var_ref m_sampY) (var_ref m_cordY) 0 1 ())))

In this case, the source and destination registers are equal, since
reg_offset is 0 for both.  Yet, this is only a partial move: the texture
operation generates four registers, and the LHS only covers one.

Fixes color distortion in XBMC when using GLSL shaders.

NOTE: This is a candidate for the 8.0 branch (with the previous commit).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44333
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/fs: Add a new fs_inst::regs_written function.
Kenneth Graunke [Tue, 14 Feb 2012 20:43:21 +0000 (12:43 -0800)]
i965/fs: Add a new fs_inst::regs_written function.

Certain instructions write more than one register.  Texturing, for
example, returns 4 registers.  (We set rlen to 4 even for TXS and float
shadow sampling.)  Some math functions return 2.  Most return 1.

The next commit introduces a use of this function.

NOTE: This is a candidate for the 8.0 branch (dependency of a fix).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agollvmpipe: fix fogcoord writing (v2)
Dave Airlie [Sat, 4 Feb 2012 17:55:56 +0000 (17:55 +0000)]
llvmpipe: fix fogcoord writing (v2)

this fixes the fogcoord related piglit tests, like I fixed them in softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agometa: Avoid FBO resizing/reallocating in decompress_texture_image
Anuj Phogat [Mon, 13 Feb 2012 18:48:45 +0000 (10:48 -0800)]
meta: Avoid FBO resizing/reallocating in decompress_texture_image

Reallocate/resize decompress FBO only if texture image width/height is
greater than existing decompress FBO width/height.

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 agost/vdpau: fix a small memory leak
Christian König [Mon, 13 Feb 2012 11:10:47 +0000 (12:10 +0100)]
st/vdpau: fix a small memory leak

The matrix filter wasn't freed on mixer destruction.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: fix low strength denoise filter
Christian König [Mon, 13 Feb 2012 10:41:23 +0000 (11:41 +0100)]
vl: fix low strength denoise filter

A filter strength of zero or one doesn't make any
sense. Thanks to Andy Furniss for pointing this out.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agor600g: fix tiling with cayman and virtual memory
Jerome Glisse [Tue, 14 Feb 2012 21:26:12 +0000 (16:26 -0500)]
r600g: fix tiling with cayman and virtual memory

The virtual address but follow the alignment requirement of the
tiled surface. The bo from handle case is not properly fix. Need
bigger change for a proper fix. Work around that by enforcing 1M
alignment for those bo.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
12 years agoi915: Fix type of "specoffset" variable.
Paul Berry [Sat, 11 Feb 2012 03:51:55 +0000 (19:51 -0800)]
i915: Fix type of "specoffset" variable.

Commit 2e5a1a2 (intel: Convert from GLboolean to 'bool' from
stdbool.h.) converted the "specoffset" local variable (in
intel_tris.c) from a GLboolean to a bool.  However, GLboolean was the
wrong type for specoffset--it should have been a GLuint (to match the
declaration of specoffset in struct intel_context).

This patch changes specoffset to the proper type.

Fixes piglit test general/two-sided-lighting-separate-specular.

This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45917
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/fs: Enable register spilling on gen7 too.
Eric Anholt [Fri, 10 Feb 2012 00:35:49 +0000 (16:35 -0800)]
i965/fs: Enable register spilling on gen7 too.

It turns out the same messages work on gen7, we were just being paranoid.

Fixes the penumbra shadows mode of Lightsmark since the register
allocation fix.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Report the failure message when failing to compile the fragment shader.
Eric Anholt [Thu, 9 Feb 2012 18:23:45 +0000 (10:23 -0800)]
i965: Report the failure message when failing to compile the fragment shader.

We just abort later, but at least this should result in more
informative bug reports.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agor600g: Use a fake reloc to sleep for fences
Simon Farnsworth [Tue, 14 Feb 2012 12:06:20 +0000 (12:06 +0000)]
r600g: Use a fake reloc to sleep for fences

r300g is able to sleep until a fence completes rather than busywait because
it creates a special buffer object and relocation that stays busy until the
CS containing the fence is finished.

Copy the idea into r600g, and use it to sleep if the user asked for an
infinite wait, falling back to busywaiting if the user provided a timeout.

Note: this is a candidate for the stable branches.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: consolidate set_blend_color code
Marek Olšák [Tue, 14 Feb 2012 14:24:25 +0000 (15:24 +0100)]
r600g: consolidate set_blend_color code

12 years agor600g: consolidate more translate functions
Marek Olšák [Tue, 14 Feb 2012 14:19:27 +0000 (15:19 +0100)]
r600g: consolidate more translate functions

12 years agor600g: inline r600_translate_ds_func
Marek Olšák [Tue, 14 Feb 2012 14:14:58 +0000 (15:14 +0100)]
r600g: inline r600_translate_ds_func

12 years agor600g: remove unused variable
Marek Olšák [Tue, 14 Feb 2012 14:13:16 +0000 (15:13 +0100)]
r600g: remove unused variable

12 years agor600g: consolidate some translate functions
Marek Olšák [Tue, 14 Feb 2012 14:12:49 +0000 (15:12 +0100)]
r600g: consolidate some translate functions

12 years agoRevert "r600g: don't advertise integer textures without GLSL 1.3"
Marek Olšák [Tue, 14 Feb 2012 14:48:37 +0000 (15:48 +0100)]
Revert "r600g: don't advertise integer textures without GLSL 1.3"

This reverts commit 2c06bcb90982280e82a044b8be83be8fdf5a9590.

It breaks u_blitter trying to blit compressed textures as uint.

12 years agor600g: don't advertise integer textures without GLSL 1.3
Marek Olšák [Tue, 14 Feb 2012 14:04:51 +0000 (15:04 +0100)]
r600g: don't advertise integer textures without GLSL 1.3

12 years agometa: Add pixel store/pack operations in decompress_texture_image
Anuj Phogat [Sat, 11 Feb 2012 00:27:19 +0000 (16:27 -0800)]
meta: Add pixel store/pack operations in decompress_texture_image

This patch adds the pixel store operations in decompress_texture_image().
decompress_texture_image() is used in glGetTexImage() for compressed
textures with unsigned, normalized values.

It also fixes the failures in intel oglconform pxstore-gettex due to
following sub test cases:

 - Test all mipmaps with byte swapping enabled
 - Test all small mipmaps with all allowable alignment values
 - Test subimage packing for all mipmap levels

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

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 agomesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case
Brian Paul [Mon, 13 Feb 2012 14:20:27 +0000 (07:20 -0700)]
mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case

in _mesa_error_check_format_and_type().

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

12 years agogallivm: Replace architecture test with PIPE_ARCH_*
Stéphane Marchesin [Fri, 10 Feb 2012 03:50:59 +0000 (19:50 -0800)]
gallivm: Replace architecture test with PIPE_ARCH_*

X86Target is a variable, and therefore isn't defined at compile time. So
 LLVM_NATIVE_ARCH == X86Target
is translated into
 0 == 0
and since X86 is first, we always pick it.

Therefore we replace the logic with PIPE_ARCH_*.

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

12 years agoi915g: Remove useless draw calls.
Stéphane Marchesin [Fri, 10 Feb 2012 04:39:00 +0000 (20:39 -0800)]
i915g: Remove useless draw calls.

12 years agoi915g: Add a way to profile the contents of command buffers.
Stéphane Marchesin [Thu, 9 Feb 2012 06:43:14 +0000 (22:43 -0800)]
i915g: Add a way to profile the contents of command buffers.

12 years agoi915g: Fix comments.
Stéphane Marchesin [Tue, 7 Feb 2012 23:09:26 +0000 (15:09 -0800)]
i915g: Fix comments.

12 years agoi915g: Don't emit state when it's already bound.
Stéphane Marchesin [Tue, 7 Feb 2012 22:33:31 +0000 (14:33 -0800)]
i915g: Don't emit state when it's already bound.

12 years agoi915g: Remove unused poly stipple state.
Stéphane Marchesin [Tue, 7 Feb 2012 22:33:12 +0000 (14:33 -0800)]
i915g: Remove unused poly stipple state.

12 years agoi915g: Implement stipple with draw.
Stéphane Marchesin [Tue, 7 Feb 2012 22:42:30 +0000 (14:42 -0800)]
i915g: Implement stipple with draw.

12 years agoi915g: Fix comment.
Stéphane Marchesin [Mon, 23 Jan 2012 07:44:31 +0000 (23:44 -0800)]
i915g: Fix comment.

12 years agoi915g: Move ureg defines to the header so we can share them.
Stéphane Marchesin [Tue, 7 Feb 2012 03:57:04 +0000 (04:57 +0100)]
i915g: Move ureg defines to the header so we can share them.

12 years agoi915g: Separate declarations and program in the fragment program struct.
Stéphane Marchesin [Sun, 22 Jan 2012 10:22:20 +0000 (02:22 -0800)]
i915g: Separate declarations and program in the fragment program struct.

We need this later to fixup fragment programs properly.

12 years agost/mesa: only resolve if number of samples is > 1
Dave Airlie [Wed, 30 Nov 2011 20:10:19 +0000 (20:10 +0000)]
st/mesa: only resolve if number of samples is > 1

Marek: this fixes a firefox crash and maybe even:
https://bugs.freedesktop.org/show_bug.cgi?id=45943

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
12 years agoswrast: fix span color type selection
Brian Paul [Fri, 3 Feb 2012 15:17:24 +0000 (08:17 -0700)]
swrast: fix span color type selection

Fixes a regression from commit 660ed923ded3552e023ef8c3dd9f92e6792f1bd2.
The basic idea is to look at the format of the dest renderbuffer and
choose either GLubyte or GLfloat for colors.  The previous code used
_mesa_format_to_type_and_comps() which could return a bunch types other
than ubyte/float.

Determine the datatype at renderbuffer mapping time to avoid frequent
calls to the format query functions.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agoextensions: remove unused code.
Dave Airlie [Sun, 12 Feb 2012 16:07:19 +0000 (16:07 +0000)]
extensions: remove unused code.

Comparing an unsigned to < 0 is pointless.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa/texparam: drop double semicolons
Dave Airlie [Sun, 12 Feb 2012 16:05:08 +0000 (16:05 +0000)]
mesa/texparam: drop double semicolons

no idea where these came from, drop them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor300g: always fail to create a multisample resource
Marek Olšák [Sun, 12 Feb 2012 12:06:15 +0000 (13:06 +0100)]
r300g: always fail to create a multisample resource

Just to be safe.

12 years agor300g: assert-fail when calling resource_resolve
Marek Olšák [Sun, 12 Feb 2012 11:29:12 +0000 (12:29 +0100)]
r300g: assert-fail when calling resource_resolve

And reset the dest pointer to NULL after it.

12 years agogallium/xvmc: r300 and r600 now depend on libdrm_radeon
Alex Deucher [Fri, 10 Feb 2012 23:21:23 +0000 (18:21 -0500)]
gallium/xvmc: r300 and r600 now depend on libdrm_radeon

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agogallivm: Change getExtent and readByte to non-const with llvm-3.1.
Vinson Lee [Thu, 9 Feb 2012 05:45:27 +0000 (21:45 -0800)]
gallivm: Change getExtent and readByte to non-const with llvm-3.1.

Fix build with llvm-3.1svn.

llvm-3.1svn r149918 changed BufferMemoryObject::getExtent and
BufferMemoryObject::readByte from const member functions to non-const
member functions in include/llvm/Support/MemoryObject.h.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoi965: Fix border color on Ironlake.
Kenneth Graunke [Thu, 9 Feb 2012 01:14:15 +0000 (17:14 -0800)]
i965: Fix border color on Ironlake.

Ironlake appears to check our pointer against the General State Base
Address upper bound, rather than ignoring the zero bound as it ought.

Unfortunately, since we leave GSBA set to zero, there is no logical
upper bound.  Set it to the maximum possible value, which should work
since our virtual addresses only go up to 2GB.

+94 piglits.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965/fs: Add support for generating MADs.
Eric Anholt [Mon, 6 Feb 2012 23:59:11 +0000 (00:59 +0100)]
i965/fs: Add support for generating MADs.

Improves nexuiz performance 0.65% +/- .10% (n=5) on my gen6, and .39%
+/- .11% (n=10) on gen7.  No statistically significant performance
difference on warsow (n=5, but only one shader has MADs).

v2: Add support for MADs in 16-wide by using compression control.
v3: Don't generate MADs when it will force an immediate to be moved to a temp.
    (it's not clear whether this is a win or not, but it should result in less
     questionable change to codegen compared to v2).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
12 years agoi965/fs: Add missing register allocation for 3rd sources.
Eric Anholt [Tue, 7 Feb 2012 00:09:59 +0000 (01:09 +0100)]
i965/fs: Add missing register allocation for 3rd sources.

Our only instruction with a 3rd source so far was linterp, and that
value was never register-allocated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Add support for the MAD opcode on gen6+.
Eric Anholt [Mon, 22 Mar 2010 17:05:42 +0000 (10:05 -0700)]
i965: Add support for the MAD opcode on gen6+.

v2: Fix MRF handling on gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
12 years agoBump version to 8.1 (devel)
Ian Romanick [Fri, 10 Feb 2012 23:34:08 +0000 (15:34 -0800)]
Bump version to 8.1 (devel)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoradeon: build fix after 9d9111108eadd65708899284b1cfa9ca425f3ac8
Alex Deucher [Fri, 10 Feb 2012 16:30:02 +0000 (11:30 -0500)]
radeon: build fix after 9d9111108eadd65708899284b1cfa9ca425f3ac8

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: 128 bit formats require tile_type = 1 on cayman
Alex Deucher [Fri, 10 Feb 2012 16:02:03 +0000 (11:02 -0500)]
r600g: 128 bit formats require tile_type = 1 on cayman

Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Note: this is a candidate for the stable branches.

12 years agor600g: fix tex tile_type offset for cayman
Alex Deucher [Fri, 10 Feb 2012 15:49:13 +0000 (10:49 -0500)]
r600g: fix tex tile_type offset for cayman

Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Note: this is a candidate for the stable branches.

12 years agost/wgl: refactor stw_pixelformat_init()
Brian Paul [Wed, 8 Feb 2012 17:06:21 +0000 (10:06 -0700)]
st/wgl: refactor stw_pixelformat_init()

Replace duplicated code with add_color_format_variants() helper.

12 years agost/wgl: Properly support non-displayble pixel formats, and implement float pixelforma...
José Fonseca [Wed, 8 Feb 2012 16:23:06 +0000 (16:23 +0000)]
st/wgl: Properly support non-displayble pixel formats, and implement float pixelformats as as one.

WGL_ARB_pixel_format establishes the existence of pixel formats which
are invisible to GDI.

However we still need to pass a valid pixelformat to GDI, so that
context creation/binding works.

The actual WGL_TYPE_RGBA_FLOAT_ARB implementation is from Brian Paul.

12 years agost/wgl: Invoke SetPixelFormat twice for pbuffers.
José Fonseca [Wed, 8 Feb 2012 16:01:22 +0000 (16:01 +0000)]
st/wgl: Invoke SetPixelFormat twice for pbuffers.

12 years agost/wgl: Just pass pPixelFormat to stw_pixelformat_get_info().
José Fonseca [Wed, 8 Feb 2012 15:58:37 +0000 (15:58 +0000)]
st/wgl: Just pass pPixelFormat to stw_pixelformat_get_info().

Avoids the likely error of forgetting to subtract one.

12 years agost/wgl: Fix argument of stw_pixelformat_get_info().
José Fonseca [Wed, 8 Feb 2012 15:46:28 +0000 (15:46 +0000)]
st/wgl: Fix argument of stw_pixelformat_get_info().

stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.

12 years agomesa: remove unused gl_shared_state::DriverData field
Brian Paul [Fri, 10 Feb 2012 15:26:31 +0000 (08:26 -0700)]
mesa: remove unused gl_shared_state::DriverData field

12 years agodocs: remove link to the GLSL compiler page
Brian Paul [Fri, 10 Feb 2012 01:06:47 +0000 (18:06 -0700)]
docs: remove link to the GLSL compiler page

The page is terribly out of date.
(cherry picked from commit 65526d54aa2599b069bd443d3e6e9762e613042d)

12 years agodocs: add VMware link
Brian Paul [Fri, 10 Feb 2012 01:06:06 +0000 (18:06 -0700)]
docs: add VMware link
(cherry picked from commit 6aa9ce2687637ee678fa4258eb9efa695fca8690)

12 years agodocs: update info about supported systems, GPUs, APIs
Brian Paul [Fri, 10 Feb 2012 01:05:52 +0000 (18:05 -0700)]
docs: update info about supported systems, GPUs, APIs

Add link to Intel's Linux graphics page, etc.
(cherry picked from commit 14cf3dd826938f0a8a6f32a81c634ecc835f7319)

12 years agodocs: add news item for 8.0 release
Brian Paul [Thu, 9 Feb 2012 22:52:13 +0000 (15:52 -0700)]
docs: add news item for 8.0 release
(cherry picked from commit 7aef839760d5216ec2a413092cae35fd223678a4)

12 years agodocs: Add 8.0 MD5 checksums
Ian Romanick [Thu, 9 Feb 2012 22:28:58 +0000 (14:28 -0800)]
docs: Add 8.0 MD5 checksums

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

12 years agomesa: fix proxy texture target initialization
Brian Paul [Thu, 9 Feb 2012 16:20:08 +0000 (09:20 -0700)]
mesa: fix proxy texture target initialization

The mapping from TEXTURE_x_INDEX to GL_TEXTURE_x was broken in
alloc_proxy_textures() because the elements in the targets[] array
were in the wrong order.

This didn't actually cause any failures since we never really use the
proxy texture's Target field.  But let's get it right.

NOTE: This is a candidate for the 8.0 branch.

12 years agomesa: remove unused gl_pixelmap::Map8[] array
Brian Paul [Fri, 10 Feb 2012 05:15:45 +0000 (22:15 -0700)]
mesa: remove unused gl_pixelmap::Map8[] array

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: stop using Map8[] tables in load_color_map_texture()
Brian Paul [Fri, 10 Feb 2012 05:15:45 +0000 (22:15 -0700)]
st/mesa: stop using Map8[] tables in load_color_map_texture()

Use the float tables instead.  Pixel maps are seldom used so this
shouldn't be a big deal.  Next, we can get rid of the gl_pixelmap::Map8
array.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: remove unused _mesa_map_ci8_to_rgba8()
Brian Paul [Fri, 10 Feb 2012 05:15:45 +0000 (22:15 -0700)]
mesa: remove unused _mesa_map_ci8_to_rgba8()

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: fix error handling in get_tex_rgba_compressed()
Brian Paul [Thu, 9 Feb 2012 03:10:15 +0000 (20:10 -0700)]
mesa: fix error handling in get_tex_rgba_compressed()

12 years agomesa: use _mesa_format_matches_format_and_type() in get_tex_memcpy()
Brian Paul [Thu, 9 Feb 2012 03:10:15 +0000 (20:10 -0700)]
mesa: use _mesa_format_matches_format_and_type() in get_tex_memcpy()

12 years agomesa: push row stride adjustment down into _mesa_decompress_image()
Brian Paul [Thu, 9 Feb 2012 03:10:15 +0000 (20:10 -0700)]
mesa: push row stride adjustment down into _mesa_decompress_image()

There's a mismatch in row strides for compressed textures between
what Driver.MapTextureImage() returns and what the software fetch-texel
functions use.  Move it down a layer.  The next step would be to fix
this in the fetch-texel functions.

12 years agomesa: replace GET_SHINE_TAB_ENTRY() macro with an inline function
Brian Paul [Thu, 9 Feb 2012 03:11:58 +0000 (20:11 -0700)]
mesa: replace GET_SHINE_TAB_ENTRY() macro with an inline function

12 years agomesa: make _mesa_invalidate_shine_table() static
Brian Paul [Thu, 9 Feb 2012 03:11:58 +0000 (20:11 -0700)]
mesa: make _mesa_invalidate_shine_table() static

12 years agomesa: remove gl_light::_SpotExpTable field
Brian Paul [Thu, 9 Feb 2012 03:11:58 +0000 (20:11 -0700)]
mesa: remove gl_light::_SpotExpTable field

Just use pow() instead.  Spot lights aren't too common and fixed-function
lighting isn't as important as it used to me.

This saves 32KB per context.  Each table was 4KB and there's 8 lights.

12 years agometa: replace abort() with _mesa_problem()
Brian Paul [Thu, 9 Feb 2012 03:11:58 +0000 (20:11 -0700)]
meta: replace abort() with _mesa_problem()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: fix comment typo
Brian Paul [Wed, 8 Feb 2012 23:37:26 +0000 (16:37 -0700)]
mesa: fix comment typo

12 years agost/vdpau: use matrix filter to blur/sharpen video
Christian König [Wed, 8 Feb 2012 18:23:33 +0000 (19:23 +0100)]
st/vdpau: use matrix filter to blur/sharpen video

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: add a matrix/convolution filter
Christian König [Wed, 8 Feb 2012 17:02:11 +0000 (18:02 +0100)]
vl: add a matrix/convolution filter

Can be used for gaussian, mean, laplacian, emboss, sharpness...

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: use median filter for noise reduction
Christian König [Tue, 7 Feb 2012 17:03:46 +0000 (18:03 +0100)]
st/vdpau: use median filter for noise reduction

And while at it implement the rest of the feature
querying also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: add a median filter for noise reduction
Christian König [Tue, 7 Feb 2012 17:00:41 +0000 (18:00 +0100)]
vl: add a median filter for noise reduction

This is a shader based median filter, generally
used for noise reduction, it could still need some
improvements, but should usually work out of the box.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoi965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.
Eric Anholt [Wed, 8 Feb 2012 23:12:56 +0000 (15:12 -0800)]
i965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965/gen7: Fix the length of the DS state packet in the HiZ op.
Eric Anholt [Wed, 8 Feb 2012 23:10:12 +0000 (15:10 -0800)]
i965/gen7: Fix the length of the DS state packet in the HiZ op.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965/gen7: Fix GPU hangs from the HiZ op.
Eric Anholt [Thu, 9 Feb 2012 18:08:00 +0000 (10:08 -0800)]
i965/gen7: Fix GPU hangs from the HiZ op.

The wm max threads is in the same dword as the dispatch enable.  The
hardware gets super angry if you set max threads to 0, even if you
aren't dispatching threads.

12 years agoglsl: Avoid excessive loop unrolling.
Mathias Fröhlich [Wed, 25 Jan 2012 16:35:01 +0000 (17:35 +0100)]
glsl: Avoid excessive loop unrolling.

Avoid unrollong loops that are either nested loops or
where the loop body times the unroll count is huge.

The change is far from being perfect but it extends the
loop unrolling decision heuristic by some additional
safeguard. In particular this cuts down compilation of
a shader precomputing atmospheric scattering integral
tables containing two nesting levels in a loop from
something way beyond some minutes (I never waited for
it to finish) to some fractions of a second.

This fixes piglit tests glsl-fs-unroll-explosion and
glsl-vs-unroll-explosion on r600g.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agomesa: fix maximum allowed proxy texture size condition
Anuj Phogat [Thu, 26 Jan 2012 03:05:45 +0000 (19:05 -0800)]
mesa: fix maximum allowed proxy texture size condition

width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type + 2 * border.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1) + 2 * border

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case:
max_values negative.textureSize.textureCube
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: exit the update fragment samplers/textures loops early.
Dave Airlie [Wed, 8 Feb 2012 13:58:14 +0000 (13:58 +0000)]
st/mesa: exit the update fragment samplers/textures loops early.

If we have no more enabled samplers and we've reset all the previously
used ones, no need to keep going around this loop.

(just moved some stuff around to clean it up a bit).

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: fixup NDEBUG vs DEBUG causing debug path to get taken.
Dave Airlie [Wed, 8 Feb 2012 12:47:05 +0000 (12:47 +0000)]
st/mesa: fixup NDEBUG vs DEBUG causing debug path to get taken.

From what I can see we were taking the debug path all the time,
when we probably only want it for enable debug path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: enable remap table when --enable-shared-glapi
Chia-I Wu [Mon, 6 Feb 2012 09:47:48 +0000 (17:47 +0800)]
mesa: enable remap table when --enable-shared-glapi

As libGL will use libglapi for function lookups, we need to enable the remap
table.

Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45660
12 years agovbo: unmap vertex store before executing lists
Brian Paul [Tue, 7 Feb 2012 20:08:53 +0000 (13:08 -0700)]
vbo: unmap vertex store before executing lists

We don't want our VBOs mapped when we're drawing.  This change checks
if the vertex store VBO is mapped before we execute a list, unmaps it,
then remaps it after drawing.  This situation pops up when building a
nested display list in GL_COMPILE_AND_EXECUTE mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agogallium: add PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
Christoph Bumiller [Mon, 6 Feb 2012 15:29:03 +0000 (16:29 +0100)]
gallium: add PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION

Just let the hardware do it if it can and avoid drivers having to
check for the special case on each draw call.

v2: update the draw module

12 years agodri: Emit a critical error if the swrast driver fails to load.
Carl Worth [Sat, 4 Feb 2012 00:25:38 +0000 (16:25 -0800)]
dri: Emit a critical error if the swrast driver fails to load.

Something has gone wrong if swrast is requested but cannot be
loaded. The user really should be made aware of this, (and instructed
to set LIBGL_DEBUG for more details).

The wording of this error message is updated from "reverting to
indirect rendering" to the more objectively descriptive "failed to
load driver: swrast". The former wording makes assumptions about what
the calling code will decide to do next, rather than simply describing
what went wrong within the current function. The new wording is
consistent with the critical errors recently added for hardware
drivers that fail to load.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agodri: Emit a critical error if a named driver fails to load.
Carl Worth [Sat, 4 Feb 2012 00:25:38 +0000 (16:25 -0800)]
dri: Emit a critical error if a named driver fails to load.

Something has gone wrong if we were asked to load a driver of a
specific name, but it failed to load for some reason. The user really
should be made aware of this, (and instructed to set LIBGL_DEBUG for
more details).

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agodri: Add a CriticalErrorMessageF macro.
Carl Worth [Sat, 4 Feb 2012 00:17:29 +0000 (16:17 -0800)]
dri: Add a CriticalErrorMessageF macro.

Sometimes an error is so sever that we want to print it even when the
user hasn't specifically requested debugging by setting LIBGL_DEBUG.

Add a CriticalErrorMessageF macro to be used for this case. (The error
message can still be slienced with the existing LIBGL_DEBUG=quiet).

For critical error messages we also direct the user to set the
LIBGL_DEBUG environment variable for more details.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agodri: Clarify comments on InfoMessageF and ErrorMessageF macros.
Carl Worth [Sat, 4 Feb 2012 00:14:23 +0000 (16:14 -0800)]
dri: Clarify comments on InfoMessageF and ErrorMessageF macros.

The description of ErrorMessageF was misleading in the case of
LIBGL_DEBUG being unset, (the previous comment could be understood to
mean the error should be printed, but the code does not print in this
case).

InfoMessageF previously had no comment at all.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agoglsl: Fix Android build
Chad Versace [Wed, 8 Feb 2012 23:07:33 +0000 (15:07 -0800)]
glsl: Fix Android build

The build was broken by the line below, added in commit 4f82fed4.
  s_expression.cpp:26: #include <limits>

Mesa's half of the fix is to add 'external/astl/include' to the include
path. The other half of the fix requires implementing
numeric_limits<float>::infinity() in astl, for which I have patches
submitted upstream for review.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agor600g: fix handling of outputs as TEX addr sources
Christian König [Mon, 6 Feb 2012 19:56:10 +0000 (20:56 +0100)]
r600g: fix handling of outputs as TEX addr sources

Outputs should be treated in the same way as
inputs and temporaries here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
12 years agoi965: Remove file i965/junk, accidentally added in 7b36c68
Chad Versace [Wed, 8 Feb 2012 17:18:46 +0000 (09:18 -0800)]
i965: Remove file i965/junk, accidentally added in 7b36c68

12 years agost/mesa: avoid vertex texture and sampler updates for 0 case
Dave Airlie [Tue, 7 Feb 2012 16:18:05 +0000 (16:18 +0000)]
st/mesa: avoid vertex texture and sampler updates for 0 case

If we had no vertex textures or samplers previously and we have none now,
don't bother doing the enables dance.

I was profiling nexuiz on noop and noticed these two functions in the
profile, this drops their usage from 0.86% to 0.03% and 0.23% to 0.03%
for texture and samplers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoi965: Remove broken symlink to intel_decode.c.
Kenneth Graunke [Wed, 8 Feb 2012 02:14:53 +0000 (18:14 -0800)]
i965: Remove broken symlink to intel_decode.c.

Eric removed intel_decode.c in 61b9ccd9e298ca1d3db55aee0cb2ff78662d6fa6.

12 years agoi965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.
Eric Anholt [Sat, 4 Feb 2012 13:05:46 +0000 (14:05 +0100)]
i965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.

We were doing saturate-based clamping on the [0,width] or [0,height]
coordinate, which meant only the first pixel was addressable.

Fixes piglit ARB_texture_rectangle/texwrap-RECT-bordercolor

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965/fs: Move GL_CLAMP handling to coordinate setup.
Eric Anholt [Fri, 3 Feb 2012 18:06:08 +0000 (19:06 +0100)]
i965/fs: Move GL_CLAMP handling to coordinate setup.

We should be able to merge self-move instruction into the MRF move
anyway, and this simplifies things for the next commit.

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965: Fix HiZ change compiler warning.
Eric Anholt [Wed, 8 Feb 2012 00:03:17 +0000 (16:03 -0800)]
i965: Fix HiZ change compiler warning.