Commit Graph

57200 Commits

Author SHA1 Message Date
Brian Paul cba7939790 svga: minor cleanups, comments in svga_tgsi_insn.c 2013-06-22 08:49:09 -06:00
Brian Paul b03f394508 svga: add null ptr check in svga_get_tex_sampler_view()
Trivial.
2013-06-22 08:49:09 -06:00
José Fonseca 67bfdea933 tools/trace: Several tweaks/fixes to dump_state 2013-06-22 12:30:39 +01:00
José Fonseca 545d3d32d8 trace: Dump result of create_stream_output_target 2013-06-22 12:30:39 +01:00
Maarten Lankhorst 6aabd9490c vl/mpeg12: fix mpeg-1 bytestream parsing
This fixes the bytestream parsing of mpeg-1 stream, but still leaves
open a number of issues with the interpretation:
- IDCT mismatch control is not correct for MPEG-1.
- Slices do not have to start and end on the same horizontal row of macroblocks.
- picture_coding_type = 4 (D-pictures) is not handled.
- full_pel_*_vector is not handled.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-06-22 09:40:15 +02:00
Rob Clark efdc6caaf5 freedreno/a3xx/compiler: ensure min # of cycles after bary instr
The results of a bary.f do not appear to be immediatley available, but
there is no explicit sync bit.  Instead the compiler must just ensure
that there are a minimum number of instructions following the bary
before use of the result of the bary.  We aren't clever enough for that
so just throw in some nop's.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-06-21 15:37:05 -04:00
Rob Clark d4aaa4439a freedreno/a3xx/compiler: add TGSI_OPCODE_ABS
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-06-21 15:37:05 -04:00
Rob Clark fe4ae1163d freedreno/a3xx/compiler: add TGSI_OPCODE_DPH
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-06-21 15:37:05 -04:00
Rob Clark 3f965556b4 freedreno/a3xx/compiler: fix for replicating instructions
If we are accumulating result into tmp.x, and need a mov to final
destination, we want to move the .x component into all of the components
enabled from the read dest's writemask, ie. we want:

  MOV dst.xyzw tmp.xxxx

rather than:

  MOV dst.xyzw tmp.xyzw

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-06-21 15:37:05 -04:00
Eric Anholt 0343f20e2f mesa: Move the common _mesa_glsl_compile_shader() code to glsl/.
This code had no relation to ir_to_mesa.cpp, since it was also used by
intel and state_tracker, and most of it was duplicated with the standalone
compiler (which has periodically drifted from the Mesa copy).

v2: Split from the ir_to_mesa to shaderapi.c changes.

Acked-by: Paul Berry <stereotype441@gmail.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-06-21 10:04:30 -07:00
Eric Anholt 10c14d16d2 mesa: Move shader compiler API code to shaderapi.c
There was nothing ir_to_mesa-specific about this code, but it's not
exactly part of the compiler's core turning-source-into-IR job either.

v2: Split from the ir_to_mesa to glsl/ commit, avoid renaming the sh
    variable.

Acked-by: Paul Berry <stereotype441@gmail.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-06-21 10:04:29 -07:00
Eric Anholt 88398a817c mesa: Fix missing setting of shader->IsES.
I noticed this while trying to merge code with the builtin compiler, which
does set it.

Note that this causes two regressions in piglit in
default-precision-sampler.* which try to link without a vertex or fragment
shader, due to being run under the desktop glslparsertest binary (using
ARB_ES3_compatibility) that doesn't know about this requirement.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-06-21 10:04:29 -07:00
Eric Anholt faf3dbad0d mesa: Use shared code for converting shader targets to short strings.
We were duplicating this code all over the place, and they all would need
updating for the next set of shader targets.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-06-21 10:04:29 -07:00
Eric Anholt 426ca34b7a glsl: Remove ir_print_visitor.h includes and usage
We have ir->print() to do the old declaration of a visitor and having the
IR accept the visitor (yuck!).  And now you can call _mesa_print_ir()
safely anywhere that you know what an ir_instruction is.

