platform/upstream/mesa.git
13 years agost/dri: Implement dri2::{Allocate,Release}Buffer
Benjamin Franzke [Fri, 4 Feb 2011 11:00:46 +0000 (12:00 +0100)]
st/dri: Implement dri2::{Allocate,Release}Buffer

13 years agoAdd dri2::{Allocate,Release}Buffer extension
Benjamin Franzke [Fri, 4 Feb 2011 10:59:12 +0000 (11:59 +0100)]
Add dri2::{Allocate,Release}Buffer extension

13 years agor600g: correctly report supported vertex formats
Marek Olšák [Mon, 7 Feb 2011 02:46:25 +0000 (03:46 +0100)]
r600g: correctly report supported vertex formats

13 years agor300g: use the new vertex buffer manager
Marek Olšák [Mon, 7 Feb 2011 01:00:44 +0000 (02:00 +0100)]
r300g: use the new vertex buffer manager

13 years agor600g: use the new vertex buffer manager
Marek Olšák [Mon, 7 Feb 2011 01:00:56 +0000 (02:00 +0100)]
r600g: use the new vertex buffer manager

13 years agoutil: import a new vertex buffer manager
Marek Olšák [Sat, 29 Jan 2011 19:53:57 +0000 (20:53 +0100)]
util: import a new vertex buffer manager

This code has originally matured in r300g and was ported to r600g several
times. It was obvious it's a code duplication.

See also comments in the header file.

13 years agor600g: do not flush the uploader
Marek Olšák [Sun, 6 Feb 2011 20:12:19 +0000 (21:12 +0100)]
r600g: do not flush the uploader

13 years agor300g: do not flush the uploader
Marek Olšák [Sun, 6 Feb 2011 20:09:38 +0000 (21:09 +0100)]
r300g: do not flush the uploader

We don't have to unmap and recreate the upload buffer when a flush occurs.
This should also prevent buffer allocations from failing.

13 years agoconfigure.ac: correctly check for libdrm_radeon version
Marek Olšák [Sun, 6 Feb 2011 14:42:55 +0000 (15:42 +0100)]
configure.ac: correctly check for libdrm_radeon version

13 years agor300g: RS400 doesn't have ZMASK
Marek Olšák [Wed, 2 Feb 2011 05:46:24 +0000 (06:46 +0100)]
r300g: RS400 doesn't have ZMASK

13 years agor600g: use surface format not underlying texture format
Dave Airlie [Sun, 6 Feb 2011 08:57:11 +0000 (18:57 +1000)]
r600g: use surface format not underlying texture format

This uses the surface format to set the CB up not the underlying texture
format, since these can and do differ.

Fixes piglit fbo-srgb.

13 years agor300/compiler: Disable register rename pass on r500
Tom Stellard [Sun, 6 Feb 2011 06:39:58 +0000 (22:39 -0800)]
r300/compiler: Disable register rename pass on r500

The scheduler and the register allocator are not good enough yet to deal
with the effects of the register rename pass.  This was causing a 50%
performance drop in Lightsmark.  The pass can be re-enabled once the
scheduler and the register allocator are more mature.  r300 and r400
still need this pass, because it prevents a lot of shaders from using
too many texture indirections.

NOTE: This is a candidate for the 7.10 branch.

13 years agor300/compiler: Don't count BEGIN_TEX instructions in the compiler stats
Tom Stellard [Sat, 5 Feb 2011 08:27:24 +0000 (00:27 -0800)]
r300/compiler: Don't count BEGIN_TEX instructions in the compiler stats

13 years agomesa/965: add support for GL_EXT_framebuffer_sRGB (v2)
Dave Airlie [Fri, 28 Jan 2011 04:16:00 +0000 (14:16 +1000)]
mesa/965: add support for GL_EXT_framebuffer_sRGB (v2)

This adds i965 support for GL_EXT_framebuffer_sRGB, it introduces a new
constant to say that the driver can support sRGB enabled FBOs since enabling
the extension doesn't mean the driver can actually support sRGB.

Also adds the suggested state flush in the core code suggested by Brian.

