Commit Graph

45353 Commits

Author SHA1 Message Date
Vadim Girlin f0a7e28e29 r600g: LIT: clamp negative src.y to 0
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39083

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-10 13:19:38 -04:00
Marek Olšák d644a50dc3 st/dri: remove unused variables 2011-07-10 17:40:38 +02:00
Christian König cd4f18089e vdpau: make capabilities query more sane 2011-07-10 14:13:08 +02:00
Christian König 3d769619e2 vdpau: implement VdpOutputSurfaceGetParameters 2011-07-10 13:48:37 +02:00
Chia-I Wu 95f9e118fe st/egl: fix linking errors
Add symbols referenced by src/glx/dri2.c.
2011-07-10 15:11:15 +08:00
Kenneth Graunke 440224ab73 intel: Recognize all depth formats in get_teximage_readbuffer.
The existing code was missing GL_DEPTH_COMPONENT32, resulting in it
wrongly returning the color buffer instead of the depth buffer.

Fixes an issue in PlaneShift 0.5.7 when casting spells.  The game calls
CopyTexSubImage2D on buffers with a GL_DEPTH_COMPONENT32 internal
format, which (prior to this patch) resulted in an attempt to copy
ARGB8888 to X8_Z24.

Instead of adding the missing enumeration directly, convert the code to
use _mesa_is_depth_format() and _mesa_is_depthstencil_format() as these
should catch any newly added depth formats in the future.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-09 10:37:42 -07:00
Henri Verbeet 7e591111bf r600g: Get rid of some superfluous braces.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet 2e53725bbc r600g: Check for Evergreen chip class instead of Cedar family in r600_context_flush().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet 2b5b289a57 r600g: Store the chip class directly in r600_bc.
Instead of deriving it from the family again.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet 89dc31a28d r600g: Replace the CHIPREV_* defines with the chip_class enum.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet 4f7dfd8ad3 r600g: Get rid of the superfluous family field from r600_shader.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet b3b946b0ab r600g: Store the chip class in r600_pipe_context.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet 949896b82f r600g: Fix the type of the family field in r600_pipe_context.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Eric Anholt d03fdc4cde i965/gen4: Fix GPU hangs since the program streaming change.
This was tricky.  We were doing a use-before-initialize of
grf_reg_count, but the value usually got overwritten anyway -- when we
didn't have to do a relocation (typical), or on gen5 when we didn't
have relocations at all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38771
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-09 07:45:48 -07:00
Kenneth Graunke 57b57f6d1c i965/gen7: Remove gratuitous dirty flags from WM and PS state.
Commit b46dc45cee claimed that
NEW_POLYGONSTIPPLE is gratuitous, but somehow just changed comments
and whitespace instead of actually removing the flag.

