mesa.git
6 years agost/mesa: only define GLSL 1.4 for compat if driver supports it
Christian Gmeiner [Wed, 16 May 2018 14:02:54 +0000 (16:02 +0200)]
st/mesa: only define GLSL 1.4 for compat if driver supports it

Currently GLSL 1.4 is defined for all gallium drivers even only
GLSL 1.2 is supported as seen on etnaviv.

v1 -> v2:
 - use _min(..) as suggested by Lucas Stach and Michel Dänzer

Fixes: 4560aad780b ("mesa: add GLSLVersionCompat constant")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agovbo: remove MaxVertexAttribStride assert check.
Dave Airlie [Tue, 15 May 2018 05:44:04 +0000 (15:44 +1000)]
vbo: remove MaxVertexAttribStride assert check.

Some drivers (virgl) don't support GL4.4 or GLES3.1 yet,
so never fill in this const.

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agomesa: drop GL_EXT_polygon_offset support
Timothy Arceri [Fri, 11 May 2018 05:33:22 +0000 (15:33 +1000)]
mesa: drop GL_EXT_polygon_offset support

glPolygonOffset() has been part of the GL standard since 1.1. Also
niether AMD or Nvidia support this in their binary drivers.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61761

6 years agotgsi: fix incorrect tgsi_shader_info::num_tokens computation
Brian Paul [Thu, 17 May 2018 19:38:05 +0000 (13:38 -0600)]
tgsi: fix incorrect tgsi_shader_info::num_tokens computation

We were incrementing num_tokens in each loop iteration while parsing
the shader.  But each call to tgsi_parse_token() can consume more than
one token (and often does).  Instead, just call the tgsi_num_tokens()
function.

Luckily, this issue doesn't seem to effect any current users of this
field (llvmpipe just checks for <= 1, for example).

Reviewed-by: Neha Bhende<bhenden@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agoradv: add radv_emit_shader_pointer() helper
Samuel Pitoiset [Thu, 17 May 2018 12:08:43 +0000 (14:08 +0200)]
radv: add radv_emit_shader_pointer() helper

For future work (support for 32-bit GPU pointers).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: add some helpers for cleaning up radv_get_preamble_cs()
Samuel Pitoiset [Thu, 17 May 2018 08:11:44 +0000 (10:11 +0200)]
radv: add some helpers for cleaning up radv_get_preamble_cs()

Because this function looks a bit ugly to me.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoamd: remove support for LLVM 4.0
Marek Olšák [Thu, 17 May 2018 02:23:41 +0000 (22:23 -0400)]
amd: remove support for LLVM 4.0

It doesn't support GFX9.

Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agodocs: update calendar, add news and link release notes to 18.0.4
Juan A. Suarez Romero [Thu, 17 May 2018 18:45:26 +0000 (18:45 +0000)]
docs: update calendar, add news and link release notes to 18.0.4

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
6 years agodocs: add sha256 checksums for 18.0.4
Juan A. Suarez Romero [Thu, 17 May 2018 18:40:11 +0000 (18:40 +0000)]
docs: add sha256 checksums for 18.0.4

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 69ef6e4a75255e60a4c4a2419d03c9352b9eb8f2)

6 years agodocs: add release notes for 18.0.4
Juan A. Suarez Romero [Thu, 17 May 2018 18:14:17 +0000 (18:14 +0000)]
docs: add release notes for 18.0.4

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 3b49ab6219790c341ffb78a6eeaaa8b1a4b29bcc)

6 years agomesa: The glArrayElement api is independent of the current program.
Mathias Fröhlich [Sun, 13 May 2018 07:18:57 +0000 (09:18 +0200)]
mesa: The glArrayElement api is independent of the current program.

All the shader program dependent handling is done on the level
of the gl_Context::Array._DrawVAO/_DrawVAOEnabledAttribs.
So, skip array element invalidation on _NEW_PROGRAM.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agomesa: Flag _NEW_ARRAY only if we are changing ctx->Array.VAO.
Mathias Fröhlich [Sun, 13 May 2018 07:18:57 +0000 (09:18 +0200)]
mesa: Flag _NEW_ARRAY only if we are changing ctx->Array.VAO.

For the VAO internal helper functions that may be called
with a non current VAO, flag the _NEW_ARRAY state only
if it is the current ctx->Array.VAO.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agomesa: Remove flush_vertices argument from VAO methods.
Mathias Fröhlich [Sun, 13 May 2018 07:18:57 +0000 (09:18 +0200)]
mesa: Remove flush_vertices argument from VAO methods.

The flush_vertices argument is now unused, remove it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agomesa: Remove FLUSH_VERTICES from VAO state changes.
Mathias Fröhlich [Sun, 13 May 2018 07:18:57 +0000 (09:18 +0200)]
mesa: Remove FLUSH_VERTICES from VAO state changes.

Pending draw calls on immediate mode or display list calls do
not depend on changes of the VAO state. So, remove calls to
FLUSH_VERTICES and flag _NEW_ARRAY as appropriate.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agodocs: add 18.0.5 in the release calendar
Juan A. Suarez Romero [Mon, 14 May 2018 14:17:38 +0000 (16:17 +0200)]
docs: add 18.0.5 in the release calendar

Mesa 18.1 series has not been released yet, so let's extend 18.0 lifetime.

v2: Add missing closing TR tags (Eric Engestrom)

CC: Andres Gomez <agomez@igalia.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
6 years agoswr/rast: Added FEClipRectangles event
Alok Hota [Wed, 16 May 2018 16:14:21 +0000 (11:14 -0500)]
swr/rast: Added FEClipRectangles event

