Commit Graph

80359 Commits

Author SHA1 Message Date
Jason Ekstrand 1e0012e3e4 nir: Add a descriptor_set field to nir_variable
This is needed for supporting the Vulkan binding model

Reviewed-by: Rob Clark <robdclark@gmail.com>
2016-04-14 17:20:05 -07:00
Chad Versace 7a835b3fd9 dri: Fix robust context creation via EGL attribute
driCreateContextAttribs() emits an error if bit
__DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS is set for an ES context.  But,
EGL_EXT_create_context_robustness and EGL 1.5 both allow creation of
robust ES contexts. One requests a robust ES context by setting the
EGL_CONTEXT_OPENGL_ROBUST_ACCESS *attribute*, which Mesa's EGL layer
translates into the __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS *bit*.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-04-14 17:38:41 -07:00
Jason Ekstrand 5567ae0547 Merge remote-tracking branch 'public/master' into vulkan 2016-04-14 17:14:28 -07:00
Leo Liu 8f4340c5e6 radeon/uvd: fix tonga feedback buffer size
This only applies to tonga

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
2016-04-14 19:33:44 -04:00
Jason Ekstrand f1d29099b4 i965: Push everything if pull_param == NULL
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 16:00:18 -07:00
Jason Ekstrand 963513bb24 i965/fs: Push small uniform arrays
Unfortunately, this also means that we need to use a slightly different
algorithm for assign_constant_locations.  The old algorithm worked based on
the assumption that each read of a uniform value read exactly one float.
If it encountered a MOV_INDIRECT, it would immediately bail and push the
whole thing.  Since we can now read ranges using MOV_INDIRECT, we need to
be able to push a series of floats without breaking them up.  To do this,
we use an algorithm similar to the on in split_virtual_grfs.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 71f8039f72 i965/fs: Rename demote_pull_constants to lower_constant_loads
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 8e76f664be i965/vec4: Get rid of the uniform_size array
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 056849772f i965/vec4: Use MOV_INDIRECT instead of reladdr for indirect push constants
This commit moves us to an instruction based model rather than a
register-based model for indirects.  This is more accurate anyway as we
have to emit instructions to resolve the reladdr.  It's also a lot simpler
because it gets rid of the recursive reladdr problem by design.

One side-effect of this is that we need a whole new algorithm in
move_uniform_array_access_to_pull_constants.  This new algorithm is much
more straightforward than the old one and is fairly similar to what we're
already doing in the FS backend.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 479e38ad63 i965/fs: Get rid of the param_size array
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 30874216cb i965/fs: Stop relying on param_size in assign_constant_locations
Now that we have MOV_INDIRECT opcodes, we have all of the size information
we need directly in the opcode.  With a little restructuring of the
algorithm used in assign_constant_locations we don't need param_size
anymore.  The big thing to watch out for now, however, is that you can have
two ranges overlap where neither contains the other.  In order to deal with
this, we make the first pass just flag what needs pulling and handle
assigning pull constant locations until later.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 275855f315 i965/fs: Get rid of reladdr
We aren't using it anymore.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 3c93cdfaf5 i965/fs: Use MOV_INDIRECT for all indirect uniform loads
Instead of using reladdr, this commit changes the FS backend to emit a
MOV_INDIRECT whenever we need an indirect uniform load.  We also have to
rework some of the other bits of the backend to handle this new form of
uniform load.  The obvious change is that demote_pull_constants now acts
more like a lowering pass when it hits a MOV_INDIRECT.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 63101177f3 nir: Add another index to load_uniform to specify the range read
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 27bd8ac6f3 i965/fs: Add support for MOV_INDIRECT on pre-Broadwell hardware
While we're at it, we also add support for the possibility that the
indirect is, in fact, a constant.  This shouldn't happen in the common case
(if it does, that means NIR failed to constant-fold something), but it's
possible so we should handle it.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 889e6054b7 i965/fs: Fix regs_read() for MOV_INDIRECT with a non-zero subnr
The subnr field is in bytes so we don't need to multiply by type_sz.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 7e08a13009 i965/fs: Don't force MASK_DISABLE on INDIRECT_MOV instructions
It should work fine without it and the visitor can set it if it wants.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 40a8fe04dc i965/fs: Add support for doing MOV_INDIRECT on uniforms
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 15:59:33 -07:00
Jason Ekstrand 48cc8c284a anv: Install the installable ICD 2016-04-14 15:15:00 -07:00
Jason Ekstrand e40b867145 anv/intel_icd: Don't provide an absolute path
The driver will be installed to $(libdir)/libvulkan_intel.so and just
providing a driver name is enough for the loader.  This also ensures that
multi-arch systems work ok.
2016-04-14 15:15:00 -07:00
Jason Ekstrand ca16373a2b configure: Add initial support for enabling Vulkan drivers 2016-04-14 15:15:00 -07:00
Jason Ekstrand e61c812f76 anv/pipeline: Use the right mask for lower_indirect_derefs 2016-04-14 15:13:29 -07:00
Ben Widawsky a8975a91cc i965: Make intel_get_param return an int
This will fix the spurious error message: "Failed to query GPU properties."
that was unintentionally added in cc01b63d73.

This patch changes the function to return an int so that the caller is able to
do stuff based on the return value.

The equivalent of this patch was in the original series that fixed up the
warning, but I dropped it at the last moment. It is required to make the desired
behavior of not warning when trying to query GPU properties from the kernel
unless there is something the user can do about it.

v2: Use strerror (Jason)
Make EINVAL check similar in all places (Ian)

NOTE: Broadwell appears to actually have some issue where the kernel returns
ENODEV when it shouldn't be. I will investigate this separately.