While we're at it, 3DSTATE_PS doesn't appear to need NEW_LINE or
NEW_POLYGON either (those are in 3DSTATE_WM).  Also, 3DSTATE_WM
doesn't appear to need BRW_NEW_NR_WM_SURFACES or BRW_NEW_CURBE_OFFSETS
either (those are in 3DSTATE_PS).

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 23:24:55 -07:00
Christian König 3ed8182c76 [g3dvl] stop calling dri2DestroyDrawable
When switching channels with xine it sometimes happens that xine
destroys the drawable before we get a chance to call
DRI2DestroyDrawable, resulting in an x error.
2011-07-09 00:00:10 +02:00
Vadim Girlin 3efb47f0b0 r600g: introduce r600_bc_src_toggle_neg helper and fix SUB & LRP
SUB & LRP instructions should toggle NEG bit instead of setting it,
otherwise e.g. "SUB a,b,-1" is translated as "ADD a,b,-1"

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin f87d566f4b r600g: introduce r600_bc_src_set_abs helper and fix LOG
LOG instruction should use absolute values of source operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin b693787fdf r600g: RSQ: clear NEG for operand
Need to clear NEG bit because it applies after ABS, e.g. "RSQ ..., -1"
uses -|1| as operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin 86f8b4117f r600g: LIT: swap MUL_LIT operands to fix 0^0
For 0^0 case result of "LOG_CLAMPED ...,0" is -MAX_FLOAT, and then result of
"MUL_LIT ...,0,-MAX_FLOAT,..." is -MAX_FLOAT instead of 0 because of special
src1 checks for -MAX_FLOAT. So swap src0/1:
"MUL_LIT ...,-MAX_FLOAT,0,..." to get expected 0, then result of
"EXP_IEEE ...,0" is 1 as expected for LIT.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Jesse Barnes 4df137691e GLX/DRI2: handle swap event swap count wrapping
Create a new GLX drawable struct to track client related info, and add a
wrap counter to it drawable and track it as we receive events.  This
allows us to support the full 64 bits of the event structure we pass to
the client even though the server only gives us a 32 bit count.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-07-08 12:38:20 -07:00
Jesse Barnes 1e39fc784b DRI2/GLX: use new swap event types
Use the new swap event type so we get valid SBC values.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-07-08 12:31:13 -07:00
Christian König 34145ecdad vdpau: add implementation of VdpDecoderGetParameters 2011-07-08 20:53:39 +02:00
Christian König ea78480029 [g3dvl] and finally remove pipe_video_context 2011-07-08 19:22:43 +02:00
Paul Berry 067c9d7bd7 glsl: Lower break instructions when necessary at the end of a loop.
Normally lower_jumps.cpp doesn't need to lower a break instruction
that occurs at the end of a loop, because all back-ends can produce
proper GPU instructions for a break instruction in this "canonical"
location.  However, if other break instructions within the loop are
already being lowered, then a break instruction at the end of the loop
needs to be lowered too, since after the optimization is complete a
new conditional break will be inserted at the end of the loop.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_breaks_6.
2011-07-08 09:59:30 -07:00
Paul Berry e71b4ab8a6 glsl: In lower_jumps.cpp, lower both branches of a conditional.
Previously, lower_jumps.cpp would break out of its loop after lowering
a jump instruction in just the then- or else-branch of a conditional,
and it would fail to lower a jump instruction occurring in the other
branch.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_returns_4.
2011-07-08 09:59:30 -07:00
Paul Berry 382cee91a4 glsl: Use foreach_list in lower_jumps.cpp
The visitor class in lower_jumps.cpp never removes or replaces the
instruction being visited, but it frequently alters or removes the
instructions that follow it.  Therefore, to make sure the altered IR
is visited, it needs to iterate through exec_lists using foreach_list
rather than visit_exec_list().

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Also, certain invariants assumed by lower_jumps.cpp may fail to hold,
causing assertion failures.

Fixes unit tests test_lower_pulled_out_jump,
test_lower_unified_returns, test_lower_guarded_conditional_break,
test_lower_return_non_void_at_end_of_loop, and test_lower_returns_3.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:30 -07:00
Paul Berry 03145ba655 glsl: lower unconditional returns and continues in loops.
Previously, lower_jumps.cpp would only lower return and continue
statements that appeared inside conditionals.  This patch makes it
lower unconditional returns and continue statements that occur inside
a loop.

Such unconditional flow control statements would be unlikely to be
explicitly coded by a reasonable user, however they might arise as a
result of other optimizations.

Without this patch, lower_jumps.cpp might not lower certain return and
continue statements, causing some backends to fail.

Fixes unit tests test_lower_return_void_at_end_of_loop and
test_remove_continue_at_end_of_loop.
2011-07-08 09:59:30 -07:00
Paul Berry afc9a50fba glsl: Lower unconditional return statements.
Previously, lower_jumps.cpp only lowered return statements that
appeared inside of an if statement.