and also added some comments

Reviewed-By: George Kyriazis <george.kyriazis@intel.com>
6 years agoswr/rast: Whitespace and tab-to-spaces changes
Alok Hota [Wed, 16 May 2018 16:14:20 +0000 (11:14 -0500)]
swr/rast: Whitespace and tab-to-spaces changes

Reviewed-By: George Kyriazis <george.kyriazis@intel.com>
6 years agoswr/rast: fix VCVTPD2PS generation for AVX512
Alok Hota [Wed, 16 May 2018 16:14:19 +0000 (11:14 -0500)]
swr/rast: fix VCVTPD2PS generation for AVX512

Reviewed-By: George Kyriazis <george.kyriazis@intel.com>
6 years agoswr/rast: Rectlist support for GS
Alok Hota [Wed, 16 May 2018 16:14:18 +0000 (11:14 -0500)]
swr/rast: Rectlist support for GS

Add rectlist as an option for GS.  Needed to support some driver
optimizations.

Reviewed-By: George Kyriazis <george.kyriazis@intel.com>
6 years agoswr/rast: Remove unneeded virtual from methods
Alok Hota [Wed, 16 May 2018 16:14:17 +0000 (11:14 -0500)]
swr/rast: Remove unneeded virtual from methods

Reviewed-By: George Kyriazis <george.kyriazis@intel.com>
6 years agobroadcom/vc4: Native fence fd support
Stefan Schake [Tue, 24 Apr 2018 22:01:00 +0000 (00:01 +0200)]
broadcom/vc4: Native fence fd support

With the syncobj support in place, lets use it to implement the
EGL_ANDROID_native_fence_sync extension. This mostly follows previous
implementations in freedreno and etnaviv.

v2: Drop the flags (Eric)
    Handle in_fence_fd already in job_submit (Eric)
    Drop extra vc4_fence_context_init (Eric)
    Dup fds with CLOEXEC (Eric)
    Mention exact extension name (Eric)

Signed-off-by: Stefan Schake <stschake@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agobroadcom/vc4: Store job fence in syncobj
Stefan Schake [Tue, 24 Apr 2018 22:00:59 +0000 (00:00 +0200)]
broadcom/vc4: Store job fence in syncobj

This gives us access to the fence created for the render job.

v2: Drop flag (Eric)

Signed-off-by: Stefan Schake <stschake@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agobroadcom/vc4: Detect syncobj support
Stefan Schake [Tue, 24 Apr 2018 22:00:58 +0000 (00:00 +0200)]
broadcom/vc4: Detect syncobj support

We need to know if the kernel supports syncobj submission since otherwise
all the DRM syncobj calls fail.

v2: Use drmGetCap to detect syncobj support (Eric)

Signed-off-by: Stefan Schake <stschake@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agobroadcom/vc4: Bump libdrm requirement
Stefan Schake [Tue, 24 Apr 2018 22:00:57 +0000 (00:00 +0200)]
broadcom/vc4: Bump libdrm requirement

Require a version of libdrm with syncobj support.

v2: Don't require a libdrm_vc4, just bump core libdrm if vc4 enabled (by
    anholt)

Signed-off-by: Stefan Schake <stschake@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agodrm-uapi: Update vc4 header with syncobj submit support
Stefan Schake [Tue, 24 Apr 2018 22:00:56 +0000 (00:00 +0200)]
drm-uapi: Update vc4 header with syncobj submit support

v2: Synchronized with kernel v2
v3: Update for the finalized kernel ABI (pad2 field)

Signed-off-by: Stefan Schake <stschake@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agobroadcom/vc4: Drop libdrm_vc4 requirement
Stefan Schake [Tue, 24 Apr 2018 22:00:55 +0000 (00:00 +0200)]
broadcom/vc4: Drop libdrm_vc4 requirement

This was missed in the move back to the local uapi copy.
libdrm_vc4 only seems to consist of headers that also exist in the
Mesa tree.

Signed-off-by: Stefan Schake <stschake@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agov3d: Add support for glSampleMask / glSampleCoverage.
Eric Anholt [Tue, 8 May 2018 21:28:33 +0000 (14:28 -0700)]
v3d: Add support for glSampleMask / glSampleCoverage.

6 years agov3d: Enable NaN propagation in the VS and CS as well.
Eric Anholt [Tue, 8 May 2018 20:22:57 +0000 (13:22 -0700)]
v3d: Enable NaN propagation in the VS and CS as well.

Fixes piglit vs-isnan-*.shader_test at the expense of gl-1.0-spot-light.

6 years agoi965/blorp: Disable BLORP clear color updates
Nanley Chery [Fri, 27 Apr 2018 00:13:36 +0000 (17:13 -0700)]
i965/blorp: Disable BLORP clear color updates

With the previous patches, we now update the indirect clear color buffer
every time the clear color changes. Avoid redundant updates.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agointel/blorp: Add a NO_UPDATE_CLEAR_COLOR batch flag
Nanley Chery [Fri, 27 Apr 2018 00:09:29 +0000 (17:09 -0700)]
intel/blorp: Add a NO_UPDATE_CLEAR_COLOR batch flag

Allow callers to handle updating the indirect clear color buffer
themselves. This can reduce the number of clear color updates in the
case where a caller performs multiple fast clears with the same clear
color.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/blorp: Also skip the fast clear if the clear color differs
Nanley Chery [Tue, 27 Mar 2018 22:08:53 +0000 (15:08 -0700)]
i965/blorp: Also skip the fast clear if the clear color differs