Reported-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-04-14 15:13:22 -07:00
Brian Paul aed975d5c5 st/mesa: fix sampler view leak in st_DrawAtlasBitmaps()
I neglected to free the sampler view which was created earlier in the
function.  So for each glCallLists() command that used the bitmap atlas
to draw text, we'd leak a sampler view object.

Also, check for st_create_texture_sampler_view() failure and record
GL_OUT_OF_MEMORY.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-04-14 15:32:18 -06:00
Nicolai Hähnle a17911ceb1 gallium/radeon: handle failure when mapping staging buffer
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-04-14 16:29:23 -05:00
Nicolai Hähnle 8bd0f0df50 radeonsi: mark ssbo and images descriptor pointers dirty at beginning of CS
Without this, we were getting non-deterministic VM faults under high pressure.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-04-14 16:29:23 -05:00
Jason Ekstrand cb372b39ea i965/vec4: Use UD rather than D for uniform indirects
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 14:25:01 -07:00
Jason Ekstrand 240d16ea94 i965/fs: Use UD type for offsets in VARYING_PULL_CONSTANT_LOAD
Reveiewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-14 14:24:57 -07:00
Samuel Pitoiset bb4cdee9a4 nvc0: do not break the universe on GK110+
I removed that return 0 by mistake. Ooops.

Fixes: 6e23fd4 ("nvc0: allow to use compute support on GM200")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-04-14 21:57:21 +02:00
Samuel Pitoiset 6e23fd420d nvc0: allow to use compute support on GM200
This works like a charm but please not that NVF0_COMPUTE have to be set
because compute support is still not enabled by default on GK110+. This
will require more testing to make sure it won't break the 3D state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-04-14 21:01:51 +02:00
Jason Ekstrand 34b5db17d9 i965: remove pointless diff with the master branch 2016-04-14 10:39:54 -07:00
Jason Ekstrand 769b5614f8 nir/opt_algebraic: Remove the encoding line
This is an unneeded diff between the vulkan and master branches
2016-04-14 10:35:40 -07:00
Jason Ekstrand c34be07230 spirv: Move to compiler/
While it does rely on NIR, it's not really part of the NIR core.  At the
moment, it still builds as part of libnir but that can be changed later if
desired.
2016-04-14 10:28:47 -07:00
Jason Ekstrand bfa3a38280 nir: Remove some pointless delta between vulkan and master 2016-04-14 10:24:33 -07:00
Jose Fonseca ffcc00ce30 scons: Build NIR.
Emil Velikov:
 - Attribute the src/{glsl,compiler}/nir move
 - Flesh out to separate SConscript

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-04-14 16:38:59 +01:00
Jose Fonseca feb6732e80 nir: Use _snprintf on Windows.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-04-14 16:38:37 +01:00
Jose Fonseca ba0c0e3940 nir: Avoid structure initalization expressions.
Not supported by MSVC, and completely unnecessary -- inline functions
work just as well.

NIR_SRC_INIT/NIR_DEST_INIT could and probably should be replaced by the
inline functions.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-04-14 16:38:37 +01:00
Jose Fonseca 8f96524f13 nir: Remove unistd.h include.
It doesn't seem needed, and is not available on MSVC.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-04-14 16:38:31 +01:00
Jose Fonseca f8e2f1fba5 nir: Avoid empty {} struct initializer.
Not supported by MSVC and consistent through NIR.

[Emil Velikov: rebase]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-04-14 16:33:52 +01:00
Emil Velikov bb949e262c gallium/swr: fold the almost identical Makefiles
Rather than having two almost identical Makefiles, with various VPATH
hacks just fold them, using COMMON_* variables and actually getting
things buildable/shipable.

v2: whitespace fixes, remove Makefile.sources-arch

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-04-14 16:30:57 +01:00
Tim Rowley aee976703d install-gallium-links.mk: handle multiple libraries
Need to prevent bash from interpreting whitespace between libraries
as a command line.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-14 16:30:57 +01:00
Marek Olšák 112291964e radeonsi: don't overwrite the scratch offset in shader prologs
Prologs only look at num_input_sgprs.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2016-04-14 17:00:14 +02:00
Marek Olšák ffe44d0283 radeonsi: fold num_user_sgprs where it is possible
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2016-04-14 17:00:14 +02:00
Marek Olšák 51c4034f9b radeonsi: fix SGPRS calculation once more
This fixes GS piglit failures after adding SI_PARAM_SHADER_BUFFERS,
which bumped NUM_USER_SGPRS and uncovered this bug on SI.

If this was fixed in LLVM, these workarounds wouldn't be needed.

LLVM would have to look at the calling convention to know how many SGPR
inputs are declared, and add VCC and the scratch wave offset (which is
enabled even if we spill SGPRs but not VGPRs, oh well).

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2016-04-14 17:00:14 +02:00
Marek Olšák aaf5be4a29 radeonsi: disable hw ETC2 on Polaris
not supported by hw directly, but it's still fully supported by the driver

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-04-14 16:58:59 +02:00
Emil Velikov 4358cfc4ad doxygen: remove git rebase fallouts
Should never have been (git) added in the first place.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-14 09:49:09 +01:00
Jose Fonseca 8fcacb4f90 appveyor: Run unit tests.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-04-14 07:19:04 +01:00
Jose Fonseca 50ddf03ada scons: Add a "check" target to run all unit tests.
Except:
- u_cache_test -- too long
- translate_test -- unreliable (it's probably testing corner cases that
  translate module doesn't care about.)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-04-14 07:19:04 +01:00
Jose Fonseca 9ae0e8ee3c test/unit: Make translate_test invoke translate_create by default.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-04-14 07:19:04 +01:00
Jose Fonseca f8a51034bd test/unit: Make pipe_barrier_test actually check correct bahavior.
So it can run unattended.

Also make it silent by default.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-04-14 07:19:04 +01:00