mesa.git
7 years agoanv/apply_pipeline_layout: Use nir_tex_instr_remove_src
Jason Ekstrand [Mon, 16 Oct 2017 15:50:44 +0000 (08:50 -0700)]
anv/apply_pipeline_layout: Use nir_tex_instr_remove_src

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agonir: Add a helper for adding texture instruction sources
Jason Ekstrand [Mon, 16 Oct 2017 15:50:23 +0000 (08:50 -0700)]
nir: Add a helper for adding texture instruction sources

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agost/va: Return correct width and height for encode/decode support
Mark Thompson [Mon, 9 Oct 2017 20:45:03 +0000 (21:45 +0100)]
st/va: Return correct width and height for encode/decode support

Previously this would return the largest possible buffer size, which is
much larger than the codecs themselves support.  This caused confusion
when client applications attempted to decode 8K video thinking it was
supported when it isn't.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: Fix config entrypoint handling
Mark Thompson [Tue, 10 Oct 2017 21:21:04 +0000 (22:21 +0100)]
st/va: Fix config entrypoint handling

Consistently use it as a PIPE_VIDEO_ENTRYPOINT.

v2: Return an error if the entrypoint is not set (Christian).

Signed-off-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: Disable vaExportSurfaceHandle()
Mark Thompson [Sun, 15 Oct 2017 19:57:21 +0000 (20:57 +0100)]
st/va: Disable vaExportSurfaceHandle()

This is not in libva 2.0, so it shouldn't be enabled yet.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
Acked-by: Christian König <christian.koenig@amd.com>
7 years agoradv/image: bump all the offset to uint64_t.
Dave Airlie [Tue, 17 Oct 2017 07:17:12 +0000 (08:17 +0100)]
radv/image: bump all the offset to uint64_t.

So one of the CTS tests tries to allocate a 16384x1 2048 array
texture. This overflows a bunch of calculations when we want it
tiled as the heights goes to 128.

addrlib returns us the correct size (16GB or so), but we mangle
it in the htile calcs due to the 32-bit offset fields, then
userspace gives us the reduced number and we try to allocate
it on a heap and things blow up.

We really need to give the app back the correct size for the
image so we can blow up properly in memory allocation later.

This should fix hangs in
dEQP-VK.pipeline.render_to_image.core.1d_array.huge.width_layers.r8g8b8a8_unorm_d32_sfloat_s8_uint
since
Fixes: ad3d98da9f (radv: enable tc compatible htile for d32s8 also.)
Now there's an open question if we should be enabling tc-compat
htile at all for shallow textures like the above.

This might cause some other wierd side effects in CTS even
without the tc compat so:
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: port to using updated anv entrypoint/extension generator.
Dave Airlie [Tue, 17 Oct 2017 05:18:36 +0000 (15:18 +1000)]
radv: port to using updated anv entrypoint/extension generator.

This ports radv to using the anv entrypoint/extension generator
code.

No differences on enabled extensions list in vulkaninfo.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: enable VK_KHX_multiview always.
Dave Airlie [Tue, 17 Oct 2017 06:47:16 +0000 (16:47 +1000)]
radv: enable VK_KHX_multiview always.

This was in the wrong place.

Fixes: ba51ad2f2 (radv: Expose VK_KHX_multiview.)
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoRevert "mesa: fix texture updates for ATI_fragment_shader"
Marek Olšák [Tue, 17 Oct 2017 01:08:47 +0000 (03:08 +0200)]
Revert "mesa: fix texture updates for ATI_fragment_shader"

This reverts commit 9d54025cd1eee3f42b80c062d1f644904bf2ba41.

It breaks KOTOR.

Cc: 17.1 17.2 <mesa-stable@lists.freedesktop.org>
7 years agomesa: remove redundant NULL check in update_single_program_texture_state
Miklós Máté [Sun, 15 Oct 2017 17:46:05 +0000 (19:46 +0200)]
mesa: remove redundant NULL check in update_single_program_texture_state

update_single_program_texture() never returns NULL.

Signed-off-by: Miklós Máté <mtmkls@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomeson: build mesa test.
Dylan Baker [Fri, 13 Oct 2017 19:07:04 +0000 (12:07 -0700)]
meson: build mesa test.

v2: - add dependency on dispatch.h generator (which this test needs)

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
7 years ago.travis: Don't build gallium drivers in non-gallium test targets
Dylan Baker [Wed, 11 Oct 2017 17:50:33 +0000 (10:50 -0700)]
.travis: Don't build gallium drivers in non-gallium test targets

Simply disable gallium in non-gallium builds. For some reason the
gallium driver wont link on ubuntu 14.04 (it will on 16.04, debian
testing, and arch)

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agomeson: refactor meson_options
Dylan Baker [Tue, 10 Oct 2017 22:44:14 +0000 (15:44 -0700)]
meson: refactor meson_options

To put one argument on each line. This results in the file being much
longer, but I think much more readable.