fix the ARB_fbo color encoding.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agomesa: Fix error checks in GetVertexAttrib functions
Ian Romanick [Fri, 4 Feb 2011 01:56:44 +0000 (17:56 -0800)]
mesa: Fix error checks in GetVertexAttrib functions

Querying index zero is not an error in OpenGL ES 2.0.

Querying an index larger than the value returned by
GL_MAX_VERTEX_ATTRIBS is an error in all APIs.

Fixes bugzilla #32375.

13 years agolinker: Generate link errors when ES shaders are missing stages
Ian Romanick [Fri, 4 Feb 2011 01:10:14 +0000 (17:10 -0800)]
linker: Generate link errors when ES shaders are missing stages

ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.

13 years agoglsl: Add opt_copy_propagation_elements.cpp to SConscript.
Vinson Lee [Fri, 4 Feb 2011 19:47:01 +0000 (11:47 -0800)]
glsl: Add opt_copy_propagation_elements.cpp to SConscript.

Fixes SCons build.

13 years agoi965: Drop the dead tracking of color_regions[].
Eric Anholt [Mon, 31 Jan 2011 05:13:17 +0000 (21:13 -0800)]
i965: Drop the dead tracking of color_regions[].

We pull the draw regions right out of the renderbuffers these days.

13 years agoi965: Drop the INTEL_DEBUG=state spam about the cache size check.
Eric Anholt [Thu, 20 Jan 2011 03:52:15 +0000 (19:52 -0800)]
i965: Drop the INTEL_DEBUG=state spam about the cache size check.

There's way more interesting info in INTEL_DEBUG=state if you could find
it among the state size checks.

13 years agoglsl: Remove extra checks for constant true assignment conditions.
Eric Anholt [Sat, 29 Jan 2011 21:59:14 +0000 (07:59 +1000)]
glsl: Remove extra checks for constant true assignment conditions.

These are already stripped by opt_constant_folding.cpp.

13 years agoglsl: Fix a comment typo in copy propagation.
Eric Anholt [Sat, 29 Jan 2011 21:50:21 +0000 (07:50 +1000)]
glsl: Fix a comment typo in copy propagation.

13 years agoglsl: Add a new opt_copy_propagation variant that does it channel-wise.
Eric Anholt [Tue, 25 Jan 2011 00:28:13 +0000 (10:28 +1000)]
glsl: Add a new opt_copy_propagation variant that does it channel-wise.

This patch cleans up many of the extra copies in GLSL IR introduced by
i965's scalarizing passes.  It doesn't result in a statistically
significant performance difference on nexuiz high settings (n=3) or my
demo (n=10), due to brw_fs.cpp's register coalescing covering most of
those extra moves anyway.  However, it does make the debug of wine's
GLSL shaders much more tractable, and reduces instruction count of
glsl-fs-convolution-2 from 376 to 288.

13 years agoralloc: Add missing va_end following va_copy.
Vinson Lee [Fri, 4 Feb 2011 06:10:16 +0000 (22:10 -0800)]
ralloc: Add missing va_end following va_copy.

13 years agor600g: don't set tile_type on evergreen.
Dave Airlie [Fri, 4 Feb 2011 05:26:41 +0000 (15:26 +1000)]
r600g: don't set tile_type on evergreen.

Since we never bind the actual DB to the CB/texture only the flushed one
we don't need to track the tile type at the moment.

13 years agor600g: fix evergreen sampler view + depth interaction
Dave Airlie [Fri, 4 Feb 2011 05:26:09 +0000 (15:26 +1000)]
r600g: fix evergreen sampler view + depth interaction

13 years agoutil: Change u_get_transfer_vtbl usage argument type to match prototype.
Vinson Lee [Fri, 4 Feb 2011 04:15:25 +0000 (20:15 -0800)]
util: Change u_get_transfer_vtbl usage argument type to match prototype.

The type of u_get_transfer_vtbl of the usage argument in u_transfer.h is
unsigned and not enum pipe_transfer_usage. This patch changes the type
of usage to unsigned to match the prototype in the header file.

13 years agoglsl: Add using statements for standard library functions.
Vinson Lee [Fri, 4 Feb 2011 03:19:12 +0000 (19:19 -0800)]
glsl: Add using statements for standard library functions.

