mesa.git
5 years agoi965: consider a 'base level' when calculating width0, height0, depth0
Andrii Simiklit [Tue, 2 Oct 2018 16:16:01 +0000 (19:16 +0300)]
i965: consider a 'base level' when calculating width0, height0, depth0

I guess that when we calculating the width0, height0, depth0
to use for function 'intel_miptree_create' we need to consider
the 'base level' like it is done in the 'intel_miptree_create_for_teximage'
function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agonir: rewrite varying component packing
Timothy Arceri [Sun, 9 Dec 2018 23:23:51 +0000 (10:23 +1100)]
nir: rewrite varying component packing

There are a number of reasons for the rewrite.

1. Adding support for packing tess patch varyings in a sane way.

2. Making use of qsort allowing the code to be much easier to
   follow.

3. Fixes a bug where different interp types caused component
   packing to be skipped for all varyings in some scenarios.

4. Allows us to add a crude live range analysis for deciding
   which components should be packed together. This support can
   optionally be added in a future patch.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agonir: add is_packing_supported_for_type() helper
Timothy Arceri [Sun, 9 Dec 2018 22:42:42 +0000 (09:42 +1100)]
nir: add is_packing_supported_for_type() helper

This will be used in the following patches to determine if we
support packing the components of a varying.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agonir: add glsl_type_is_32bit() helper
Timothy Arceri [Wed, 6 Feb 2019 01:27:39 +0000 (12:27 +1100)]
nir: add glsl_type_is_32bit() helper

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agonir: add support for marking used patches when packing varyings
Timothy Arceri [Sun, 2 Dec 2018 23:42:40 +0000 (10:42 +1100)]
nir: add support for marking used patches when packing varyings

This adds support needed for marking the varyings as used but we
don't actually support packing patches in this patch.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agost/glsl_to_nir: call nir_remove_dead_variables() after lowing local indirects
Timothy Arceri [Wed, 6 Feb 2019 09:37:14 +0000 (20:37 +1100)]
st/glsl_to_nir: call nir_remove_dead_variables() after lowing local indirects

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agoutil: move BITFIELD macros to util/macros.h
Timothy Arceri [Wed, 6 Feb 2019 01:18:52 +0000 (12:18 +1100)]
util: move BITFIELD macros to util/macros.h

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agost/mesa: require RGBA2, RGB4, and RGBA4 to be renderable
Karol Herbst [Wed, 16 Jan 2019 14:17:31 +0000 (15:17 +0100)]
st/mesa: require RGBA2, RGB4, and RGBA4 to be renderable

If the driver does not support rendering to these formats but does
support texturing, we can end up in incompatibilities between textures
and renderbuffers that are then copied to.

Fixes KHR-GL45.copy_image.functional on nvc0

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agogallium: add PIPE_CAP_MAX_VARYINGS
Karol Herbst [Fri, 25 Aug 2017 17:22:03 +0000 (19:22 +0200)]
gallium: add PIPE_CAP_MAX_VARYINGS

Some NVIDIA hardware can accept 128 fragment shader input components,
but only have up to 124 varying-interpolated input components. We add a
new cap to express this cleanly. For most drivers, this will have the
same value as PIPE_SHADER_CAP_MAX_INPUTS for the fragment shader.

Fixes KHR-GL45.limits.max_fragment_input_components

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
[imirkin: rebased, improved docs/commit message]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agokmsro: Silence warning if missing
Alyssa Rosenzweig [Thu, 7 Feb 2019 02:09:21 +0000 (02:09 +0000)]
kmsro: Silence warning if missing

Regardless of whether the build uses kmsro, kmsro is the default driver
descriptor when the static loader is used. Thus, in an edge case where
the static loader is used, no static targets are loaded, and kmsro is
not compiled, a spurious warning is printed. There's no harm in
executing the stub function in this case, but it's not "an error" to not
have kmsro in the build; the driver missing warning should not printed
kmsro.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
5 years agoradv: assert that colorAttachment is valid for CmdClearAttachment
Lionel Landwerlin [Wed, 6 Feb 2019 17:48:38 +0000 (17:48 +0000)]
radv: assert that colorAttachment is valid for CmdClearAttachment

