Commit Graph

45490 Commits

Author SHA1 Message Date
Eric Anholt 83f5d5e6aa Add dependency generation for Mesa and GLSL dricore objects.
Reviewed-By: Christopher James Halse Rogers
	     <christopher.halse.rogers@canonical.com>
2011-07-28 17:32:42 -07:00
Eric Anholt f79e3518b4 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>
2011-07-28 17:32:42 -07:00
Brian Paul e4fdc95277 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
5874890c26.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39604
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-28 17:29:36 -06:00
Brian Paul 26684e0b1a mesa: test against MESA_FORMAT_NONE in _mesa_GetTexLevelParameteriv() 2011-07-28 17:24:57 -06:00
Brian Paul 58d6aa8287 st/mesa: fix comment language 2011-07-28 17:24:56 -06:00
Vadim Girlin 95ee961f77 r600g: fix vs export count
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39572

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-28 18:58:40 -04:00
Kenneth Graunke f73caddd33 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>
2011-07-28 14:04:39 -07:00
Kenneth Graunke 15c0bc5eef 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>
2011-07-28 14:04:39 -07:00
Kenneth Graunke 3e1fd13f60 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>
2011-07-28 14:04:39 -07:00
Paul Berry fe33c886a7 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>
2011-07-28 10:41:39 -07:00
Marek Olšák 0aed27ee37 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.
2011-07-28 00:25:28 +02:00
Marek Olšák c6f59fcd00 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.
2011-07-28 00:25:12 +02:00
Ian Romanick f622c6d7a2 glsl: Add source location tracking to TODO list 2011-07-27 11:41:14 -07:00
Ian Romanick 5e1b7097f3 glsl: Remove completed items from the TODO list 2011-07-27 11:41:14 -07:00
Christoph Bumiller 58c04435b1 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>
2011-07-27 12:13:37 +02:00
Benjamin Franzke 79dcfb266a wayland-drm: Add copyright notice to protocol
Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.
2011-07-27 10:07:14 +02:00
Tobias Droste d4d5e3a336 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>
2011-07-27 09:35:46 +02:00
Marek Olšák 1c2c4ddbd1 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.
2011-07-26 22:35:49 +02:00
Bryan Cain 860c51d827 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.
2011-07-26 12:54:42 -05:00
Bryan Cain 95739f19cc st/mesa: respect force_s3tc_enable environment variable
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 12:54:40 -05:00
Ian Romanick b189d1635d 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>
2011-07-25 19:57:24 -07:00
Ian Romanick 143b65f761 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>
2011-07-25 19:57:17 -07:00
Ian Romanick 09916e877f mesa: Add utility function to get base format from a GL compressed format
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 19:57:14 -07:00
Eric Anholt 3daa2d97eb i965/fs: Fix MRT drawing since the m0->m2 move for shader debug.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-25 19:42:18 -07:00
Ian Romanick c1e591eed4 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>
2011-07-25 18:45:46 -07:00
Marek Olšák 99fba503b1 configure.ac: do not check for llvm-config if llvm is disabled
NOTE: This is a candidate for the 7.11 branch.
2011-07-25 23:47:22 +02:00
Tobias Droste 84f8548dfc 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>
2011-07-25 23:47:07 +02:00
Marek Olšák f170555a18 winsys/radeon: fix typos in the driver interface 2011-07-25 23:10:40 +02:00
Marek Olšák 533e228923 winsys/radeon: manage constant buffers by the cache bufmgr too 2011-07-25 23:10:40 +02:00
Marek Olšák 7db148d3a5 winsys/radeon: remove usage parameter from buffer_create 2011-07-25 23:10:40 +02:00
Marek Olšák e22a1005c0 winsys/radeon: fix int->boolean conversion in radeon_bo_is_referenced_by_any_cs 2011-07-25 23:10:40 +02:00
Marek Olšák 67c995e0f1 winsys/radeon: little change in radeon_bo_is_referenced_by_cs 2011-07-25 23:10:40 +02:00
Marek Olšák ce9daf6f0b winsys/radeon: add R300 infix to winsys feature names 2011-07-25 23:10:39 +02:00
Marek Olšák 28a336dc38 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.
2011-07-25 23:10:39 +02:00
Eric Anholt 818db3848b 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.
2011-07-25 13:47:18 -07:00
Eric Anholt a0e5affb22 i965: Use 3D clears on gen6+ to avoid inter-ring synchronization.
Improves firefox-talos-gfx around 5%.
2011-07-25 13:47:18 -07:00
Eric Anholt 8080246892 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>
2011-07-25 13:47:18 -07:00
Eric Anholt 185868c9c2 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.
2011-07-25 13:47:01 -07:00
Paul Berry d92463d5dc 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>
2011-07-25 11:40:53 -07:00
Kenneth Graunke 572f631895 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>
2011-07-25 10:45:56 -07:00
Kenneth Graunke 156cef0fba i965/fs: Clear result before visiting shadow comparitor and LOD info.
Commit 53c89c67f3 ("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>
2011-07-25 10:45:56 -07:00
Emeric 7746b7d4bf 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>
2011-07-25 19:22:35 +02:00
Christian König 4f90b89961 gallium: change formats merged with pipe-video to type "other"
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39276
2011-07-25 18:20:22 +02:00
Benjamin Franzke 42cdf4074e 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
2011-07-25 09:37:02 +02:00
Christian König 4c84acc86f 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.
2011-07-25 01:32:39 +02:00
Christian König 4d23c6df81 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>
2011-07-24 19:17:27 +02:00
Younes Manton ac6455e9a2 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>
2011-07-23 17:13:44 -04:00
Ian Romanick 6c8f1f483a 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>
2011-07-23 01:24:18 -07:00
Ian Romanick 90cc372400 glsl: Factor out code that generates block of index comparisons
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick 156f85336f 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>
2011-07-23 01:24:18 -07:00