Suggested-by: Eero Tamminen <eero.t.tamminen@intel.com>
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: build llvmpipe
Dylan Baker [Tue, 10 Oct 2017 21:56:39 +0000 (14:56 -0700)]
meson: build llvmpipe

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: build softpipe
Dylan Baker [Tue, 10 Oct 2017 21:27:19 +0000 (14:27 -0700)]
meson: build softpipe

This doesn't include llvmpipe.

v2: - Fix inconsistent use of with_gallium_swrast and
      with_gallium_softpipe.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: build nouveau (gallium) driver
Dylan Baker [Mon, 9 Oct 2017 21:59:35 +0000 (14:59 -0700)]
meson: build nouveau (gallium) driver

Tested with a GK107.

v2: - Add target for nouveau standalone compiler. This target is not
      built by default.
v3: - Add nouveau to list of drivers built by default

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
7 years agomeson: build radeonsi gallium driver
Dylan Baker [Sat, 30 Sep 2017 21:04:28 +0000 (14:04 -0700)]
meson: build radeonsi gallium driver

This hooks up the bits necessary to build gallium dri drivers, with
radeonSI as the first example driver. This isn't tested yet.

v4: - drop radeonsi generated header from sources.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
7 years agomeson: build gallium winsys for dri, null, and wrapper
Dylan Baker [Sat, 30 Sep 2017 20:48:34 +0000 (13:48 -0700)]
meson: build gallium winsys for dri, null, and wrapper

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
7 years agomeson: build radeonsi
Dylan Baker [Sat, 30 Sep 2017 16:03:51 +0000 (09:03 -0700)]
meson: build radeonsi

This builds the radeonsi (and radeon) window system bits and gallium
driver bits.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
7 years agomeson: Build gallium dri state tracker
Dylan Baker [Tue, 10 Oct 2017 18:57:50 +0000 (11:57 -0700)]
meson: Build gallium dri state tracker

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
7 years agomeson: build gallium helper drivers
Dylan Baker [Sat, 30 Sep 2017 03:21:23 +0000 (20:21 -0700)]
meson: build gallium helper drivers

This builds ddebug, noop, rbug, and trace drivers.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
7 years agomeson: Build gallium pipe-loader
Dylan Baker [Sat, 30 Sep 2017 03:03:20 +0000 (20:03 -0700)]
meson: Build gallium pipe-loader

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agomeson: split and simplify dependencies
Dylan Baker [Sat, 30 Sep 2017 00:53:01 +0000 (17:53 -0700)]
meson: split and simplify dependencies

Rather than group dependencies in complex groups, use a flatter
structure with split dependencies to avoid checking for the same
dependencies twice.

v2: - Fix building vulkan drivers without gallium or dri drivers
v3: - Drop TODO comment that is done
    - Fix typo in commit message

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: Build gallium auxiliary
Dylan Baker [Fri, 29 Sep 2017 05:25:02 +0000 (22:25 -0700)]
meson: Build gallium auxiliary

v2: - guard gallivm files with "with_llvm" instead of "dep_llvm.found()"

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
7 years agomeson: build libmesa_gallium
Dylan Baker [Fri, 29 Sep 2017 04:03:07 +0000 (21:03 -0700)]
meson: build libmesa_gallium

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: Add option to toggle LLVM
Dylan Baker [Thu, 12 Oct 2017 16:47:30 +0000 (09:47 -0700)]
meson: Add option to toggle LLVM

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: always set GLX_USE_TLS
Dylan Baker [Wed, 11 Oct 2017 19:49:31 +0000 (12:49 -0700)]
meson: always set GLX_USE_TLS

This can be applied to all GLX implementations, and in autotools this is
guarded only by the --enable-glx-tls flag. Since this is on by default
in autotools, and is strictly better than being off, the meson build
doesn't even have a toggle for it.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: Don't try to install dri drivers unless one is built
Dylan Baker [Mon, 9 Oct 2017 23:34:03 +0000 (16:34 -0700)]
meson: Don't try to install dri drivers unless one is built

This confused the with_dri flag which is meant to control Direct
Rendering Infrastructure, not classic drivers

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: Set _GNU_SOURCE
Dylan Baker [Mon, 9 Oct 2017 21:22:07 +0000 (14:22 -0700)]
meson: Set _GNU_SOURCE

When we start adding non-free software platforms support we'll need to
guard this, but for now it should be fine as is.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: add checks for version script and dynamic list
Dylan Baker [Sat, 30 Sep 2017 20:15:52 +0000 (13:15 -0700)]
meson: add checks for version script and dynamic list

These are used by gallium drivers.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agoconfigure: commit test files
Dylan Baker [Sat, 30 Sep 2017 19:14:02 +0000 (12:14 -0700)]
configure: commit test files

These are currently auto-generated, but meson needs the same files, so
lets commit them to reduce duplication.