Standard library functions in C++ are in the std namespace. When using
C++-style header files for the standard library, some compilers, such as
Sun Studio, provide symbols only for the std namespace and not for the
global namespace.

This patch adds using statements for standard library functions. Another
option could have been to prepend standard library function calls with
'std::'.

This patch fixes several compilation errors with Sun Studio.

13 years agor600g: get offset for correct texture when setting up CB.
Dave Airlie [Thu, 3 Feb 2011 23:38:01 +0000 (09:38 +1000)]
r600g: get offset for correct texture when setting up CB.

this fixes the mipmap tests with tiling forced on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: avoid trying to flush the flushing texture.
Dave Airlie [Thu, 3 Feb 2011 23:36:02 +0000 (09:36 +1000)]
r600g: avoid trying to flush the flushing texture.

Since these textures still have the depth bit set.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: evergreen CB check for flushed texture
Dave Airlie [Thu, 3 Feb 2011 23:34:32 +0000 (09:34 +1000)]
r600g: evergreen CB check for flushed texture

13 years agor600g: flushing texture needs all levels.
Dave Airlie [Thu, 3 Feb 2011 23:08:32 +0000 (09:08 +1000)]
r600g: flushing texture needs all levels.

For mipmap generation we need all levels in the flushing texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: remove unused variables
Dave Airlie [Thu, 3 Feb 2011 23:08:18 +0000 (09:08 +1000)]
r600g: remove unused variables

13 years agor600g: add a flag to just create flushed texture without flushing.
Dave Airlie [Thu, 3 Feb 2011 23:07:08 +0000 (09:07 +1000)]
r600g: add a flag to just create flushed texture without flushing.

This just adds a flag to create the texture without doing any
flushing to it. Flushing occurs in the draw function. This avoids
unnecessary flushes when we end up rebinding a CB/DB/texture due
to the blitter just restoring state.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: also check CB bindings for textures to depth flush.
Dave Airlie [Thu, 3 Feb 2011 23:06:02 +0000 (09:06 +1000)]
r600g: also check CB bindings for textures to depth flush.

This checks the color buffer bindings to make sure there is something
to flush.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: flush depth texture before a blit from it.
Dave Airlie [Thu, 3 Feb 2011 04:45:40 +0000 (14:45 +1000)]
r600g: flush depth texture before a blit from it.

If we are going to blit from a depth texture we need to flush
it before we blit from it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agosvga: rename a couple sampler, sampler view functions
Brian Paul [Thu, 3 Feb 2011 19:41:16 +0000 (12:41 -0700)]
svga: rename a couple sampler, sampler view functions

13 years agogallium/svga: added debug code for dumping framebuffer images (disabled)
Brian Paul [Mon, 31 Jan 2011 21:41:36 +0000 (14:41 -0700)]
gallium/svga: added debug code for dumping framebuffer images (disabled)

13 years agogallium/docs: more info about setting samplers and sampler views
Brian Paul [Thu, 3 Feb 2011 19:30:19 +0000 (12:30 -0700)]
gallium/docs: more info about setting samplers and sampler views

Plus other assorted clarifications.

13 years agocso: don't tell drivers to bind null samplers, sampler views
Brian Paul [Thu, 3 Feb 2011 18:59:59 +0000 (11:59 -0700)]
cso: don't tell drivers to bind null samplers, sampler views

Before, the set_sampler_views() and restore_sampler_views() functions
used MAX2(old,new) to tell the driver how many samplers or sampler
views to set.  This could result in cases such as:

pipe->set_fragment_sampler_views(pipe, 4, views={foo, bar, NULL, NULL})

Many/most gallium drivers would take this as-is and set
ctx->num_sampler_views=4 and ctx->sampler_views={foo, bar, NULL, NULL, ...}.
Later, loops over ctx->num_sampler_views would have to check for null
pointers.  Worse, the number of sampler views and number of sampler CSOs
could get out of sync:

ctx->num_samplers = 2
ctx->samplers = {foo, bar, ...}
ctx->num_sampler_views = 4
ctx->sampler_views={Foo, Bar, NULL, NULL, ...}

So loops over the num_samplers could run into null sampler_views pointers
or vice versa.