A couple of missing printf("\n")s are added in error paths -- when an
expression is handed to the visitor, it doesn't print '\n' (since it might
be a step in printing a whole expression tree).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-06-21 10:04:29 -07:00
Eric Anholt 2b049aa53e glsl: Make _mesa_print_ir() available from anything including ir.h.
No more forgetting to #include "ir_print_visitor.h" when doing temporary
debug code, or forgetting and leaving it in after removing your temporary
debug code.  Also, available from C code so you don't need to move the
caller to C++ just to call it (see also: ir_to_mesa.cpp).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-06-21 10:04:29 -07:00
Paul Berry d0abac22c3 glsl: Make some files safe to include from C
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-06-21 10:04:28 -07:00
José Fonseca 2d7e837716 tools/trace: Quick instructions/notes.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-21 14:30:20 +01:00
José Fonseca c14f516e58 tools/trace: Do a better job at comparing multi line strings.
For TGSI diffing.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-21 14:30:20 +01:00
José Fonseca 9b7d21f8f5 tools/trace: Tool to compare json state dumps.
Copied verbatim from apitrace's scripts/jsondiff.py
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-21 14:30:20 +01:00
José Fonseca cc4ad695ca tools/trace: Tool to dump gallium state at any draw call.
Based from the code from the good old python state tracker.

Extremely handy to diagnose regressions in state trackers.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-21 14:30:20 +01:00
José Fonseca a7bccb33b9 tools/trace: Defer blob hex-decoding.
To speed up parsing.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-21 14:30:19 +01:00
José Fonseca a8f7e12d92 trace: Don't dump texture transfers.
Huge trace files with little value.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-21 14:30:19 +01:00
Chia-I Wu bbd2d575e6 ilo: replace a boolean by bool
bool is used internally.  This is just cosmetic.
2013-06-20 11:40:20 +08:00
Chia-I Wu 8b2cba8f97 ilo: rename cache_seqno to uploaded
It has been used as a bool since shader cache rework.
2013-06-20 11:36:54 +08:00
Roland Scheidegger ffebefa114 util: (trivial) add has_popcnt field
Not used yet but there's a couple of places in llvmpipe which should use this
(occlusion count is currently very inefficent if there's no cpu popcnt
instruction).
2013-06-19 23:47:36 +02:00
Roland Scheidegger 5c9aee111e llvmpipe: use 64bit counter for occlusion queries
Some APIs require 64bit and at least for 64bit archs the overhead
should be minimal.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 23:47:36 +02:00
Roland Scheidegger dc5dc4fd94 llvmpipe: handle more queries
Handle PIPE_QUERY_GPU_FINISHED and PIPE_QUERY_TIMESTAMP_DISJOINT, and
also fill out the ps_invocations and c_primitives from the
PIPE_QUERY_PIPELINE_STATISTICS (the others in there should already
be handled). Note that ps_invocations isn't pixel exact, just 16 pixel
exact but I guess it's better than nothing.
Doesn't really seem to work correctly but there's probably bugs elsewhere.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 23:47:36 +02:00
Roland Scheidegger bf5096303f softpipe: handle all queries, and change for the new disjoint semantics
The driver can do render_condition but wasn't handling the occlusion
and so_overflow predicates (though the latter might not work yet due
to gs support).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 23:47:36 +02:00
Roland Scheidegger cdf89d0b5c gallium: fix PIPE_QUERY_TIMESTAMP_DISJOINT
The semantics didn't really make sense, not really matching neither d3d9
(though the docs are all broken there) nor d3d10. So make it match d3d10
semantics, which actually gives meaning to the "disjoint" part.
Drivers are fixed up in a very primitive way, I have no idea what could
actually cause the counter to become unreliable so just always return
FALSE for the disjoint part.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 23:47:35 +02:00
José Fonseca a0a40805dd trace: Dump pipe_rasterizer_state::clip_halfz.
Trivial.
2013-06-19 18:16:16 +01:00
Brian Paul 1e16e48f88 svga: add some comments about primitive conversion
And clean up the svga_translate_prim() function with better
variable names.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 11:13:14 -06:00
Brian Paul 8b3d4efed8 indices: add some comments
This is pretty complicated code with few/any comments.  Here's a first stab.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 11:13:14 -06:00
Brian Paul 2e8c51c98f svga: reindent svga_tgsi.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 11:13:14 -06:00
Brian Paul 0de01a47dd svga: whitespace, comment, formatting fixes in svga_tgsi_emit.h
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 11:13:14 -06:00
Brian Paul 1f57349e20 svga: move some svga/tgsi functions
Move some functions from the svga_tgsi_insn.h header into the
svga_tgsi_insn.c file since they're only used there.  Plus, add
comments and fix formatting.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 11:13:14 -06:00
Brian Paul 3abd9285be svga: formatting fixes in svga_tgsi_insn.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 11:13:13 -06:00
Brian Paul 9e6c29bf12 mesa: wrap comments, code to 78 columns in multisample.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 11:13:13 -06:00
Brian Paul bdd5a0c12b mesa: remove unused BITSET64 macros
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-19 11:13:13 -06:00
Maarten Lankhorst f1cccd6ca0 nvc0: kill assert in ppp code
It's no longer always true, and the video tilign aligment should
ensure the alignment is handled correctly regardless.
2013-06-19 13:08:51 +02:00
Chia-I Wu cf41fae96b ilo: rework shader cache
The new code makes the shader cache manages all shaders and be able to upload
all of them to a caller-provided bo as a whole.

