mesa.git
5 years agoRevert "st/dri: simplify dri_get_egl_image by reusing dri2_format_table"
Kenneth Graunke [Wed, 31 Jul 2019 18:05:49 +0000 (11:05 -0700)]
Revert "st/dri: simplify dri_get_egl_image by reusing dri2_format_table"

This reverts commit c47af8b95f26bd83efe322ff0baa52263fb8625e.  It causes
dEQP-EGL regressions.  (I think there is an easy fix, but we'll have it
go through review again.)

5 years agopan/midgard: Don't special case inline_constant
Alyssa Rosenzweig [Tue, 30 Jul 2019 19:25:21 +0000 (12:25 -0700)]
pan/midgard: Don't special case inline_constant

Another constant source of bugs. Ain't that special.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: De-special-case branching
Alyssa Rosenzweig [Tue, 30 Jul 2019 19:20:24 +0000 (12:20 -0700)]
pan/midgard: De-special-case branching

It's not that special.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Add MALI_SAMP_NORM_COORDS flag
Alyssa Rosenzweig [Wed, 31 Jul 2019 16:08:07 +0000 (09:08 -0700)]
panfrost: Add MALI_SAMP_NORM_COORDS flag

Corresponds to the normalized coordinates? flag on images in OpenCL and
evidently also shows up in GL, so let's wire it in.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Simplify filter_mode definition
Alyssa Rosenzweig [Wed, 31 Jul 2019 15:50:02 +0000 (08:50 -0700)]
panfrost: Simplify filter_mode definition

It's just a bit field containing some flags; there's no need for all the
macro magic.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Shrink "compute FBD"
Alyssa Rosenzweig [Wed, 31 Jul 2019 14:25:24 +0000 (07:25 -0700)]
pan/midgard: Shrink "compute FBD"

We still don't know what it is, but from a newer trace we now know it's
half the size we thought it was.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Flip texture/sampler fields
Alyssa Rosenzweig [Wed, 31 Jul 2019 14:20:29 +0000 (07:20 -0700)]
panfrost: Flip texture/sampler fields

We had them backwards in both the command stream and the Midgard stack.
In OpenGL ES 2.0, they're always the same, but in Vulkan/later-GL/CL
they diverge so we can fix this.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Add MALI_ATTR_IMAGE value
Alyssa Rosenzweig [Wed, 31 Jul 2019 00:27:03 +0000 (17:27 -0700)]
panfrost: Add MALI_ATTR_IMAGE value

Images are implemented (in part) as special attributes, so include
support for decoding this.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agost/dri: simplify dri_get_egl_image by reusing dri2_format_table
Mike Blumenkrantz [Thu, 6 Jun 2019 23:47:23 +0000 (19:47 -0400)]
st/dri: simplify dri_get_egl_image by reusing dri2_format_table

this makes dri2_get_mapping_by_fourcc accessible from dri_helpers.h
and does a direct lookup on the fourcc id to match the pipe format

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agogallium: add handling for YUV planar surfaces
Mike Blumenkrantz [Wed, 29 May 2019 21:14:32 +0000 (17:14 -0400)]
gallium: add handling for YUV planar surfaces

st/dri:
this adds a table (similar to the one in i965) which provides
mappings for turning various planar formats into multiple sampler views.
whereas only NV12 and IYUV were supported, now many more formats are
supported here:
* P0XX
* YUV4XX
* YVU4XX
* AYUV
* XYUV
* YUYV
* UYVY

the table is used directly to handle image creation, simplifying
a lot of code and resolving related TODO/FIXME items where workarounds were
previously in place to manage NV12 and IYUV formats exclusively

st/mesa:
the changes here relate to setting up samplers for the planar formats.
this requires:
* checking for driver support for all the sampler formats
* creating the samplers with the corresponding formats and swizzling
* running nir_lower_tex with the appropriate options to trigger the lowering
  for each plane->sampler

fixes kwg/mesa#36

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agogallium: add AYUV and XYUV formats
Mike Blumenkrantz [Wed, 3 Jul 2019 16:14:54 +0000 (12:14 -0400)]
gallium: add AYUV and XYUV formats

