mesa.git
8 years agoradeonsi: use multi-threaded compilation in debug contexts
Nicolai Hähnle [Thu, 7 Jul 2016 07:28:25 +0000 (09:28 +0200)]
radeonsi: use multi-threaded compilation in debug contexts

We only have to stay single-threaded when debug output must be synchronous.
This yields better parallelism in shader-db runs for me.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agost/mesa: set debug callback async flag
Nicolai Hähnle [Thu, 7 Jul 2016 07:25:31 +0000 (09:25 +0200)]
st/mesa: set debug callback async flag

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium: add async flag to pipe_debug_callback
Nicolai Hähnle [Thu, 7 Jul 2016 07:11:17 +0000 (09:11 +0200)]
gallium: add async flag to pipe_debug_callback

v2: fix typo db -> cb

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: catch a potential state tracker error with non-MSAA FBs
Nicolai Hähnle [Wed, 6 Jul 2016 14:55:08 +0000 (16:55 +0200)]
radeonsi: catch a potential state tracker error with non-MSAA FBs

At least st/mesa ensures this, so I'd rather not handle deviations in radeonsi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: explicitly choose center locations for 1xAA on Polaris
Nicolai Hähnle [Wed, 6 Jul 2016 14:33:43 +0000 (16:33 +0200)]
radeonsi: explicitly choose center locations for 1xAA on Polaris

Unlike SC, the small primitive filter does not automatically use center
locations in 1xAA mode, so this is needed to avoid artifacts caused by
the small primitive filter discarding triangles that it shouldn't.

As a side effect of how the effective number of samples is now calculated,
this patch also avoids submitting the sample locations for line/poly smoothing
when they're not really needed.

Cc: 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agor600g: call cayman_emit_msaa_sample_locs only when needed
Nicolai Hähnle [Wed, 6 Jul 2016 12:26:47 +0000 (14:26 +0200)]
r600g: call cayman_emit_msaa_sample_locs only when needed

In the case of nr_samples <= 1, that function is (currently) a no-op anyway.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agomesa: Mark R*32F formats as filterable when an extension is present.
Kenneth Graunke [Thu, 7 Jul 2016 18:50:44 +0000 (11:50 -0700)]
mesa: Mark R*32F formats as filterable when an extension is present.

GL_OES_texture_float_linear marks R32F, RG32F, RGB32F, and RGBA32F
as texture filterable.

Fixes glGenerateMipmap GL errors when visiting a WebGL demo in Chromium:
http://www.iamnop.com/particles

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoi965/blorp: fix indentation level
Eric Engestrom [Wed, 6 Jul 2016 21:02:42 +0000 (22:02 +0100)]
i965/blorp: fix indentation level

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965: Fix remaining flush vs invalidate race conditions in brw_emit_pipe_control_flush.
Francisco Jerez [Fri, 1 Jul 2016 00:49:18 +0000 (17:49 -0700)]
i965: Fix remaining flush vs invalidate race conditions in brw_emit_pipe_control_flush.

This hardware race condition has caused problems several times already
(see "i965: Fix cache pollution race during L3 partitioning set-up.",
"i965: Fix brw_render_cache_set_check_flush's PIPE_CONTROLs." and
"i965: intel_texture_barrier reimplemented").  The problem is that
whenever we attempt to both flush and invalidate multiple caches with
a single pipe control command the flush and invalidation happen in
reverse order, so the contents flushed from the R/W caches aren't
guaranteed to become visible from the invalidated caches after the
PIPE_CONTROL command completes execution if some concurrent rendering
workload happened to pollute any of the invalidated R/O caches in the
short window of time between the invalidation and flush.

This makes sure that brw_emit_pipe_control_flush() has the effect
expected by most callers of making the contents flushed from any R/W
caches visible from the invalidated R/O caches.

Cc: "12.0 11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: Make room in the batch epilogue for three more pipe controls.
Francisco Jerez [Fri, 1 Jul 2016 04:15:26 +0000 (21:15 -0700)]
i965: Make room in the batch epilogue for three more pipe controls.

Review carefully, it sucks to have to keep track of the number of
command packet dwords emitted in the batch epilogue manually.  The
MI_REPORT_PERF_COUNT_BATCH_DWORDS calculation was obviously wrong.

Cc: "12.0 11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: Emit SKL VF cache invalidation W/A from brw_emit_pipe_control_flush.
Francisco Jerez [Fri, 1 Jul 2016 02:41:49 +0000 (19:41 -0700)]
i965: Emit SKL VF cache invalidation W/A from brw_emit_pipe_control_flush.

