Commit Graph

84113 Commits

Author SHA1 Message Date
Marek Olšák
0328b20050 gallium/hud: round max_value to print nicely rounded numbers next to graphs
This improves readability a lot.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
0f1befe926 gallium/hud: generalize code for drawing numbers next to graphs
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
a33eb48d61 gallium/hud: draw numbers with 3 decimal places if those aren't 0
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
b9c9551c09 gallium/hud: use sRGB for nicer AA lines
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
6ffde82083 gallium/hud: use AA lines for graphs
this looks a lot better (with the next patch)

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
6902f9e82a gallium/hud: don't enable blending for all objects
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Tapani Pälli
0abebec012 util: add assert that key cannot be NULL on insertion
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-22 07:37:55 +03:00
Tapani Pälli
68233801ae glsl: fix key used for hashing switch statement cases
Implementation previously used value itself as the key, however after
hash implementation change by ee02a5e we cannot use 0 as key.

v2: use constant pointer as the key and implement comparison
    for contents (Eric Anholt)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97309
2016-08-22 07:36:33 +03:00
Mauro Rossi
a5f445640e android: i965: add per-gen libmesa_i965_gen{8,9} static
Needed to fix android build after commit 16a9fcb
which enabled genxml for gen{8,9} state setup

This is the last patch needed, android build tested successfully.
2016-08-20 16:18:31 -07:00
Mauro Rossi
9dc70a71f8 android: i965: add per-gen libmesa_i965_gen{7,75} static libraries
Needed to fix android build after commit e198983
which enabled genxml for gen{7,75} state setup

Android build fix for gen{8,9} will follow as incremental patch,
build tested successfully with all per-gen patches applied.
2016-08-20 16:18:28 -07:00
Mauro Rossi
7478ddad29 android: i965: add per-gen libmesa_i965_gen6 static library
Needed to fix android build after commit c8bc1ae
where new per-gen genX_blorp.c source replaced gen6_blorp.c for gen6

Android build fixes for gen{7,75} and gen{8,9} will follow as incremental patches,
build tested successfully with all per-gen patches applied.
2016-08-20 16:18:26 -07:00
Kenneth Graunke
7db81d9a87 glsl: Rename link_fs_input_layout_qualifiers to "inout".
We're going to handle output qualifiers here too, and calling it "inout"
seems to be the going convention.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2016-08-20 13:52:25 -07:00
Matt Turner
7e3e1bed03 i965/cfg: Factor common code out of switch statement.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-08-20 11:40:42 -07:00
Jason Ekstrand
a2ae67aa47 anv: Give the installed intel_icd.json file an absolute path
Not providing a path allows the ICD to work on multi-arch systems but
breaks it if you install anywhere other than /usr/lib.  Given that users
may be installing locally in .local or similar, we probably do want to
provide a filename.  Distros can carry a revert of this commit if they want
an intel_icd.json file without the path.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chad@kiwitree.net>
2016-08-20 00:50:03 -07:00
Daniel Scharrer
16ef7ab5c1 mesa: Fix fixed function spot lighting on newer hardware (again)
This was first fixed in commit b3f9c5c and then broken again in commit
fe2d2c7, which removed the abs modifier from input registers.

