mesa.git
13 years agoglsl: Add method glsl_type::can_implicitly_convert_to()
Chad Versace [Wed, 27 Jul 2011 19:21:27 +0000 (12:21 -0700)]
glsl: Add method glsl_type::can_implicitly_convert_to()

This method checks if a source type is identical to or can be implicitly
converted to a target type according to the GLSL 1.20 spec, Section 4.1.10
Implicit Conversions.

The following commits use the method for a bugfix:
    glsl: Fix implicit conversions in non-constructor function calls
    glsl: Fix implicit conversions in array constructors

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agomesa: minor comment changes in teximage.c
Brian Paul [Fri, 29 Jul 2011 22:49:55 +0000 (16:49 -0600)]
mesa: minor comment changes in teximage.c

13 years agomesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries
Brian Paul [Fri, 29 Jul 2011 22:49:55 +0000 (16:49 -0600)]
mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries

And fix indentation.

NOTE: This is a candidate for the 7.11 branch.

13 years agoi965/fs: Allow register coalescing where the source is a uniform.
Eric Anholt [Fri, 22 Jul 2011 23:52:54 +0000 (16:52 -0700)]
i965/fs: Allow register coalescing where the source is a uniform.

Removes 0.8% of the fragment shader instructions on Unigine Tropics.

13 years agoi965/fs: Optimize a * 1.0 -> a.
Eric Anholt [Fri, 22 Jul 2011 23:45:15 +0000 (16:45 -0700)]
i965/fs: Optimize a * 1.0 -> a.

This appears in our instruction stream as a result of the
brw_vs_constval.c handling.

13 years agoi965/fs: If we see a RCP of a constant, try to constant fold it.
Eric Anholt [Fri, 22 Jul 2011 23:18:39 +0000 (16:18 -0700)]
i965/fs: If we see a RCP of a constant, try to constant fold it.

13 years agoi965/fs: Port texture projection avoidance optimization from the old backend.
Eric Anholt [Fri, 22 Jul 2011 22:56:46 +0000 (15:56 -0700)]
i965/fs: Port texture projection avoidance optimization from the old backend.

This is part of fixing a ~1% performance regression in OpenArena when
changing the fixed function fragment shader to using the new backend.
Right now this just avoids the LINTERP of the projector, not the math
using it.

13 years agoRevert "i965: Don't compute brw->wm.input_size_masks when it's unused."
Eric Anholt [Fri, 22 Jul 2011 22:48:53 +0000 (15:48 -0700)]
Revert "i965: Don't compute brw->wm.input_size_masks when it's unused."

This reverts commit 3412069e23b7fa5656262f3dd1aa86f66980594d.  We're
about to start using it in fragment shaders to handle avoiding
projection for fixed function.

13 years agoi965/fs: Stop using the exec_list iterator.
Eric Anholt [Fri, 29 Jul 2011 18:52:39 +0000 (11:52 -0700)]
i965/fs: Stop using the exec_list iterator.

The old style has gone out of favor in the project, but I kept copy
and pasting from existing iterator code.

13 years agor600g: fix up vs export handling
Alex Deucher [Fri, 29 Jul 2011 15:29:53 +0000 (11:29 -0400)]
r600g: fix up vs export handling

Certain attributes (position, psize, etc.) don't
count as params; they are handled separately by the hw.
However, the VS is required to export at least one param
and r600_shader_from_tgsi() takes care of adding a dummy
export if there is none.  Make sure the VS param export
count in the SPI properly accounts for this.

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 years agost/egl: create pbuffers with PIPE_BIND_SAMPLER_VIEW
Chia-I Wu [Fri, 29 Jul 2011 01:59:18 +0000 (10:59 +0900)]
st/egl: create pbuffers with PIPE_BIND_SAMPLER_VIEW

So that eglBindTexImage works.

13 years agoi965/fs: Respect ARB_color_buffer_float clamping.
Eric Anholt [Tue, 26 Jul 2011 01:50:43 +0000 (18:50 -0700)]
i965/fs: Respect ARB_color_buffer_float clamping.

This was done in the old codegen path, but not the new one.  Caught by
piglit fbo tests after the conversion to GLSL ff_fragment_shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Fix ff fragment shader inputs calculation when enabling a VS.
Eric Anholt [Wed, 13 Jul 2011 21:24:41 +0000 (14:24 -0700)]
mesa: Fix ff fragment shader inputs calculation when enabling a VS.

The FF VS generation happens just after the FF FS generation in
state.c, so the ctx->VP._Current value is for the previous state
update's vertex shader, not the one that will be chosen as a result of
this state update.  The vertexShader and vertexProgram variables
should be accurately telling us whether there's going to be a
ctx->VP._Current (except on _MaintainTnlProgram drivers, where it's
always true).