Previously, we uploaded only the bound shaders.  When a different set of
shaders is bound, we had to allocate a new kernel bo to upload if the current
one is busy.
2013-06-19 16:46:42 +08:00
Emil Velikov 7f7b05d6b3 nv50: avoid crash on updating RASTERIZE_ENABLE state
When doing blit using the 3D engine, the rasterizer cso may be NULL.

Ported from nvc0 commit 8aa8b0539.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-06-19 00:02:24 +02:00
Kristian Høgsberg 712269d674 wayland: Handle global_remove event as well
We need to set up a handler for the global_remove event that gets sent
out when a global gets removed.  Without the handler we end up calling
a NULL pointer.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-06-18 17:45:19 -04:00
Jordan Justen adeda5afd4 gen7: fix GPU hang on WebGL texture-size test
When rendering to a texture with BaseLevel set, the miptree may be laid
out such that BaseLevel is in level 0 of the miptree (to avoid wasting
memory on unused levels between 0 and BaseLevel-1).  In that case, we
have to shift our render target's level down to the appropriate level of
the smaller miptree.

The WebGL test in combination with a meta code relating to
glGenerateMipmap also triggered a similar failure scenario.

This GPU hang regression was introduced by c754f7a8.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=65324
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-06-18 14:06:46 -07:00
Eric Anholt 248fddecd8 intel: Remove unused IS_POWER_OF_TWO() macro.
The is_power_of_two() inline function has been used instead.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-06-18 12:08:08 -07:00
Zack Rusin 9542131b27 Revert "draw: clear the draw buffers in draw"
This reverts commit 41966fdb3b.
While it's a lot cleaner it causes regressions because
the draw interface is always called from the draw functions
of the drivers (because the buffers need to be mapped) which
means that the stream output buffers endup being cleared on
every draw rather than on setting.

Signed-off-by: Zack Rusin <zackr@vmware.com>
2013-06-17 21:43:10 -04:00
Roland Scheidegger 8975dc798d llvmpipe: fixes for conditional rendering
honor render_condition for clear_render_target and clear_depth_stencil.
Also add minimal support for occlusion predicate, though it can't be active
at the same time as an occlusion query yet.
While here also switchify some large if-else (actually just mutually
exclusive if-if-if...) constructs.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-18 18:01:24 +02:00
Roland Scheidegger 793e8e3d7e gallium: add condition parameter to render_condition
For conditional rendering this makes it possible to skip rendering
if either the predicate is true or false, as supported by d3d10
(in fact previously it was sort of implied skip rendering if predicate
is false for occlusion predicate, and true for so_overflow predicate).
There's no cap bit for this as presumably all drivers could do it trivially
(but this patch does not implement it for the drivers using true
hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL
functionality).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-18 18:01:24 +02:00
Chia-I Wu 443dc15cf7 ilo: construct depth/stencil command in create_surface()
Add ilo_gpe_init_zs_surface() to construct

 3DSTATE_DEPTH_BUFFER
 3DSTATE_STENCIL_BUFFER
 3DSTATE_HIER_DEPTH_BUFFER

at surface creation time.  This allows fast state emission in draw_vbo().
2013-06-18 16:23:13 +08:00
Eric Anholt eb20215075 intel: Allow blorp CopyTexSubImage to nonzero destination slices.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-06-17 15:43:23 -07:00
Eric Anholt 746b57ef0e intel: Allow blit CopyTexSubImage to nonzero destination slices.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-06-17 15:43:23 -07:00