Without this patch, lower_jumps.cpp might not lower certain return
statements, causing some back-ends to fail (as in bug #36669).

Fixes unit test test_lower_returns_1.
2011-07-08 09:59:30 -07:00
Paul Berry dbaa2e627e glsl: Refactor logic for determining whether to lower return statements.
Previously, do_lower_jumps.cpp determined whether to lower return
statements in ir_lower_jumps_visitor::should_lower_jumps().  Moved
this logic to ir_lower_jumps_visitor::visit(ir_function_signature *),
so that it can be used in determining whether to lower a return
statement at the end of a function.
2011-07-08 09:59:30 -07:00
Paul Berry e2c748aec5 glsl: Add explanatory comments to lower_jumps.cpp.
No functional change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:30 -07:00
Paul Berry f4830be938 glsl: Make ir_reader able to read plain (return) statements.
Previously ir_reader was only able to handle return of non-void.

This patch is necessary in order to allow optimization passes to be
tested in isolation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:29 -07:00
Paul Berry 5fb79fc69f glsl: Remove unused function prototypes.
No functional change.  Remove prototypes for do_mod_to_fract() and
do_sub_to_add_neg(), which haven't existed since November 2010.
2011-07-08 09:59:29 -07:00
Christian König 4e837f557b [g3dvl] move video buffer creation out of video context 2011-07-08 16:56:11 +02:00
Gustaw Smolarczyk fc98444bd5 gallivm: Fix build with llvm-3.0
LLVM 3.0svn changes pretty rapidly. The change in
Target->createMCInstPrinter() signature which inspired commits
40ae214067 and
92e29dc5b0 has been reverted.

Signed-off-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-08 07:57:27 -06:00
Christian König 3bb33c911b [g3dvl] remove the unused priv member from pipe_video_context 2011-07-08 15:07:39 +02:00
Christian König bd5fd67a3e [g3dvl] move compositor creation and handling directly into the state trackers 2011-07-08 14:44:19 +02:00
Marek Olšák 7de28e80dc st/mesa: handle float formats in st_format_datatype
NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-08 13:02:27 +02:00
Marek Olšák 292148dc4b st/mesa: use the first non-VOID channel in st_format_datatype
Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-08 13:02:22 +02:00
Christian König 10fd45114d [g3dvl] remove sampler view handling from video context 2011-07-08 12:47:52 +02:00
Christian König 06ddbc3b8e [g3dvl] remove create_surface from video context 2011-07-08 12:15:48 +02:00
Christian König 2ec350ff1d [g3dvl] make pipe_context mandatory for creation pipe_video_context 2011-07-08 12:03:13 +02:00
Christian König 7eca76952b [g3dvl] rename is_format_supported to is_video_format_supported and move it into screen object 2011-07-08 11:20:39 +02:00
Thomas Hellstrom a65e970603 mesa/st: Fix piglit read-front with new drawable invalidation v2
When the state tracker adds a front buffer, nothing triggers a validate
drawable call, since the state tracker manager is never notified.

Force a validate drawable call by invalidating the framebuffer's stamp, so
that the window system's renderbuffer (if any) is picked up.

This fixes bug 38988
https://bugs.freedesktop.org/show_bug.cgi?id=38988

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-08 08:37:42 +02:00
Stéphane Marchesin 8c1a2e128e i915g: Make the optimizer more generic. 2011-07-07 21:59:09 -07:00
Brian Paul d8f65c07e9 intel: add null src pointer check in intel_region_reference()
Fixes segfault when running cubemap demo on i945.  This happened
when intel_region_reference() was called in i915_set_draw_region()
with depth_region=NULL.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 19:22:06 -06:00
Stéphane Marchesin 9baad92660 i915g: Make optimization more generic. 2011-07-07 16:57:37 -07:00
Stéphane Marchesin 3c0c624879 Revert "i915: Eliminate redundant CONSTANTS updates"
This reverts commit 87641cffd9.
2011-07-07 16:57:37 -07:00
Brian Paul 7eb7d67d50 glsl: use casts to silence warning 2011-07-07 17:28:48 -06:00
José Fonseca 61efad6865 scons: Generate libGL.so.1.5 and libGL.so.1 symlinks.
In build/xxx/src/gallium/targets/libgl-xlib/SConscript
2011-07-07 23:41:06 +01:00