v2: Don't change the size of struct ureg.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91342
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Daniel Scharrer <daniel@constexpr.org>
2016-08-19 20:46:53 -07:00
Matt Turner
a9033d1dc1 i965: Remove comment within a comment. 2016-08-19 20:44:37 -07:00
Roland Scheidegger
0849621891 llvmpipe: fix issues with depth clamp
We only did depth clamp when the value was written from the fs.
This is very wrong both for d3d10 and GL, and only passed the
corresponding piglit test due to pure luck (it no longer does
with the enhanced test).
Also, interpolation clamped values to 1.0 always, which can legitimately
happen if depth clip is disabled, so fix that as well (untested).
There is one unresolved issue left, d3d10 always does depth clamping,
whereas GL does not (but does [0,1] clamp instead for fs depth outputs)
- this information isn't in any gallium state object, leave it as-is
for now (though it looks like llvmpipe misses the [0,1] clamp as well).
This (with the previous patch) fixes piglit depth-clamp-range test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-08-20 04:05:33 +02:00
Roland Scheidegger
b0a647f284 llvmpipe: fix depth clamping wrt reversed near/far values
This wasn't handled before (the result was that no matter what value got
clamped, it always ended up as the near value in this case) (if clamping
actually happened).
Fix this by using the util helper for that (the math is otherwise "mostly"
the same, mostly because there could actually be differences due to float
rounding, but I don't even know which one would be more correct).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-08-20 04:05:33 +02:00
Matt Turner
a73116ecc6 i965/sched: Simplify work done by add_barrier_deps().
Scheduling barriers are implemented by placing a dependence on every
node before and after the barrier. This is unnecessary as we can limit
the number of nodes we place dependencies on to those between us and the
next barrier in each direction.

Runtime of dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.23
is reduced from ~25 minutes to a little more than three.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94681
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 16:52:25 -07:00
Matt Turner
e7c376adfd i965/vec4: Ignore swizzle of VGRF for use by var_range_end().
var_range_end(v, n) loops over the n components of variable number v and
finds the maximum value, giving the last use of any component of v.
Therefore it expects v to correspond to the variable associated with the
.x channel of the VGRF.

var_from_reg() however returns the variable for the first channel of the
VGRF, post-swizzle.

So, if the last register had a swizzle with y, z, or w in the swizzle
component, we would read out of bounds. For any other register, we would
read liveness information from the next register.

The fix is to convert the src_reg to a dst_reg in order to call the
dst_reg version of var_from_reg() that doesn't consider the swizzle.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 16:52:25 -07:00
Matt Turner
3ef31122d0 i965/vec4: Print spills:fills.
Allows shader-db to work on vec4 programs (has been broken since
shader-db commit 646df5ca98b2 from April!)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 16:52:25 -07:00
Ilia Mirkin
89f00f749f a4xx: make sure to actually clamp depth as requested
We were previously ... not clamping. I guess this meant that everything
got clamped to 1/0, which was enough to pass the existing tests. Or
perhaps the clamping would only happen to the rasterized depth value and
not the frag shader's output depth value.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97231
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
2016-08-19 19:40:04 -04:00
Ilia Mirkin
cd8e30452f a4xx: only disable depth clipping, not all clipping, when requested
The previous bit disables the whole clipper, including the regular
viewport-related clipping that would go on. The two new bits disable
near and far clipping (separately, as verified with the
depth-clamp-range piglit).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
2016-08-19 19:40:04 -04:00
Eric Anholt
5adee83806 vc4: Switch store_output to using nir_lower_io_to_scalar / component. 2016-08-19 13:11:36 -07:00
Eric Anholt
f8fecc396a vc4: Use the intrinsic's first_component for vattr VPM index.
Avoids another multiplication by 4 of the base in the NIR.
2016-08-19 13:11:36 -07:00
Eric Anholt
cbf8c19410 vc4: Convert to using nir_lower_io_scalar for FS inputs.
The scalarizing of FS inputs can be done in a non-driver-dependent manner,
so extract it out of the driver.
2016-08-19 13:11:36 -07:00
Eric Anholt
c30b22c421 vc4: Switch to using the intrinsic accessors.
The const_index[] values have always felt magic, and this documents them a
bit better.
2016-08-19 13:11:36 -07:00
Eric Anholt
9f1411d1ec nir: Add an IO scalarizing pass using the intrinsic's first_component.
vc4 wants to have per-scalar IO load/stores so that dead code elimination
can happen on a more granular basis, which it has been doing in the
backend using a multiplication by 4 of the intrinsic's driver_location.
We can represent it properly in the NIR using the first_component field,
though.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 13:11:36 -07:00
Eric Anholt
c35f979220 nir: Add nir_builder support for individual system value loads.
The previous nir_load_system_value(b, nir_intrinsic_load_whatever), 0) was
rather verbose, when system values should be easy to generate.