If the aux state is CLEAR and clear color value has changed, only the
surface state must be updated. The bit-pattern in the aux buffer is
exactly the same.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/clear: Drop a stale comment in fast_clear_depth
Nanley Chery [Sun, 8 Apr 2018 21:00:30 +0000 (14:00 -0700)]
i965/clear: Drop a stale comment in fast_clear_depth

This comment made more sense when it was above the calls to
intel_miptree_slice_set_needs_depth_resolve(). We stopped using these
functions at commit 554f7d6d02931ea45653c8872565d21c1678a6da
("i965: Move depth to the new resolve functions").

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965: Update the indirect buffer in set_clear_color
Nanley Chery [Sun, 8 Apr 2018 21:00:30 +0000 (14:00 -0700)]
i965: Update the indirect buffer in set_clear_color

For depth buffers, we avoid fast-clearing if the aux_state is already
CLEAR. We do the same for color buffers only if the clear color
doesn't change. We require that the clear colors match because, in
that case, we don't update the indirect clear color outside of BLORP.

Update the indirect clear color for color buffers as well. We'll
enable the same depth buffer optimization for color buffers in a
later patch.

Note that we're now actually updating the indirect clear color twice
in the case where we use BLORP to perform the fast-clear. This is
only temporary. In later patches, we'll prevent BLORP from performing
the update.

v2: Add more context to the commit message (Topi).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
6 years agoi965/clear: Remove an early return in fast_clear_depth
Nanley Chery [Wed, 25 Apr 2018 00:16:50 +0000 (17:16 -0700)]
i965/clear: Remove an early return in fast_clear_depth

Reduce complexity and allow the next patch to delete some code. With
this change, clear operations will still be skipped and setting the
aux_state will cause no side-effects.

Remove the associated comment which implies an early return.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965: Use set_clear_color for depth miptrees
Nanley Chery [Fri, 27 Apr 2018 01:49:19 +0000 (18:49 -0700)]
i965: Use set_clear_color for depth miptrees

Reduce code duplication now and prevent it in the following commits.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoRevert "i965: Make the miptree clear color setter take a gl_color_union"
Nanley Chery [Fri, 27 Apr 2018 19:27:07 +0000 (12:27 -0700)]
Revert "i965: Make the miptree clear color setter take a gl_color_union"

This reverts commit 1d94aa19877fb702ffacacde28ad7253cce72c97.

The next patch will make depth miptrees use the clear color setter that
was originally being used for color miptrees. Go back to using the
isl_color_value parameter because it's the same type as the
fast_clear_color field used by color and depth miptrees.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Unify aux buffer allocation
Nanley Chery [Tue, 1 May 2018 00:00:32 +0000 (17:00 -0700)]
i965/miptree: Unify aux buffer allocation

There isn't much that changes between the aux allocation functions.
Remove the duplicated code.

v2: Inline the switch statement (Jason).

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965: Prepare to delete intel_miptree_alloc_ccs()
Nanley Chery [Thu, 3 May 2018 03:05:08 +0000 (20:05 -0700)]
i965: Prepare to delete intel_miptree_alloc_ccs()

We're going to delete intel_miptree_alloc_ccs() in the next commit. With
that in mind, replace the use of this function in
do_single_blorp_clear() with intel_miptree_alloc_aux() and move the
delayed allocation logic to it's callers.

v2: Duplicate the delayed allocation comment (Topi Pohjolainen).

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Drop the mt param from alloc_aux_buffer
Nanley Chery [Wed, 2 May 2018 21:30:17 +0000 (14:30 -0700)]
i965/miptree: Drop the mt param from alloc_aux_buffer

Drop an unused parameter.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Drop the alloc_flags param from alloc_aux_buffer
Nanley Chery [Wed, 2 May 2018 19:46:54 +0000 (12:46 -0700)]
i965/miptree: Drop the alloc_flags param from alloc_aux_buffer

We have enough information to determine the optimal flags internally.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Drop the name param from alloc_aux_buffer
Nanley Chery [Tue, 1 May 2018 21:35:35 +0000 (14:35 -0700)]
i965/miptree: Drop the name param from alloc_aux_buffer

A name of "aux-miptree" should be sufficient.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Initialize the indirect clear color to zero
Nanley Chery [Mon, 30 Apr 2018 18:30:32 +0000 (11:30 -0700)]
i965/miptree: Initialize the indirect clear color to zero

The indirect clear color isn't correctly tracked in
intel_miptree::fast_clear_color. The initial value of ::fast_clear_color
is zero, while that of the indirect clear color is undefined.

Topi Pohjolainen discovered this issue with MCS buffers. This issue is
apparent when fast-clearing an MCS buffer for the first time with
glClearColor = {0.0,}. Although the indirect clear color is undefined,
the initial aux state of the MCS is CLEAR and the tracked clear color is
zero, so we avoid updating the indirect clear color with {0.0,}.

Make the indirect clear color match the initial value of
::fast_clear_color.

Note: although we only have to drop HiZ's BO_ALLOC_BUSY flag for gen10+,
we also drop it pre-gen10 to keep things simple. We add this flag back
for pre-gen10 in a later patch.

v2: Add a note about dropping HiZ's BO_ALLOC_BUSY flag (Topi).

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Add and use a memset option in alloc_aux_buffer
Nanley Chery [Mon, 30 Apr 2018 17:44:01 +0000 (10:44 -0700)]
i965/miptree: Add and use a memset option in alloc_aux_buffer

