Commit graph

82384 commits

Author SHA1 Message Date
Kenneth Graunke
c7a8b32700 nir: Replace vecN(undef, undef, ...) with a single undef.
shader-db statistics on Broadwell:

total instructions in shared programs: 8963409 -> 8962455 (-0.01%)
instructions in affected programs: 60858 -> 59904 (-1.57%)
helped: 318
HURT: 0

total cycles in shared programs: 71408022 -> 71406276 (-0.00%)
cycles in affected programs: 398416 -> 396670 (-0.44%)
helped: 199
HURT: 51

GAINED: 1

The only shaders affected were in Dota 2 Reborn.

It also sets up for the next optimization.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-05 14:24:00 -07:00
Kenneth Graunke
49ea7454a1 nir: Rename opt_undef_alu to opt_undef_csel; update comments.
This better reflects what it does.  I plan to add other ALU
optimizations as well, so the old name would be confusing.

In preparation for that, also move the file comments about csels
above the opt_undef_csel function, and delete the ones about there
not being other optimizations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-05 14:24:00 -07:00
Kenneth Graunke
a808ba5965 i965: Rework passthrough TCS checks.
According to Timothy, using program_string_id == 0 to identify the
passthrough TCS is going to be problematic for his shader cache work.

So, change it to strcmp() the name at visitor creation time.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-05 14:24:00 -07:00
Tim Rowley
ff8c0c9a35 swr: [rasterizer core] Faster modulo operator in ProcessVerts
Avoid % operator, since we know that curVertex is always incrementing.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:50:11 -05:00
Tim Rowley
2be7c3e780 swr: [rasterizer] Small warning cleanup
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:50:03 -05:00
Tim Rowley
b39c530f88 swr: [rasterizer] Add SWR_ASSUME / SWR_ASSUME_ASSERT macros
Fix static code analysis errors found by coverity on Linux

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:49:56 -05:00
Tim Rowley
db084f48eb swr: [rasterizer] Miscellaneous backend changes
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:49:48 -05:00
Tim Rowley
3951a2109e swr: [rasterizer] Add support for X24_TYPELESS_G8_UINT format
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:49:42 -05:00
Tim Rowley
909aee07f8 swr: [rasterizer jitter] Fix printing bugs for tracing.
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:49:29 -05:00
Tim Rowley
bc084e6b3d swr: [rasterizer memory] Add missing store tiles function
Storing color hot tile to 8bit w-major stencil format.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:49:23 -05:00
Tim Rowley
5332c9d931 swr: [rasterizer jitter] Add asserts for supported formats in fetch shader
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:49:18 -05:00
Tim Rowley
6e89227054 swr: [rasterizer core] Fix thread allocation
Fix windows in 32-bit mode when hyperthreading is disabled on Xeons.

Some support for asymmetric processor topologies.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:49:11 -05:00
Tim Rowley
c2f5d2daa8 swr: [rasterizer core] Fix threadviz support in buckets
Need to do lazy eval of the threadviz knob since order of globals
is undefined.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:49:04 -05:00
Tim Rowley
1eb211c4a4 swr: [rasterizer] Whitespace cleanup and misc changes
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-05-05 14:48:55 -05:00
Nicolai Hähnle
d97e333ea4 radeonsi: mark descriptor loads as using dynamically uniform indices
This tells LLVM to always use SMEM loads for descriptors. It fixes a
regression in piglit's arb_shader_storage_buffer_object/execution/indirect.shader_test
that was caused by LLVM r268259 (but the proper fix is really here in Mesa).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-05-05 12:21:40 -05:00
Matt Turner
f01d92f473 i965/fs: Don't follow pow with an instruction with two dest regs.
Beginning with commit 7b208a73, Unigine Valley began hanging the GPU on
Gen >= 8 platforms.

Evidently that commit allowed the scheduler to make different choices
that somehow finally ran afoul of a hardware bug in which POW and FDIV
instructions may not be followed by an instruction with two destination
registers (including compressed instructions). I presume the conditions
are more complex than that, but the internal hardware bug report (BDWGFX
bug_de 1696294) does not contain much more information.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94924
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> [v1]
Tested-by:  Mark Janes <mark.a.janes@intel.com> [v1]
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2016-05-05 10:18:28 -07:00
Bruce Cherniak
9d86a5eea7 swr: Remove stall waiting for core query counters.
When gathering query results, swr_gather_stats was
unnecessarily stalling the entire pipeline.  Results are now
collected asynchronously, with a fence marking completion.