v3: - Rename .build to build-support

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agomeson: Add switch for texture float
Dylan Baker [Tue, 10 Oct 2017 22:25:07 +0000 (15:25 -0700)]
meson: Add switch for texture float

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agoRevert "i965/tex_image: Reference the renderbuffer miptree in setTexBuffer2"
Kenneth Graunke [Mon, 16 Oct 2017 22:30:47 +0000 (15:30 -0700)]
Revert "i965/tex_image: Reference the renderbuffer miptree in setTexBuffer2"

This reverts commit d80cbbeaff9329fdc78ae3d97097c1e65dfcdd61.

It turns out that formats do matter - the framebuffer's miptree has an
sRGB format, and the one we created did not.  This broke rendering when
using KWin compositing, GNOME Terminal Fedora (with a transparent
background), and Qt menu rendering in general, to name a few.

It's been a month and this hasn't been fixed, and I'm sick of reverting
this patch or applying NAK'd hacks and restarting various programs at
random times every day, multiple times a day, to keep my desktop
environment functional.

The only benefit of this patch was to prepare the way for modifiers,
which AFAIK aren't finished yet anyway, so there's really no downside
to reverting it.

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

7 years agoAndroid: add libmesa_nir dependency to libmesa_dricore
Rob Herring [Mon, 16 Oct 2017 12:43:36 +0000 (07:43 -0500)]
Android: add libmesa_nir dependency to libmesa_dricore

Commit 32fcced7b479 ("meta: Unset the textures_used_by_txf bitfield.")
added a dependency in libmesa_dricore to NIR headers, but failed to add
libmesa_nir as a dependency resulting in a build error:

In file included from external/mesa3d/src/mesa/drivers/common/meta.c:90:
external/mesa3d/src/compiler/nir/nir.h:48:10: fatal error: 'nir_opcodes.h' file not found

Add libmesa_nir as a static library dependency to libmesa_dricore.

Fixes: 32fcced7b479 ("meta: Unset the textures_used_by_txf bitfield.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rob Herring <robh@kernel.org>
7 years agoi965: Only put external handles into the handle ht
Chris Wilson [Fri, 13 Oct 2017 09:34:51 +0000 (10:34 +0100)]
i965: Only put external handles into the handle ht

We know that we will only ever need to lookup an external handle and so
can defer adding a bo to the external ht until it is ever exported or
imported, keeping that hashtable compact.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agosvga: format the version string like the rest of mesa
Eric Engestrom [Mon, 16 Oct 2017 16:14:28 +0000 (17:14 +0100)]
svga: format the version string like the rest of mesa

All 4 other version strings do it like this.
((Also, double parentheses just look confusing))

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agogit_sha1_gen: use git_sha1.h.in on all build systems
Eric Engestrom [Mon, 16 Oct 2017 16:02:03 +0000 (17:02 +0100)]
git_sha1_gen: use git_sha1.h.in on all build systems

Meson already uses this, let's get the other build sys to use it too.

Note: rstrip() was dropped, as truncating to the first 10 chars already
gets rid of the terminating newline (not an issue with the env var
either, unless maliciously crafted to break the build... not sure this
is a real-world issue).

Verified to work and give the same output as before on both python 2
and 3 :)

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agosvga: fix format_conversion_table breakage
Brian Paul [Sat, 14 Oct 2017 16:50:21 +0000 (10:50 -0600)]
svga: fix format_conversion_table breakage

The new A1B5G5R5_UNORM, X1B5G5R5_UNORM formats were added in the
wrong place in commit ef874ee450b18e.

Fixes: ef874ee450b18e "gallium: Add support for 5551 with the 1-bit field in the low bit."
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoi965/miptree: Drop the invalidate parameter form copy_teximage
Jason Ekstrand [Mon, 9 Oct 2017 22:08:33 +0000 (15:08 -0700)]
i965/miptree: Drop the invalidate parameter form copy_teximage

This was a leftover from i915.  The one caller in i965 always passes in
false so there's no point in having the parameter.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoanv: Get rid of gen fall-through
Jason Ekstrand [Mon, 11 Sep 2017 04:27:13 +0000 (21:27 -0700)]
anv: Get rid of gen fall-through

In the early days of the Vulkan driver, we thought it would be a good
idea to just make genN just fall back to the genN-1 code if it didn't
need to be any different for genN.  While this seemed like a good idea,
it ultimately ended up being far simpler to just recompile everything.
We haven't been using the fall-through functionality for some time so
we're better off just deleting it so it doesn't accidentally start
causing problems.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agointel/common: Improve the comments for sample positions
Jason Ekstrand [Fri, 18 Aug 2017 02:05:30 +0000 (19:05 -0700)]
intel/common: Improve the comments for sample positions

These are pulled directly from brw_multisample_state.h

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoradv: update ia_multi_vgt when executing secondary buffers
Samuel Pitoiset [Mon, 16 Oct 2017 12:15:55 +0000 (14:15 +0200)]
radv: update ia_multi_vgt when executing secondary buffers

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: be smarter with the draw packets when executing secondary buffers
Samuel Pitoiset [Mon, 16 Oct 2017 12:15:54 +0000 (14:15 +0200)]
radv: be smarter with the draw packets when executing secondary buffers

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: always dirty some states after executing secondary buffers
Samuel Pitoiset [Wed, 11 Oct 2017 14:10:43 +0000 (16:10 +0200)]
radv: always dirty some states after executing secondary buffers