Add infrastructure for initializing the clear color BO.
intel_miptree_init_mcs is no longer needed with change.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Zero-initialize CCS_D buffers
Nanley Chery [Wed, 2 May 2018 16:38:47 +0000 (09:38 -0700)]
i965/miptree: Zero-initialize CCS_D buffers

Before this patch, the aux_state was actually AUX_INVALID because the BO
was never defined. This was fine on single slice miptrees because we
would fast-clear the resource right after creation. For multi-slice
miptrees on SKL+ however, this results in undefined behavior when
accessing a non-base slice. Here's a specific example:

1) Fast clear level 0
   * Undefined CCS_D buffer allocated in "PASS_THROUGH" state.
   * Level 0 transitions to the CLEAR state.
2) Render to level 1
   * Level 1 may have a 2-bit pattern of 2's.
   * Rendering with a 2 in the CCS is undefined.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Fix handling of uninitialized MCS buffers
Nanley Chery [Mon, 30 Apr 2018 17:40:18 +0000 (10:40 -0700)]
i965/miptree: Fix handling of uninitialized MCS buffers

Before this patch, if we failed to initialize an MCS buffer, we'd
end up in a state in which the miptree thinks it has an MCS buffer,
but doesn't. We also leaked the clear_color_bo if it existed.

With this patch, we now free the miptree aux buffer resources and let
intel_miptree_alloc_mcs() know that the MCS buffer no longer exists.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoradv: only declare the ESGS rings for pre GFX9 chips
Samuel Pitoiset [Tue, 15 May 2018 20:27:28 +0000 (22:27 +0200)]
radv: only declare the ESGS rings for pre GFX9 chips

GFX9 uses LDS instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: allow to print GPU info with RADV_DEBUG=info
Samuel Pitoiset [Wed, 16 May 2018 13:52:37 +0000 (15:52 +0200)]
radv: allow to print GPU info with RADV_DEBUG=info

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: do not emit unnecessary ES output stores
Samuel Pitoiset [Wed, 16 May 2018 15:43:23 +0000 (17:43 +0200)]
radv: do not emit unnecessary ES output stores

GFX9:
Totals from affected shaders:
SGPRS: 472 -> 464 (-1.69 %)
VGPRS: 576 -> 584 (1.39 %)
Code Size: 45432 -> 44324 (-2.44 %) bytes
Max Waves: 40 -> 40 (0.00 %)

VI:
SGPRS: 720 -> 720 (0.00 %)
VGPRS: 728 -> 728 (0.00 %)
Code Size: 45348 -> 43992 (-2.99 %) bytes
Max Waves: 120 -> 120 (0.00 %)

This affects Rise of Tomb Raider and the three Vulkan demos
that use a geometry shader (geometryshader, deferredshadows
and viewportarray).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: do not emit unnecessary GS output stores
Samuel Pitoiset [Wed, 16 May 2018 15:43:22 +0000 (17:43 +0200)]
radv: do not emit unnecessary GS output stores

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: only pass the global BO list at submit time if enabled
Samuel Pitoiset [Thu, 17 May 2018 09:36:09 +0000 (11:36 +0200)]
radv: only pass the global BO list at submit time if enabled

That way the winsys might use a faster path when the global
BO list is NULL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: remove the radv_finishme() when compiling shaders
Samuel Pitoiset [Thu, 17 May 2018 07:56:48 +0000 (09:56 +0200)]
radv: remove the radv_finishme() when compiling shaders

Having an entrypoint different than "main" doesn't mean we
have multiple shaders per module.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: remove radv_device::llvm_supports_spill
Samuel Pitoiset [Thu, 17 May 2018 07:56:47 +0000 (09:56 +0200)]
radv: remove radv_device::llvm_supports_spill

It's always true.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agomesa: add glUniform*ui{v} support to display lists
Timothy Arceri [Thu, 10 May 2018 03:42:16 +0000 (13:42 +1000)]
mesa: add glUniform*ui{v} support to display lists

Fixes: a017c7ecb7ae "mesa: display list support for uint uniforms"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78097

6 years agoradeonsi: create .gitignore
Dieter Nützel [Sun, 13 May 2018 20:51:14 +0000 (22:51 +0200)]
radeonsi: create .gitignore

Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
6 years agoac/llvm: use amdgcn.tbuffer.store instead of SI.tbuffer.store intrinsic
Dave Airlie [Tue, 15 May 2018 23:36:22 +0000 (09:36 +1000)]
ac/llvm: use amdgcn.tbuffer.store instead of SI.tbuffer.store intrinsic

Drop the use of the old intrinsic.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agov3d: Fix wiring filters to NEAREST for 32-bit texture returns.
Eric Anholt [Wed, 2 May 2018 00:22:09 +0000 (17:22 -0700)]
v3d: Fix wiring filters to NEAREST for 32-bit texture returns.

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

6 years agov3d: Enable the driver by default.
Eric Anholt [Tue, 1 May 2018 19:20:11 +0000 (12:20 -0700)]
v3d: Enable the driver by default.

Now that we have a stabilized ABI and a fairly conformant driver, turn it
on.

6 years agov3d: Rename driver functions from vc5 to v3d.
Eric Anholt [Tue, 1 May 2018 19:39:31 +0000 (12:39 -0700)]
v3d: Rename driver functions from vc5 to v3d.

This is the final step of the driver rename.

6 years agov3d: Rename the driver files from "vc5" to "v3d".
Eric Anholt [Tue, 1 May 2018 19:24:48 +0000 (12:24 -0700)]
v3d: Rename the driver files from "vc5" to "v3d".