There were two places in the driver doing a pipe control VF cache
flush, one of them was missing this workaround, move it down into
brw_emit_pipe_control_flush to make sure we don't miss it again.

Cc: "12.0 11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
8 years agoi965: Emit SNB write cache flush W/A from brw_emit_pipe_control_flush.
Francisco Jerez [Fri, 1 Jul 2016 02:39:24 +0000 (19:39 -0700)]
i965: Emit SNB write cache flush W/A from brw_emit_pipe_control_flush.

Shouldn't cause any functional changes at this point, but we have
forgotten to apply this workaround several times in the past, make
sure it doesn't happen again.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
8 years agoegl: restrict swap_available dri2_egl_display field to X11
Frank Binns [Mon, 20 Jun 2016 08:00:37 +0000 (09:00 +0100)]
egl: restrict swap_available dri2_egl_display field to X11

This field is only ever set and read by the X11 platform.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoegl: Fix the bad surface attributes combination checking for pbuffers. (v3)
Guillaume Charifi [Mon, 20 Jun 2016 13:27:33 +0000 (15:27 +0200)]
egl: Fix the bad surface attributes combination checking for pbuffers. (v3)

Fixes a regression induced by commit a0674ce5c41903ccd161e89abb149621bfbc40d2:
When EGL_TEXTURE_FORMAT and EGL_TEXTURE_TARGET were both specified (and
both != EGL_NO_TEXTURE), an error was instantly triggered, before the
other one had even a chance to be checked, which is obviously not the
intended behaviour.

v2: Full commit hash, remove useless variables.
v3: [chadv] Add Fixes footers.

Fixes: piglit "spec/egl 1.4/eglcreatepbuffersurface and then glclear"
Fixes: piglit "spec/egl 1.4/largest possible eglcreatepbuffersurface and then glclear"
Signed-off-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoegl/display: remove unnecessary code and make it easier to read
Eric Engestrom [Wed, 6 Jul 2016 13:31:31 +0000 (14:31 +0100)]
egl/display: remove unnecessary code and make it easier to read

Remove the two first level `if` as they will always be true, and
flatten the two remaining `if`.
No functional change.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agomesa: Make single-buffered GLES representation internally consistent
Gurchetan Singh [Thu, 30 Jun 2016 22:20:34 +0000 (15:20 -0700)]
mesa: Make single-buffered GLES representation internally consistent

There are a few places in the code where clearing and reading are done on
incorrect buffers for GLES contexts.  See comments for details.  This
fixes 75 GLES3 dEQP tests on the surfaceless platform with no regressions.

v2: Corrected unclear comment
v3: Make the change in context.c instead of get.c
v4: Removed whitespace

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agobugzilla_mesa.sh: Drop "Bug " from sed command
Emil Velikov [Thu, 7 Jul 2016 10:51:13 +0000 (11:51 +0100)]
bugzilla_mesa.sh: Drop "Bug " from sed command

After a recent Bugzilla update the word is no longer in the title. Thus
the script ended up producing bogus HTML.

Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agomesa: don't install GLX files if GLX is not built
Akihiko Odaki [Sun, 26 Jun 2016 01:54:35 +0000 (10:54 +0900)]
mesa: don't install GLX files if GLX is not built

Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
[Emil Velikov: Drop guards around dri_interface.h, add stable tag]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agonir: add glsl_dvec_type() helper
Timothy Arceri [Wed, 15 Jun 2016 00:43:12 +0000 (10:43 +1000)]
nir: add glsl_dvec_type() helper

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoosmesa: Export OSMesaCreateContextAttribs.
Mathias Fröhlich [Fri, 1 Jul 2016 05:13:46 +0000 (07:13 +0200)]
osmesa: Export OSMesaCreateContextAttribs.

Since the function is exported like any other
public api function and put in the header
as if you could link against it, export it also
from shared objects.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
8 years agoi965: consolidate generation check
Timothy Arceri [Wed, 6 Jul 2016 03:14:37 +0000 (13:14 +1000)]
i965: consolidate generation check

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoi965: don't copy VS attribute work arounds for HSW+
Timothy Arceri [Wed, 6 Jul 2016 02:41:02 +0000 (12:41 +1000)]
i965: don't copy VS attribute work arounds for HSW+