The spec requires the number of buffer to be greater than 0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: be smarter with pipelines when emitting secondary buffers
Samuel Pitoiset [Wed, 11 Oct 2017 13:54:40 +0000 (15:54 +0200)]
radv: be smarter with pipelines when emitting secondary buffers

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agodocs: Add EXT_memory_objects extensions to features.txt
Jakob Bornecrantz [Sun, 15 Oct 2017 16:42:48 +0000 (17:42 +0100)]
docs: Add EXT_memory_objects extensions to features.txt

These extensions are good for Vulkan interop, so track them.

Signed-off-by: Jakob Bornecrantz <jakob.bornecrantz@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agonir: add component level support to remove_unused_io_vars()
Timothy Arceri [Tue, 26 Sep 2017 03:18:58 +0000 (13:18 +1000)]
nir: add component level support to remove_unused_io_vars()

Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agoglsl: mark xfb inputs as always_active_io
Timothy Arceri [Fri, 22 Sep 2017 06:04:17 +0000 (16:04 +1000)]
glsl: mark xfb inputs as always_active_io

We won't split varyings marked as always active because there
is no point in doing so. This means we need to mark both
sides of the interface as always active otherwise we will have
a mismatch and start removing things we shouldn't.

Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agonir: add variant of lower_io_to_scalar to be called earlier
Timothy Arceri [Thu, 5 Oct 2017 22:19:35 +0000 (09:19 +1100)]
nir: add variant of lower_io_to_scalar to be called earlier

This is intended to be called before nir_lower_io() so that we
can do some linking optimisations with the results. It can also
be used with drivers that don't use nir_lower_io() at all such
as RADV.

v2: pass mode mask rather than first and last stage integer.

Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agonir: add glsl_channel_type() helper
Timothy Arceri [Tue, 19 Sep 2017 23:49:57 +0000 (09:49 +1000)]
nir: add glsl_channel_type() helper

Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agonir: add glsl_type_is_64bit() to nir_types
Timothy Arceri [Sun, 4 Dec 2016 06:21:16 +0000 (17:21 +1100)]
nir: add glsl_type_is_64bit() to nir_types

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoa2xx: add support for a few 16-bit color rendering formats
Ilia Mirkin [Fri, 25 Aug 2017 04:47:05 +0000 (00:47 -0400)]
a2xx: add support for a few 16-bit color rendering formats

The rest should be possible too, just needs some additional
investigation. Passes fbo-*-formats piglit tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
7 years agofreedreno/a20x: Enable rendering to RGBA/RGBX
Wladimir J. van der Laan [Fri, 25 Aug 2017 14:34:08 +0000 (14:34 +0000)]
freedreno/a20x: Enable rendering to RGBA/RGBX

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agofreedreno/a20x: Fix rendering to BGRX
Wladimir J. van der Laan [Fri, 25 Aug 2017 14:29:53 +0000 (14:29 +0000)]
freedreno/a20x: Fix rendering to BGRX

Make sure that BGRX rendering is swapped the correct way around.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agomesa: minor simplification in test_attachment_completeness()
Brian Paul [Fri, 13 Oct 2017 22:16:48 +0000 (16:16 -0600)]
mesa: minor simplification in test_attachment_completeness()

We already have a pointer to the texture object.  Use it here.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agoetnaviv: rework TS enable to be a derived state
Lucas Stach [Thu, 12 Oct 2017 14:07:48 +0000 (16:07 +0200)]
etnaviv: rework TS enable to be a derived state

Draw operations should not use the TS if the TS buffer content is invalid,
as this leads to wrong rendering or even GPU hangs. As the TS valid status
can change between draws (clear operations changing it to valid, blits using
the RS to the color or ZS buffer changing it to invalid), the TS_MEM_CONFIG
must be updated before each draw if the status has changed.

This fixes the remaining TS related piglit failures (regressions of a
standard run against a piglit run with TS completely disabled).

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: skip unused vertex attributes when assigning VS inputs
Lucas Stach [Thu, 12 Oct 2017 14:07:47 +0000 (16:07 +0200)]
etnaviv: skip unused vertex attributes when assigning VS inputs

When not all of the vertex attributes are actually used in the shader,
we end up with some inputs without an assigned reg. Those are marked
as invalid and must be skipped when assigning the inputs, as those would
overwrite other valid inputs otherwise.

Fixes piglit drawpixels and a bunch of other tests using the st_draw path.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoradv: do not allocate CMASK for non-MSSA images with 128 bit formats
Samuel Pitoiset [Thu, 12 Oct 2017 20:55:32 +0000 (22:55 +0200)]
radv: do not allocate CMASK for non-MSSA images with 128 bit formats