this only adds the PIPE_FORMAT members, not any direct handling for them

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agopan/midgard: Simplify discard logic
Alyssa Rosenzweig [Wed, 31 Jul 2019 00:07:25 +0000 (17:07 -0700)]
pan/midgard: Simplify discard logic

The "branch offset" is, in fact, ignored.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add units for more instructions
Alyssa Rosenzweig [Tue, 30 Jul 2019 23:55:16 +0000 (16:55 -0700)]
pan/midgard: Add units for more instructions

For everything but freduce, we have some sense of what units the
instruction takes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Fix ball/bany opcode table
Alyssa Rosenzweig [Tue, 30 Jul 2019 23:46:57 +0000 (16:46 -0700)]
pan/midgard: Fix ball/bany opcode table

This were seriously messed up beyond all recognition. How we're passing
shaders.random.* is a mystery.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Document branch combination LUT
Alyssa Rosenzweig [Mon, 29 Jul 2019 16:15:32 +0000 (09:15 -0700)]
pan/midgard: Document branch combination LUT

This took way longer to figure out than it should have..

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agost/mesa: Skip scissor rect updates when scissor is entirely disabled.
Kenneth Graunke [Wed, 31 Jul 2019 01:07:17 +0000 (18:07 -0700)]
st/mesa: Skip scissor rect updates when scissor is entirely disabled.

If any scissor rectangles are enabled, then we need to set proper
scissor rectangles for all viewports.  But if the scissor test is
entirely disabled, then we can skip updating any scissor rectangles.

Without this step, we were updating the scissor rectangles based on
the current framebuffer size.  So if an app rendered to a variety of
render targets at different sizes, with scissor test disabled each
time, we'd still be continually updating the scissor rectangles,
even though it's not necessary.

In Civilization VI, this drops us from 310-350 set_scissor_state
calls per frame to 0, as it doesn't appear to use scissor testing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoegl/drm: ensure the backing gbm is set before using it
Emil Velikov [Fri, 5 Jul 2019 10:14:30 +0000 (11:14 +0100)]
egl/drm: ensure the backing gbm is set before using it

Currently, if we error out before gbm_dri is set (say due to a different
name of the backing GBM implementation, or otherwise) the tear down will
trigger a NULL ptr deref and crash out.

Move the gbm_dri initialization as early as possible.

v2: Drop check in dri2_teardowm_drm (Eric)

Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agodocs: update required meson version
Eric Engestrom [Mon, 29 Jul 2019 23:44:21 +0000 (00:44 +0100)]
docs: update required meson version

Fixes: f7b6a8d12fdc446e3251 ("meson: bump required version to 0.46")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
5 years agoradv/gfx10: implement a GE bug workaround
Samuel Pitoiset [Wed, 31 Jul 2019 07:39:23 +0000 (09:39 +0200)]
radv/gfx10: implement a GE bug workaround

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv/gfx10: remove an obsolete VGT_REUSE_OFF workaround
Samuel Pitoiset [Wed, 31 Jul 2019 07:39:22 +0000 (09:39 +0200)]
radv/gfx10: remove an obsolete VGT_REUSE_OFF workaround

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv/gfx10: disable LATE_ALLOC_GS on Navi14
Samuel Pitoiset [Wed, 31 Jul 2019 07:39:21 +0000 (09:39 +0200)]
radv/gfx10: disable LATE_ALLOC_GS on Navi14

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv/gfx10: implement a bug workaround for GE_PC_ALLOC
Samuel Pitoiset [Wed, 31 Jul 2019 07:39:20 +0000 (09:39 +0200)]
radv/gfx10: implement a bug workaround for GE_PC_ALLOC

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv/gfx10: implement a bug workaround for NGG -> legacy transitions
Samuel Pitoiset [Wed, 31 Jul 2019 07:39:19 +0000 (09:39 +0200)]
radv/gfx10: implement a bug workaround for NGG -> legacy transitions

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: skip draw calls with 0-sized index buffers
Samuel Pitoiset [Wed, 31 Jul 2019 07:39:18 +0000 (09:39 +0200)]
radv: skip draw calls with 0-sized index buffers

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoautotools: delete leftover script wrapper
Eric Engestrom [Tue, 30 Jul 2019 21:05:22 +0000 (22:05 +0100)]
autotools: delete leftover script wrapper