This partially reverts a change from b7a93cbdede05a ("radv: Handle
VK_ATTACHMENT_UNUSED in CmdClearAttachment") which fixed actual issues
but also started to accept invalid values for the colorAttachment
field.

This change asserts that the field is valid for the current pass.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b7a93cbdede05a ("radv: Handle VK_ATTACHMENT_UNUSED in CmdClearAttachment")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoanv: assert that color attachment are valid
Lionel Landwerlin [Wed, 6 Feb 2019 17:37:58 +0000 (17:37 +0000)]
anv: assert that color attachment are valid

This reverts commit d76e7779884775bcebf235adb0e8367816b9b95d.

Let's make this obvious that there is an application issue if it tries
to access an attachment that doesn't exist in the current pass.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d76e7779884775 ("anv: Handle VK_ATTACHMENT_UNUSED in colorAttachment")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agodocs: update qbo support for virgl
Dave Airlie [Thu, 7 Feb 2019 23:06:13 +0000 (09:06 +1000)]
docs: update qbo support for virgl

Signed-off-by: Dave Airlie <airlied@redhat.com>
5 years agotravis: fix osx make build
Eric Engestrom [Thu, 7 Feb 2019 11:36:19 +0000 (11:36 +0000)]
travis: fix osx make build

This variable was removed in commit 087af992a276e7478c9c "travis: remove
unused linux code path" because it looked like it was only used by the
Linux build. Turns out I was wrong, so let's restore it.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agoREADME: Drop the badges from the readme
Jason Ekstrand [Thu, 7 Feb 2019 15:44:58 +0000 (09:44 -0600)]
README: Drop the badges from the readme

They have been added as badges directly to the GitLab project.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agodriconf: drop unused macro
Eric Engestrom [Tue, 22 Jan 2019 16:44:44 +0000 (16:44 +0000)]
driconf: drop unused macro

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agomeson: add script to print the options before configuring a builddir
Eric Engestrom [Thu, 17 Jan 2019 18:04:42 +0000 (18:04 +0000)]
meson: add script to print the options before configuring a builddir

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agopanfrost: Include glue for out-of-tree legacy code
Alyssa Rosenzweig [Tue, 5 Feb 2019 05:13:50 +0000 (05:13 +0000)]
panfrost: Include glue for out-of-tree legacy code

In addition to the DRM interface in active development, for legacy
kernels Panfrost has a small, optional, out-of-tree glue repository. For
various reasons, this legacy code should not be included in Mesa proper,
but this commit allows it to coexist peacefully with upstream Panfrost.
If the nondrm repo is cloned/symlinked to the directory
`src/gallium/drivers/panfrost/nondrm`, legacy functionality will be
built. Otherwise, the driver will build normally, though a runtime error
message will be printed if a legacy kernel is detected.

This workaround is icky, but it allows a nearly-upstream Panfrost to
work on real hardware, today. Ideally, this patch will be reverted when
the Panfrost kernel module is mature and we drop legacy support.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
5 years agopanfrost: Check in sources for command stream
Alyssa Rosenzweig [Tue, 5 Feb 2019 04:32:27 +0000 (04:32 +0000)]
panfrost: Check in sources for command stream

This patch includes the command stream portion of the driver,
complementing the earlier compiler. It provides a base for future work,
though it does not integrate with any particular winsys.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
5 years agopanfrost: Use u_pipe_screen_get_param_defaults
Alyssa Rosenzweig [Tue, 5 Feb 2019 02:19:38 +0000 (02:19 +0000)]
panfrost: Use u_pipe_screen_get_param_defaults

Switching to the defaults function cleans up pan_screen.h markedly and
futureproofs for when new PIPE_CAPs are added.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Suggested-by: Eric Anholt <eric@anholt.net>
5 years agokmsro: Move DRM entrypoints to shared block
Alyssa Rosenzweig [Tue, 5 Feb 2019 02:25:01 +0000 (02:25 +0000)]
kmsro: Move DRM entrypoints to shared block

As kmsro allows an essentially mix-and-match hodgepodge of display
drivers and renderonly GPUs, it doesn't make sense to couple the display
driver entrypoint definition with the driver. Instead, we move *all*
kmsro entrypoints to a shared kmsro block at the end (avoiding clutter
and distraction since this list may snowball in the future).

v2: Alphabetize driver list.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agonvc0: add compute invocation counter
Rhys Perry [Tue, 26 Jun 2018 23:04:41 +0000 (00:04 +0100)]
nvc0: add compute invocation counter

The strategy is to keep a CPU-side counter of the direct invocations,
and a GPU-side counter of the indirect invocations, and then add them
together for queries.

The specific technique is a macro which multiplies a list of integers
together and accumulates the product into SCRATCH registers held inside
of the context. Another macro will read those values out and add them to
the passed-in cpu-side counter to be stored in a query buffer the same
way that all the other statistics are stored.

Original implementation by Rhys Perry, redone by Ilia Mirkin to use the
SCRATCH temporaries.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agogm107/ir: add fp64 rsq
Karol Herbst [Sun, 1 Jul 2018 07:44:48 +0000 (09:44 +0200)]
gm107/ir: add fp64 rsq

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agogm107/ir: add fp64 rcp
Karol Herbst [Sat, 30 Jun 2018 21:09:27 +0000 (23:09 +0200)]
gm107/ir: add fp64 rcp

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agogk104/ir: Use the new rcp/rsq in library
Karol Herbst [Mon, 14 Aug 2017 21:55:25 +0000 (23:55 +0200)]
gk104/ir: Use the new rcp/rsq in library

[imirkin: add a few more "long" prefixes to safen things up]
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agogk110/ir: Use the new rcp/rsq in library
Boyan Ding [Thu, 9 Mar 2017 05:55:19 +0000 (13:55 +0800)]
gk110/ir: Use the new rcp/rsq in library

v2: (Karol Herbst <kherbst@redhat.com>
 * fix Value setup for the builtins

Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
[imirkin: track the fp64 flag when switching ops to calls]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agogk110/ir: Add rsq f64 implementation
Boyan Ding [Thu, 9 Mar 2017 05:55:18 +0000 (13:55 +0800)]
gk110/ir: Add rsq f64 implementation

Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agogk110/ir: Add rcp f64 implementation
Boyan Ding [Thu, 9 Mar 2017 05:55:17 +0000 (13:55 +0800)]
gk110/ir: Add rcp f64 implementation

Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agonvc0: stick zero values for the compute invocation counts
Ilia Mirkin [Tue, 5 Feb 2019 08:05:33 +0000 (03:05 -0500)]
nvc0: stick zero values for the compute invocation counts

Not quite perfect, but at least we don't end up with random values in
the query buffer.

Fixes KHR-GL45.pipeline_statistics_query_tests_ARB.functional_default_qo_values

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agonv50,nvc0: use condition for occlusion queries when already complete
Ilia Mirkin [Tue, 5 Feb 2019 03:57:06 +0000 (22:57 -0500)]
nv50,nvc0: use condition for occlusion queries when already complete

For the NO_WAIT variants, we would jump into the ALWAYS case for both
nested and inverted occlusion queries. However if the query had
previously completed, the application could reasonably expect that the
render condition would follow that result.

To resolve this, we remove the nesting distinction which unnecessarily
created an imbalance between the regular and inverted cases (since
there's no "zero" condition mode). We also use the proper comparison if
we know that the query has completed (which could happen as a result of
an earlier get_query_result call).

Fixes KHR-GL45.conditional_render_inverted.functional

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agonvc0: fix 3d images on kepler
Ilia Mirkin [Mon, 4 Feb 2019 02:55:12 +0000 (21:55 -0500)]
nvc0: fix 3d images on kepler

Looks like SUBFM.3D and SUEAU are perfectly capable of dealing with 3d
tiling, they just need the correct inputs. Supply them.

We also have to deal with the case where a 2d "layer" of a 3d image is
bound. In this case, we supply the z coordinate separately to the
shader, which has to optionally treat every 2d case as if it could be a
slice of a 3d texture.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agonvc0/ir: fix second tex argument after levelZero optimization
Ilia Mirkin [Sat, 2 Feb 2019 07:56:48 +0000 (02:56 -0500)]
nvc0/ir: fix second tex argument after levelZero optimization

We used to pre-set a bunch of extra arguments to a texture instruction
in order to force the RA to allocate a register at the boundary of 4.
However with the levelZero optimization, which removes a LOD argument
when it's uniformly equal to zero, we undid that logic by removing an
extra argument. As a result, we could end up with insufficient alignment
on the second wide texture argument.

Instead we switch to a different method of achieving the same result.
The logic runs during the constraint analysis of the RA, and adds unset
sources as necessary right before being merged into a wide argument.

Fixes MISALIGNED_REG errors in Hitman when run with bindless textures
enabled on a GK208.

Fixes: 9145873b152 ("nvc0/ir: use levelZero flag when the lod is set to 0")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agonvc0/ir: always use CG mode for loads from atomic-only buffers
Ilia Mirkin [Sun, 3 Feb 2019 15:06:24 +0000 (10:06 -0500)]
nvc0/ir: always use CG mode for loads from atomic-only buffers

Atomic operations don't update the local cache, which means that we
would have to issue CCTL operations in order to get the updated values.
When we know that a buffer is primarily used for atomic operations, it's
easier to just avoid the caching at that level entirely.

The same issue persists for non-atomic buffers, which will have to be
fixed separately.

Fixes the failing dEQP-GLES31.functional.atomic_counter.* tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agonvc0: add support for handling indirect draws with attrib conversion
Ilia Mirkin [Sat, 2 Feb 2019 21:23:50 +0000 (16:23 -0500)]
nvc0: add support for handling indirect draws with attrib conversion

The hardware does not natively support FIXED and DOUBLE formats. If
those are used in an indirect draw, they have to be converted. Our
conversion tries to be clever about only converting the data that's
needed. However for indirect, that won't work.

Given that DOUBLE or FIXED are highly unlikely to ever be used with
indirect draws, read the indirect buffer on the CPU and issue draws
directly.

Fixes the failing dEQP-GLES31.functional.draw_indirect.random.* tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agofreedreno/a6xx: Use tiling for all resources
Kristian H. Kristensen [Wed, 6 Feb 2019 22:10:36 +0000 (14:10 -0800)]
freedreno/a6xx: Use tiling for all resources

We used to restrict this to just PIPE_BIND_SAMPLER_VIEW resources, but
most resources benefit from being tiled.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/a6xx: Emit blitter dst with OUT_RELOCW
Kristian H. Kristensen [Wed, 6 Feb 2019 21:47:32 +0000 (13:47 -0800)]
freedreno/a6xx: Emit blitter dst with OUT_RELOCW

We're writing to the bo and the kernel needs to know for
fd_bo_cpu_prep() to work.

Fixes: f93e43127252679b ("freedreno/a6xx: Enable blitter")
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
5 years agoradv: Implement VK_EXT_buffer_device_address.
Bas Nieuwenhuizen [Thu, 24 Jan 2019 01:06:27 +0000 (02:06 +0100)]
radv: Implement VK_EXT_buffer_device_address.

v2: Also update the release notes.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Do not use the bo list for local buffers.
Bas Nieuwenhuizen [Fri, 25 Jan 2019 00:56:45 +0000 (01:56 +0100)]
radv: Do not use the bo list for local buffers.

The kernel already does it for us.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/common: Implement global memory accesses.
Bas Nieuwenhuizen [Thu, 24 Jan 2019 01:04:10 +0000 (02:04 +0100)]
amd/common: Implement global memory accesses.

Needed for VK_EXT_buffer_device_address.

The pointers are implmemented as i8*, since I could not figure
out how to emulate setting struct offsets in LLVM based on the
SPIR-V offsets (and more weird stuff like row major matrices).

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/common: Do not use 32-bit loads for shared memory.
Bas Nieuwenhuizen [Thu, 24 Jan 2019 00:28:16 +0000 (01:28 +0100)]
amd/common: Do not use 32-bit loads for shared memory.

We use a straight glsl->llvm type conversion so types should already be right.

Also even though the writemasks were changed we we not actually doing 32-bit
things, so this fails miserably.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/common: handle nir_deref_cast for shared memory from integers.
Bas Nieuwenhuizen [Thu, 24 Jan 2019 00:25:50 +0000 (01:25 +0100)]
amd/common: handle nir_deref_cast for shared memory from integers.

Can happen e.g. after a phi.

Fixes: a2b5cc3c399 "radv: enable variable pointers"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/common: Handle nir_deref_type_ptr_as_array for shared memory.
Bas Nieuwenhuizen [Thu, 24 Jan 2019 00:21:28 +0000 (01:21 +0100)]
amd/common: Handle nir_deref_type_ptr_as_array for shared memory.

Fixes: a2b5cc3c399 "radv: enable variable pointers"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/common: Fix stores to derefs with unknown variable.
Bas Nieuwenhuizen [Wed, 23 Jan 2019 21:50:33 +0000 (22:50 +0100)]
amd/common: Fix stores to derefs with unknown variable.

Fixes: a2b5cc3c399 "radv: enable variable pointers"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/common: Use correct writemask for shared memory stores.
Bas Nieuwenhuizen [Wed, 23 Jan 2019 21:44:05 +0000 (22:44 +0100)]
amd/common: Use correct writemask for shared memory stores.

The check was for 1 bit being set, which is clearly not what we want.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Fix the shader info pass for not having the variable.
Bas Nieuwenhuizen [Wed, 23 Jan 2019 21:41:46 +0000 (22:41 +0100)]
radv:  Fix the shader info pass for not having the variable.

For example with VK_EXT_buffer_device_address or
 VK_KHR_variable_pointers.

Fixes: a2b5cc3c399 "radv: enable variable pointers"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/common: Implement ptr->int casts in ac_to_integer.
Bas Nieuwenhuizen [Wed, 23 Jan 2019 00:54:39 +0000 (01:54 +0100)]
amd/common: Implement ptr->int casts in ac_to_integer.

For the implicit casts inherent in nir.

This should probably have been done for shared memory for
VK_KHR_variable_pointers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoamd/common: Add gep helper for pointer increment.
Bas Nieuwenhuizen [Wed, 23 Jan 2019 00:53:59 +0000 (01:53 +0100)]
amd/common: Add gep helper for pointer increment.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Only look at pImmutableSamples if the descriptor has a sampler.
Bas Nieuwenhuizen [Tue, 22 Jan 2019 21:29:26 +0000 (22:29 +0100)]
radv: Only look at pImmutableSamples if the descriptor has a sampler.

Equivalent of ANV patch c7f4a2867ce492d78c1f8e2870c0a593d280572d

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoxvmc: fix string comparison
Eric Engestrom [Wed, 6 Feb 2019 16:28:12 +0000 (16:28 +0000)]
xvmc: fix string comparison

Fixes: 6fca18696d0e6a243f6f "g3dvl: Update XvMC unit tests."
Cc: Younes Manton <younes.m@gmail.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoxvmc: fix string comparison
Eric Engestrom [Wed, 6 Feb 2019 16:21:08 +0000 (16:21 +0000)]
xvmc: fix string comparison

Fixes: c7b65dcaffeb9d0760c8 "xvmc: Define some Xv attribs to allow users
                             to specify color standard and procamp"
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson glvnd build
Eric Engestrom [Tue, 29 Jan 2019 08:57:17 +0000 (08:57 +0000)]
gitlab-ci: add meson glvnd build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agotravis: remove unused scons code path
Eric Engestrom [Mon, 28 Jan 2019 21:36:19 +0000 (21:36 +0000)]
travis: remove unused scons code path

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agotravis: remove unused linux code path
Eric Engestrom [Mon, 28 Jan 2019 21:36:08 +0000 (21:36 +0000)]
travis: remove unused linux code path

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium ST Other build
Eric Engestrom [Mon, 28 Jan 2019 20:48:37 +0000 (20:48 +0000)]
gitlab-ci: add make Gallium ST Other build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium ST Clover LLVM-7 build
Eric Engestrom [Mon, 28 Jan 2019 20:40:25 +0000 (20:40 +0000)]
gitlab-ci: add make Gallium ST Clover LLVM-7 build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium ST Clover LLVM-6.0 build
Eric Engestrom [Mon, 28 Jan 2019 20:39:22 +0000 (20:39 +0000)]
gitlab-ci: add make Gallium ST Clover LLVM-6.0 build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium ST Clover LLVM-5.0 build
Eric Engestrom [Mon, 28 Jan 2019 20:37:03 +0000 (20:37 +0000)]
gitlab-ci: add make Gallium ST Clover LLVM-5.0 build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium ST Clover LLVM-4.0 build
Eric Engestrom [Mon, 28 Jan 2019 20:36:25 +0000 (20:36 +0000)]
gitlab-ci: add make Gallium ST Clover LLVM-4.0 build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium ST Clover LLVM-3.9 build
Eric Engestrom [Mon, 28 Jan 2019 20:29:59 +0000 (20:29 +0000)]
gitlab-ci: add make Gallium ST Clover LLVM-3.9 build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium Drivers "Other" build
Eric Engestrom [Mon, 28 Jan 2019 20:24:04 +0000 (20:24 +0000)]
gitlab-ci: add make Gallium Drivers "Other" build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium Drivers RadeonSI build
Eric Engestrom [Mon, 28 Jan 2019 20:21:44 +0000 (20:21 +0000)]
gitlab-ci: add make Gallium Drivers RadeonSI build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make Gallium Drivers SWR build
Eric Engestrom [Mon, 28 Jan 2019 20:17:12 +0000 (20:17 +0000)]
gitlab-ci: add make Gallium Drivers SWR build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add make loaders/classic DRI build
Eric Engestrom [Mon, 28 Jan 2019 20:13:33 +0000 (20:13 +0000)]
gitlab-ci: add make loaders/classic DRI build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson gallium ST "Other" build
Eric Engestrom [Mon, 28 Jan 2019 18:13:55 +0000 (18:13 +0000)]
gitlab-ci: add meson gallium ST "Other" build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson gallium ST Clover (LLVM 7.0) build
Eric Engestrom [Mon, 28 Jan 2019 18:09:24 +0000 (18:09 +0000)]
gitlab-ci: add meson gallium ST Clover (LLVM 7.0) build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson gallium ST Clover (LLVM 6.0) build
Eric Engestrom [Mon, 28 Jan 2019 18:07:31 +0000 (18:07 +0000)]
gitlab-ci: add meson gallium ST Clover (LLVM 6.0) build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson gallium ST Clover (LLVM 5.0) build
Eric Engestrom [Mon, 28 Jan 2019 18:05:22 +0000 (18:05 +0000)]
gitlab-ci: add meson gallium ST Clover (LLVM 5.0) build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson gallium "other drivers" build
Eric Engestrom [Mon, 28 Jan 2019 17:47:09 +0000 (17:47 +0000)]
gitlab-ci: add meson gallium "other drivers" build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson gallium RadeonSI build
Eric Engestrom [Mon, 28 Jan 2019 17:45:26 +0000 (17:45 +0000)]
gitlab-ci: add meson gallium RadeonSI build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson gallium SWR build
Eric Engestrom [Mon, 28 Jan 2019 17:42:59 +0000 (17:42 +0000)]
gitlab-ci: add meson gallium SWR build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add meson loader/classic DRI build
Eric Engestrom [Mon, 28 Jan 2019 17:38:17 +0000 (17:38 +0000)]
gitlab-ci: add meson loader/classic DRI build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add scons SWR build
Eric Engestrom [Mon, 28 Jan 2019 16:33:22 +0000 (16:33 +0000)]
gitlab-ci: add scons SWR build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add scons llvm 3.5 build
Eric Engestrom [Mon, 28 Jan 2019 16:30:36 +0000 (16:30 +0000)]
gitlab-ci: add scons llvm 3.5 build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add a scons no-llvm build
Eric Engestrom [Wed, 23 Jan 2019 15:46:10 +0000 (15:46 +0000)]
gitlab-ci: add a scons no-llvm build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add a make vulkan build
Eric Engestrom [Mon, 21 Jan 2019 09:42:37 +0000 (09:42 +0000)]
gitlab-ci: add a make vulkan build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add a meson vulkan build
Eric Engestrom [Sun, 20 Jan 2019 11:26:53 +0000 (11:26 +0000)]
gitlab-ci: add a meson vulkan build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: add ubuntu container
Eric Engestrom [Sun, 20 Jan 2019 11:21:45 +0000 (11:21 +0000)]
gitlab-ci: add ubuntu container

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoradeonsi: use local ws variable in si_need_dma_space
Marek Olšák [Thu, 31 Jan 2019 15:59:48 +0000 (10:59 -0500)]
radeonsi: use local ws variable in si_need_dma_space

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: don't leak an index buffer if draw_vbo fails
Marek Olšák [Tue, 22 Jan 2019 22:29:19 +0000 (17:29 -0500)]
radeonsi: don't leak an index buffer if draw_vbo fails

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: make allocator_zeroed_memory unmappable and use bigger buffers
Marek Olšák [Wed, 30 Jan 2019 19:29:36 +0000 (14:29 -0500)]
radeonsi: make allocator_zeroed_memory unmappable and use bigger buffers

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: clear allocator_zeroed_memory with SDMA
Marek Olšák [Tue, 29 Jan 2019 00:49:56 +0000 (19:49 -0500)]
radeonsi: clear allocator_zeroed_memory with SDMA

so that it can be used in parallel IBs.

This also removes the SO_FILLED_SIZE hack.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: initialize textures using DCC to black when possible
Marek Olšák [Wed, 23 Jan 2019 16:34:48 +0000 (11:34 -0500)]
radeonsi: initialize textures using DCC to black when possible

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agofreedreno: a2xx: fix fast clear
Jonathan Marek [Tue, 5 Feb 2019 19:08:12 +0000 (14:08 -0500)]
freedreno: a2xx: fix fast clear

Fixes: 912a9c8d
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
5 years agoegl: use coherent variable names
Eric Engestrom [Sat, 2 Feb 2019 11:38:45 +0000 (11:38 +0000)]
egl: use coherent variable names

`EGLDisplay` variables (the opaque Khronos type) have mostly been
consistently called `dpy`, as this is the name used in the Khronos
specs.

However, `_EGLDisplay` variables (our internal struct) have been
randomly called `dpy` when there was no local variable clash with
`EGLDisplay`s, and `disp` otherwise.

Let's be consistent and use `dpy` for the Khronos type, and `disp`
for our struct.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
5 years agomeson: Remove panfrost from default driver list
Alyssa Rosenzweig [Tue, 5 Feb 2019 02:00:12 +0000 (02:00 +0000)]
meson: Remove panfrost from default driver list

Until the kernel side matures and the full driver is upstreamed, to
avoid end-user surprises, Panfrost should only be built for the
adventurous.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agov3d: Whitespace consistency fix.
Eric Anholt [Mon, 4 Feb 2019 20:07:41 +0000 (12:07 -0800)]
v3d: Whitespace consistency fix.

5 years agov3d: Fix copy-propagation of input unpacks.
Eric Anholt [Mon, 4 Feb 2019 18:35:40 +0000 (10:35 -0800)]
v3d: Fix copy-propagation of input unpacks.

I had a single function for "does this do float input unpacking" with two
major flaws: It was missing the most common thing to try to copy propagate
a f32 input nunpack to (the VFPACK to an FP16 render target) along with
several other ALU ops, and also would try to propagate an f32 unpack into
a VFMUL which only does f16 unpacks.

instructions in affected programs: 659232 -> 655895 (-0.51%)
uniforms in affected programs: 132613 -> 135336 (2.05%)

and a couple of programs increase their thread counts.

The uniforms hit appears to be a pattern in generated code of doing (-a >=
a) comparisons, which when a is abs(b) can result in the abs instruction
being copy propagated once but not fully DCEed.

5 years agov3d: Fix input packing of .l for rounding/fdx/fdy.
Eric Anholt [Tue, 5 Feb 2019 01:15:36 +0000 (17:15 -0800)]
v3d: Fix input packing of .l for rounding/fdx/fdy.

Avoids a regression in
dEQP-GLES3.functional.shaders.derivate.fwidth.texture.* once we start
copy-propagating more input packs.

5 years agov3d: Fix pack/unpack of VFPACK operand unpacks.
Eric Anholt [Mon, 4 Feb 2019 19:18:55 +0000 (11:18 -0800)]
v3d: Fix pack/unpack of VFPACK operand unpacks.

We want to be able to copy propagate our texture unpacks into the vfpack.

5 years agov3d: Fix dumping of shaders with alpha test.
Eric Anholt [Sat, 2 Feb 2019 01:18:41 +0000 (17:18 -0800)]
v3d: Fix dumping of shaders with alpha test.

We were trying to print a NULL entry from the table.

5 years agov3d: Store the actual mask of color buffers present in the key.
Eric Anholt [Fri, 1 Feb 2019 21:13:48 +0000 (13:13 -0800)]
v3d: Store the actual mask of color buffers present in the key.

If you only bound rt 1+, we'd still emit a write to the rt0 that isn't
present (noticed while debugging an
ext_framebuffer_multisample-alpha-to-coverage-no-draw-buffer-zero
regression in another change).

5 years agov3d: Fix precompile of FRAG_RESULT_DATA1 and higher outputs.
Eric Anholt [Sat, 2 Feb 2019 00:41:56 +0000 (16:41 -0800)]
v3d: Fix precompile of FRAG_RESULT_DATA1 and higher outputs.

I was just leaving the other MRT targets than DATA0 out, by accident.

5 years agost/nir: Use src/ relative include path for autotools
Kristian H. Kristensen [Tue, 5 Feb 2019 22:13:51 +0000 (14:13 -0800)]
st/nir: Use src/ relative include path for autotools

Fixes: cdc53fa81cbeb80373eac33ef7695d9025caf14b
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
5 years agogallium: Add a PIPE_CAP_NIR_COMPACT_ARRAYS capability bit.
Kenneth Graunke [Wed, 23 Jan 2019 10:04:01 +0000 (02:04 -0800)]
gallium: Add a PIPE_CAP_NIR_COMPACT_ARRAYS capability bit.

Iris would like to use compact arrays for tesslevels and clip/cull
distances.  radeonsi will likely want to switch to these at some point,
since it'll be necessary for GL_ARB_gl_spirv support, but it's not ready
for them just yet.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agost/nir: Call nir_lower_clip_cull_distance_arrays().
Kenneth Graunke [Wed, 23 Jan 2019 10:44:28 +0000 (02:44 -0800)]
st/nir: Call nir_lower_clip_cull_distance_arrays().

Today, st always sets LowerCombinedClipCullDistance, causing the GLSL IR
lowering to run, giving us vec4[2] arrays.  I would like to disable this
and instead run the NIR lowering so that we get compact float[] arrays
instead.

Calling the new pass is a noop if the GLSL IR pass has already run, so
it's safe to call the pass unconditionally.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agonir: Avoid splitting compact arrays into per-element variables.
Kenneth Graunke [Thu, 5 Jul 2018 21:34:27 +0000 (14:34 -0700)]
nir: Avoid splitting compact arrays into per-element variables.

Compact arrays are used for special variables like clip and cull
distances, or tessellation levels.  Drivers using compact arrays
assume that these values will always be actual arrays.  We don't
want to turn a float[1] gl_CullDistance into a single float; that
would confuse drivers.

Today, i965 uses compact arrays, and Gallium drivers use
nir_lower_io_arrays_to_elements, so we haven't had any overlap
that would demonstrate the issue.  Iris will use both.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agonir: Avoid clip/cull distance lowering multiple times.
Kenneth Graunke [Wed, 23 Jan 2019 09:15:05 +0000 (01:15 -0800)]
nir: Avoid clip/cull distance lowering multiple times.

A couple places in st/nir assume that cull distances have been lowered
away, so it will need to call this lowering pass for drivers which opt
out of the GLSL IR lowering.  The Intel backend also calls this pass,
for i965 and anv.  We need to only do it once.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agonir: Bail on clip/cull distance lowering if GLSL IR already did it.
Kenneth Graunke [Wed, 23 Jan 2019 10:36:44 +0000 (02:36 -0800)]
nir: Bail on clip/cull distance lowering if GLSL IR already did it.

We have a GLSL IR pass to convert clip/cull distance float[] arrays
into vec4[2] arrays.  In ff281e6204, we attempted to skip this pass
if the GLSL IR lowering had already run.  But, that code was not quite
right, as we forgot to strip away the per-vertex IO array layer for
geometry and tessellation shader varyings.

If the GLSL IR pass has run, the variables will not be marked as
"compact".  So we can simply check that and bail.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agocompiler: Mark clip/cull distance arrays as compact before lowering.
Kenneth Graunke [Wed, 23 Jan 2019 09:55:45 +0000 (01:55 -0800)]
compiler: Mark clip/cull distance arrays as compact before lowering.

nir_lower_clip_cull_distance_arrays() marks the combined clip/cull
distance array as compact.  However, when translating in from GLSL
or SPIR-V, we were not marking the original float[] arrays as compact.

We should do so.  That way, we can detect these corner cases properly.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agonir: Record info->fs.pixel_center_integer in lower_system_values
Kenneth Graunke [Sat, 2 Feb 2019 08:43:42 +0000 (00:43 -0800)]
nir: Record info->fs.pixel_center_integer in lower_system_values

radeonsi uses a system value for gl_FragCoord rather than an input var.
These get translated into load_frag_coord NIR intrinsics, which lose the
pixel_center_integer and origin_upper_left decorations.  To cope with
this, Tim added a shader_info field for pixel_center_integer, and made
glsl_to_nir set it accordingly.

prog_to_nir also needs to handle these fragcoord conventions.  Instead
of duplicating the logic to set the info field, just move it to
nir_lower_system_values so it'll happen regardless of who makes the NIR.

(For what it's worth, we don't need an info flag for origin_upper_left,
because radeonsi lowers origin conventions in nir_lower_wpos_ytransform
before nir_lower_system_values destroys the variable and qualifiers.)

Reviewed-by: Eric Anholt <eric@anholt.net>