This saves some useless CMASK initializations/eliminations in
the Vulkan SSAO demo.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: set correct INDEX_TYPE for indexed indirect draws on GFX9
Samuel Pitoiset [Fri, 13 Oct 2017 16:01:56 +0000 (18:01 +0200)]
radv: set correct INDEX_TYPE for indexed indirect draws on GFX9

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: add the draw count buffer to the list of buffers
Samuel Pitoiset [Fri, 13 Oct 2017 16:20:21 +0000 (18:20 +0200)]
radv: add the draw count buffer to the list of buffers

My guess is that the GPU is going to report VM faults if
vkCmdDrawIndirectCountAMD() (and friends) are used.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoblob: Use intptr_t instead of ssize_t
Jason Ekstrand [Fri, 13 Oct 2017 17:40:45 +0000 (10:40 -0700)]
blob: Use intptr_t instead of ssize_t

ssize_t is a GNU extension and is not available on Windows or MacOS.
Instead, we use intptr_t which should be effectively equivalent and is
part of the C standard.  This should fix the Windows and Mac OS builds.

Fixes: 3af1c829891a4530682bce113fdd512d4f2de3c6
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103253
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
7 years agoi965: Rename brw->no_batch_wrap to intel_batchbuffer::no_wrap
Kenneth Graunke [Fri, 13 Oct 2017 07:35:30 +0000 (00:35 -0700)]
i965: Rename brw->no_batch_wrap to intel_batchbuffer::no_wrap

This really makes more sense in the intel_batchbuffer struct.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoi965: Delete dead brw_context fields.
Kenneth Graunke [Fri, 13 Oct 2017 07:31:27 +0000 (00:31 -0700)]
i965: Delete dead brw_context fields.

fast_clear_op is leftover from the meta-fast-clear days.
No idea what the other thing was for, but it isn't used now.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agomapi/shared-glapi/test: rework glapitable.h handling
Emil Velikov [Fri, 13 Oct 2017 15:35:47 +0000 (16:35 +0100)]
mapi/shared-glapi/test: rework glapitable.h handling

Currently all the build systems but Meson generate the header in
src/mapi/glapi. Meson cannot do that since:
 - it does not allow user control over the location of output files
 - moving the generation rule(s) causes explosion due to the unusual
structure of glapi and friends
 - copying the file into the correct location is a non-trivial task

To workaround the above deficiency in the least invasive way, let's
adjust the #include directive and add a few -I flags to the autotools
build.

Note: both builddir and srcdir, should be used. Otherwise building from
a release tarball fails badly.

Cc: Dylan Baker <dylanx.c.baker@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
7 years agomeson: fix blob test includes
Dylan Baker [Fri, 13 Oct 2017 17:34:07 +0000 (10:34 -0700)]
meson: fix blob test includes

Since blob.h moved up to src/compiler the test should include that
instead of src/compiler/glsl

fixes: 0e3bd56c6ea783dbc ("compiler: Move blob up a level")
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoRevert "make: Fix test to be meson compatible"
Emil Velikov [Fri, 13 Oct 2017 13:54:53 +0000 (14:54 +0100)]
Revert "make: Fix test to be meson compatible"

This reverts commit fc48ad24272799b154de37f6a944eb391bdbbb82.

There commit reference the previous commit as it justification of
changing behaviour. Although unlike the said commit, there's nothing
obviously wrong there.

I'll take a look close why Meson fails to pick the file, but in the
interim reverting this commit fixes the normal distcheck target.

7 years agost/dri: Add definitions to allow importing 16-bit surfaces
Mark Thompson [Sun, 1 Oct 2017 17:39:05 +0000 (18:39 +0100)]
st/dri: Add definitions to allow importing 16-bit surfaces

Necessary to support P010/P016 surfaces for video.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
Acked-by: Leo Liu <leo.liu@amd.com>
7 years agoi965: Complete 'expose RGBA visuals only on Android'
Mario Kleiner [Fri, 6 Oct 2017 16:11:31 +0000 (18:11 +0200)]
i965: Complete 'expose RGBA visuals only on Android'

Commit 731ba6924a2ed6cdf47a78fd637a91a19ddcf9ed
"expose RGBA visuals only on Android" replaced
ARRAY_SIZE(formats) by num_formats, but there are
3 loops which add configs, and only one was updated
to num_formats.

Also update loops for configs with accumulation buffer
and multisample configs.

Fixes: 731ba6924a2 "i965: expose RGBA visuals only on Android"
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoconfigure.ac: add missing LLVM components for OpenCL
Emil Velikov [Thu, 5 Oct 2017 10:19:08 +0000 (11:19 +0100)]
configure.ac: add missing LLVM components for OpenCL

Coverage and LTO seems to be hard requirements for Clang, while
coroutines is needed as of LLVM/Clang 4.0.