Randomly came across this file, which was likely only used by autotools
to pass arguments to the test.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agovirgl: make use of local variable
Eric Engestrom [Sat, 22 Jun 2019 18:40:04 +0000 (19:40 +0100)]
virgl: make use of local variable

Otherwise that variable is only used in an assert() and would need an
ASSERTED to avoid the warning.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agomesa: add an ASSERTED
Eric Engestrom [Sat, 22 Jun 2019 18:39:09 +0000 (19:39 +0100)]
mesa: add an ASSERTED

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agocompiler/nir: add an ASSERTED
Eric Engestrom [Sat, 22 Jun 2019 18:38:17 +0000 (19:38 +0100)]
compiler/nir: add an ASSERTED

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agointel: add a couple of ASSERTED
Eric Engestrom [Sat, 22 Jun 2019 18:37:53 +0000 (19:37 +0100)]
intel: add a couple of ASSERTED

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agotree-wide: replace MAYBE_UNUSED with ASSERTED
Eric Engestrom [Wed, 19 Jun 2019 11:47:19 +0000 (12:47 +0100)]
tree-wide: replace MAYBE_UNUSED with ASSERTED

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agor600: replace MAYBE_UNUSED with specific #ifdef
Eric Engestrom [Thu, 4 Jul 2019 13:28:10 +0000 (14:28 +0100)]
r600: replace MAYBE_UNUSED with specific #ifdef

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agogallium/aux: replace MAYBE_UNUSED with UNUSED
Eric Engestrom [Sat, 22 Jun 2019 17:08:08 +0000 (18:08 +0100)]
gallium/aux: replace MAYBE_UNUSED with UNUSED

MAYBE_UNUSED is going away, so let's replace legitimate uses of it with
UNUSED, which the former aliased to so far anyway.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agomesa: replace MAYBE_UNUSED with UNUSED
Eric Engestrom [Sat, 22 Jun 2019 17:05:14 +0000 (18:05 +0100)]
mesa: replace MAYBE_UNUSED with UNUSED

MAYBE_UNUSED is going away, so let's replace legitimate uses of it with
UNUSED, which the former aliased to so far anyway.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agov3d: replace MAYBE_UNUSED with UNUSED
Eric Engestrom [Sat, 22 Jun 2019 14:29:52 +0000 (15:29 +0100)]
v3d: replace MAYBE_UNUSED with UNUSED

MAYBE_UNUSED is going away, so let's replace legitimate uses of it with
UNUSED, which the former aliased to so far anyway.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agov3d: drop incorrect MAYBE_UNUSED
Eric Engestrom [Sat, 22 Jun 2019 14:29:03 +0000 (15:29 +0100)]
v3d: drop incorrect MAYBE_UNUSED

While at it, use that `screen` variable everywhere.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agost/tests: drop incorrect MAYBE_UNUSED
Eric Engestrom [Tue, 30 Jul 2019 14:11:23 +0000 (15:11 +0100)]
st/tests: drop incorrect MAYBE_UNUSED

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoradv: drop incorrect MAYBE_UNUSED
Eric Engestrom [Sat, 22 Jun 2019 14:19:12 +0000 (15:19 +0100)]
radv: drop incorrect MAYBE_UNUSED

`compressed` is clearly always used on the line right after.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agor600: move variable to proper scope
Eric Engestrom [Sat, 22 Jun 2019 14:16:23 +0000 (15:16 +0100)]
r600: move variable to proper scope

It helps show when it's actually used.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agocompiler: replace MAYBE_UNUSED with UNUSED
Eric Engestrom [Sat, 22 Jun 2019 14:21:44 +0000 (15:21 +0100)]
compiler: replace MAYBE_UNUSED with UNUSED