Reviewed-By: George Kyriazis <george.kyriazis@intel.com>
2016-05-05 10:50:09 -05:00
Dave Airlie
76a36ac3ea mesa/ubo: add missing compute cases for ubo/atomic buffers
This fixes: GL43-CTS.compute_shader.resource-ubo

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-05 20:29:02 +10:00
Dave Airlie
2dd3fc3cac mesa/compute: drop pointless casts.
We already are a GLintptr, casting won't help.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-05 20:28:41 +10:00
Thomas Hindoe Paaboel Andersen
76a423efe0 mesa: remove null check before free
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2016-05-05 09:50:38 +02:00
Thomas Hindoe Paaboel Andersen
3a6763f0a0 freedreno: remove null check before free
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2016-05-05 09:34:01 +02:00
Thomas Hindoe Paaboel Andersen
8698194313 nir: fix assert for wildcard pairs
The assert was null checking dest_arr_parent twice. The intention
seems to be to check both dest_ and src_.

Added in d3636da9

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2016-05-05 09:33:02 +02:00
Brian Paul
be5010c4b8 glapi: fix parameter type for GetSamplerParameterIuivEXT() in es_EXT.xml
The function returns GLuint, not GLfloat values.

v2: also fix the OES function

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-05-04 14:49:39 -06:00
Brian Paul
54d203a319 mesa: include texture format in glGenerateMipmap error message
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-05-04 14:49:39 -06:00
Brian Paul
a62f031bc3 main: uses casts to silence some _mesa_debug() format warnings
Silences warnings with 32-bit Linux gcc builds and MinGW which doesn't
recognize the ‘t’ conversion character.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-05-04 14:49:39 -06:00
Jordan Justen
51300a0387 docs: Mark GL_ARB_query_buffer_object as done for i965/hsw+
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-04 11:23:17 -07:00
Jordan Justen
f00c399bae i965: Implement ARB_query_buffer_object for HSW+
v2:
 * Declare loop index variable at loop site (idr)
 * Make arrays of MI_MATH instructions 'static const' (idr)
 * Remove commented debug code (idr)
 * Updated comment in set_query_availability (Ken)
 * Replace switch with if/else in hsw_result_to_gpr0 (Ken)
 * Only divide GL_FRAGMENT_SHADER_INVOCATIONS_ARB by 4 on
   hsw and gen8 (Ken)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-05-04 11:23:17 -07:00
Jordan Justen
357ff91359 i965/gen6+: Add load register immediate helper functions
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-04 11:23:17 -07:00
Jordan Justen
959e1e9e66 i965/hsw+: Add support for copying a register
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-04 11:23:17 -07:00
Jordan Justen
aad14a22cb i965/gen6+: Add support for storing immediate data into a buffer
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-04 11:23:17 -07:00
Jordan Justen
ac0bbf9ef3 i965: Add MI_MATH reg defs for HSW+
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-04 11:23:17 -07:00
Jordan Justen
9f581f8f24 i965: Add brw_store_register_mem32
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-04 11:23:17 -07:00
Jordan Justen
c54e5c2fb2 i965: Use offset instead of index in brw_store_register_mem64
This matches the byte based offset of brw_load_register_mem*.