These workarounds are not required for HSW and above so stop
copying them at VS key generation which is called at draw time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: add double packing support to tess stages
Timothy Arceri [Fri, 10 Jun 2016 11:57:49 +0000 (21:57 +1000)]
i965: add double packing support to tess stages

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: add double support packing support to gs inputs
Timothy Arceri [Fri, 10 Jun 2016 04:23:58 +0000 (14:23 +1000)]
i965: add double support packing support to gs inputs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agonir: add glsl_double_type() helper
Timothy Arceri [Fri, 10 Jun 2016 02:50:45 +0000 (12:50 +1000)]
nir: add glsl_double_type() helper

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: add indirect packing support to gs load inputs
Timothy Arceri [Sun, 22 May 2016 12:48:53 +0000 (22:48 +1000)]
i965: add indirect packing support to gs load inputs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: add indirect packing support for tcs and tes
Timothy Arceri [Mon, 23 May 2016 06:32:50 +0000 (16:32 +1000)]
i965: add indirect packing support for tcs and tes

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: add component packing support for tcs
Timothy Arceri [Fri, 20 May 2016 00:29:06 +0000 (10:29 +1000)]
i965: add component packing support for tcs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: add component packing support for tes
Timothy Arceri [Thu, 19 May 2016 06:58:48 +0000 (16:58 +1000)]
i965: add component packing support for tes

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: add component packing support for gs
Timothy Arceri [Thu, 19 May 2016 05:58:51 +0000 (15:58 +1000)]
i965: add component packing support for gs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agonir: use the same driver location for packed varyings
Timothy Arceri [Wed, 18 May 2016 00:26:05 +0000 (10:26 +1000)]
nir: use the same driver location for packed varyings

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agonir: add new intrinsic field for storing component offset
Timothy Arceri [Mon, 23 May 2016 06:46:46 +0000 (16:46 +1000)]
nir: add new intrinsic field for storing component offset

This offset is used for packing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/docs: update Intel Linux Graphics URLs
Eric Engestrom [Wed, 6 Jul 2016 16:09:15 +0000 (17:09 +0100)]
i965/docs: update Intel Linux Graphics URLs

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoanv: gitignore anv_timestamp.h
Chad Versace [Wed, 6 Jul 2016 20:13:18 +0000 (13:13 -0700)]
anv: gitignore anv_timestamp.h

8 years agoradeon/llvm: Use alloca instructions for larger arrays
Tom Stellard [Tue, 17 May 2016 18:10:51 +0000 (18:10 +0000)]
radeon/llvm: Use alloca instructions for larger arrays

We were storing arrays in vectors, which was leading to some really bad
spill code for large arrays.  allocas instructions are a better fit for
arrays and LLVM optimizations are more geared toward dealing with
allocas instead of vectors.

For arrays that have 16 or less 32-bit elements, we will continue to use
vectors, because this will force LLVM to store them in registers and
use indirect registers, which is usually faster for small arrays.

In the future we should use allocas for all arrays and teach LLVM
how to store allocas in registers.

This fixes the piglit test:

spec/glsl-1.50/execution/geometry/max-input-component

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeon/llvm: Add helpers for loading and storing data from arrays.
Tom Stellard [Tue, 17 May 2016 14:48:42 +0000 (14:48 +0000)]
radeon/llvm: Add helpers for loading and storing data from arrays.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeon/llvm: Remove uses_temp_indirect_addressing() function
Tom Stellard [Tue, 17 May 2016 17:51:00 +0000 (17:51 +0000)]
radeon/llvm: Remove uses_temp_indirect_addressing() function

bld->indirect_files is never set, so this function always returns false.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoanv: vulkan: remove the anv_device.$(OBJEXT) rule
Emil Velikov [Wed, 6 Jul 2016 15:18:21 +0000 (16:18 +0100)]
anv: vulkan: remove the anv_device.$(OBJEXT) rule

Atm the actual rule will expand to foo.o which is used for static
libraries only.

Thus the automake manual recommendation [to use OBJEXT] won't help us,
since since we're working with a shared library.

Thus let's 'demote' the file and add it back to BUILT_SOURCES. This will
manage all the complexity for us, at the (existing expense) of working
only with the all, check and install targets.