MAYBE_UNUSED is going away, so let's replace legitimate uses of it with
UNUSED, which the former aliased to so far anyway.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agomesa: drop MAYBE_UNUSED var
Eric Engestrom [Sat, 22 Jun 2019 17:18:40 +0000 (18:18 +0100)]
mesa: drop MAYBE_UNUSED var

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoanv: drop MAYBE_UNUSED var
Eric Engestrom [Sat, 22 Jun 2019 17:07:02 +0000 (18:07 +0100)]
anv: drop MAYBE_UNUSED var

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoi965: drop unused MAYBE_UNUSED function
Eric Engestrom [Sat, 22 Jun 2019 17:11:44 +0000 (18:11 +0100)]
i965: drop unused MAYBE_UNUSED function

Added in 1b85c605a60a80975460 but never used.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoi965: replace MAYBE_UNUSED with GEN condition
Eric Engestrom [Sat, 22 Jun 2019 17:11:04 +0000 (18:11 +0100)]
i965: replace MAYBE_UNUSED with GEN condition

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agointel: replace MAYBE_UNUSED with UNUSED
Eric Engestrom [Sat, 22 Jun 2019 12:31:53 +0000 (13:31 +0100)]
intel: replace MAYBE_UNUSED with UNUSED

MAYBE_UNUSED is going away, so let's replace legitimate uses of it with
UNUSED, which the former aliased to so far anyway.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agointel: drop incorrect MAYBE_UNUSED
Eric Engestrom [Sat, 22 Jun 2019 17:02:52 +0000 (18:02 +0100)]
intel: drop incorrect MAYBE_UNUSED

All these are actually always used.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoegl: replace MAYBE_UNUSED with UNUSED
Eric Engestrom [Sat, 22 Jun 2019 13:27:29 +0000 (14:27 +0100)]
egl: replace MAYBE_UNUSED with UNUSED

MAYBE_UNUSED is going away, so let's replace legitimate uses of it with
UNUSED, which the former aliased to so far anyway.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoradv/gfx10: add Wave32 support for compute shaders
Samuel Pitoiset [Tue, 30 Jul 2019 16:32:42 +0000 (18:32 +0200)]
radv/gfx10: add Wave32 support for compute shaders

It can be enabled with RADV_PERFTEST=cswave32.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoiris: Skip repeated depth buffer disables.
Kenneth Graunke [Wed, 31 Jul 2019 01:49:47 +0000 (18:49 -0700)]
iris: Skip repeated depth buffer disables.

Often times, the depth buffer is entirely disabled, but color render
targets change.  For example, GenerateMipmaps will change the color
render target for each miplevel, but there is no depth buffer.

In the Civilization VI benchmark, this drops the median number of
3DSTATE_DEPTH_BUFFER etc. packets emitted per frame from 472 to 34.

5 years agoradeonsi: release NIR in the right place to fix crashes
Marek Olšák [Thu, 25 Jul 2019 01:49:36 +0000 (21:49 -0400)]
radeonsi: release NIR in the right place to fix crashes

5 years agoradeonsi: fix packing of key.mono.u.ps
Marek Olšák [Thu, 25 Jul 2019 00:07:52 +0000 (20:07 -0400)]
radeonsi: fix packing of key.mono.u.ps

5 years agoac/nir: fix incorrect Phis if callbacks use control flow inside control flow
Marek Olšák [Thu, 25 Jul 2019 00:21:27 +0000 (20:21 -0400)]
ac/nir: fix incorrect Phis if callbacks use control flow inside control flow

5 years agoac/nir: handle abs modifier
Marek Olšák [Wed, 24 Jul 2019 21:44:51 +0000 (17:44 -0400)]
ac/nir: handle abs modifier

5 years agoac: fix a memory leak in the error path of ac_build_type_name_for_intr
Marek Olšák [Wed, 24 Jul 2019 21:36:25 +0000 (17:36 -0400)]
ac: fix a memory leak in the error path of ac_build_type_name_for_intr

5 years agoac: allow control flow statements in NIR callbacks
Marek Olšák [Wed, 24 Jul 2019 21:19:38 +0000 (17:19 -0400)]
ac: allow control flow statements in NIR callbacks

This fixes a crash when compiling geometry shaders on radeonsi.

5 years agoac/nir: handle negate modifier
Marek Olšák [Wed, 24 Jul 2019 03:11:40 +0000 (23:11 -0400)]
ac/nir: handle negate modifier