The function is also moved into intel_batchbuffer.c like
brw_load_register_mem*.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-04 11:23:10 -07:00
Jan Vesely
77959ce07b r600,compute: create vtx buffer for text + rodata
Reserve buffer id 2

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2016-05-04 13:09:18 -04:00
Rob Clark
2e117a7649 freedreno: allow ctx->draw_vbo to fail
Pretty much only happens if shader variant compile fails.  But in this
case, if we haven't emitted cmdstream, we don't want to set needs_flush.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
291ac872a4 freedreno: move shader-stage dirty bits to global dirty flag
This was always a bit overly complicated, and had some issues (like
ctx->prog.dirty not getting reset at the end of the batch).  It also
required some special hacks to avoid resetting dirty state on binning
pass.  So just move it all into ctx->dirty (leaving some free bits
for future shader stages), and make FD_DIRTY_PROG just be the union
of all FD_SHADER_DIRTY_*.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
a48cccacf3 freedreno/a4xx: fix bogus offset for f32x24s8 stencil restore
fixes: $piglit/bin/fbo-clear-formats GL_ARB_depth_buffer_float

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
e7c64041e9 freedreno: add some debug_asserts() to catch insane offsets
Ofc won't catch *all* faults, but at least helpful for catching offsets
which are completely bogus.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
1f2bc64f31 freedreno/a4xx: deal with VS which do not write position
Fixes $piglit/bin/glsl-1.40-tf-no-position

a3xx may need similar?

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
a6ad30202c freedreno/ir3: remove a couple redundant is_flow()s
Now that the opc's encode the instruction category (making them unique)
we no longer need to check the category in addition to the opc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
f0a1f3de27 freedreno/ir3: cp small negative integers too
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
1f04d4bf59 freedreno/ir3: fix # of registers
The instruction encoding allows for more registers, but at least on
a3xx/a4xx they don't actually exist.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
173871dfb9 freedreno/ir3: lower immeds to const
Helps reduce register pressure and instruction counts for immediates
that would otherwise require a mov into gpr.

total instructions in shared programs:          4455332 -> 4369297 (-1.93%)
total dwords in shared programs:                8807872 -> 8614432 (-2.20%)
total full registers used in shared programs:   263062 -> 250846 (-4.64%)
total half registers used in shader programs:   9845 -> 9845 (0.00%)
total const registers used in shared programs:  1029735 -> 1466993 (42.46%)

                 half       full      const      instr     dwords
    helped           0       10415           0       17861        5912
      hurt           0        1157       21458         947          33

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
b15c7fc268 freedreno/ir3: add ir3_cp_ctx
Needed in next commit.. just split out to reduce noise.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:55 -04:00
Rob Clark
b9985e5bde add REVIEWERS and get_reviewer.pl script
Copied from linux kernel (where it is called MAINTAINERS and
get_maintainer.pl), with minimal changes to script (to recognize
mesa src tree rather than linux kernel src tree, and to avoid
accidentaly CC'ing Linus Torvalds on mesa patches), and slimmed
down MAINTAINER file syntax to recognize that we don't really have
subsystem "maintainers" in the same sense as the linux kernel (ie. no
different mailing lists and git trees per subsystem).

The main point is to automate slapping on the correct CC's for patches
via git's --cc-cmd feature, more than anything else.

I didn't attempt to fully populate the REVIEWERS file, by a long shot.
This is an opt-in system and anyone else can add their own entries.

To utilize:

  git send-email --cc-cmd ./scripts/get_reviewer.pl ...

or to configure it to be the default:

  git config sendemail.cccmd ./scripts/get_reviewer.pl

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-05-04 11:25:46 -04:00
Ilia Mirkin
38fcf7cbad nouveau/video: properly detect the decoder class for availability checks
The kernel is now more strict with the class ids it exposes, so we need
to check the G98 and MCP89 classes as well as the GT215 class. This
effectively caused us to decide there were no decoding capabilities on
newer kernel for VP3 chips.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95251
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
2016-05-04 10:45:07 -04:00
Kenneth Graunke
0332963d19 i965: Delete stale perf_debug().
MOCS for 3DSTATE_SO_BUFFER has existed for ages.
2016-05-04 02:29:03 -07:00
Kenneth Graunke
3a886721ed i965: Silence unused variable warning
I added this when deleting some unnecessary code in a rebase.
2016-05-04 00:46:31 -07:00
Juan A. Suarez Romero
97989059b9 mesa/main: handle double uniform matrices properly
When computing the offset in the uniform storage table, take into account
the size multiplier so double precision matrices are handled correctly.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-04 08:08:12 +02:00
Samuel Iglesias Gonsálvez
2ab2d2e588 nir: Separate 32 and 64-bit fmod lowering
Split 32-bit and 64-bit fmod lowering as the drivers might need to
lower them separately inside NIR depending on the HW support.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-04 08:07:49 +02:00