This fixes a failed assertion in the SVGA driver when running the Mesa
engine demo in AA line mode (and possibly other cases).

It looks like all gallium drivers are careful to unreference views
and null-out sampler CSO pointers for the units beyond what's set
with the pipe::bind_x_sampler_states() and pipe::set_x_sampler_views()
functions.

I'll update the gallium docs to explain this as well.

13 years agor600g: Make some more things static.
Henri Verbeet [Thu, 3 Feb 2011 20:10:50 +0000 (21:10 +0100)]
r600g: Make some more things static.

13 years agor600g: Get rid of the unused r600_cf_vtx_tc() function.
Henri Verbeet [Thu, 3 Feb 2011 20:10:50 +0000 (21:10 +0100)]
r600g: Get rid of the unused r600_cf_vtx_tc() function.

13 years agor300g: Make the buffer and texture vbtls static const.
Henri Verbeet [Thu, 3 Feb 2011 20:10:50 +0000 (21:10 +0100)]
r300g: Make the buffer and texture vbtls static const.

13 years agor600g: Make the buffer and texture vbtls static const.
Henri Verbeet [Thu, 3 Feb 2011 20:10:50 +0000 (21:10 +0100)]
r600g: Make the buffer and texture vbtls static const.

13 years agoegl_dri2: Add new radeon pci ids
Alex Deucher [Thu, 3 Feb 2011 19:35:54 +0000 (14:35 -0500)]
egl_dri2: Add new radeon pci ids

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agoegl_dri2: Split out drm platform implementation to a separate file
Kristian Høgsberg [Thu, 3 Feb 2011 03:21:13 +0000 (22:21 -0500)]
egl_dri2: Split out drm platform implementation to a separate file

13 years agoegl_dri2: Split out x11 platform code
Kristian Høgsberg [Thu, 3 Feb 2011 03:10:40 +0000 (22:10 -0500)]
egl_dri2: Split out x11 platform code

13 years agoswrast: add an interface createNewContextForAPI
Haitao Feng [Sun, 30 Jan 2011 08:03:35 +0000 (16:03 +0800)]
swrast: add an interface createNewContextForAPI

This new interface could set up context for OpenGL,
OpenGL ES1 and OpenGL ES2. It will be used by egl_dri2
driver.

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
13 years agosvga: Fix resource leak; undo temporary workaround.
José Fonseca [Thu, 3 Feb 2011 16:14:02 +0000 (16:14 +0000)]
svga: Fix resource leak; undo temporary workaround.

Leak was introduced when fixing strict aliasing violation in this code:
the reference counting was preserved, but the destructor call on zero
reference count was not.

13 years agosvga: Temporarily disable buffer DMA upload coalescing.
José Fonseca [Thu, 3 Feb 2011 15:14:59 +0000 (15:14 +0000)]
svga: Temporarily disable buffer DMA upload coalescing.

See comment for more details.

13 years agosvga/drm: Flushing preemptively on a 1/3 of the aperture.
José Fonseca [Thu, 3 Feb 2011 15:06:39 +0000 (15:06 +0000)]
svga/drm: Flushing preemptively on a 1/3 of the aperture.

Exactly one half would be the ideal, but this is a soft limit, and one
more byte over brings us to synchronous behavior.

Flushing when the referred GMR exceeds one third of the aperture gives us
statistically better performance.

13 years agoutil: Prevent transfer dangling pointer on map failure.
José Fonseca [Thu, 3 Feb 2011 15:05:03 +0000 (15:05 +0000)]
util: Prevent transfer dangling pointer on map failure.

13 years agosvga: Don't call swc->flush directly.
José Fonseca [Thu, 3 Feb 2011 15:02:07 +0000 (15:02 +0000)]
svga: Don't call swc->flush directly.

Only svga_context_flush should do it, to ensure upload commands are not
submitted to hardware in an inconsistent state.

13 years agosvga: Add an assert to catch reentrancy.
José Fonseca [Thu, 3 Feb 2011 15:01:09 +0000 (15:01 +0000)]
svga: Add an assert to catch reentrancy.