5 years agoradeonsi: don't use lp_build_if for the prim discard compute shader
Marek Olšák [Wed, 24 Jul 2019 00:49:27 +0000 (20:49 -0400)]
radeonsi: don't use lp_build_if for the prim discard compute shader

5 years agoradeonsi: don't use lp_build_if for the wrapping if block in the VS prolog
Marek Olšák [Wed, 24 Jul 2019 00:34:03 +0000 (20:34 -0400)]
radeonsi: don't use lp_build_if for the wrapping if block in the VS prolog

5 years agoradeonsi: don't use lp_build_if for the wrapping if block in merged shaders
Marek Olšák [Wed, 24 Jul 2019 00:34:03 +0000 (20:34 -0400)]
radeonsi: don't use lp_build_if for the wrapping if block in merged shaders

5 years agoradeonsi: don't use lp_build_if (in most common places)
Marek Olšák [Wed, 24 Jul 2019 00:41:55 +0000 (20:41 -0400)]
radeonsi: don't use lp_build_if (in most common places)

5 years agoradeonsi: don't use lp_build_alloca
Marek Olšák [Wed, 24 Jul 2019 00:41:30 +0000 (20:41 -0400)]
radeonsi: don't use lp_build_alloca

5 years agoradeonsi/nir: implement FBFETCH for KHR_blend_equation_advanced
Marek Olšák [Tue, 23 Jul 2019 23:32:50 +0000 (19:32 -0400)]
radeonsi/nir: implement FBFETCH for KHR_blend_equation_advanced

5 years agoradeonsi/nir: set input_interpolate_loc for color inputs
Marek Olšák [Tue, 23 Jul 2019 23:22:57 +0000 (19:22 -0400)]
radeonsi/nir: set input_interpolate_loc for color inputs

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
5 years agoradeonsi/nir: set tgsi_shader_info::num_memory_instructions
Marek Olšák [Tue, 23 Jul 2019 23:15:45 +0000 (19:15 -0400)]
radeonsi/nir: set tgsi_shader_info::num_memory_instructions

5 years agoradeonsi/nir: accurately set input_usage_mask for doubles (v2)
Marek Olšák [Tue, 23 Jul 2019 23:12:45 +0000 (19:12 -0400)]
radeonsi/nir: accurately set input_usage_mask for doubles (v2)

v2: fix doubles

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoradeonsi/nir: accurately set output_usagemask (v2)
Marek Olšák [Tue, 23 Jul 2019 22:55:47 +0000 (18:55 -0400)]
radeonsi/nir: accurately set output_usagemask (v2)

v2: fix doubles

5 years agoradeonsi/nir: accurately set reads_*_outputs for TCS
Marek Olšák [Tue, 23 Jul 2019 22:03:39 +0000 (18:03 -0400)]
radeonsi/nir: accurately set reads_*_outputs for TCS

5 years agoradeonsi/nir: clean up gather_intrinsic_load_deref_input_info
Marek Olšák [Tue, 23 Jul 2019 22:00:50 +0000 (18:00 -0400)]
radeonsi/nir: clean up gather_intrinsic_load_deref_input_info

5 years agoradeonsi/nir: add an option to convert TGSI to NIR
Marek Olšák [Tue, 23 Jul 2019 21:36:09 +0000 (17:36 -0400)]
radeonsi/nir: add an option to convert TGSI to NIR

Use at your own risk.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoradeonsi/nir: clean up some nir_scan_shader code
Marek Olšák [Tue, 23 Jul 2019 21:42:26 +0000 (17:42 -0400)]
radeonsi/nir: clean up some nir_scan_shader code

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoradeonsi/gfx10: disable DCC image stores
Marek Olšák [Tue, 23 Jul 2019 21:46:38 +0000 (17:46 -0400)]
radeonsi/gfx10: disable DCC image stores

Uncompressed image stores are usually faster.

Also, the driver didn't set WRITE_COMPRESS_ENABLE, so I don't know
what the hw did for image stores.