Mark the last one as "optional" so we handle every case.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tobias Droste <tdroste@gmx.de>
7 years agoconfigure.ac: add llvm_add_optional_component helper
Emil Velikov [Thu, 5 Oct 2017 10:19:07 +0000 (11:19 +0100)]
configure.ac: add llvm_add_optional_component helper

We want to add "optional" components, which have been added with later
LLVM versions.

One such in-tree example is inteljitevents. Others are to follow
shortly.

v2: Use the correct function, add blank line between functions (Tobias)

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tobias Droste <tdroste@gmx.de>
7 years agoTravis: add binutils 2.26 for a few more LLVM 3.9 builds
Emil Velikov [Thu, 5 Oct 2017 10:19:06 +0000 (11:19 +0100)]
Travis: add binutils 2.26 for a few more LLVM 3.9 builds

Otherwise we error out at link stage as follows:

/usr/lib/llvm-3.9/lib/libLLVMAMDGPUCodeGen.a(R600OptimizeVectorRegisters.cpp.o):
unrecognized relocation (0x2a) in section
`.text._ZNK12_GLOBAL__N_119R600VectorRegMerger16getAnalysisUsageERN4llvm13AnalysisUsageE'
/usr/bin/ld: final link failed: Bad value

Cc: mesa-stable@lists.freedesktop.org
Cc: Jan Vesely <jan.vesely@rutgers.edu
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoconfigure.ac: rework llvm libs handling for 3.9+
Emil Velikov [Thu, 5 Oct 2017 10:19:05 +0000 (11:19 +0100)]
configure.ac: rework llvm libs handling for 3.9+

Earlier versions need different quirks, but as of LLVM 3.9 llvm-config
provides --link-shared/link-static toggles.

The output of which seems to be reliable - looking at LLVM 3.9, 4.0 and
5.0.

Note that there are earlier code will be used for pre LLVM 3.9 and is
unchanged.

This effectively fixes LLVM static linking, while providing a clearer
and more robust solution for future versions.

Mildly interesting side notes:

 - build-mode (introduced with 3.8) was buggy with 3.8
It shows "static" when build with -DLLVM_LINK_LLVM_DYLIB=ON, yet it was
consistent with --libs. The latter shows the static libraries.

 - libnames and libfiles are broken with LVM 3.9
The library prefix and extension is printed twice liblibLLVM-3.9.so.so

v2: Invoke llvm-config twice, instead of using sed, to combine the two
lines into one (Tobias)

Cc: mesa-stable@lists.freedesktop.org
Cc: Dieter Nützel <Dieter@nuetzel-hh.de>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tobias Droste <tdroste@gmx.de>
7 years agoconfigure.ac: factor out detection for old and buggy llvm
Emil Velikov [Thu, 5 Oct 2017 10:19:04 +0000 (11:19 +0100)]
configure.ac: factor out detection for old and buggy llvm

As of LLVM 3.9 one could use consistent ways to handle the component.
Factor out the current handling, as it will be used for older versions.

Cc: mesa-stable@lists.freedesktop.org
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tobias Droste <tdroste@gmx.de>
7 years agoconfigure.ac: remove no longer necessary llvm-config --libs check
Emil Velikov [Thu, 5 Oct 2017 10:19:03 +0000 (11:19 +0100)]
configure.ac: remove no longer necessary llvm-config --libs check

Prior to the refactor/cleanup by Tobias one could add an invalid
component to LLVM_COMPONENTS.

Since that's no longer the case we can drop the current check.

Cc: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tobias Droste <tdroste@gmx.de>
7 years agoeglmesaext: add forward declaration for struct wl_buffers
Emil Velikov [Thu, 12 Oct 2017 10:39:46 +0000 (11:39 +0100)]
eglmesaext: add forward declaration for struct wl_buffers

The user does not need to know the specifics of the struct, as only a
pointer to it is used.

Just forward declare the struct making the header self-contained.

v2: Remove deprecation warning text/bugzilla - patch does no help there.

Cc: Greg V <greg@unrelenting.technology>
Fixes: 5cddb1ce3c9 ("wayland: Add an extension to create wl_buffers from
EGLImages")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
7 years agoconfigure.ac: bump Clover LLVM requirement to 3.9
Emil Velikov [Tue, 3 Oct 2017 16:51:16 +0000 (17:51 +0100)]
configure.ac: bump Clover LLVM requirement to 3.9

The only driver that utilises Clover already depends on LLVM 3.9.
Close to every supported distribution has said version.

Additionally libclc also requires LLVM 3.9.

With this in mind, we can safely bump the requirement.

There is a handful of dead code that we could remove, which will be
resolved with later commits.

Note: this drops the LLVM 3.6 build from the Travis build. LLVM 3.9 (and
later) are already covered in there.

https://lists.freedesktop.org/archives/mesa-dev/2017-September/170028.html

v2: Add reference to discussion thread (Eric), adjust libclc LLVM req.
(Jan).

Cc: Aaron Watry <awatry@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
7 years agowayland-drm: constify the callbacks struct, take 2
Emil Velikov [Wed, 27 Sep 2017 18:49:12 +0000 (19:49 +0100)]
wayland-drm: constify the callbacks struct, take 2

Now that wayland-drm (correctly) keeps a local copy of the callbacks,
this should not longer cause explosions.

After all the symbol is a local, constant data.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Tested-by: Derek Foreman <derekf@osg.samsung.com>
7 years agowayland-drm: use a copy of the wayland_drm_callbacks struct
Emil Velikov [Wed, 27 Sep 2017 18:49:11 +0000 (19:49 +0100)]
wayland-drm: use a copy of the wayland_drm_callbacks struct

The callbacks may be called even when they are no longer valid.
Say, the user is dlclose(ing) libEGL while the buffers are being
destroyed.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Tested-by: Derek Foreman <derekf@osg.samsung.com>
7 years agoegl/dri: don't crash when createImageFromRenderbuffer2 is NULL
Emil Velikov [Tue, 10 Oct 2017 17:50:13 +0000 (18:50 +0100)]
egl/dri: don't crash when createImageFromRenderbuffer2 is NULL

The __DRI_IMAGE version can be 17 or over, while the function pointer is
NULL. Guard for that instead of crashing.

Fixes: bad24395d91 ("egl/dri: use createImageFromRenderbuffer2 when
available")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomeson: Build i915
Ville Syrjälä [Mon, 9 Oct 2017 22:15:42 +0000 (01:15 +0300)]
meson: Build i915

Build i915 with meson. More or less copied from i965, with all
the unneeded cruft removed, and the libdrm_intel dependency added.

Cc: Dylan Baker <dylan@pnwbakers.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
7 years agomeson: Fix xf86vm dep
Ville Syrjälä [Mon, 9 Oct 2017 22:34:18 +0000 (01:34 +0300)]
meson: Fix xf86vm dep

The pkg-config file is called xxf86vm.pc not xf86vm.pc.

Cc: Dylan Baker <dylan@pnwbakers.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
7 years agointel/cs: Make thread_local_id a regular builtin param
Jason Ekstrand [Fri, 29 Sep 2017 19:22:48 +0000 (12:22 -0700)]
intel/cs: Make thread_local_id a regular builtin param

This is a lot more natural than special casing it all over the place.
We still have to do a bit of special-casing in assign_constant_locations
but it's not special-cased quite as bad as it was before.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel/compiler: Allocate pull_param in assign_constant_locations
Jason Ekstrand [Fri, 29 Sep 2017 18:30:25 +0000 (11:30 -0700)]
intel/compiler: Allocate pull_param in assign_constant_locations

Now that everything is nicely ralloc'd, we can allocate the pull_param
array in assign_constant_locations instead of higher up.  We can also
re-allocate the param array so that it's exactly the needed size.  This
should save us some memory because we're not allocating the total needed
param space for both push and pull.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel: Allocate prog_data::[pull_]param deeper inside the compiler
Jason Ekstrand [Fri, 29 Sep 2017 04:45:41 +0000 (21:45 -0700)]
intel: Allocate prog_data::[pull_]param deeper inside the compiler

Now that we're always growing the param array as-needed, we can
allocate the param array in common code and stop repeating the
allocation everywere.  In order to keep things sane, we ralloc the
[pull_]param array off of the compile context and then steal it back
to a NULL context later.  This doesn't get us all the way to where
prog_data::[pull_]param is purely an out parameter of the back-end
compiler but it gets us a lot closer.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoralloc: Allow reparenting to a NULL context
Jason Ekstrand [Wed, 16 Aug 2017 23:50:46 +0000 (16:50 -0700)]
ralloc: Allow reparenting to a NULL context

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoanv/pipeline: Refactor setup of the prog_data::param array
Jason Ekstrand [Fri, 29 Sep 2017 18:18:04 +0000 (11:18 -0700)]
anv/pipeline: Refactor setup of the prog_data::param array

Now that the only thing we put in the array up-front are client push
constants, we can simplify anv_pipeline_compile a bit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoanv/pipeline: Grow the param array for images
Jason Ekstrand [Fri, 29 Sep 2017 18:10:22 +0000 (11:10 -0700)]
anv/pipeline: Grow the param array for images

Before, we were calculating up-front and then filling in later.  Now we
just grow as needed in anv_nir_apply_pipeline_layout.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoanv/pipeline: Whack nir->num_uniforms to MAX_PUSH_CONSTANT_SIZE
Jason Ekstrand [Fri, 29 Sep 2017 18:09:04 +0000 (11:09 -0700)]
anv/pipeline: Whack nir->num_uniforms to MAX_PUSH_CONSTANT_SIZE

This way any image uniforms end up having locations higher than
MAX_PUSH_CONSTANT_SIZE.  There's no bug here at the moment, but this
consistency will make the next commit easier.  Also, because
nir_apply_pipeline_layout properly increments nir->num_uniforms when
it expands the param array, we no longer need to stomp it to match
prog_data::nr_params because it already does.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel/vs: Grow the param array for clip planes
Jason Ekstrand [Fri, 29 Sep 2017 17:50:07 +0000 (10:50 -0700)]
intel/vs: Grow the param array for clip planes

Instead of requiring the caller of brw_compile_vs to figure it out, just
grow the param array on-demand.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel/cs: Grow prog_data::param on-demand for thread_local_id_index
Jason Ekstrand [Fri, 29 Sep 2017 17:37:40 +0000 (10:37 -0700)]
intel/cs: Grow prog_data::param on-demand for thread_local_id_index

Instead of making the caller of brw_compile_cs add something to the
param array for thread_local_id_index, just add it on-demand in
brw_nir_intrinsics and grow the array.  This is now safe to do because
everyone is now using ralloc for prog_data::param.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel/compiler: Make brw_nir_lower_intrinsics compute-specific
Jason Ekstrand [Fri, 6 Oct 2017 17:08:11 +0000 (10:08 -0700)]
intel/compiler: Make brw_nir_lower_intrinsics compute-specific

It's already only ever called from brw_compile_cs and only handles
compute intrinsics.  Let's just make it CS-specific.  We can always
make it handle other stages again later if we want.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel/compiler: Add a helper for growing the prog_data::param array
Jason Ekstrand [Fri, 29 Sep 2017 18:05:55 +0000 (11:05 -0700)]
intel/compiler: Add a helper for growing the prog_data::param array

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel/compiler: Stop adding params for texture sizes
Jason Ekstrand [Fri, 29 Sep 2017 17:12:12 +0000 (10:12 -0700)]
intel/compiler: Stop adding params for texture sizes

We haven't needed this ever since we started using NIR for lowering
rectangle textures.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Only add the wpos state reference if we lowered something
Jason Ekstrand [Fri, 29 Sep 2017 17:16:43 +0000 (10:16 -0700)]
i965: Only add the wpos state reference if we lowered something

Otherwise, in the ARB program case _mesa_add_state_reference may grow
the parameter array which will cause brw_nir_setup_arb_uniforms to write
past the end of the param array because it only looks at the parameter
list length but the parma array is allocated based on nir->num_uniforms.
The only reason this hasn't caused us problems is because we are padding
out the param array for fragment programs unnecessarily.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel/compiler: Add a flag for pull constant support
Jason Ekstrand [Fri, 29 Sep 2017 05:16:55 +0000 (22:16 -0700)]
intel/compiler: Add a flag for pull constant support

The Vulkan driver does not support pull constants.  It simply limits
things such that we can always push everything.  Previously, we were
determining whether or not to push things based on whether or not the
prog_data::pull_param array is non-null.  This is rather hackish and
about to stop working.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoanv/pipeline: Ralloc prog_data::param of the compile mem_ctx
Jason Ekstrand [Fri, 29 Sep 2017 17:06:17 +0000 (10:06 -0700)]
anv/pipeline: Ralloc prog_data::param of the compile mem_ctx

This way we stop leaking it.  This is completely safe because, when we
hand it off to anv_shader_bin_create or anv_pipeline_cache_upload_kernel,
they make a copy of the entire param array.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoanv/pipeline: Add a mem_ctx parameter to anv_pipeline_compile
Jason Ekstrand [Fri, 29 Sep 2017 04:51:48 +0000 (21:51 -0700)]
anv/pipeline: Add a mem_ctx parameter to anv_pipeline_compile

This lets us avoid some of the manual ralloc stealing and prepares for
future commits in which we will want to ralloc prog_data::param.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Store image_param in brw_context instead of prog_data
Jason Ekstrand [Fri, 29 Sep 2017 02:04:31 +0000 (19:04 -0700)]
i965: Store image_param in brw_context instead of prog_data

This burns an extra 10k of memory or so in the case where you don't have
any images.  However, if you have several shaders which use images, this
should be much less memory.  It also gets rid of a part of prog_data
that really has nothing to do with the compiler.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Use prog->info.num_images for needs_dc computation
Jason Ekstrand [Fri, 29 Sep 2017 02:03:38 +0000 (19:03 -0700)]
i965: Use prog->info.num_images for needs_dc computation

This should be just as good as looking in prog_data but removes our one
state setup dependency on brw_stage_prog_data::nr_image_param.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel: Rewrite the world of push/pull params
Jason Ekstrand [Thu, 28 Sep 2017 23:25:31 +0000 (16:25 -0700)]
intel: Rewrite the world of push/pull params

This moves us away to the array of pointers model and onto a model where
each param is represented by a generic uint32_t handle.  We reserve 2^16
of these handles for builtins that get generated by somewhere inside the
compiler and have well-defined meanings.  Generic params have handles
whose meanings are defined by the driver.

The primary downside to this new approach is that it moves a little bit
of the work that we would normally do at compile time to draw time.  On
my laptop this hurts OglBatch6 by no more than 1% and doesn't seem to
have any measurable affect on OglBatch7.  So, while this may come back
to bite us, it doesn't look too bad.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>