13 years agosvga/drm: Update for pb_vtbl::map argument addition.
José Fonseca [Thu, 3 Feb 2011 13:59:58 +0000 (13:59 +0000)]
svga/drm: Update for pb_vtbl::map argument addition.

13 years agor300c: Unbreak after R4xx support was added to r300/compiler.
Michel Dänzer [Thu, 3 Feb 2011 12:25:16 +0000 (13:25 +0100)]
r300c: Unbreak after R4xx support was added to r300/compiler.

13 years agoscons: Eliminate libgcc_s_sjlj-1.dll dependency
José Fonseca [Thu, 3 Feb 2011 09:12:11 +0000 (09:12 +0000)]
scons: Eliminate libgcc_s_sjlj-1.dll dependency

Certain mingw32 cross compilers (e.g. RedHat's) defaults to use DLL gcc
runtime.

Given the main deliverable from this project are self-contained drivers,
which are loaded by any application, this dependency can cause havoc.

13 years agor600g: flush differences back to DB copy.
Dave Airlie [Thu, 3 Feb 2011 03:43:37 +0000 (13:43 +1000)]
r600g: flush differences back to DB copy.

13 years agor600g: fix depth hw resource copies.
Dave Airlie [Tue, 1 Feb 2011 07:20:53 +0000 (17:20 +1000)]
r600g: fix depth hw resource copies.

With the previous fixes we can now enabled hw depth copies

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: only set depth bit for hw accessible depth buffers.
Dave Airlie [Thu, 3 Feb 2011 03:19:30 +0000 (13:19 +1000)]
r600g: only set depth bit for hw accessible depth buffers.

If we get a sw accessible buffer like the S8 texture we end up
doing depth tracking on it when there is no need since we won't
ever bind it to the hardware. This leads to a sw fallback in the
transfer destruction which leads to and endless recusion loop
of fail in transfer destroy.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: rework dirty / depth texture tracking.
Dave Airlie [Thu, 3 Feb 2011 03:12:35 +0000 (13:12 +1000)]
r600g: rework dirty / depth texture tracking.

this adds a flag to keep track of whether the depth texture structure
is the flushed texture or not, so we can avoid doing flushes when
we do a hw rendering from one to the other.

it also renames flushed to dirty_db which tracks if the DB copy
has been dirtied by being bound to the hw.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: set correct pitch/offset for depth textures in flushed state.
Dave Airlie [Thu, 3 Feb 2011 03:21:08 +0000 (13:21 +1000)]
r600g: set correct pitch/offset for depth textures in flushed state.

This fixes zreaddraw in tiling mode

13 years agosoftpipe: rename sampler[] -> fragment_samplers[]
Brian Paul [Thu, 3 Feb 2011 03:43:56 +0000 (20:43 -0700)]
softpipe: rename sampler[] -> fragment_samplers[]

13 years agosoftpipe: rename fragment sampler/view fields
Brian Paul [Thu, 3 Feb 2011 03:30:54 +0000 (20:30 -0700)]
softpipe: rename fragment sampler/view fields

To be consistant with vertex, geometry sampler fields.

13 years agocso: refactor texture sampler and sampler view code
Brian Paul [Thu, 3 Feb 2011 03:19:51 +0000 (20:19 -0700)]
cso: refactor texture sampler and sampler view code

This consolidates the code duplicated between the fragment sampler
and vertex sampler functions.  Plus, it'll make adding support for
geometry shader samplers trivial.

13 years agocso: rename fragment sampler-related fields
Brian Paul [Thu, 3 Feb 2011 01:14:46 +0000 (18:14 -0700)]
cso: rename fragment sampler-related fields

To better distinguish from vertex sampler fields.

13 years agocso: fix loop bound in cso_set_vertex_samplers()
Brian Paul [Thu, 3 Feb 2011 01:11:27 +0000 (18:11 -0700)]
cso: fix loop bound in cso_set_vertex_samplers()

Before we were looping to nr_samplers, which is the number of fragment
samplers, not vertex samplers.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

13 years agoglcpp: Raise error when modulus is zero
Chad Versace [Wed, 2 Feb 2011 18:15:19 +0000 (10:15 -0800)]
glcpp: Raise error when modulus is zero

For example, this now raises an error:
   #define XXX 1 / 0

Fixes bug: https://bugs.freedesktop.org//show_bug.cgi?id=33507
Fixes Piglit test: spec/glsl-1.10/preprocessor/modulus-by-zero.vert

NOTE: This is a candidate for the 7.9 and 7.10 branches.

13 years agoglsl: Avoid division-by-zero during constant-folding
Chad Versace [Tue, 1 Feb 2011 18:14:28 +0000 (10:14 -0800)]
glsl: Avoid division-by-zero during constant-folding

Avoid division-by-zero when constant-folding the following expression
types:
    ir_unop_rsq
    ir_binop_div
    ir_binop_mod

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

Fixes Piglit tests:
glslparsertest/glsl2/div-by-zero-01.frag
glslparsertest/glsl2/div-by-zero-02.frag
glslparsertest/glsl2/div-by-zero-03.frag
glslparsertest/glsl2/modulus-zero-01.frag
glslparsertest/glsl2/modulus-zero-02.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.

13 years agoglsl: Fix constant-folding for reciprocal expressions
Chad Versace [Tue, 1 Feb 2011 17:09:33 +0000 (09:09 -0800)]
glsl: Fix constant-folding for reciprocal expressions

Do not constant-fold a reciprocal if any component of the reciprocated
expression is 0. For example, do not constant-fold `1 / vec4(0, 1, 2, 3)`.

Incorrect, previous behavior
----------------------------
Reciprocals were constant-folded even when some component of the
reciprocated expression was 0. The incorrectly applied arithmetic was:
   1 / 0 := 0
For example,
   1 / vec4(0, 1, 2, 3) = vec4(0, 1, 1/2, 1/3)

NOTE: This is a candidate for the 7.9 and 7.10 branches.

13 years agosvga: Flush upload buffers or we get asserts
José Fonseca [Wed, 2 Feb 2011 11:28:41 +0000 (11:28 +0000)]
svga: Flush upload buffers or we get asserts

Based on work from Jakob Bornecrantz, Michel Dänzer, and Brian Paul.

13 years agoglsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.
Kenneth Graunke [Wed, 2 Feb 2011 07:47:26 +0000 (23:47 -0800)]
glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.

This has probably existed since e5e34ab18eeaffa465 or so.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

13 years agoglsl: Fix invalid use of ralloc_asprintf in prototype_string.
Kenneth Graunke [Wed, 2 Feb 2011 07:31:35 +0000 (23:31 -0800)]
glsl: Fix invalid use of ralloc_asprintf in prototype_string.

This was my mistake when converting from talloc to ralloc.  I was
confused because the other calls in the function are to asprintf_append
and the original code used str as the context rather than NULL.

Fixes bug #33823.

13 years agor600g: use burst exports in shaders
Christian König [Tue, 1 Feb 2011 23:24:34 +0000 (00:24 +0100)]
r600g: use burst exports in shaders

Join multiple exports into just one instruction
instead of exporting each register separately.

13 years agor200: remove 0x4243 pci id
Alex Deucher [Wed, 2 Feb 2011 00:13:54 +0000 (19:13 -0500)]
r200: remove 0x4243 pci id

There's no such device.  0x4243 is a pci bridge id,
not a GPU.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agoi915: Only mark a register as available if all components are written
Ian Romanick [Tue, 1 Feb 2011 21:35:36 +0000 (13:35 -0800)]
i915: Only mark a register as available if all components are written

Previously a register would be marked as available if any component
was written.  This caused shaders such as this:

  0: TEX TEMP[0].xyz, INPUT[14].xyyy, texture[0], 2D;
  1: MUL TEMP[1], UNIFORM[0], TEMP[0].xxxx;
  2: MAD TEMP[2], UNIFORM[1], TEMP[0].yyyy, TEMP[1];
  3: MAD TEMP[1], UNIFORM[2], TEMP[0].zzzz, TEMP[2];
  4: ADD TEMP[0].xyz, TEMP[1].xyzx, UNIFORM[3].xyzx;
  5: TEX TEMP[1].w, INPUT[14].xyyy, texture[0], 2D;
  6: MOV TEMP[0].w, TEMP[1].wwww;
  7: MOV OUTPUT[2], TEMP[0];
  8: END

to produce incorrect code such as this:

  BEGIN
  DCL S[0]
  DCL T_TEX0
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[0].xyz = MOV U[0]
  R[1] = MUL CONST[0], R[0].xxxx
  R[2] = MAD CONST[1], R[0].yyyy, R[1]
  R[1] = MAD CONST[2], R[0].zzzz, R[2]
  R[0].xyz = ADD R[1].xyzx, CONST[3].xyzx
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[1].w = MOV U[0]
  R[0].w = MOV R[1].wwww
  oC = MOV R[0]
  END

Note that T_TEX0 is copied to R[0], but the xyz components of R[0] are
still expected to hold a calculated value.

Fixes piglit tests draw-elements-vs-inputs, fp-kill, and
glsl-fs-color-matrix.  It also fixes Meego bugzilla #13005.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

13 years agomesa: glGetUniform only returns a single element of an array
Ian Romanick [Thu, 27 Jan 2011 20:24:27 +0000 (12:24 -0800)]
mesa: glGetUniform only returns a single element of an array

Also return it as the correct type.  Previously the whole array would
be returned and each element would be expanded to a vec4.

Fixes piglit test getuniform-01 and bugzilla #29823.

13 years agoglsl: Fix printf_length() on MSVC.
José Fonseca [Tue, 1 Feb 2011 10:41:46 +0000 (10:41 +0000)]
glsl: Fix printf_length() on MSVC.

13 years agoglsl: Fix memory error when creating the supported version string.
Kenneth Graunke [Tue, 1 Feb 2011 08:20:01 +0000 (00:20 -0800)]
glsl: Fix memory error when creating the supported version string.

Passing ralloc_vasprintf_append a 0-byte allocation doesn't work.  If
passed a non-NULL argument, ralloc calls strlen to find the end of the
string.  Since there's no terminating '\0', it runs off the end.

Fixes a crash introduced in 14880a510a1a288df0778395097d5a52806abfb0.

13 years agor600g: just change tile type when buffer is set to depth.
Dave Airlie [Tue, 1 Feb 2011 04:38:45 +0000 (14:38 +1000)]
r600g: just change tile type when buffer is set to depth.

Not 100% sure on this one, but this is how it should work,
the question is whether it will uncover other bugs elsewhere.

13 years agor600g: align the tiling modes with what the DDX and kernel expects.
Dave Airlie [Tue, 1 Feb 2011 04:22:08 +0000 (14:22 +1000)]
r600g: align the tiling modes with what the DDX and kernel expects.

If we see a MACRO bit on r600g its 2D tiled,
if don't see a MACRO bit and we do see a MICRO bit then its 1D tiled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: fix evergreen for depth decompress test
Dave Airlie [Tue, 1 Feb 2011 03:06:35 +0000 (13:06 +1000)]
r600g: fix evergreen for depth decompress test

13 years agor600: only decompress depth when its tile type is wrong.
Dave Airlie [Tue, 1 Feb 2011 03:00:56 +0000 (13:00 +1000)]
r600: only decompress depth when its tile type is wrong.

If the tile type for the buffer is 1 then its been bound to the
DB at some point, we need to decompress it, otherwise its only
been bound as texture/cb so don't do anything.

This fixes 5 piglit tests here on r600g.

13 years agotexture_builtins.py: Fix a warning about mixed tabs/spaces.
Kenneth Graunke [Tue, 1 Feb 2011 00:41:34 +0000 (16:41 -0800)]
texture_builtins.py: Fix a warning about mixed tabs/spaces.

13 years agor600g: start looking at evergreen tiling.
Dave Airlie [Sat, 29 Jan 2011 11:25:37 +0000 (21:25 +1000)]
r600g: start looking at evergreen tiling.

this just adds the ioctl interface and sets the tile type
and array mode in the correct place.

This seems to bring eg 1D tiling to the same level, and issues
as on r600. No idea how to address 2D yet.

13 years agor600g: Actually use the info from the flushed depth texture when creating a sampler...
Henri Verbeet [Tue, 1 Feb 2011 00:17:02 +0000 (01:17 +0100)]
r600g: Actually use the info from the flushed depth texture when creating a sampler view on a depth texture.

R600/R700 was using incorrect tiling information from the (compressed) depth
buffer. Evergreen worked anyway because tiling doesn't work.

13 years agoglsl: Refresh autogenerated lexer and parser files.
Ian Romanick [Mon, 31 Jan 2011 23:04:45 +0000 (15:04 -0800)]
glsl: Refresh autogenerated lexer and parser files.

For the previous commit.

13 years agoglsl: Reject shader versions not supported by the implementation
Ian Romanick [Mon, 31 Jan 2011 23:02:24 +0000 (15:02 -0800)]
glsl: Reject shader versions not supported by the implementation

Previously we'd happily compile GLSL 1.30 shaders on any driver.  We'd
also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context.
This has been a long standing FINISHME in the compiler.

NOTE: This is a candidate for the 7.9 and 7.10 branches

13 years agoglsl: Ensure that all GLSL versions are supported in the stand-alone compiler
Ian Romanick [Mon, 31 Jan 2011 22:52:27 +0000 (14:52 -0800)]
glsl: Ensure that all GLSL versions are supported in the stand-alone compiler

NOTE: This is a candidate for the 7.9 and 7.10 branches

13 years agoglsl: Fix dependencies / linkage for glsl_compiler
Ian Romanick [Fri, 28 Jan 2011 01:51:55 +0000 (17:51 -0800)]
glsl: Fix dependencies / linkage for glsl_compiler

13 years agomesa: Initial size for secondary color array is 3
Ian Romanick [Mon, 31 Jan 2011 21:46:16 +0000 (13:46 -0800)]
mesa: Initial size for secondary color array is 3

See table 6.7 on page 347 of the OpenGL 3.0 specification.

13 years agor600g: fix invalid ref count handling in r600_set_constant_buffer
Christian König [Mon, 31 Jan 2011 22:38:10 +0000 (23:38 +0100)]
r600g: fix invalid ref count handling in r600_set_constant_buffer

Only decrement ref count if r600_upload_const_buffer
really changes the buffer.

13 years agollvmpipe: fix incorrect array index in image dump code
Brian Paul [Mon, 31 Jan 2011 21:09:17 +0000 (14:09 -0700)]
llvmpipe: fix incorrect array index in image dump code

13 years agoglsl: regerated files
Brian Paul [Mon, 31 Jan 2011 21:08:47 +0000 (14:08 -0700)]
glsl: regerated files

13 years agoglsl: make _token_list_is_empty_ignoring_space() static
Brian Paul [Mon, 31 Jan 2011 21:08:22 +0000 (14:08 -0700)]
glsl: make _token_list_is_empty_ignoring_space() static

To silence warning about missing prototype.

13 years agoscons/glsl: add top-level 'include' dir to CPPPATH
Brian Paul [Mon, 31 Jan 2011 21:07:12 +0000 (14:07 -0700)]
scons/glsl: add top-level 'include' dir to CPPPATH

To avoid using the /usr/include/GL/gl.h file which may be lacking
some special #defines.

13 years agoglsl: add cast to silence signed/unsigned comparison warning
Brian Paul [Mon, 31 Jan 2011 21:06:38 +0000 (14:06 -0700)]
glsl: add cast to silence signed/unsigned comparison warning

13 years agoglsl: Define va_copy on MSVC.
José Fonseca [Mon, 31 Jan 2011 20:52:18 +0000 (20:52 +0000)]
glsl: Define va_copy on MSVC.

13 years agoi965: Emit texel offsets in sampler messages.
Kenneth Graunke [Mon, 27 Dec 2010 11:21:23 +0000 (03:21 -0800)]
i965: Emit texel offsets in sampler messages.

13 years agoglsl/builtins: Uncomment prototypes for texture*Offset functions.
Kenneth Graunke [Sun, 9 Jan 2011 07:53:51 +0000 (23:53 -0800)]
glsl/builtins: Uncomment prototypes for texture*Offset functions.

13 years agotexture_builtins.py: Generate texture*Offset functions.
Kenneth Graunke [Sun, 9 Jan 2011 07:53:11 +0000 (23:53 -0800)]
texture_builtins.py: Generate texture*Offset functions.