The glsl-vs-statechange-1 test was created to test for this, but it
turns out that the bug is hidden by the fact that we call
_mesa_update_state() twice per draw call -- once from
_mesa_valid_to_render() and once from vbo_draw_arrays(), and the
second one was fixing up the first one.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agotargets/{egl,gbm}: omit unneeded libdrm_radeon
Chia-I Wu [Fri, 29 Jul 2011 00:58:18 +0000 (09:58 +0900)]
targets/{egl,gbm}: omit unneeded libdrm_radeon

13 years agoegl: EGL_MATCH_NATIVE_NATIVE_PIXMAP cannot be EGL_DONT_CARE
Chia-I Wu [Thu, 28 Jul 2011 07:03:11 +0000 (16:03 +0900)]
egl: EGL_MATCH_NATIVE_NATIVE_PIXMAP cannot be EGL_DONT_CARE

13 years agoegl: make pixmaps and pbuffers EGL_BUFFER_PRESERVED
Chia-I Wu [Thu, 28 Jul 2011 04:33:55 +0000 (13:33 +0900)]
egl: make pixmaps and pbuffers EGL_BUFFER_PRESERVED

eglSwapBuffers is no-op to these surface types anyway.

13 years agoAdd dependency generation for Mesa and GLSL dricore objects.
Eric Anholt [Sat, 23 Jul 2011 01:42:21 +0000 (18:42 -0700)]
Add dependency generation for Mesa and GLSL dricore objects.

Reviewed-By: Christopher James Halse Rogers
     <christopher.halse.rogers@canonical.com>

13 years agosoftpipe: When doing write_all_cbufs, don't stomp over the color.
Eric Anholt [Wed, 13 Jul 2011 23:08:42 +0000 (16:08 -0700)]
softpipe: When doing write_all_cbufs, don't stomp over the color.

We have to make it through this loop processing the color multiple
times, so we can't go overwriting it on our first color buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: fix format selection for meta CopyTexSubImage()
Brian Paul [Thu, 28 Jul 2011 15:51:30 +0000 (09:51 -0600)]
mesa: fix format selection for meta CopyTexSubImage()

When we do a glReadPixels into the temporary buffer, we don't want to
use GL_LUMINANCE, GL_LUMINANCE_ALPHA or GL_INTENSITY since they will
compute L=R+G+B which is not what we want.

This bug has existed all along but was only exposed by the elimination
of the driver hook for glCopyTexImage() in
5874890c26f434f54e9218b83fae4eb8175c24e9.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39604
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agomesa: test against MESA_FORMAT_NONE in _mesa_GetTexLevelParameteriv()
Brian Paul [Thu, 28 Jul 2011 15:43:09 +0000 (09:43 -0600)]
mesa: test against MESA_FORMAT_NONE in _mesa_GetTexLevelParameteriv()

13 years agost/mesa: fix comment language
Brian Paul [Wed, 27 Jul 2011 21:49:39 +0000 (15:49 -0600)]
st/mesa: fix comment language

13 years agor600g: fix vs export count
Vadim Girlin [Thu, 28 Jul 2011 20:33:31 +0000 (00:33 +0400)]
r600g: fix vs export count

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
13 years agoi965: Remove the now unused intel_renderbuffer::draw_offset field.
Kenneth Graunke [Tue, 26 Jul 2011 04:13:43 +0000 (21:13 -0700)]
i965: Remove the now unused intel_renderbuffer::draw_offset field.

The previous commit removed the last use of this field.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Check actual tile offsets in Gen4 miptree workaround.
Kenneth Graunke [Tue, 26 Jul 2011 00:06:13 +0000 (17:06 -0700)]
i965: Check actual tile offsets in Gen4 miptree workaround.

The purpose of the (irb->draw_offset & 4095) != 0 check was to ensure
that we don't have XYy offsets into a tile, since Gen4 hardware doesn't
support that.  However, it's insufficient: there are cases where
draw_offset & 4095 is 0 but we still have a Y-offset.  This leads to an
assertion failure in brw_update_renderbuffer_surface with tile_y != 0.

Instead, simply call intel_renderbuffer_tile_offsets to compute the
actual X/Y offsets and check if either are non-zero.  This makes both
the workaround and the assertion check the same things.

Fixes piglit test fbo-generatemipmap-formats, and should also fix
bugs #34009 and #39487.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34009
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39487
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/gen4: Fix message parameter loading for 1D TXD sampling.
Kenneth Graunke [Mon, 25 Jul 2011 21:27:07 +0000 (14:27 -0700)]
i965/gen4: Fix message parameter loading for 1D TXD sampling.