6 years agov3d: Rename the vc5_dri.so driver to v3d_dri.so.
Eric Anholt [Fri, 25 Aug 2017 22:34:22 +0000 (15:34 -0700)]
v3d: Rename the vc5_dri.so driver to v3d_dri.so.

This allows the driver to load against the merged kernel DRM driver.  In
the process, rename most of the build system variables and gallium
plumbing functions.

6 years agov3d: Switch the vc5 driver to using the finalized V3D UABI.
Eric Anholt [Tue, 1 May 2018 19:00:56 +0000 (12:00 -0700)]
v3d: Switch the vc5 driver to using the finalized V3D UABI.

In the process of merging to the kernel, I renamed the driver to the
general product line's name (since we have both vc5 and vc6 supported
already).  Since the ABI is finalized, move the header to include/drm-uapi.

6 years agosvga: fix incompatible bind flags at buffer validation time
Charmaine Lee [Fri, 11 May 2018 18:21:52 +0000 (11:21 -0700)]
svga: fix incompatible bind flags at buffer validation time

At buffer resource validation time, if the resource handle is not yet
created and if the initial buffer bind flags and the tobind flags are
incompatible, just use the tobind flags to create the resource handle.
On the other hand, if the bind flags are compatible, we can combine
the bind flags for the resource handle creation.

Fixes piglit gl-3.1-buffer-bindings crash.

Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: cast the GLenum16 to GLint to avoid compile warning on android
jenny.q.cao [Wed, 16 May 2018 07:02:00 +0000 (01:02 -0600)]
mesa: cast the GLenum16 to GLint to avoid compile warning on android

Cast the enum to GLint to avoid the compile warning:
/src/mesa/main/get.c:3005:19:
warning: comparison of constant -32768 with expression of type
'GLenum16' (aka 'unsigned short') is always false
-Wtautologicalia-constant-out-of-range-compare

Tests: compilation without this warning
Signed-off-by: jenny.q.cao <jenny.q.cao@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agoetnaviv: Fix missing rnndb file in tarballs
Stuart Young [Wed, 16 May 2018 17:01:43 +0000 (03:01 +1000)]
etnaviv: Fix missing rnndb file in tarballs

Seems that when the rnndb files for etniviv were updated/included back
in Nov 2017, hw/texdesc_3d.xml.h was missed from Makefile.sources and
meson.build. This was all during the conversion to meson, so it apears
to have slipped through the cracks. As such, this file has been missing
from the official tarballs since inclusion in Mesa, so the git trees
and tarballs differ.

Found due to lintian errors in the Debian packages.

Fixes: f1e1c60ff6 ("etnaviv: Update from rnndb")
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
6 years agogallium/hud: add frametime graph (v2)
Matthias Groß [Tue, 15 May 2018 21:09:05 +0000 (23:09 +0200)]
gallium/hud: add frametime graph (v2)

Thanks for your comment. This version has an additional boolean in the
fps_info struct to distinguish between fps and frame time calculation.
The struct is initialised in the respecting install functions for this
purpose.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
6 years agoeg/compute: Use reference counting to handle compute memory pool.
Jan Vesely [Thu, 3 May 2018 23:26:29 +0000 (19:26 -0400)]
eg/compute: Use reference counting to handle compute memory pool.

Use pipe_reference to release old RAT surfaces.
RAT surface adds a reference to pool bo, so use reference counting for pool->bo
as well.

v2: Use the same pattern for both defrag paths
    Drop confusing comment

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agogallivm: Use alloca_undef with array type instead of alloca_array
Roland Scheidegger [Tue, 15 May 2018 02:35:50 +0000 (04:35 +0200)]
gallivm: Use alloca_undef with array type instead of alloca_array