The index is left out because only one system value had an index included
in it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 13:11:36 -07:00
Eric Anholt
24728637e2 nir: Move the undef of nir_intrinsics.h macros to the .h.
I wanted to include this from nir_builder as well, so it also needed the
undefs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 13:11:36 -07:00
Eric Anholt
c078c41520 ttn: Use nir_load_front_face instead of the TGSI-style input.
This reduces the diff between GLSL-to-NIR and TGSI-to-NIR, and gives NIR
more optimization to work on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 13:11:36 -07:00
Eric Anholt
3f607f9e4f nir: Use the system-value front face for twoside lowering.
GLSL-to-NIR generates system value usage, and vc4/freedreno would both
like the system value instead of the varying, so switch this pass over to
it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 13:11:36 -07:00
Eric Anholt
ed92241d78 ttn: Make FRAG_RESULT_DEPTH be a float variable to match gtn and ptn.
This lets TTN-using drivers handle FRAG_RESULT_DEPTH the same between all
their source paths.

Reviewed-by: Rob Clark <robdclark@gmail.com>
2016-08-19 13:11:36 -07:00
Eric Anholt
d80d03b830 vc4: Dump the TGSI before trying to convert it to NIR.
In the case of debugging a crash in TTN, this is nice to have.
2016-08-19 13:11:36 -07:00
Boyuan Zhang
c0be51f270 radeon/vce: set flag based on dual instance enablement
Set the flag on when dual instance encoding is supported,
otherwise set it to off.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
2016-08-19 10:36:44 -04:00
Boyuan Zhang
c59628d11b st/va: enable dual instances encode by sync surface
This patch improves the performance of Vaapi Encode by enabling dual
instances encoding. flush function is not called after each end_frame
call. radeon/vce will do flush whenever 2 frames are submitted for
encoding. Implement sync surface function to flush only if the frame
hasn't been flushed yet.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2016-08-19 10:36:44 -04:00
Jason Ekstrand
93d2b5c576 i965/blorp: Remove no longer used state setup helpers
Now that we're using genxml for everything, we no longer need the
hand-rolled state emit helpers.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
16a9fcbbb6 i965/blorp: Use genxml for gen8-9 state setup
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
e198983c61 i965/blorp: Use genxml for gen7 state setup
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
344841fcba i965/blorp: Add genxml-based vertex setup helpers
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
7b035fd0c9 i965/blorp: Add a helper for emitting surface states
The new helper emits surface states and the binding table in one go.  It's
nice to have it pulled out of the main blorp_exec function.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
48f13545dd i965/blorp: Add genxml-based sampler state emit function
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
eb655c4fc2 i965/blorp: Add genxml-based dynamic state emit functions
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
c8bc1ae96a i965: Move gen6_blorp.c to a file that gets recompiled per-gen
At the moment, it's only used for gen6 but that will change soon.  We use
the genX prefix for recompiled things in the Vulkan driver.  It isn't
great, but it seems to have worked ok.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
eea6a66222 i965/blorp/gen6: Use genxml packing structs for state setup
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
b5c20a98c1 i965/blorp: Stop setting point and line rasterization rules
Blorp never uses points or lines and the default values of 0 are perfectly
fine.  Explicitly setting them is just noise.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
5e2dd7a381 i965/blorp/gen8: Move viewport setup to after wm state
This matches gen6 and gen7.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
802f0f8596 i965/blorp/gen6-7: Move multisample setup to right after samplers
This mimics gen8 blorp

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
75304fdbd8 i965/blorp/gen6-7: Move surfaces and samplers closer together
This mimics what we do on gen8.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00
Jason Ekstrand
8b0426ddd4 i965/blorp/gen7-8: Emit depth stencil state with CC and BLEND
All three go together on SNB so let's keep them together for gen7+ as well.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-19 03:11:29 -07:00