We were neglecting to load dvdx and dvdy.  v is not optional.

Fixes glslparsertests tex-grad-0[12345].frag on Broadwater/Crestline.
(We still need an execution test using sampler1D.)

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoglsl: improve the accuracy of the radians() builtin function
Paul Berry [Wed, 27 Jul 2011 17:35:17 +0000 (10:35 -0700)]
glsl: improve the accuracy of the radians() builtin function

The constant used in the radians() function didn't have enough
precision, causing a relative error of 1.676e-5, which is far worse
than the precision of 32-bit floats.  This patch reduces the relative
error to 1.14e-9, which is the best we can do in 32 bits.

Fixes piglit tests {fs,vs}-radians-{float,vec2,vec3,vec4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoconfigure.ac: add DLOPEN_LIBS to xlib build
Marek Olšák [Mon, 25 Jul 2011 23:05:51 +0000 (01:05 +0200)]
configure.ac: add DLOPEN_LIBS to xlib build

Otherwise xlib-based llvmpipe fails to link.

NOTE: This is a candidate for the 7.11 branch.

13 years agoconfigure.ac: fix xlib-based softpipe build
Marek Olšák [Mon, 25 Jul 2011 23:05:13 +0000 (01:05 +0200)]
configure.ac: fix xlib-based softpipe build

Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
NOTE: This is a candidate for the 7.11 branch.

13 years agoglsl: Add source location tracking to TODO list
Ian Romanick [Wed, 27 Jul 2011 18:37:30 +0000 (11:37 -0700)]
glsl: Add source location tracking to TODO list

13 years agoglsl: Remove completed items from the TODO list
Ian Romanick [Wed, 27 Jul 2011 18:35:31 +0000 (11:35 -0700)]
glsl: Remove completed items from the TODO list

13 years agomesa: don't forget about sampleBuffers in framebuffer visual update
Christoph Bumiller [Wed, 27 Jul 2011 10:13:37 +0000 (12:13 +0200)]
mesa: don't forget about sampleBuffers in framebuffer visual update

Otherwise multisample will never been enabled for multisample
renderbuffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agowayland-drm: Add copyright notice to protocol
Benjamin Franzke [Wed, 27 Jul 2011 08:04:51 +0000 (10:04 +0200)]
wayland-drm: Add copyright notice to protocol

Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.

13 years agoegl/gallium: fix build without softpipe and llvmpipe
Tobias Droste [Thu, 14 Jul 2011 20:32:58 +0000 (22:32 +0200)]
egl/gallium: fix build without softpipe and llvmpipe

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
13 years agor300g: copy the compiler from r300c
Marek Olšák [Tue, 26 Jul 2011 19:15:05 +0000 (21:15 +0200)]
r300g: copy the compiler from r300c

What a beast.

r300g doesn't depend on files from r300c anymore, so r300c is now left
to its own fate. BTW 'make test' can be invoked from the gallium/r300
directory to run some compiler unit tests.

13 years agoutil: enable S3TC support when the force_s3tc_enable env var is set to "true"
Bryan Cain [Wed, 20 Jul 2011 22:35:22 +0000 (17:35 -0500)]
util: enable S3TC support when the force_s3tc_enable env var is set to "true"

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

13 years agost/mesa: respect force_s3tc_enable environment variable
Bryan Cain [Mon, 25 Jul 2011 18:30:17 +0000 (13:30 -0500)]
st/mesa: respect force_s3tc_enable environment variable

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

13 years agomesa: Make _mesa_get_compressed_formats match the texture compression specs
Ian Romanick [Fri, 22 Jul 2011 23:45:50 +0000 (16:45 -0700)]
mesa: Make _mesa_get_compressed_formats match the texture compression specs

The implementation deviated slightly from the GL_EXT_texture_sRGB spec
and from other implementations.  A giant comment block was added to
justify the somewhat odd behavior of this function.

In addition, the interface had unnecessary cruft.  The 'all' parameter
was false at all callers, so it has been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Return the correct internal fmt when a generic compressed fmt was used
Ian Romanick [Fri, 22 Jul 2011 22:26:24 +0000 (15:26 -0700)]
mesa: Return the correct internal fmt when a generic compressed fmt was used

If an application requests a generic compressed format for a texture
and the driver does not pick a specific compressed format, return the
generic base format (e.g., GL_RGBA) for the GL_TEXTURE_INTERNAL_FORMAT
query.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3165
Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Add utility function to get base format from a GL compressed format
Ian Romanick [Fri, 22 Jul 2011 22:25:55 +0000 (15:25 -0700)]
mesa: Add utility function to get base format from a GL compressed format

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoi965/fs: Fix MRT drawing since the m0->m2 move for shader debug.
Eric Anholt [Mon, 25 Jul 2011 22:39:03 +0000 (15:39 -0700)]
i965/fs: Fix MRT drawing since the m0->m2 move for shader debug.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoglsl: Correctly return progress from lower_variable_index_to_cond_assign
Ian Romanick [Tue, 26 Jul 2011 01:33:40 +0000 (18:33 -0700)]
glsl: Correctly return progress from lower_variable_index_to_cond_assign

lower_variable_index_to_cond_assign runs until it can't make any more
progress.  It then returns the result of the last pass which will
always be false.  This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign.  This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.

In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements.  This is easily controlled by
switch_generator::linear_sequence_max_length.  This would generate
much better code on architectures without any flow contol.

Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoconfigure.ac: do not check for llvm-config if llvm is disabled
Marek Olšák [Sat, 23 Jul 2011 13:57:51 +0000 (15:57 +0200)]
configure.ac: do not check for llvm-config if llvm is disabled

NOTE: This is a candidate for the 7.11 branch.

13 years agor300/compiler: simplify code in peephole_add_presub_add
Tobias Droste [Mon, 18 Jul 2011 05:14:06 +0000 (07:14 +0200)]
r300/compiler: simplify code in peephole_add_presub_add

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
13 years agowinsys/radeon: fix typos in the driver interface
Marek Olšák [Sun, 24 Jul 2011 21:59:44 +0000 (23:59 +0200)]
winsys/radeon: fix typos in the driver interface

13 years agowinsys/radeon: manage constant buffers by the cache bufmgr too
Marek Olšák [Fri, 22 Jul 2011 20:14:39 +0000 (22:14 +0200)]
winsys/radeon: manage constant buffers by the cache bufmgr too

13 years agowinsys/radeon: remove usage parameter from buffer_create
Marek Olšák [Sat, 23 Jul 2011 02:11:31 +0000 (04:11 +0200)]
winsys/radeon: remove usage parameter from buffer_create

13 years agowinsys/radeon: fix int->boolean conversion in radeon_bo_is_referenced_by_any_cs
Marek Olšák [Fri, 22 Jul 2011 17:22:50 +0000 (19:22 +0200)]
winsys/radeon: fix int->boolean conversion in radeon_bo_is_referenced_by_any_cs

13 years agowinsys/radeon: little change in radeon_bo_is_referenced_by_cs
Marek Olšák [Fri, 22 Jul 2011 17:20:25 +0000 (19:20 +0200)]
winsys/radeon: little change in radeon_bo_is_referenced_by_cs

13 years agowinsys/radeon: add R300 infix to winsys feature names
Marek Olšák [Fri, 22 Jul 2011 17:14:23 +0000 (19:14 +0200)]
winsys/radeon: add R300 infix to winsys feature names

13 years agowinsys/radeon: simplify how value queries work
Marek Olšák [Fri, 22 Jul 2011 16:58:30 +0000 (18:58 +0200)]
winsys/radeon: simplify how value queries work

This drops the get_value query and adds a function query_info, which returns
all the values in one nice structure.

13 years agoi965: Fix many of the trivial WebGL demos that broke due to IB optimization.
Eric Anholt [Fri, 22 Jul 2011 17:56:10 +0000 (10:56 -0700)]
i965: Fix many of the trivial WebGL demos that broke due to IB optimization.

The index buffer state emit only occurred if there was an IB in place
and we were in either a new batch or a new IB state.  But because we
only flagged new IB state if IB state changed from the last IB state
we calculated, we could simply never emit IB state after batchbuffer
wraps if the first draw didn't use the IB and we didn't actually
change the IB.

Fixes piglit glx-multi-context-ib-1.

13 years agoi965: Use 3D clears on gen6+ to avoid inter-ring synchronization.
Eric Anholt [Thu, 19 May 2011 18:02:14 +0000 (11:02 -0700)]
i965: Use 3D clears on gen6+ to avoid inter-ring synchronization.

Improves firefox-talos-gfx around 5%.

13 years agometa: Also save/restore clip planes for GLSL.
Eric Anholt [Thu, 21 Jul 2011 16:15:05 +0000 (09:15 -0700)]
meta: Also save/restore clip planes for GLSL.

Fixes user-clip on 965 with 3D clears enabled.  I created a separate
flag because I wanted to avoid the overhead of the matrix operations
in this path.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoi965: Emit texture cache flushes on gen6 along with render cache flushes.
Eric Anholt [Mon, 25 Jul 2011 18:50:27 +0000 (11:50 -0700)]
i965: Emit texture cache flushes on gen6 along with render cache flushes.

It turns out that internally the texture cache gets flushed in a
couple of cases, particularly around 2D operations mixed with 3D.  In
almost all cases one of those happens between rendering to an
FBO-attached texture and rendering from that texture.  However, as of
the next patch, glean tfbo (and the new fbo-flushing-2 test) would
manage to get stale texture values because one of those flushes didn't
occur.  The intention of this code was always to get the render cache
cleared and ready to be used from the sampler cache (and it does on <=
gen4), so this just catches gen5 up.

This patch was also tested to fix fbo-flushing on gen7.

13 years agoi965: vs optimization fix: Check val.{negate,abs} in accumulator_contains()
Paul Berry [Fri, 22 Jul 2011 21:05:52 +0000 (14:05 -0700)]
i965: vs optimization fix: Check val.{negate,abs} in accumulator_contains()

When emitting a MAC instruction in a vertex shader, brw_vs_emit()
calls accumulator_contains() to determine whether the accumulator
already contains the appropriate addend; if it does, then we can avoid
emitting an unnecessary MOV instruction.

However, accumulator_contains() wasn't checking the val.negate or
val.abs flags.  As a result, if the desired value was the negation, or
the absolute value, of what was already in the accumulator, we would
generate an incorrect shader.

Fixes piglit test vs-refract-vec4-vec4-float.

Tested on Gen5 and Gen6.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965/gen7: Fix shadow sampling in the old brw_wm_emit backend.
Kenneth Graunke [Thu, 12 May 2011 11:02:32 +0000 (04:02 -0700)]
i965/gen7: Fix shadow sampling in the old brw_wm_emit backend.

On Ivybridge, the shadow comparitor goes in the first slot, rather than
at the end.  It's not necessary to send u, v, and r.

Fixes tests texturing/texdepth and glean/fbo.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/fs: Clear result before visiting shadow comparitor and LOD info.
Kenneth Graunke [Fri, 22 Jul 2011 04:17:10 +0000 (21:17 -0700)]
i965/fs: Clear result before visiting shadow comparitor and LOD info.

Commit 53c89c67f33639afef951e178f93f4e29acc5d53 ("i965: Avoid generating
MOVs for assignments of expressions.") added the line "this->result =
reg_undef" all over the code.  Unfortunately, since Eric developed his
patch before I landed Ivybridge support, he missed adding it to
fs_visitor::emit_texture_gen7() after rebasing.

Furthermore, since I developed TXD support before Eric's patch, I
neglected to add it to the gradient handling when I rebased.

Neglecting to set this causes the visitor to use this->result as storage
rather than generating a new temporary.  These missing statements
resulted in the same register being used to store several different
values.

Fixes the following piglit tests on Ivybridge:
- glsl-fs-shadow2dproj.shader_test
- glsl-fs-shadow2dproj-bias.shader_test

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agovdpau: enable mpeg1 hw decoding, using the exact same code path as mpeg2
Emeric [Mon, 18 Jul 2011 15:17:25 +0000 (15:17 +0000)]
vdpau: enable mpeg1 hw decoding, using the exact same code path as mpeg2

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39307
Signed-off-by: Christian König <deathsimple@vodafone.de>
13 years agogallium: change formats merged with pipe-video to type "other"
Christian König [Mon, 25 Jul 2011 00:58:31 +0000 (02:58 +0200)]
gallium: change formats merged with pipe-video to type "other"

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39276
13 years agoconfigure: Move gbm before egl in SRC_DIRS
Benjamin Franzke [Mon, 25 Jul 2011 07:37:02 +0000 (09:37 +0200)]
configure: Move gbm before egl in SRC_DIRS

egl_dri2 built into libEGL depends on libgbm.

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

13 years agog3dvl: remove unused vs output from create_ref_vert_shader
Christian König [Sun, 24 Jul 2011 23:32:39 +0000 (01:32 +0200)]
g3dvl: remove unused vs output from create_ref_vert_shader

The position of the quad vertex is calculated in calc_position,
so we don't need the output here any more.

13 years agor600g: use file_max instead of file_count to determine reg offset
Christian König [Sun, 24 Jul 2011 17:11:34 +0000 (19:11 +0200)]
r600g: use file_max instead of file_count to determine reg offset

Otherwise shaders with skipped inputs/outputs doesn't work correctly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
13 years agogallium/softpipe: Don't clobber dest color/alpha before masking.
Younes Manton [Fri, 22 Jul 2011 00:10:34 +0000 (20:10 -0400)]
gallium/softpipe: Don't clobber dest color/alpha before masking.

The blend_quad function clobbers the actual render target color/alpha
values while applying the destination blend factor, which results in
restoring the wrong value during the masking stage for write-disabled
channels.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoglsl: Compare vector indices in blocks
Ian Romanick [Tue, 19 Jul 2011 01:51:25 +0000 (18:51 -0700)]
glsl: Compare vector indices in blocks

Just like the non-constant array index lowering pass, compare all N
indices at once.  For accesses to a vec4, this saves 3 comparison
instructions on a vector architecture.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglsl: Factor out code that generates block of index comparisons
Ian Romanick [Tue, 19 Jul 2011 01:48:39 +0000 (18:48 -0700)]
glsl: Factor out code that generates block of index comparisons

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglsl: Treat ir_dereference_array of non-var as a constant for lowering
Ian Romanick [Mon, 18 Jul 2011 23:25:33 +0000 (16:25 -0700)]
glsl: Treat ir_dereference_array of non-var as a constant for lowering

Previously the code would just look at deref->array->type to see if it
was a constant.  This isn't good enough because deref->array might be
another ir_dereference_array... of a constant.  As a result,
deref->array->type wouldn't be a constant, but
deref->variable_referenced() would return NULL.  The unchecked NULL
pointer would shortly lead to a segfault.

Instead just look at the return of deref->variable_referenced().  If
it's NULL, assume that either a constant or some other form of
anonymous temporary storage is being dereferenced.

This is a bit hinkey because most drivers treat constant arrays as
uniforms, but the lowering pass treats them as temporaries.  This
keeps the behavior of the old code, so this change isn't making things
worse.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: When emitting a src/dst read of an output, keep the swizzle and neg
Ian Romanick [Thu, 21 Jul 2011 01:07:50 +0000 (18:07 -0700)]
i965: When emitting a src/dst read of an output, keep the swizzle and neg

Fixes i965 piglit vs-varying-array-mat[234]-row-rd.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: When emitting a src/dst write of an output, keep the write mask
Ian Romanick [Wed, 20 Jul 2011 23:04:17 +0000 (16:04 -0700)]
i965: When emitting a src/dst write of an output, keep the write mask

Fixes i965 piglit:

    vs-varying-array-mat[234]-col-row-wr
    vs-varying-array-mat[234]-index-col-row-wr
    vs-varying-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-row-wr
    vs-varying-mat[234]-col-row-wr
    vs-varying-mat[234]-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoprog_optimize: Set unused regs to PROGRAM_UNDEFINED after CMP->MOV conversion
Ian Romanick [Thu, 21 Jul 2011 01:02:17 +0000 (18:02 -0700)]
prog_optimize: Set unused regs to PROGRAM_UNDEFINED after CMP->MOV conversion

Leaving the unused registers with other values caused assertion
failures and other problems in places that blindly iterate over all
sources.

brw_vs_emit.c:1381: get_src_reg: Assertion `c->regs[file][index].nr !=
0' failed.

Fixes i965 piglit:

    vs-uniform-array-mat[234]-col-row-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-row-rd
    vs-uniform-mat[234]-col-row-rd

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoir_to_mesa: Copy reladdr in src_reg(dst_reg) constructor
Ian Romanick [Mon, 18 Jul 2011 06:35:26 +0000 (23:35 -0700)]
ir_to_mesa: Copy reladdr in src_reg(dst_reg) constructor

Fixes i965 piglit:

    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Fixes swrast piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-row-wr
    fs-temp-mat[234]-col-row-wr
    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoir_to_mesa: Add each relative address to the previous
Ian Romanick [Mon, 18 Jul 2011 06:15:54 +0000 (23:15 -0700)]
ir_to_mesa: Add each relative address to the previous

This fixes many cases of accessing arrays of matrices using
non-constant indices at each level.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd

Fixes swrast piglit:

    fs-temp-array-mat[234]-index-col-rd
    fs-temp-array-mat[234]-index-col-row-rd
    fs-temp-array-mat[234]-index-col-wr
    fs-uniform-array-mat[234]-index-col-rd
    fs-uniform-array-mat[234]-index-col-row-rd
    fs-varying-array-mat[234]-index-col-rd
    fs-varying-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-rd
    vs-varying-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglsl: When lowering non-constant vector indexing, respect existing conditions
Ian Romanick [Mon, 18 Jul 2011 00:35:00 +0000 (17:35 -0700)]
glsl: When lowering non-constant vector indexing, respect existing conditions

If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglsl: When lowering non-constant array indexing, respect existing conditions
Ian Romanick [Mon, 18 Jul 2011 00:33:26 +0000 (17:33 -0700)]
glsl: When lowering non-constant array indexing, respect existing conditions

If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Fixes i965 piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-col-wr
    fs-temp-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglsl: Rework lowering of non-constant array indexing
Ian Romanick [Mon, 18 Jul 2011 19:18:19 +0000 (12:18 -0700)]
glsl: Rework lowering of non-constant array indexing

The previous implementation could easily get tricked if the LHS of an
assignment included a non-constant index that was "inside" another
dereference.  For example:

    mat4 m[2];
    m[0][i] = vec4(0.0);

Due to the way it tracked whether the array was being assigned, it
would think that the non-constant index was in an r-value.  The new
code fixes that by tracking l-values and r-values differently.  The
index is also replaced by cloning the IR and replacing the index
variable instead of the odd way it was done before.

v2: Apply some simplifications suggested by Eric Anholt.  Making
assignment_generator::rvalue be ir_dereference instead of ir_rvalue
simplified the code a bit.

Fixes i965 piglit fs-temp-array-mat[234]-index-wr and
vs-varying-array-mat[234]-index-wr.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34691
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
Ian Romanick [Mon, 18 Jul 2011 17:07:24 +0000 (10:07 -0700)]
glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering

Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglsl: Move is_array_or_matrix outside visitor class
Ian Romanick [Mon, 18 Jul 2011 16:51:34 +0000 (09:51 -0700)]
glsl: Move is_array_or_matrix outside visitor class

There's no reason for it to be there, and another class that may not
have access to the visitor will need it soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agogallivm: Add a note about log2 computation and denormalized numbers.
José Fonseca [Wed, 20 Jul 2011 21:53:59 +0000 (14:53 -0700)]
gallivm: Add a note about log2 computation and denormalized numbers.

13 years agogallivm: Fix lp_build_exp2 order 4-5 polynomial coefficients and bump order.
José Fonseca [Wed, 20 Jul 2011 21:53:08 +0000 (14:53 -0700)]
gallivm: Fix lp_build_exp2 order 4-5 polynomial coefficients and bump order.

Not sure how I computed these, but they were wrong (which explains why
bumping the polynomial order before never improved precision).

This allows to pass the EXP test cases of PSPrecision/VSPrecision DCTs.

13 years agogallivm: Increase lp_build_rsqrt() precision.
José Fonseca [Wed, 20 Jul 2011 21:41:17 +0000 (14:41 -0700)]
gallivm: Increase lp_build_rsqrt() precision.

Add an iteration step, which makes rqsqrt precision go from 12bits to
24, and fixes RSQ/NRM test case of PSPrecision/VSPrevision DCTs.

There are no uses of this function outside shader translation.

13 years agogallivm: Update minimax comments.
José Fonseca [Wed, 20 Jul 2011 21:34:46 +0000 (14:34 -0700)]
gallivm: Update minimax comments.

13 years agogallivm: Fix lp_build_exp/lp_build_log.
José Fonseca [Tue, 19 Jul 2011 22:58:09 +0000 (15:58 -0700)]
gallivm: Fix lp_build_exp/lp_build_log.

Never used so far -- we only used the base 2 variants -- which is why
it went unnoticed so far.

13 years agollvmpipe: Unit tests for arithmetic functions.
José Fonseca [Wed, 20 Jul 2011 21:39:23 +0000 (14:39 -0700)]
llvmpipe: Unit tests for arithmetic functions.

Conflicts:

src/gallium/drivers/llvmpipe/SConscript

13 years agoutil: Store alpha value too.
José Fonseca [Tue, 19 Jul 2011 22:58:21 +0000 (15:58 -0700)]
util: Store alpha value too.

13 years agoglsl: Add standalone_scaffolding.cpp to SConscript.
Vinson Lee [Fri, 22 Jul 2011 17:38:05 +0000 (10:38 -0700)]
glsl: Add standalone_scaffolding.cpp to SConscript.

13 years agoglsl: Add unit tests for lower_jumps.cpp
Paul Berry [Tue, 5 Jul 2011 18:52:06 +0000 (11:52 -0700)]
glsl: Add unit tests for lower_jumps.cpp

These tests invoke do_lower_jumps() in isolation (using the glsl_test
executable) and verify that it transforms the IR in the expected way.

The unit tests may be run from the top level directory using "make
check".

For reference, I've also checked in the Python script
create_test_cases.py, which was used to generate these tests.  It is
not necessary to run this script in order to run the tests.

Acked-by: Chad Versace <chad@chad-versace.us>
13 years agoglsl: Create a standalone executable for testing optimization passes.
Paul Berry [Wed, 29 Jun 2011 19:30:04 +0000 (12:30 -0700)]
glsl: Create a standalone executable for testing optimization passes.

This patch adds a new build artifact, glsl_test, which can be used for
testing optimization passes in isolation.

I'm hoping that we will be able to add other useful standalone tests
to this executable in the future.  Accordingly, it is built in a
modular fashion: the main() function uses its first argument to
determine which test function to invoke, removes that argument from
argv[], and then calls that function to interpret the rest of the
command line arguments and perform the test.  Currently the only test
function is "optpass", which tests optimization passes.

13 years agoglsl: Move functions into standalone_scaffolding.cpp for later reuse.
Paul Berry [Thu, 7 Jul 2011 21:01:40 +0000 (14:01 -0700)]
glsl: Move functions into standalone_scaffolding.cpp for later reuse.

This patch moves the following functions from main.cpp (the main cpp
file for the standalone executable that is used to create the built-in
functions) to standalone_scaffolding.cpp, so that they can be re-used
in other standalone executables:

- initialize_context()*
- _mesa_new_shader()
- _mesa_reference_shader()

*initialize_context contained some code that was specific to main.cpp,
so it was split into two functions: initialize_context() (which
remains in main.cpp), and initialize_context_from_defaults() (which is
in standalone_scaffolding.cpp).

13 years agomesa: Add an ifndef guard around the definition of the INLINE macro
Paul Berry [Thu, 7 Jul 2011 20:03:45 +0000 (13:03 -0700)]
mesa: Add an ifndef guard around the definition of the INLINE macro

Several Mesa headers redundantly define the INLINE macro.  Adding this
guard prevents the compiler from complaining about macro redefinition.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
13 years agoRevert "g3dvl: Preserve previously rendered components for MC output."
Younes Manton [Thu, 21 Jul 2011 17:53:34 +0000 (13:53 -0400)]
Revert "g3dvl: Preserve previously rendered components for MC output."

This reverts commit b56daf71d2f63d044d4c53ab49c6f87e02991a28.

The bug is actually in softpipe's blend and writemask interaction.

13 years agoconfigure.ac: check for libdrm_radeon only when building classic
Marek Olšák [Thu, 21 Jul 2011 20:31:24 +0000 (22:31 +0200)]
configure.ac: check for libdrm_radeon only when building classic

13 years agoMerge branch 'gallium-polygon-stipple'
Brian Paul [Thu, 21 Jul 2011 16:38:21 +0000 (10:38 -0600)]
Merge branch 'gallium-polygon-stipple'

13 years agosoftpipe: use the polygon stipple utility module
Brian Paul [Thu, 21 Jul 2011 15:55:22 +0000 (09:55 -0600)]
softpipe: use the polygon stipple utility module

This is an alternative to the draw module's polygon stipple stage.
The softpipe implementation here is just a test.  The advantange of
using the new polygon stipple utility module (with other drivers)
is we can avoid software vertex processing in the draw module and
get much better performance.
Polygon stipple doesn't require special vertex processing like
the other draw module stage.

13 years agosoftpipe: implement fragment shader variants
Brian Paul [Thu, 21 Jul 2011 15:55:22 +0000 (09:55 -0600)]
softpipe: implement fragment shader variants

We'll need shader variants to accomodate the new polygon stipple utility.

13 years agoutil: assorted updates to polygon stipple helper
Brian Paul [Thu, 21 Jul 2011 15:55:22 +0000 (09:55 -0600)]
util: assorted updates to polygon stipple helper

13 years agosoftpipe: use tgsi_shader_info fields for fragcoord origin, center, etc.
Brian Paul [Thu, 21 Jul 2011 15:55:22 +0000 (09:55 -0600)]
softpipe: use tgsi_shader_info fields for fragcoord origin, center, etc.

13 years agotgsi: add info fields for fragcoord origin, center, etc
Brian Paul [Thu, 21 Jul 2011 15:55:22 +0000 (09:55 -0600)]
tgsi: add info fields for fragcoord origin, center, etc

13 years agosoftpipe: remove obsolete comment
Brian Paul [Thu, 21 Jul 2011 15:55:22 +0000 (09:55 -0600)]
softpipe: remove obsolete comment

13 years agosoftpipe: rename a function
Brian Paul [Thu, 21 Jul 2011 15:55:22 +0000 (09:55 -0600)]
softpipe: rename a function

13 years agoMerge branch 'remove-copyteximage-hook'
Brian Paul [Thu, 21 Jul 2011 14:46:02 +0000 (08:46 -0600)]
Merge branch 'remove-copyteximage-hook'

13 years agou_vbuf_mgr: restore buffer offsets
Chia-I Wu [Wed, 20 Jul 2011 10:52:33 +0000 (18:52 +0800)]
u_vbuf_mgr: restore buffer offsets

u_vbuf_upload_buffers modifies the buffer offsets.  If they are not
restored, and any of the vertex formats is not supported natively, the
next u_vbuf_mgr_draw_begin call will translate the vertex buffers with
incorrect buffer offsets.