5 years agoradeonsi: adjust RB+ blend optimization settings
Marek Olšák [Tue, 23 Jul 2019 04:32:06 +0000 (00:32 -0400)]
radeonsi: adjust RB+ blend optimization settings

based on PAL

5 years agoac/surface: allow linear swizzle mode automatic selection on gfx9 & 10
Marek Olšák [Tue, 23 Jul 2019 05:55:12 +0000 (01:55 -0400)]
ac/surface: allow linear swizzle mode automatic selection on gfx9 & 10

let addrlib make the decision to get the same result as PAL.

5 years agomesa: add EXT_dsa indexed generic queries
Pierre-Eric Pelloux-Prayer [Thu, 2 May 2019 13:01:05 +0000 (15:01 +0200)]
mesa: add EXT_dsa indexed generic queries

Only GetPointerIndexedvEXT needs an implementation, the other functions are
aliases of existing functions.

5 years agomesa: add EXT_dsa indexed texture commands functions
Pierre-Eric Pelloux-Prayer [Mon, 29 Apr 2019 15:39:49 +0000 (17:39 +0200)]
mesa: add EXT_dsa indexed texture commands functions

Added functions:
  - EnableClientStateIndexedEXT
  - DisableClientStateIndexedEXT
  - EnableClientStateiEXT
  - DisableClientStateiEXT

Implemented using the idiom provided by the spec:

        if (array == TEXTURE_COORD_ARRAY) {
          int savedClientActiveTexture;

          GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture);
          ClientActiveTexture(TEXTURE0+index);
          XXX(array);
          ClientActiveTexture(savedActiveTexture);
        } else {
          // Invalid enum
        }

5 years agomesa: add EXT_dsa (Named)Framebuffer functions
Pierre-Eric Pelloux-Prayer [Mon, 29 Apr 2019 11:53:29 +0000 (13:53 +0200)]
mesa: add EXT_dsa (Named)Framebuffer functions

These functions dont support display list as specified:

    Should the selector-free versions of various OpenGL 3.0 and
    EXT_framebuffer_object framebuffer object commands not be allowed
    in display lists [...]?

    RESOLVED:  Yes

5 years agomesa: add EXT_dsa NamedBuffer functions
Pierre-Eric Pelloux-Prayer [Fri, 26 Apr 2019 16:10:44 +0000 (18:10 +0200)]
mesa: add EXT_dsa NamedBuffer functions

5 years agoi965/curbe: Look at SYSTEM_VALUE_FRAG_COORD instead of VARYING_SLOT_POS
Jason Ekstrand [Tue, 30 Jul 2019 23:07:08 +0000 (18:07 -0500)]
i965/curbe: Look at SYSTEM_VALUE_FRAG_COORD instead of VARYING_SLOT_POS

When transitioning gl_FragCoord over to a system value, we missed one
instance of VARYING_SLOT_POS in i965.  As of this commit, i965 has no
references to VARYING_SLOT_POS.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111263
Fixes: 4bb6e6817ec "intel: Use a system value for gl_FragCoord"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agointel/fs: Implement quad_swap_horizontal with a swizzle on gen7
Jason Ekstrand [Fri, 26 Jul 2019 21:03:08 +0000 (16:03 -0500)]
intel/fs: Implement quad_swap_horizontal with a swizzle on gen7

This fixes dEQP-VK.subgroups.quad.compute.subgroupquadswaphorizontal_*
on all gen7 platforms.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agointel/fs: Use ALIGN16 instructions for all derivatives on gen <= 7
Jason Ekstrand [Thu, 25 Jul 2019 23:28:44 +0000 (18:28 -0500)]
intel/fs: Use ALIGN16 instructions for all derivatives on gen <= 7

The issue here was discovered by a set of Vulkan CTS tests:

    dEQP-VK.glsl.derivate.*.dynamic_*

These tests use ballot ops to construct a branch condition that takes
the same path for each 2x2 quad but may not be uniform across the whole
subgroup.  They then tests that derivatives work and give the correct
value even when executed inside such a branch.  Because the derivative
isn't executed in uniform control-flow and the values coming into the
derivative aren't smooth (or worse, linear), they nicely catch bugs that
aren't uncovered by simpler derivative tests.