The crazy (why the issue was hard to spot):
If the dependencies (.deps/*.Plo) are already created one can alter the
anv_device.$(OBJEXT) line and/or nuke it all together. That won't lead
to any warnings/issues, even though the Makefile is regenerated.

Moral of the story:
Always rm -rf top_builddir or don't resolve the dependencies manually
and use BUILT_SOURCES.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96825
Fixes: d7a604c3f7a ("anv: use cache uuid based on the build timestamp.")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Tested-by: Mark Janes <mark.a.janes@intel.com>
8 years agovbo: fix attr reset
Rob Clark [Tue, 5 Jul 2016 19:41:26 +0000 (15:41 -0400)]
vbo: fix attr reset

In bc4e0c4 (vbo: Use a bitmask to track the active arrays in vbo_exec*.)
we stopped looping over all the attributes and resetting all slots.
Which exposed an issue in vbo_exec_bind_arrays() for handling GENERIC0
vs. POS.

Split out a helper which can reset a particular slot, so that
vbo_exec_bind_arrays() can re-use it to reset POS.

This fixes an issue with 0ad (and possibly others).

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
8 years agolist: fix list_replace() for empty lists
Rob Clark [Sat, 2 Jul 2016 12:02:51 +0000 (08:02 -0400)]
list: fix list_replace() for empty lists

Before, it would happily copy list_head next/prev (ie. pointer to the
*from* list_head), leaving things in a confused state and causing much
mayhem.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agogallium: un-inline pipe_surface_desc
Rob Clark [Sun, 26 Jun 2016 17:56:42 +0000 (13:56 -0400)]
gallium: un-inline pipe_surface_desc

Want to re-use this struct, so un-inline it.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/util: make util_copy_framebuffer_state(src=NULL) work
Rob Clark [Sat, 11 Jun 2016 13:21:10 +0000 (09:21 -0400)]
gallium/util: make util_copy_framebuffer_state(src=NULL) work

Be more consistent with the other u_inlines util_copy_xyz_state()
helpers and support NULL src.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agowinsys/amdgpu: avoid flushed depth when possible
Nicolai Hähnle [Fri, 1 Jul 2016 14:18:34 +0000 (16:18 +0200)]
winsys/amdgpu: avoid flushed depth when possible

If a depth/stencil texture has no mipmaps, we can always get a layout that is
compatible with DB and TC.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon: add depth/stencil_adjusted output to surface computation
Nicolai Hähnle [Thu, 30 Jun 2016 18:04:54 +0000 (20:04 +0200)]
gallium/radeon: add depth/stencil_adjusted output to surface computation

This fixes a rare bug with stencil texturing -- seen on Polaris and Tonga,
though it's basically a function of the memory configuration so could affect
other parts as well.

Fixes piglit "unaligned-blit * stencil downsample" and various
"fbo-depth-array *stencil*" tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon: allocate only the required plane for flushed depth
Nicolai Hähnle [Thu, 30 Jun 2016 15:22:54 +0000 (17:22 +0200)]
gallium/radeon: allocate only the required plane for flushed depth

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: decompress to flushed depth texture when required
Nicolai Hähnle [Wed, 29 Jun 2016 12:30:37 +0000 (14:30 +0200)]
radeonsi: decompress to flushed depth texture when required

v2: s/dirty_level_mask/stencil_dirty_level_mask/ in stencil case

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: extract DB->CB copy logic into its own function
Nicolai Hähnle [Thu, 30 Jun 2016 14:25:39 +0000 (16:25 +0200)]
radeonsi: extract DB->CB copy logic into its own function

Also clean up some of the looping.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: sample from flushed depth texture when required
Nicolai Hähnle [Wed, 29 Jun 2016 19:57:00 +0000 (21:57 +0200)]
radeonsi: sample from flushed depth texture when required

Note that this has no effect yet. A case where can_sample_z/s can be false
in radeonsi will be added in a later patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon: replace is_flushing_texture with db_compatible
Nicolai Hähnle [Thu, 30 Jun 2016 09:26:13 +0000 (11:26 +0200)]
gallium/radeon: replace is_flushing_texture with db_compatible

This is a left-over of when I considered generalizing the separate stencil
support. I do prefer the new name since it emphasizes what flushing vs.
non-flushing means from a functional point-of-view, namely special handling
of the texture format.

v2: adjust r600_init_color_surface as well

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon: add can_sample_z/s flags for textures
Nicolai Hähnle [Wed, 29 Jun 2016 19:56:42 +0000 (21:56 +0200)]
gallium/radeon: add can_sample_z/s flags for textures

v2: adjust r600_init_color_surface as well

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: correctly mark levels of 3D textures as fully decompressed
Nicolai Hähnle [Fri, 1 Jul 2016 09:37:59 +0000 (11:37 +0200)]
radeonsi: correctly mark levels of 3D textures as fully decompressed

Account for the fact that max_layer is minified for higher levels.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon/winsyses: remove unused stencil_offset
Nicolai Hähnle [Wed, 29 Jun 2016 12:07:44 +0000 (14:07 +0200)]
gallium/radeon/winsyses: remove unused stencil_offset

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon: remove redundant null-pointer check
Nicolai Hähnle [Tue, 28 Jun 2016 07:40:26 +0000 (09:40 +0200)]
gallium/radeon: remove redundant null-pointer check

v2: keep using r600_texture_reference

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon: print StencilLayout only once
Nicolai Hähnle [Mon, 27 Jun 2016 14:59:55 +0000 (16:59 +0200)]
gallium/radeon: print StencilLayout only once

It is the same for all levels.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon: flush stdout after printing texture information
Nicolai Hähnle [Wed, 22 Jun 2016 18:05:12 +0000 (20:05 +0200)]
gallium/radeon: flush stdout after printing texture information

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoglsl: don't try to lower non-gl builtins as if they were gl_FragData
Ilia Mirkin [Fri, 1 Jul 2016 23:10:36 +0000 (19:10 -0400)]
glsl: don't try to lower non-gl builtins as if they were gl_FragData

If a shader has an output array, it will get treated as though it were
gl_FragData and rewritten into gl_out_FragData instances. We only want
this to happen on the actual gl_FragData and not everything else.

This is a small part of the problem pointed out by the below bug.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96765
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
8 years agoglsl: Document and enforce restriction on type values
Ian Romanick [Wed, 29 Jun 2016 22:17:16 +0000 (15:17 -0700)]
glsl: Document and enforce restriction on type values

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl: Pack integer and double varyings as flat even if interpolation mode is none
Ian Romanick [Tue, 14 Jun 2016 21:38:04 +0000 (14:38 -0700)]
glsl: Pack integer and double varyings as flat even if interpolation mode is none

v2: Also update varying_matches::compute_packing_class().  Suggested by
Timothy Arceri.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96358
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Cc: Gregory Hainaut <gregory.hainaut@gmail.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agomesa: Strip arrayness from interface block names in some IO validation
Ian Romanick [Fri, 10 Jun 2016 15:01:30 +0000 (08:01 -0700)]
mesa: Strip arrayness from interface block names in some IO validation

Outputs from the vertex shader need to be able to match
per-vertex-arrayed inputs of later stages.  Acomplish this by stripping
one level of arrayness from the names and types of outputs going to a
per-vertex-arrayed stage.

v2: Add missing checks for TESS_EVAL->GEOMETRY.  Noticed by Timothy
Arceri.

v3: Use a slightly simpler stage check suggested by Ilia.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96358
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Cc: Gregory Hainaut <gregory.hainaut@gmail.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agosvga: avoid emitting redundant DXSetRenderTargets command
Charmaine Lee [Tue, 28 Jun 2016 23:09:59 +0000 (16:09 -0700)]
svga: avoid emitting redundant DXSetRenderTargets command

Tested with Lightsmark2008, MTT piglit, glretrace, conform.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoradeon/vce: update encRefPic addr and array mode to tiled
Leo Liu [Wed, 29 Jun 2016 15:48:53 +0000 (11:48 -0400)]
radeon/vce: update encRefPic addr and array mode to tiled

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoradeon/vce: increase cpb height alignment
Leo Liu [Mon, 4 Jul 2016 15:29:28 +0000 (11:29 -0400)]
radeon/vce: increase cpb height alignment

Height should be aligned with 2 macroblocks, thus making safer
for tiled mode

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoi965: Remove trailing whitespace
Iago Toral Quiroga [Tue, 5 Jul 2016 12:06:37 +0000 (14:06 +0200)]
i965: Remove trailing whitespace

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965: Make inline function static
Iago Toral Quiroga [Tue, 5 Jul 2016 12:05:40 +0000 (14:05 +0200)]
i965: Make inline function static

Without this the i965 driver fails to load.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv: install the intel_icd.json to ${datarootdir} by default
Emil Velikov [Fri, 24 Jun 2016 15:35:05 +0000 (16:35 +0100)]
anv: install the intel_icd.json to ${datarootdir} by default

As mentioned by the spec (and used by Archlinux and Debian) default to
${datarootdir} as opposed to ${sysconfdir} for the default location.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoswr: automake: don't ship LLVM version specific generated sources
Emil Velikov [Fri, 1 Jul 2016 16:17:13 +0000 (17:17 +0100)]
swr: automake: don't ship LLVM version specific generated sources

Otherwise things will fail to build, if the builder is using another
version of LLVM.

v2: annotate all the dependencies of builder_gen.h
v3: clean the generated files as needed
v4: comment cleanups (Tim)

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Tested-by: Tim Rowley <timothy.o.rowley@intel.com>
Tested-by: Chuck Atkins <chuck.atkins@kitware.com> (v2)
Reported-by: Chuck Atkins <chuck.atkins@kitware.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoautomake: don't mandate git_sha1.h/MESA_GIT_SHA1
Emil Velikov [Tue, 21 Jun 2016 17:05:23 +0000 (18:05 +0100)]
automake: don't mandate git_sha1.h/MESA_GIT_SHA1

It has proven subtle to get it right both from the build side POV (see
commit list below) and builders due to their varying workflows.

Furthermore it does not fully fulfil the reason why it was enforced -
to detect uniqueness between different builds, in order to distinguish
and invalidate Vulkan/GL caches.

With that having a much better solution (previous commit) we can drop
this solution.

This effectively reverts the following commits:
359d9dfec33 ("mesa: automake: add directory prefix for git_sha1.h")
2c424e00c39 ("mesa: automake: ensure that git_sha1.h.tmp has the right
attributes")
b7f7ec78435 ("mesa: automake: distclean git_sha1.h when building OOT")
8229fe68b5d ("automake: get in-tree `make distclean' working again.")

Cc: Timo Aaltonen <tjaalton@debian.org>
Cc: Haixia Shi <hshi@chromium.org>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoanv: automake: indent with tabs and not spaces
Emil Velikov [Fri, 1 Jul 2016 16:16:30 +0000 (17:16 +0100)]
anv: automake: indent with tabs and not spaces

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoanv: use cache uuid based on the build timestamp.
Emil Velikov [Tue, 21 Jun 2016 16:43:35 +0000 (17:43 +0100)]
anv: use cache uuid based on the build timestamp.

Do not rely on the git sha1:
 - its current truncated form makes it less unique
 - it does not attribute for local (Vulkand or otherwise) changes

Use a timestamp produced at the time of build. It's perfectly unique,
unless someone explicitly thinkers with their system clock. Even then
chances of producing the exact same one are very small, if not zero.

v2: Remove .tmp rule. Its not needed since we want for the header to be
regenerated on each time we call make (Eric).

v3:
 - Honour SOURCE_DATE_EPOCH, to make the build reproducible (Michel)
 - Replace the generated header with a define, to prevent needless
builds on consecutive `make' and/or `make install' calls. (Dave)

v4:
 - Keep the timestamp generation at make time. (Jason)

v5:
 - Ensure that file is regenerated on incremental builds.

Cc: Michel Dänzer <michel@daenzer.net>
Cc: Dave Airlie <airlied@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoclover: conditionally use MESA_GIT_SHA1
Emil Velikov [Tue, 21 Jun 2016 17:21:54 +0000 (18:21 +0100)]
clover: conditionally use MESA_GIT_SHA1

Considering how hard/annoying it was for many peoples' workflow to
properly generate the macro, it will be demoted to conditionally
available with follow-up commits.

v2: Kill off gracious blank line (Vedran).

Cc: mesa-stable@lists.freedesktop.org
Cc: Vedran Miletić <vedran@miletic.net>
Cc: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Vedran Miletić <vedran@miletic.net>
8 years agomesa: stop copying SamplerUnits twice
Timothy Arceri [Sun, 3 Jul 2016 09:16:23 +0000 (19:16 +1000)]
mesa: stop copying SamplerUnits twice

The call to _mesa_update_shader_textures_used() already takes
care of copying for us.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agomesa: make attribute binding message more useful
Timothy Arceri [Fri, 1 Jul 2016 04:00:23 +0000 (14:00 +1000)]
mesa: make attribute binding message more useful

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: make more effective use of SamplersUsed
Timothy Arceri [Tue, 5 Jul 2016 07:02:46 +0000 (17:02 +1000)]
i965: make more effective use of SamplersUsed

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoglsl: stop allocating memory for UBOs during linking
Timothy Arceri [Sat, 2 Jul 2016 10:02:47 +0000 (20:02 +1000)]
glsl: stop allocating memory for UBOs during linking

This just stops counting and assigning a storage location for
these uniforms, the count is only used to create the uniform storage.

These uniform types don't use this storage.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoglsl: mark link_uniform_blocks_are_compatible() as static
Timothy Arceri [Sat, 2 Jul 2016 03:36:09 +0000 (13:36 +1000)]
glsl: mark link_uniform_blocks_are_compatible() as static

Missed this when doing 6d1a59d15b.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agomesa: fix build error
Timothy Arceri [Tue, 5 Jul 2016 08:40:30 +0000 (18:40 +1000)]
mesa: fix build error

Fix build error cased by 6a524c76f5.

8 years agomesa: faster validation of sampler unit mapping for SSO
Gregory Hainaut [Fri, 24 Jun 2016 08:07:02 +0000 (10:07 +0200)]
mesa: faster validation of sampler unit mapping for SSO

Code was inspired from _mesa_update_shader_textures_used

However unlike _mesa_update_shader_textures_used that only check for a single
stage, it will check all stages.

It avoids to loop on all uniforms, only active samplers are checked.

For my use case: high FS frequency switches with few samplers.
Perf event (relative to nouveau_dri.so) goes from 5.01% to 1.68% for
the _mesa_sampler_uniforms_pipeline_are_valid function.

Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoRevert "st/glsl_to_tgsi: don't increase immediate index by 1."
Dave Airlie [Tue, 5 Jul 2016 00:22:21 +0000 (10:22 +1000)]
Revert "st/glsl_to_tgsi: don't increase immediate index by 1."

This reverts commit 27d456cc87a01998c6fe1dbf45937e2ca6128495.

DOH, what seems right and what is right with fp64 are always
two different things.

This regressed:
spec@arb_gpu_shader_fp64@shader_storage@layout-std140-fp64-mixed-shader
on radeonsi

Reported-by: Michel Dänzer <michel@daenzer.net>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agonvc0/ir: rename NVE4_SU_INFO_XXX to NVC0_SU_INFO_XXX
Samuel Pitoiset [Mon, 4 Jul 2016 22:20:00 +0000 (00:20 +0200)]
nvc0/ir: rename NVE4_SU_INFO_XXX to NVC0_SU_INFO_XXX

While we are at it, fix a typo inside the comment which describes
what those constants are for.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0/ir: reset the base offset for indirect images accesses
Samuel Pitoiset [Mon, 4 Jul 2016 22:08:03 +0000 (00:08 +0200)]
nvc0/ir: reset the base offset for indirect images accesses

In presence of an indirect image access, the base offset should be
zeroed because the stride will be computed twice. This is a pretty
rare situation but it can happen when tex.r > 0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
8 years agogm107/ir: fix sign bit emission for FADD32I
Samuel Pitoiset [Mon, 4 Jul 2016 11:12:20 +0000 (13:12 +0200)]
gm107/ir: fix sign bit emission for FADD32I

When emitting OP_SUB, the sign bit for FADD and FADD32I is not
at the same position. It's at position 45 for FADD but 51 for FADD32I.

This fixes the following piglit test:
tests/spec/arb_fragment_program/fdo30337b.shader_test

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
8 years agovc4: Regularize instruction emit macros
Eric Anholt [Sun, 26 Jun 2016 02:49:07 +0000 (19:49 -0700)]
vc4: Regularize instruction emit macros

ALU0 didn't have the _dest variant, and ALU2 didn't unset the def the way
ALU1 did.  This should make the ALU[012] macros much clearer, by moving
most of their contents to vc4_qir.c

8 years agovc4: Enable dead CF elimination.
Eric Anholt [Sun, 26 Jun 2016 01:45:28 +0000 (18:45 -0700)]
vc4: Enable dead CF elimination.

Now that we're about to start generating control flow in our NIR, we want
this in place.  It optimizes things frequently in the CS, when the GL VS
has control flow that doesn't affect the vertex position.

8 years agovc4: Optimize out redundant SF updates.
Eric Anholt [Sat, 4 Jun 2016 00:09:14 +0000 (17:09 -0700)]
vc4: Optimize out redundant SF updates.

Tiny change on shader-db currently, but it will be important when we start
emitting a lot of SFs from the same variable as part of control flow
support.

total instructions in shared programs: 89463 -> 89430 (-0.04%)
instructions in affected programs:     1522 -> 1489 (-2.17%)
total estimated cycles in shared programs: 250060 -> 250015 (-0.02%)
estimated cycles in affected programs:     8568 -> 8523 (-0.53%)

8 years agovc4: Move SF removal to a separate peephole pass.
Eric Anholt [Fri, 3 Jun 2016 21:36:04 +0000 (14:36 -0700)]
vc4: Move SF removal to a separate peephole pass.

The DCE pass is going to change significantly to handle control flow,
while we don't really need to change it for the SF handling.  We also need
to add some more SF peephole optimization for SF updates generated by
control flow support.

No change on shader-db.

8 years agovc4: DCE instructions with a NULL destination.
Eric Anholt [Fri, 3 Jun 2016 22:06:52 +0000 (15:06 -0700)]
vc4: DCE instructions with a NULL destination.

I'm going to add an optimization for redundant SF update removal, which
will just remove the SF and leave us (in many cases) with an instruction
with a NULL destination and no side effects.  Rather than teaching that
pass whether the whole instruction can be removed, leave that
responsibility to this pass.

8 years agovc4: Mark texturing setup instructions as having side effects.
Eric Anholt [Fri, 3 Jun 2016 22:04:57 +0000 (15:04 -0700)]
vc4: Mark texturing setup instructions as having side effects.

We need to not DCE them even though they don't have a destination in QIR.
We also shouldn't relocate them in vc4_opt_vpm.  Neither of these things
happen, but I'm about to make DCE consider instructions with a NULL
destination.

8 years agovc4: Fix a pasteo in scheduling condition flag usage.
Eric Anholt [Sat, 2 Jul 2016 22:08:27 +0000 (15:08 -0700)]
vc4: Fix a pasteo in scheduling condition flag usage.

Noticed by code inspection.  This hasn't been too big of a deal, because
our cond usages all start out as adder ops, either MOVs or the FTOI for Z
writes.  MOVs *can* get converted to mul ops during scheduling, but
apparently we hadn't hit this.

8 years agovc4: Drop the dead QIR_PACK() macro.
Eric Anholt [Sun, 26 Jun 2016 02:39:05 +0000 (19:39 -0700)]
vc4: Drop the dead QIR_PACK() macro.

This isn't used since we switched to using the dst.pack field instead of
custom instructions.

8 years agoradeonsi: do compilation from si_create_shader_selector asynchronously
Marek Olšák [Sat, 11 Jun 2016 17:57:40 +0000 (19:57 +0200)]
radeonsi: do compilation from si_create_shader_selector asynchronously

Main shader parts and geometry shaders are compiled asynchronously
by util_queue. si_create_shader_selector doesn't wait and returns.
si_draw_vbo(si_shader_select) waits for completion.

This has the best effect when shaders are compiled at app-loading time.
It doesn't help much for shaders compiled on demand, even though
VS+PS compilation should take as much as time as the bigger one of the two.

If an app creates more shaders, at most 4 threads will be used to compile
them.

Debug output disables this for shader stats to be printed in the correct
order.

(We could go even further and build variants asynchronously too, then emit
draw calls without waiting and emit incomplete shader states, then force IB
chaining to give the compiler more time, then sync the compilation at the IB
flush and patch the IB with correct shader states. This is great for
compilation before draw calls, but there are some difficulties such as
scratch and tess states requiring the compiler output, and an on-disk shader
cache will likely be a much better and simpler solution.)

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: don't lock shader cache mutex during compilation
Marek Olšák [Sat, 11 Jun 2016 17:32:53 +0000 (19:32 +0200)]
radeonsi: don't lock shader cache mutex during compilation

to allow multiple shaders to be compiled simultaneously.

ALso, shader-db can again use all 4 cores.

v2: Remove the pipe_mutex_unlock call in the error path.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
8 years agoradeonsi: separate the compilation chunk of si_create_shader_selector
Marek Olšák [Sat, 11 Jun 2016 16:59:26 +0000 (18:59 +0200)]
radeonsi: separate the compilation chunk of si_create_shader_selector

The function interface is ready to be used by util_queue.
Also, si_shader_select_with_key can no longer accept si_context.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: move LLVMTargetMachineRef creation to a separate function
Marek Olšák [Sat, 11 Jun 2016 16:53:15 +0000 (18:53 +0200)]
radeonsi: move LLVMTargetMachineRef creation to a separate function

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon: add and use radeon_info::max_alloc_size (v2)
Marek Olšák [Thu, 30 Jun 2016 22:17:36 +0000 (00:17 +0200)]
gallium/radeon: add and use radeon_info::max_alloc_size (v2)

v2: - squashed the patches
    - use INT_MAX
    - clamp max_const_buffer_size
    - check the DRM version in radeon

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
8 years agoradeonsi: print LLVM IRs to ddebug logs
Marek Olšák [Thu, 30 Jun 2016 22:10:15 +0000 (00:10 +0200)]
radeonsi: print LLVM IRs to ddebug logs

Getting LLVM IRs of hanging shaders have never been easier.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: enable string markers and record apitrace call numbers
Marek Olšák [Wed, 29 Jun 2016 23:15:19 +0000 (01:15 +0200)]
radeonsi: enable string markers and record apitrace call numbers

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoddebug: add an option to dump info about a specific apitrace call
Marek Olšák [Thu, 30 Jun 2016 00:11:04 +0000 (02:11 +0200)]
ddebug: add an option to dump info about a specific apitrace call

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoddebug: implement pipe_context::generate_mipmap
Marek Olšák [Wed, 29 Jun 2016 23:53:04 +0000 (01:53 +0200)]
ddebug: implement pipe_context::generate_mipmap

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoddebug: record and dump apitrace call numbers
Marek Olšák [Wed, 29 Jun 2016 22:40:01 +0000 (00:40 +0200)]
ddebug: record and dump apitrace call numbers

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoddebug: implement emit_string_marker
Marek Olšák [Wed, 29 Jun 2016 21:30:12 +0000 (23:30 +0200)]
ddebug: implement emit_string_marker

and remove some obsolete comments

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>