Use a single allocation of array type instead of the old-style array
allocation for the temp and immediate arrays.
Probably only makes a difference if they aren't used indirectly (so,
if we used them solely because there's too many temps or immediates).
In this case the sroa and early-cse passes can sometimes do some
optimizations which they otherwise cannot.
(As a side note, for the temp reg array, we actually really should
use one allocation per array id, not just one for everything.)
Note that the instcombine pass would actually promote such
allocations to single alloc of array type as well, but it's too late
for some artificial shaders we've seen to help (we don't want to run
instcombine at the beginning due to its cost, hence would need
another sroa/cse pass after instcombine). sroa/early-cse help there
because they can actually eliminate all of the huge shader, reducing
it to a single const output (don't ask...).
(Interestingly, instcombine also removes all the bitcasts we do on that
allocation for single-value gathering, and in the end directly indexes
into the single vector elements, which according to spec is only
semi-valid, but this happens regardless. Another thing instcombine also
does is use inbound GEPs, which is probably something we should do
manually as well - for indirectly indexed reg files llvm may not be
able to figure it out on its own, but we should be able to guarantee
all pointers are always inbound. In any case, by the looks of it
using single allocation with array type seems to be the right thing
to do even for ordinary shaders.)
No piglit change.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
6 years agoradv: add generated files to .gitignore(s)
Dieter Nützel [Sun, 13 May 2018 21:10:07 +0000 (23:10 +0200)]
radv: add generated files to .gitignore(s)

Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agospirv: fix visiting inner loops with same break/continue block
Samuel Pitoiset [Tue, 15 May 2018 10:00:30 +0000 (12:00 +0200)]
spirv: fix visiting inner loops with same break/continue block

We should stop walking through the CFG when the inner loop's
break block ends up as the same block as the outer loop's
continue block because we are already going to visit it.

This fixes the following assertion which ends up by crashing
in RADV or ANV:

SPIR-V parsing FAILED:
In file ../src/compiler/spirv/vtn_cfg.c:381
block->node.link.next == NULL
0 bytes into the SPIR-V binary

This also fixes a crash with a camera shader from SteamVR.

v2: make use of vtn_get_branch_type() and add an assertion

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106090
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106504
CC: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agomesa/st: handle vert_attrib_mask in nir case too
Rob Clark [Tue, 15 May 2018 18:29:46 +0000 (14:29 -0400)]
mesa/st: handle vert_attrib_mask in nir case too

Note, actually fixes 9987a072cb, but the problems don't show up until
19a91841c3.

Fixes: 19a91841c3 st/mesa: Use Array._DrawVAO in st_atom_array.c.
Fixes: 9987a072cb st/mesa: Make the input_to_index array available.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agocso: check count == 0 in cso_set_vertex_buffers
Marek Olšák [Tue, 15 May 2018 02:32:33 +0000 (22:32 -0400)]
cso: check count == 0 in cso_set_vertex_buffers

The code didn't expect that, leading to crashes.

Fixes: 86d63b53a20a747e "gallium: remove aux_vertex_buffer_slot code"
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
6 years agovc5: use util_copy_framebuffer_state
Rob Clark [Mon, 14 May 2018 13:09:17 +0000 (09:09 -0400)]
vc5: use util_copy_framebuffer_state

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agovc4: use util_copy_framebuffer_state
Rob Clark [Mon, 14 May 2018 13:08:43 +0000 (09:08 -0400)]
vc4: use util_copy_framebuffer_state

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agofreedreno/a5xx: remove fd5_shader_stateobj
Rob Clark [Fri, 11 May 2018 12:19:22 +0000 (08:19 -0400)]
freedreno/a5xx: remove fd5_shader_stateobj

Extra level of indirection that serves no purpose.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno/a4xx: remove fd4_shader_stateobj
Rob Clark [Fri, 11 May 2018 12:16:37 +0000 (08:16 -0400)]
freedreno/a4xx: remove fd4_shader_stateobj

Extra level of indirection that serves no purpose.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno/a3xx: remove fd3_shader_stateobj
Rob Clark [Fri, 11 May 2018 12:11:01 +0000 (08:11 -0400)]
freedreno/a3xx: remove fd3_shader_stateobj

Extra level of indirection that serves no purpose.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: fence should hold a ref to pipe
Rob Clark [Wed, 9 May 2018 11:52:53 +0000 (07:52 -0400)]
freedreno: fence should hold a ref to pipe

Since the fence can outlive the context, and all it really needs to wait
on a fence is the pipe, use the new fd_pipe reference counting to hold a
ref to the pipe and drop the ctx pointer.

This fixes a crash seen with (for example) glmark2:

  #0  fd_pipe_wait_timeout (pipe=0xbf48678b3cd7b32b, timestamp=0, timeout=18446744073709551615) at freedreno_pipe.c:101
  #1  0x0000ffffbdf75914 in fd_fence_finish (pscreen=0x561110, ctx=0x0, fence=0xc55c10, timeout=18446744073709551615) at ../src/gallium/drivers/freedreno/freedreno_fence.c:96
  #2  0x0000ffffbde154e4 in dri_flush (cPriv=0xb1ff80, dPriv=0x556660, flags=3, reason=__DRI2_THROTTLE_SWAPBUFFER) at ../src/gallium/state_trackers/dri/dri_drawable.c:569
  #3  0x0000ffffbecd8b44 in loader_dri3_flush (draw=0x558a28, flags=3, throttle_reason=__DRI2_THROTTLE_SWAPBUFFER) at ../src/loader/loader_dri3_helper.c:656
  #4  0x0000ffffbecbc36c in glx_dri3_flush_drawable (draw=0x558a28, flags=3) at ../src/glx/dri3_glx.c:132
  #5  0x0000ffffbecd91e8 in loader_dri3_swap_buffers_msc (draw=0x558a28, target_msc=0, divisor=0, remainder=0, flush_flags=3, force_copy=false) at ../src/loader/loader_dri3_helper.c:827
  #6  0x0000ffffbecbcfc4 in dri3_swap_buffers (pdraw=0x5589f0, target_msc=0, divisor=0, remainder=0, flush=1) at ../src/glx/dri3_glx.c:587
  #7  0x0000ffffbec98218 in glXSwapBuffers (dpy=0x502bb0, drawable=2097154) at ../src/glx/glxcmds.c:840
  #8  0x000000000040994c in CanvasGeneric::update (this=0xfffffffff400) at ../src/canvas-generic.cpp:114
  #9  0x0000000000411594 in MainLoop::step (this=this@entry=0x5728f0) at ../src/main-loop.cpp:108
  #10 0x0000000000409498 in do_benchmark (canvas=...) at ../src/main.cpp:117
  #11 0x00000000004071b0 in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.cpp:210

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: batch cache doesn't hold a ref to batch
Rob Clark [Tue, 8 May 2018 17:38:18 +0000 (13:38 -0400)]
freedreno: batch cache doesn't hold a ref to batch

The cache doesn't hold a (strong) reference to the batch.  So we
shouldn't be trying to drop a reference, as that leads to:

   #0  0x0000ffffbecb37a0 in raise () from /lib64/libc.so.6
   #1  0x0000ffffbeca159c in abort () from /lib64/libc.so.6
   #2  0x0000ffffbecacf48 in __assert_fail_base () from /lib64/libc.so.6
   #3  0x0000ffffbecacfa8 in __assert_fail () from /lib64/libc.so.6
   #4  0x0000ffffbd28def0 in pipe_reference_described (ptr=0x4f47130, reference=0x0, get_desc=0xffffbd2e0f08 <__fd_batch_describe>) at ../src/gallium/auxiliary/util/u_inlines.h:88
   #5  0x0000ffffbd28e188 in fd_batch_reference_locked (ptr=0x4f40de0, batch=0x0) at ../src/gallium/drivers/freedreno/freedreno_batch.h:258
   #6  0x0000ffffbd28e9a8 in fd_bc_invalidate_resource (rsc=0x4f40ca0, destroy=true) at ../src/gallium/drivers/freedreno/freedreno_batch_cache.c:244
   #7  0x0000ffffbd293778 in fd_resource_destroy (pscreen=0xedc170, prsc=0x4f40ca0) at ../src/gallium/drivers/freedreno/freedreno_resource.c:644
   #8  0x0000ffffbd922674 in u_transfer_helper_resource_destroy (pscreen=0xedc170, prsc=0x4f40ca0) at ../src/gallium/auxiliary/util/u_transfer_helper.c:144
   #9  0x0000ffffbd29527c in pipe_resource_reference (ptr=0x4f455d8, tex=0x0) at ../src/gallium/auxiliary/util/u_inlines.h:144
   #10 0x0000ffffbd29548c in fd_surface_destroy (pctx=0x1012720, psurf=0x4f455d0) at ../src/gallium/drivers/freedreno/freedreno_surface.c:78
   #11 0x0000ffffbd1f9c48 in pipe_surface_reference (ptr=0x4f471d0, surf=0x0) at ../src/gallium/auxiliary/util/u_inlines.h:113
   #12 0x0000ffffbd1f9ef4 in util_copy_framebuffer_state (dst=0x4f471c8, src=0x0) at ../src/gallium/auxiliary/util/u_framebuffer.c:114
   #13 0x0000ffffbd2e0e30 in __fd_batch_destroy (batch=0x4f47130) at ../src/gallium/drivers/freedreno/freedreno_batch.c:225
   #14 0x0000ffffbd28e1b0 in fd_batch_reference_locked (ptr=0xfffffffff010, batch=0x0) at ../src/gallium/drivers/freedreno/freedreno_batch.h:262
   #15 0x0000ffffbd28e6b0 in fd_bc_invalidate_context (ctx=0x1012720) at ../src/gallium/drivers/freedreno/freedreno_batch_cache.c:190
   #16 0x0000ffffbd2e2b6c in fd_context_destroy (pctx=0x1012720) at ../src/gallium/drivers/freedreno/freedreno_context.c:139
   #17 0x0000ffffbd2c3280 in fd5_context_destroy (pctx=0x1012720) at ../src/gallium/drivers/freedreno/a5xx/fd5_context.c:56
   #18 0x0000ffffbd5b7a8c in st_destroy_context_priv (st=0xfd72f0, destroy_pipe=true) at ../src/mesa/state_tracker/st_context.c:281

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodocs/meson: mark code/commands as <code>
Eric Engestrom [Mon, 14 May 2018 15:47:57 +0000 (16:47 +0100)]
docs/meson: mark code/commands as <code>

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agodocs/meson: replace plaintext url with a link
Eric Engestrom [Mon, 14 May 2018 15:47:18 +0000 (16:47 +0100)]
docs/meson: replace plaintext url with a link

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agodocs/meson: fix various html issues
Eric Engestrom [Mon, 14 May 2018 15:45:31 +0000 (16:45 +0100)]
docs/meson: fix various html issues

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agodocs/meson: fix various typos
Eric Engestrom [Mon, 14 May 2018 15:44:08 +0000 (16:44 +0100)]
docs/meson: fix various typos

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agomeson: fix copyright symbol
Eric Engestrom [Tue, 15 May 2018 09:29:36 +0000 (10:29 +0100)]
meson: fix copyright symbol

Fixes: bd68f1013cea8742390c "autotools, meson: add tileset.h"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agoautotools, meson: add tileset.h
Juan A. Suarez Romero [Mon, 14 May 2018 11:32:54 +0000 (13:32 +0200)]
autotools, meson: add tileset.h

Fixes: 4e52cb51b5 ("swr/rast: Thread locked tiles improvement")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agost/xa: Bump minor
Thomas Hellstrom [Thu, 8 Mar 2018 07:56:47 +0000 (08:56 +0100)]
st/xa: Bump minor

Bump xa minor to signal that the underlying mesa version is suitable for dri3.

This is a bit ugly since it doesn't relate to a specific xa interface change.
Recently there has been a number of fixes in mesa that helps enabling dri3
without any significant regressions in automated testing and common desktop
usage latency. However, the xf86-video-vmware driver has no other way to tell
but inspecting the xa version.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agovirgl: enable vertex streams when glsl level is high enough.
Dave Airlie [Mon, 21 Dec 2015 06:59:58 +0000 (16:59 +1000)]
virgl: enable vertex streams when glsl level is high enough.

This enabled the vertex streams out when the host supports
GL4.0.

6 years agoopencl: autotools: Fix linking order for OpenCL target
Kai Wasserbäch [Tue, 1 May 2018 12:14:46 +0000 (14:14 +0200)]
opencl: autotools: Fix linking order for OpenCL target

Otherwise the build fails with an undefined reference to
clang::FrontendTimesIsEnabled.

Bugzilla: https://bugs.freedesktop.org/106209
Cc: Jan Vesely <jan.vesely@rutgers.edu>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Acked-by: Jan Vesely <jan.vesely@rutgers.edu>
Tested-by: Aaron Watry <awatry@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradv: reduce the number of parameters export by the GS copy shader
Samuel Pitoiset [Mon, 14 May 2018 14:04:36 +0000 (16:04 +0200)]
radv: reduce the number of parameters export by the GS copy shader

By using the geometry shader output usage mask.

This improves all Vulkan demos that use a geometry shader
(ie. geometryshader, deferredshadows, viewportarray).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: scan the geometry shader output usage mask
Samuel Pitoiset [Mon, 14 May 2018 14:04:35 +0000 (16:04 +0200)]
radv: scan the geometry shader output usage mask

For reducing the number of parameters that are exported by
the GS copy shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: run the shader info pass before emitting the GS copy shader
Samuel Pitoiset [Mon, 14 May 2018 14:04:34 +0000 (16:04 +0200)]
radv: run the shader info pass before emitting the GS copy shader

For further optimizations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: check that layout isn't NULL in radv_nir_shader_info_pass()
Samuel Pitoiset [Mon, 14 May 2018 14:04:33 +0000 (16:04 +0200)]
radv: check that layout isn't NULL in radv_nir_shader_info_pass()

An upcoming patch will run the shader info pass on the
geometry shader just before emitting the GS copy shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agointel/blorp: Use linear formats for CCS_E clear colors in copies
Jason Ekstrand [Fri, 11 May 2018 22:02:13 +0000 (15:02 -0700)]
intel/blorp: Use linear formats for CCS_E clear colors in copies

It's clear that the original code meant to do this and there is even a
10-line comment explaining why.  Originally, we had a simple function
for packing the clear colors which was unaware of sRGB.  However, in
a6b66a7b26ae1, when we started using ISL to do the packing, the wrong
format was used.

Fixes: a6b66a7b26 "intel/blorp: Use ISL instead of bitcast_color..."
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
6 years agoradv: Disable texel buffers with A2 SNORM/SSCALED/SINT for pre-vega.
Bas Nieuwenhuizen [Sat, 12 May 2018 21:56:56 +0000 (23:56 +0200)]
radv: Disable texel buffers with A2 SNORM/SSCALED/SINT for pre-vega.

The hardware always interprets the alpha as unsigned and fixing it
in the shader is going to add unacceptable overheads.

CC: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106480
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv: Fix up 2_10_10_10 alpha sign.
Bas Nieuwenhuizen [Sat, 12 May 2018 21:50:04 +0000 (23:50 +0200)]
radv: Fix up 2_10_10_10 alpha sign.

Pre-Vega HW always interprets the alpha for this format as unsigned,
so we have to implement a fixup to do the sign correctly for signed
formats.

v2: Improve indexing mess.

CC: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106480
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv: Add support for IMG_DATA_FORMAT_32_32_32.
Bas Nieuwenhuizen [Tue, 1 May 2018 02:03:34 +0000 (04:03 +0200)]
radv: Add support for IMG_DATA_FORMAT_32_32_32.

Basic sampling support for linear tiling.

No CTS regressions, but it seems the blitting coverage is not very
extensive.

https://bugs.freedesktop.org/show_bug.cgi?id=106331
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv: Translate logic ops.
Bas Nieuwenhuizen [Mon, 14 May 2018 01:01:21 +0000 (03:01 +0200)]
radv: Translate logic ops.

radeonsi could pass them through but the enum changed between
Gallium and Vulkan, so we have to translate.

In progress I made the register defines a bit more readable.

CC: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100430
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv: Fix multiview queries.
Bas Nieuwenhuizen [Sun, 13 May 2018 20:01:44 +0000 (22:01 +0200)]
radv: Fix multiview queries.

This moves the extra queries to after the main query ended, instead
of doing it after the begin and hence doing nesting.

We also emit only (view count - 1) extra queries, as the main query
is already there for the first view.

This fixes the CTS occasionally getting stuck in
dEQP-VK.multiview.queries* waiting on results.

Fixes: 32b4f3c38dc "radv/query: handle multiview queries properly. (v3)"
CC: 18.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agomeson: remove dependency antipattern
Eric Engestrom [Tue, 8 May 2018 15:40:24 +0000 (16:40 +0100)]
meson: remove dependency antipattern

`dep_valgrind != []` now (0.45) produces a warning that is quite explicit:
  WARNING: Trying to compare values of different types (DependencyHolder, list) using !=.
  The result of this is undefined and will become a hard error in a future Meson release.

`dep_valgrind = []` used to be the recommended way to deal with
non-existant dependency, but these don't work with `.found()`, so now
the recommended way is to declare a impossible dependency, which
null_dep does for us in Mesa.

In short, we don't need and shouldn't check for `!= []` anywhere anymore.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agoradv: remove useless check in radv_create_shaders()
Samuel Pitoiset [Fri, 11 May 2018 14:36:52 +0000 (16:36 +0200)]
radv: remove useless check in radv_create_shaders()

radv_can_dump_shader() already handles if module is NULL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradv: allow to dump the GS copy shader with RADV_DEBUG="shaders"
Samuel Pitoiset [Fri, 11 May 2018 14:36:02 +0000 (16:36 +0200)]
radv: allow to dump the GS copy shader with RADV_DEBUG="shaders"

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>