Unfortunately, these tests require Vulkan and the equivalent GL test
would require the GL_ARB_shader_ballot extension which requires int64.
Because the requirements for these tests are so high, it's not easy to
test on older hardware and the bug is only proven to exist on gen7;
gen4-6 are a conjecture.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoscons+meson: suppress spammy build warning on MacOS
Eric Engestrom [Tue, 30 Jul 2019 14:41:06 +0000 (15:41 +0100)]
scons+meson: suppress spammy build warning on MacOS

Originally introduced in c7f36574506838274460 ("darwin: Suppress type
conversion warnings for GLhandleARB") to fix Bugzilla #66346 [1], this
workaround was never ported to Scons or Meson.

[1] https://bugs.freedesktop.org/66346

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
5 years agoi965/fs: Print the scheduler mode.
Matt Turner [Mon, 17 Oct 2016 21:12:28 +0000 (14:12 -0700)]
i965/fs: Print the scheduler mode.

Line wrap some awfully long lines while we are here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
5 years agoi965/fs: Add a shader_stats struct.
Matt Turner [Mon, 17 Oct 2016 21:10:26 +0000 (14:10 -0700)]
i965/fs: Add a shader_stats struct.

It'll grow further, and we'd like to avoid adding an additional
parameter to fs_generator() for each new piece of data.

v2 (idr): Rebase on 17 months.  Track a visitor instead of a cfg.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agolima/gp: Support exp2 and log2
Connor Abbott [Sun, 21 Apr 2019 19:46:46 +0000 (21:46 +0200)]
lima/gp: Support exp2 and log2

log2 is tricky because there cannot be a move between complex1 and
postlog2. We can't guarantee that scheduling complex1 will succeed when
we schedule postlog2, so we try to schedule complex1 and if it fails we
back out by rewriting the postlog2 as a move and introducing a new
postlog2 so that we can try again later.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Acked-by: Qiang Yu <yuq825@gmail.com>
5 years agolima/gpir: Always schedule complex2 and *_impl right after complex1
Connor Abbott [Sat, 27 Jul 2019 23:13:10 +0000 (01:13 +0200)]
lima/gpir: Always schedule complex2 and *_impl right after complex1

See https://gitlab.freedesktop.org/lima/mesa/issues/94 for the gory
details of why this is needed. For *_impl this is easy, since it never
increases register pressure and it goes in the complex slot hence it
never counts against max nodes. It's a bit more challenging for
complex2, since it does count against max nodes, so we need to change
the reservation logic to reserve an extra slot for complex2 when
scheduling complex1. This second part isn't strictly necessary yet, but
it will be for exp2.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Acked-by: Qiang Yu <yuq825@gmail.com>
5 years agoradv: Fix descriptor set allocation failure.
Bas Nieuwenhuizen [Tue, 30 Jul 2019 20:23:02 +0000 (22:23 +0200)]
radv: Fix descriptor set allocation failure.

Set all the handles to VK_NULL_HANDLE:

"If the creation of any of those descriptor sets fails, then the implementation
must destroy all successfully created descriptor set objects from this command,
set all entries of the pDescriptorSets array to VK_NULL_HANDLE and return the
error."

(Vulkan 1.1.117 Spec, section 13.2)

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
5 years agoradv: fix queries with WAIT_BIT returning VK_NOT_READY
Andres Rodriguez [Sat, 27 Jul 2019 13:44:44 +0000 (09:44 -0400)]
radv: fix queries with WAIT_BIT returning VK_NOT_READY

When vkGetQueryPoolResults() is called with VK_QUERY_RESULT_WAIT_BIT
set, the driver is supposed to wait for the query to become available
before returning.

Currently, radv returns once the query is indeed ready, but it returns
VK_NOT_READY. It also fails to populate the results.

The problem is a missing volatile in the secondary check for query
availability. This patch removes the secondary check altogether since it
is redundant with the preceding loop.

This bug was found with an unreleased version of SteamVR.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agomeson: Test for program_invocation_name
Matt Turner [Mon, 29 Jul 2019 20:51:55 +0000 (13:51 -0700)]
meson: Test for program_invocation_name

program_invocation_name and program_invocation_short_name are both GNU
extensions. I don't believe one can exist without the other, so only
check for program_invocation_name.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoscons: Test for random_r()
Matt Turner [Mon, 29 Jul 2019 22:31:34 +0000 (15:31 -0700)]
scons: Test for random_r()

Suggested-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agomeson: Test for random_r()
Matt Turner [Thu, 25 Jul 2019 01:44:35 +0000 (18:44 -0700)]
meson: Test for random_r()

It's better to test for needed functions instead of using external
knowledge about presence in this or that C library.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agost/nine: Drop preprocessor guards for glibc-2.12
Matt Turner [Thu, 25 Jul 2019 01:28:38 +0000 (18:28 -0700)]
st/nine: Drop preprocessor guards for glibc-2.12

Same rationale as the previous patch, but additionally these checks just
seem entirely unnecessary. pthread_self() has been used in Mesa since at
least 1999.

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoutil: Drop preprocessor guards for glibc-2.12
Matt Turner [Thu, 25 Jul 2019 01:26:49 +0000 (18:26 -0700)]
util: Drop preprocessor guards for glibc-2.12

glibc-2.12 was released in 2010. No one is building new Mesa against 9
year old glibc, and removing these checks allows the code to work on
other C libraries like musl.

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agopan/midgard: Nothing to see here, move along folks
Alyssa Rosenzweig [Tue, 30 Jul 2019 17:49:13 +0000 (10:49 -0700)]
pan/midgard: Nothing to see here, move along folks

Fixes: dee1e18fe4f ("pan/midgard: Cleanup ops table")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agospirv: don't discard access set by vtn_pointer_dereference
Lionel Landwerlin [Fri, 26 Jul 2019 19:47:09 +0000 (22:47 +0300)]
spirv: don't discard access set by vtn_pointer_dereference

We can have a access flag already set here so just augment the
existing ones.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0fb61dfdeb ("spirv: propagate access qualifiers through ssa & pointer")
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
5 years agoiris: Enable EXT_texture_shadow_lod
Sagar Ghuge [Thu, 25 Jul 2019 21:07:36 +0000 (14:07 -0700)]
iris: Enable EXT_texture_shadow_lod

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agogallium: Add PIPE_CAP_TEXTURE_SHADOW_LOD
Sagar Ghuge [Thu, 25 Jul 2019 21:05:58 +0000 (14:05 -0700)]
gallium: Add PIPE_CAP_TEXTURE_SHADOW_LOD

v2: Line wrap to 80 char (Marek Olsak)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoi965: Enable EXT_texture_shadow_lod
Sagar Ghuge [Fri, 31 May 2019 19:56:03 +0000 (12:56 -0700)]
i965: Enable EXT_texture_shadow_lod

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoglsl: Add builtin functions for EXT_texture_shadow_lod
Paulo Zanoni [Thu, 25 Jul 2019 18:49:09 +0000 (11:49 -0700)]
glsl: Add builtin functions for EXT_texture_shadow_lod

With the help of Sagar, Ian and Ivan.

v2: Fix dependencies (Ian Romanick)

v3: 1) fix function name (Marek Olsak)
    2) Add check for extension enable (Marek Olsak)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoglsl: Allow _textureCubeArrayShadow function to accept ir_texture_opcode
Paulo Zanoni [Thu, 25 Jul 2019 17:57:43 +0000 (10:57 -0700)]
glsl: Allow _textureCubeArrayShadow function to accept ir_texture_opcode

This will be used to support one of the function from
Ext_texture_shadow_lod specification.

With the help of Sagar, Ian and Ivan.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agomesa: extension boilerplate for EXT_texture_shadow_lod
Paulo Zanoni [Mon, 18 Mar 2019 23:37:17 +0000 (16:37 -0700)]
mesa: extension boilerplate for EXT_texture_shadow_lod

With the help of Sagar, Ian and Ivan.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agopan/midgard: Cleanup ops table
Alyssa Rosenzweig [Tue, 30 Jul 2019 17:26:44 +0000 (10:26 -0700)]
pan/midgard: Cleanup ops table

Hopefully this should make a few ops make more sense. No functional
changes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>