mesa.git
5 years agoandroid: radv: build vulkan.radv conditionally to radeonsi
Mauro Rossi [Thu, 2 Aug 2018 19:07:31 +0000 (21:07 +0200)]
android: radv: build vulkan.radv conditionally to radeonsi

A problem was reported with arm,arm64 targets build due to missing
libLLVM shared library dependency with AOSP; to avoid this issue vulkan.radv
is built conditionally only when radeonsi is in BOARD_GPU_DRIVERS

Fixes: 0ca153f869 ("android: radv: enable build of vulkan.radv HAL module")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "18.2" <mesa-stable@lists.freedesktop.org>
5 years agoutil: return 0 for NaNs in float_to_ubyte
Roland Scheidegger [Fri, 3 Aug 2018 03:34:07 +0000 (05:34 +0200)]
util: return 0 for NaNs in float_to_ubyte

d3d10 requires NaNs to get converted to 0 for float->unorm conversions
(and float->int etc.). GL spec probably doesn't care in general, but it
would make sense to have reasonable behavior in any case imho - the
old code was converting negative NaNs to 0, and positive NaNs to 255.
(Note that using float comparison isn't actually all that much more
effort in any case, at least with sse2 it's just float comparison
(ucommiss) instead of int one - I converted the second comparison
to float too simply because it saves the probably somewhat expensive
transfer of the float from simd to int domain (with sse2 via stack),
so the generated code actually has 2 less instructions, although float
comparisons are more expensive than int ones.)

Reviewed-by: Brian Paul <brianp@vmware.com>
5 years agoanv/pipeline: Disable FS dispatch for pointless fragment shaders
Jason Ekstrand [Wed, 11 Jul 2018 07:03:27 +0000 (00:03 -0700)]
anv/pipeline: Disable FS dispatch for pointless fragment shaders

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agonir: add fall through comment to nir_gather_info
Timothy Arceri [Thu, 2 Aug 2018 00:04:51 +0000 (10:04 +1000)]
nir: add fall through comment to nir_gather_info

This stops Coverity reporting a defect and helps make the code less
error-prone.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agoCleanSpec.mk: Remove HOST_OUT_release
Dan Willemsen [Wed, 1 Aug 2018 23:20:38 +0000 (16:20 -0700)]
CleanSpec.mk: Remove HOST_OUT_release

This is a forward port of a patch from the AOSP/master tree:
https://android.googlesource.com/platform/external/mesa3d/+/bd633f11de0c6ac1ed333a28344c74fd9898df9e%5E%21/

Which replaces HOST_OUT_release with HOST_OUT

As per Dan's explanation, the current code was incorrect to use
$(HOST_OUT_release) as $(HOST_OUT) will be set properly for
whether the current build that's being cleaned during
incrementals is using host debug or release builds.

Additionally Dan noted it was incredibly uncommon to use a debug
host build, as there was never a shortcut and one had to set an
environment variable manually. Thus it was rarely if ever tested.

Change-Id: I7972c0a50fa3520dcfa962d6dd7e602bfe22368d
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
5 years agoAndroid.common.mk: define HAVE_TIMESPEC_GET
Sumit Semwal [Wed, 1 Aug 2018 23:20:37 +0000 (16:20 -0700)]
Android.common.mk: define HAVE_TIMESPEC_GET

This is a forward port of a patch from the AOSP/master tree:
https://android.googlesource.com/platform/external/mesa3d/+/bd30b663f55f8af73a0be4446349c5a2d4c641b0%5E%21/

Since https://android-review.googlesource.com/c/718518 added
timespec_get() to bionic, mesa3d doesn't build due to redefinition
of timespec_get().

Avoid redefinition by defining HAVE_TIMESPEC_GET flag.

Test: build and boot tested db820c to UI.

Change-Id: I3dcc8034b48785e45cd3fa50e4d9cf2c684694a0
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
5 years agoutil: Android.mk: Convert implicit rules to static pattern rules
Dan Willemsen [Wed, 1 Aug 2018 23:20:36 +0000 (16:20 -0700)]
util: Android.mk: Convert implicit rules to static pattern rules

This is a partial cherry-pick from AOSP's mesa3d tree:
 https://android.googlesource.com/platform/external/mesa3d/+/a88dcf769eb00a4ffc7183a0396d881a28b5a29b%5E%21/

"We're deprecating make implicit rules, preferring static pattern
rules, or just regular rules."

Without this patch, the freedesktop/master branch won't build in
the AOSP environment, and this patch corrects that, as tested
on the Dragonboard 820c.

The i965 portion of the patch this is based on collided badly,
and I'm not sure how to best forward port it. However, so far
we don't see build issues without that portion.

Comments or feedback would be appreciated!

Change-Id: Id6dfd0d018cbd665fa19d80c14abd5f75fa10b8a
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
5 years agoradeonsi: add new R600_DEBUG test "testclearbufperf"
Darren Powell [Wed, 13 Jun 2018 22:54:24 +0000 (18:54 -0400)]
radeonsi: add new R600_DEBUG test "testclearbufperf"

Signed-off-by: Darren Powell <darren.powell@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa: add switch case for GL 2.0 in _mesa_compute_version()
Brian Paul [Thu, 2 Aug 2018 15:32:58 +0000 (09:32 -0600)]
mesa: add switch case for GL 2.0 in _mesa_compute_version()

Previously, I added a switch case for GL 2.1 (ed7a0770b881791dd697f3).
I don't know of any driver which only supports GL 2.0, but adding
this switch case avoids a failure if the app queries
GL_SHADING_LANGUAGE_VERSION.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
5 years agointel/tools: add error2aub creation into autotools
Andres Gomez [Thu, 2 Aug 2018 16:39:06 +0000 (19:39 +0300)]
intel/tools: add error2aub creation into autotools

Tarball distribution is done through "make distcheck". We include the
meson targets also into autotools so they won't fail when building
from the tarball.

Fixes: 6a60beba408 ("intel/tools: Add an error state to aub translator")
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Dylan Baker <dylan.c.baker@intel.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agoanv/pipeline: Do cross-stage linking optimizations
Jason Ekstrand [Sat, 28 Oct 2017 00:07:52 +0000 (17:07 -0700)]
anv/pipeline: Do cross-stage linking optimizations

This appears to help the Aztec Ruins benchmark by about 2% on my Kaby
Lake gt2 laptop.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Pull most of the anv_pipeline_compile_* into common code
Jason Ekstrand [Fri, 27 Oct 2017 23:54:32 +0000 (16:54 -0700)]
anv/pipeline: Pull most of the anv_pipeline_compile_* into common code

This leaves us with a series of little anv_pipeline_compile_* functions
which each take a compiler object, a mem_ctx, the stage to compile, and
the previous stage for VUE linking purposes.  Some of them do
interesting things but most are little more than wrappers around
brw_compile_*.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Add a separate "link" stage
Jason Ekstrand [Fri, 27 Oct 2017 23:03:58 +0000 (16:03 -0700)]
anv/pipeline: Add a separate "link" stage

This breaks compilation up a bit into "link" and "compile".  In the
"link" stage, new anv_pipeline_link_* helpers are called which are
responsible for setting up the binding table and doing anything needed
to properly link with the next stage in the pipeline if one exists.
They are called in reverse order starting with the fragment shader so
you can assume linking in later stages is already done.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Compile to NIR in compile_graphics
Jason Ekstrand [Fri, 27 Oct 2017 22:47:11 +0000 (15:47 -0700)]
anv/pipeline: Compile to NIR in compile_graphics

This pulls the SPIR-V to NIR step out into common code.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Recompile all shaders if any are missing from the cache
Jason Ekstrand [Fri, 27 Oct 2017 22:05:02 +0000 (15:05 -0700)]
anv/pipeline: Recompile all shaders if any are missing from the cache

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Drop anv_pipeline_add_compiled_stage
Jason Ekstrand [Fri, 27 Oct 2017 21:47:38 +0000 (14:47 -0700)]
anv/pipeline: Drop anv_pipeline_add_compiled_stage

We can set active_stages much more directly and then it's just candy
around setting pipeline->stages[stage].

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Pull shader compilation out into a helper.
Jason Ekstrand [Fri, 27 Oct 2017 17:18:31 +0000 (10:18 -0700)]
anv/pipeline: Pull shader compilation out into a helper.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Call anv_pipeline_compile_* in a loop
Jason Ekstrand [Fri, 27 Oct 2017 17:13:38 +0000 (10:13 -0700)]
anv/pipeline: Call anv_pipeline_compile_* in a loop

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Hash the entire pipeline in one go
Jason Ekstrand [Fri, 27 Oct 2017 02:24:28 +0000 (19:24 -0700)]
anv/pipeline: Hash the entire pipeline in one go

Instead of hashing each stage separately (and TES and TCS together), we
hash the entire pipeline.  This means we'll get fewer cache hits if
they, for instance, re-use the same VS over and over again but it also
means we can now safely do cross-stage optimizations.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Populate keys up-front
Jason Ekstrand [Fri, 27 Oct 2017 01:59:33 +0000 (18:59 -0700)]
anv/pipeline: Populate keys up-front

Instead of having each anv_pipeline_compile_* function populate the
shader key, make it part of the anv_pipeline_stage struct and fill it
out up-front.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipline: Add a helper struct for per-stage info
Jason Ekstrand [Fri, 27 Oct 2017 01:42:35 +0000 (18:42 -0700)]
anv/pipline: Add a helper struct for per-stage info

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agomeson: use correct keyword to fix a meson warning
Jon Turney [Thu, 2 Aug 2018 13:50:27 +0000 (14:50 +0100)]
meson: use correct keyword to fix a meson warning

With a sufficently recent meson, the following warning is produced:

WARNING: Passed invalid keyword argument "extra_args".
WARNING: This will become a hard error in the future.

It seems that compiler.links(args:) is meant here.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-and-Tested-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agodocs: add 18.3.0-devel release notes template
Andres Gomez [Thu, 2 Aug 2018 15:15:33 +0000 (18:15 +0300)]
docs: add 18.3.0-devel release notes template

Signed-off-by: Andres Gomez <agomez@igalia.com>
5 years agomesa: bump version to 18.3.0-devel
Andres Gomez [Thu, 2 Aug 2018 15:00:01 +0000 (18:00 +0300)]
mesa: bump version to 18.3.0-devel

Signed-off-by: Andres Gomez <agomez@igalia.com>
5 years agoegl/main: fix indentation
Eric Engestrom [Thu, 2 Aug 2018 10:56:13 +0000 (11:56 +0100)]
egl/main: fix indentation

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
5 years agoloader: fix indentation
Eric Engestrom [Thu, 2 Aug 2018 10:49:40 +0000 (11:49 +0100)]
loader: fix indentation

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
5 years agoswr: Remove unnecessary memset call
Vlad Golovkin [Wed, 1 Aug 2018 17:56:23 +0000 (20:56 +0300)]
swr: Remove unnecessary memset call

Zeroing memory after calloc is not necessary. This also allows to avoid
possible crash when allocation fails, because memset is called before
checking screen for NULL.

Fixes: a29d63ecf71546c4798c6 "swr: refactor swr_create_screen to allow
                              for proper cleanup on error"
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agomesa: replace binary constants with hexadecimal constants
Andres Gomez [Wed, 1 Aug 2018 14:16:24 +0000 (17:16 +0300)]
mesa: replace binary constants with hexadecimal constants

The binary constant notation "0b" is a GCC extension. Instead, we use
hexadecimal notation to fix the MSVC 2013 build:

Compiling src\mesa\main\texcompress_astc.cpp ...
texcompress_astc.cpp
src\mesa\main\texcompress_astc.cpp(111) : error C2059: syntax error : 'bad suffix on number'

...

src\mesa\main\texcompress_astc.cpp(1007) : fatal error C1003: error count exceeds 100; stopping compilation
scons: *** [build\windows-x86-debug\mesa\main\texcompress_astc.obj] Error 2
scons: building terminated because of errors.

v2: Fix wrong conversion (Ilia).

Fixes: 38ab39f6501 ("mesa: add ASTC 2D LDR decoder")
Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Roland Scheidegger <sroland@vmware.com>
Cc: Mike Lothian <mike@fireburn.co.uk>
Cc: Gert Wollny <gert.wollny@collabora.com>
Cc: Dieter Nützel <Dieter@nuetzel-hh.de>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoddebug: use util_snprintf() in dd_get_debug_filename_and_mkdir
Andres Gomez [Wed, 1 Aug 2018 13:26:48 +0000 (16:26 +0300)]
ddebug: use util_snprintf() in dd_get_debug_filename_and_mkdir

Instead of plain snprintf(). To fix the MSVC 2013 build:

  Compiling src\gallium\auxiliary\driver_ddebug\dd_draw.c ...
dd_draw.c
c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(60) : warning C4013: 'snprintf' undefined; assuming extern returning int

...

gallium.lib(dd_draw.obj) : error LNK2001: unresolved external symbol _snprintf
build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll : fatal error LNK1120: 1 unresolved externals
scons: *** [build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll] Error 1120
scons: building terminated because of errors.

Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to improve build times")
Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Roland Scheidegger <sroland@vmware.com>
Cc: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agokutil/queue: use util_snprintf() in util_queue_init
Andres Gomez [Wed, 1 Aug 2018 12:55:51 +0000 (15:55 +0300)]
kutil/queue: use util_snprintf() in util_queue_init

Instead of plain snprintf(). To fix the MSVC 2013 build:

  Compiling src\util\u_queue.c ...
u_queue.c
src\util\u_queue.c(325) : warning C4013: 'snprintf' undefined; assuming extern returning int

...

mesautil.lib(u_queue.obj) : error LNK2001: unresolved external symbol _snprintf
scons: building terminated because of errors.

Fixes: b238e33bc9d ("kutil/queue: add a process name into a thread name")
Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Roland Scheidegger <sroland@vmware.com>
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Cc: Eric Engestrom <eric.engestrom@intel.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
5 years agogallium/aux/util: use util_snprintf() in test_texture_barrier
Andres Gomez [Wed, 1 Aug 2018 12:47:13 +0000 (15:47 +0300)]
gallium/aux/util: use util_snprintf() in test_texture_barrier

Instead of plain snprintf(). To fix the MSVC 2013 build:

  Compiling src\gallium\auxiliary\util\u_tests.c ...
u_tests.c
src\gallium\auxiliary\util\u_tests.c(624) : warning C4013: 'snprintf' undefined; assuming extern returning int

...

gallium.lib(u_tests.obj) : error LNK2019: unresolved external symbol _snprintf referenced in function _test_texture_barrier
build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll : fatal error LNK1120: 1 unresolved externals
scons: *** [build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll] Error 1120
scons: building terminated because of errors.

Fixes: 56342c97ee7 ("gallium/u_tests: test FBFETCH and shader-based blending with MSAA")
Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Roland Scheidegger <sroland@vmware.com>
Cc: Dieter Nützel <Dieter@nuetzel-hh.de>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
5 years agoglsl: use util_snprintf()
Andres Gomez [Wed, 1 Aug 2018 10:22:00 +0000 (13:22 +0300)]
glsl: use util_snprintf()

Instead of plain snprintf(). To fix the MSVC 2013 build.

Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to improve build times")
Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
5 years agointel/compiler: Add brw_get_compiler_config_value for disk cache
Jordan Justen [Wed, 25 Jul 2018 21:31:05 +0000 (14:31 -0700)]
intel/compiler: Add brw_get_compiler_config_value for disk cache

During code review, Jason pointed out that:

2b3064c0731 "i965, anv: Use INTEL_DEBUG for disk_cache driver flags"

Didn't account for INTEL_SCALER_* environment variables.

To fix this, let the compiler return the disk_cache driver flags.

Another possible fix would be to pull the INTEL_SCALER_* into
INTEL_DEBUG bits, but as we are currently using 41 of 64 bits, I
didn't think it was a good use of 4 more of these bits. (5 since
INTEL_PRECISE_TRIG needs to be accounted for as well.)

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoi965: Disable shader cache with INTEL_DEBUG=shader_time
Jordan Justen [Wed, 25 Jul 2018 00:13:52 +0000 (17:13 -0700)]
i965: Disable shader cache with INTEL_DEBUG=shader_time

Shader time hard codes an index of the shader time buffer within the
gen program.

In order to support shader time in the disk shader cache, we'd need to
add the shader time index into the program key. This should work, but
probably is not worth it for this particular debug feature.

Therefore, let's just disable the disk shader cache if the shader time
debug feature is used.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106382
Fixes: 96fe36f7acc "i965: Enable disk shader cache by default"
Cc: Eero Tamminen <eero.t.tamminen@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoglsl: make a copy of array indices that are used to deref a function out param
Timothy Arceri [Sat, 21 Jul 2018 05:22:24 +0000 (15:22 +1000)]
glsl: make a copy of array indices that are used to deref a function out param

Fixes new piglit test:
tests/spec/glsl-1.20/execution/qualifiers/vs-out-conversion-int-to-float-vec4-index.shader_test

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
5 years agoanv/pipeline: Add populate_tcs/tes_key helpers
Jason Ekstrand [Fri, 27 Oct 2017 01:11:25 +0000 (18:11 -0700)]
anv/pipeline: Add populate_tcs/tes_key helpers

They don't really do anything interesting, but it's more consistent this
way.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Rework the parameters to populate_wm_prog_key
Jason Ekstrand [Fri, 27 Oct 2017 00:56:07 +0000 (17:56 -0700)]
anv/pipeline: Rework the parameters to populate_wm_prog_key

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: More aggressively optimize away color attachments
Jason Ekstrand [Wed, 11 Jul 2018 06:31:47 +0000 (23:31 -0700)]
anv/pipeline: More aggressively optimize away color attachments

Instead of just looking at the number of color attachments, look at
which ones are actually used by the subpass.  This lets us potentially
throw away chunks of the fragment shader.  In DXVK, for example, all
subpasses have 8 attachments and most are VK_ATTACHMENT_UNUSED so this
is very helpful in that case.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv: Restrict the number of color regions to those actually written
Jason Ekstrand [Thu, 28 Jun 2018 01:30:09 +0000 (18:30 -0700)]
anv: Restrict the number of color regions to those actually written

The back-end compiler emits the number of color writes specified by
wm_prog_key::nr_color_regions regardless of what nir_store_outputs we
have.  Once we've gone through and figured out which render targets
actually exist and are written by the shader, we should restrict the key
to avoid extra RT write messages.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoanv/pipeline: Fix up deref modes if we delete a FS output
Jason Ekstrand [Thu, 28 Jun 2018 01:25:17 +0000 (18:25 -0700)]
anv/pipeline: Fix up deref modes if we delete a FS output

With the new deref instructions, we have to keep the modes consistent
between the derefs and the variables they reference.  Since we remove
outputs by changing them to local variables, we need to run the fixup
pass to fix the modes.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agonir/lower_indirect: Bail early if modes == 0
Jason Ekstrand [Sat, 28 Oct 2017 16:05:01 +0000 (09:05 -0700)]
nir/lower_indirect: Bail early if modes == 0

There's no point in walking the program if we're never going to actually
lower anything.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agointel/nir: Call nir_lower_io_to_scalar_early
Jason Ekstrand [Tue, 31 Jul 2018 13:16:34 +0000 (06:16 -0700)]
intel/nir: Call nir_lower_io_to_scalar_early

Shader-db results on Kaby Lake:

    total instructions in shared programs: 15166953 -> 15073611 (-0.62%)
    instructions in affected programs: 2390284 -> 2296942 (-3.91%)
    helped: 16469
    HURT: 505

    total loops in shared programs: 4954 -> 4951 (-0.06%)
    loops in affected programs: 3 -> 0
    helped: 3
    HURT: 0

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agointel/nir: Split IO arrays into elements
Jason Ekstrand [Thu, 26 Jul 2018 05:52:39 +0000 (22:52 -0700)]
intel/nir: Split IO arrays into elements

The NIR nir_lower_io_arrays_to_elements pass attempts to split I/O
variables which are arrays or matrices into a sequence of separate
variables.  This can help link-time optimization by allowing us to
remove varyings at a more granular level.

Shader-db results on Kaby Lake:

    total instructions in shared programs: 15177645 -> 15168494 (-0.06%)
    instructions in affected programs: 79857 -> 70706 (-11.46%)
    helped: 392
    HURT: 0

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoi965/fs: Flag all slots of a flat input as flat
Jason Ekstrand [Tue, 31 Jul 2018 12:31:47 +0000 (05:31 -0700)]
i965/fs: Flag all slots of a flat input as flat

Otherwise, only the first vec4 of a matrix or other complex type will
get marked as flat and we'll interpolate the others.  This was caught by
a dEQP test which started failing because it did a SSO vs. non-SSO
comparison.  Previously, we did the interpolation wrong consistently in
both versions.  However, with one of Tim Arceri's NIR linkingpatches, we
started splitting the matrix input into vectors at link time in the
non-SSO version and it started getting correctly interpolated which
didn't match the broken SSO version.  As of this commit, they both get
correctly interpolated.

Fixes: e61cc87c757f8bc "i965/fs: Add a flat_inputs field to prog_data"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agointel/nir: Use the correct scalar stage for consumers when linking
Jason Ekstrand [Tue, 31 Jul 2018 18:31:22 +0000 (11:31 -0700)]
intel/nir: Use the correct scalar stage for consumers when linking

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agodocs: update 18.2.0 release notes for virgl
Dave Airlie [Wed, 1 Aug 2018 22:43:56 +0000 (08:43 +1000)]
docs: update 18.2.0 release notes for virgl

5 years agonir/meson: fix c vs cpp args for nir test
Dylan Baker [Tue, 22 May 2018 22:34:38 +0000 (15:34 -0700)]
nir/meson: fix c vs cpp args for nir test

Fixes: d1992255bb29054fa51763376d125183a9f602f3
       ("meson: Add build Intel "anv" vulkan driver")
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogallium: fix ddebug on windows
Dylan Baker [Wed, 18 Apr 2018 17:21:14 +0000 (10:21 -0700)]
gallium: fix ddebug on windows

By including the proper headers for getpid and for mkdir.

Fixes: 6ff0c6f4ebcb87ea6c6fe5a4ba90b548f666067d
       ("gallium: move ddebug, noop, rbug, trace to auxiliary to improve build times")
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoutil: move process.[ch] to u_process.[ch]
Dylan Baker [Tue, 10 Jul 2018 22:00:13 +0000 (15:00 -0700)]
util: move process.[ch] to u_process.[ch]

On windows process.h is a system provided header, and it's required in
include/c11/threads_win32.h. This header interferes with searching for
that header, and results in windows build warnings with scons, but
errors in meson which doesn't allow implicit function declarations. Just
rename process to u_process, which follows the style of utils anyway.

Fixes: 2e1e6511f76370870b5cde10caa9ca3b6d0dc65f
       ("util: extract get_process_name from xmlconfig.c")
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoac,radeonsi: reduce optimizations for complex compute shaders on older APUs (v2)
Marek Olšák [Fri, 20 Jul 2018 02:55:49 +0000 (22:55 -0400)]
ac,radeonsi: reduce optimizations for complex compute shaders on older APUs (v2)

To make dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.23
finish sooner on the older CPUs. (otherwise it gets killed and we fail
the test)

Acked-by: Dave Airlie <airlied@gmail.com>
5 years agov3d: Actually put the "%s" in the snprintf.
Eric Anholt [Wed, 1 Aug 2018 18:25:58 +0000 (11:25 -0700)]
v3d: Actually put the "%s" in the snprintf.

I missed an important part when porting the change over, fixing my
compiler warning but breaking -Werror=format-security.

Fixes: e6ff5ac4468e ("v3d: use snprintf(..., "%s", ...) instead of strncpy")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107443

5 years agovc4: Fix automake linking error.
Juan A. Suarez Romero [Tue, 31 Jul 2018 12:17:23 +0000 (14:17 +0200)]
vc4: Fix automake linking error.

  CXXLD    gallium_dri.la
../../../../src/gallium/drivers/vc4/.libs/libvc4.a(vc4_cl_dump.o): In function `vc4_dump_cl':
src/gallium/drivers/vc4/vc4_cl_dump.c:45: undefined reference to `clif_dump_init'
src/gallium/drivers/vc4/vc4_cl_dump.c:82: undefined reference to `clif_dump_destroy'
../../../../src/broadcom/cle/.libs/libbroadcom_cle.a(cle_libbroadcom_cle_la-v3d_decoder.o): In function `v3d_field_iterator_next':
src/broadcom/cle/v3d_decoder.c:902: undefined reference to `clif_lookup_bo'

Fixes: e92959c4e0 ("v3d: Pass the whole clif_dump structure to v3d_print_group().")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107423
CC: Eric Anholt <eric@anholt.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Andres Gomez <agomez@igalia.com>
5 years agoscons: require scons 2.4 or greater
Juan A. Suarez Romero [Wed, 1 Aug 2018 15:48:11 +0000 (17:48 +0200)]
scons: require scons 2.4 or greater

There is a bug with scons 2.3, used in Travis, where it fails to detect
some C functions.

Reviewed-by: Andres Gomez <agomez@igalia.com>
5 years agotravis: install scons from pip
Juan A. Suarez Romero [Wed, 1 Aug 2018 15:14:56 +0000 (17:14 +0200)]
travis: install scons from pip

The ubuntu version provided by Travis is a bit old, and does not detect
correctly some C functions.

Use a more modern version through scons.

Reviewed-by: Andres Gomez <agomez@igalia.com>
5 years agodocs: mark ARB_ES3_2_compatibility as done for radeonsi
Marek Olšák [Wed, 1 Aug 2018 15:36:18 +0000 (11:36 -0400)]
docs: mark ARB_ES3_2_compatibility as done for radeonsi

5 years agointel: tools: aubwrite: split gen[89] from gen10+
Lionel Landwerlin [Sat, 28 Jul 2018 12:52:44 +0000 (13:52 +0100)]
intel: tools: aubwrite: split gen[89] from gen10+

Gen10+ has an additional bit in MI_BATCH_BUFFER_END to signal the end
of the context image.

We select the largest size for the context image regardless of the
generation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agopython: Use the unicode_escape codec
Mathieu Bridon [Thu, 7 Jun 2018 10:26:20 +0000 (12:26 +0200)]
python: Use the unicode_escape codec

Python 2 had string_escape and unicode_escape codecs. Python 3 only has
the latter. These work the same as far as we're concerned, so let's use
the future-proof one.

However, the reste of the code expects unicode strings, so we need to
decode them again.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agopython: Explicitly add the 'L' suffix on Python 3
Mathieu Bridon [Mon, 25 Jun 2018 16:31:01 +0000 (18:31 +0200)]
python: Explicitly add the 'L' suffix on Python 3

Python 2 had two integer types: int and long. Python 3 dropped the
latter, as it made the int type automatically support bigger numbers.

As a result, Python 3 lost the 'L' suffix on integer litterals.

This probably doesn't make much difference when compiling the generated
C code, but adding it explicitly means that both Python 2 and 3 generate
the exact same C code anyway, which makes it easier to compare and check
for discrepencies when moving to Python 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agopython: Explicitly use byte strings
Mathieu Bridon [Sun, 17 Jun 2018 12:40:31 +0000 (14:40 +0200)]
python: Explicitly use byte strings

In both Python 2 and 3, zlib.Compress.compress() takes a byte string,
and returns a byte string as well.

In Python 2, the script was working because:

1. string literalls were byte strings;
2. opening a file in unicode mode, reading from it, then passing the
   unicode string to compress() would automatically encode to a byte
   string;

On Python 3, the above two points are not valid any more, so:

1. zlib.Compress.compress() refuses the passed unicode string;
2. compressed_data, defined as an empty unicode string literal, can't be
   concatenated with the byte string returned by compress();

This commit fixes this by explicitly using byte strings where
appropriate, so that the script works on both Python 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agopython: Use open(), not file()
Mathieu Bridon [Fri, 1 Jun 2018 13:02:21 +0000 (15:02 +0200)]
python: Use open(), not file()

The latter is a constructor for file objects, but when actually opening
a file, using the former is more idiomatic.

In addition, file() is not a builtin any more in Python 3, so this makes
the script compatible with both Python 2 and Python 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agopython: Open file in binary mode
Mathieu Bridon [Tue, 26 Jun 2018 06:52:08 +0000 (08:52 +0200)]
python: Open file in binary mode

The XML parser wants byte strings, not unicode strings.

In both Python 2 and 3, opening a file without specifying the mode will
open it for reading in text mode ('r').

On Python 2, the read() method of the file object will return byte
strings, while on Python 3 it will return unicode strings.

Explicitly specifying the binary mode ('rb') makes the behaviour
identical in both Python 2 and 3, returning what the XML parser
expects.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agopython: Don't abuse hex()
Mathieu Bridon [Sun, 17 Jun 2018 15:53:16 +0000 (17:53 +0200)]
python: Don't abuse hex()

The hex() builtin returns a string containing the hexa-decimal
representation of an integer.

When the argument is not an integer, then the function calls that
object's __hex__() method, if one is defined. That method is supposed to
return a string.

While that's not explicitly documented, that string is supposed to be a
valid hexa-decimal representation for a number. Python 2 doesn't enforce
this though, which is why we got away with returning things like
'NIR_TRUE' which are not numbers.

In Python 3, the hex() builtin instead calls an object's __index__()
method, which itself must return an integer. That integer is then
automatically converted to a string with its hexa-decimal representation
by the rest of the hex() function.

As a result, we really can't make this compatible with Python 3 as it
is.

The solution is to stop using the hex() builtin, and instead use a hex()
object method, which can return whatever we want, in Python 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agopython: Better get character ordinals
Mathieu Bridon [Sun, 17 Jun 2018 12:44:46 +0000 (14:44 +0200)]
python: Better get character ordinals

In Python 2, iterating over a byte-string yields single-byte strings,
and we can pass them to ord() to get the corresponding integer.

In Python 3, iterating over a byte-string directly yields those
integers.

Transforming the byte string into a bytearray gives us a list of the
integers corresponding to each byte in the string, removing the need to
call ord().

This makes the script compatible with both Python 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoloader_dri3: Handle mismatched depth 30 formats for Prime renderoffload.
Mario Kleiner [Thu, 14 Jun 2018 04:04:24 +0000 (06:04 +0200)]
loader_dri3: Handle mismatched depth 30 formats for Prime renderoffload.

Detect if the display (X-Server) gpu and Prime renderoffload gpu prefer
different channel ordering for color depth 30 formats ([X/A]BGR2101010
vs. [X/A]RGB2101010) and perform format conversion during the blitImage()
detiling op from tiled backbuffer -> linear buffer.

For this we need to find the visual (= red channel mask) for the
X-Drawable used to display on the server gpu. We use the same proven
logic for finding that visual as in commit "egl/x11: Handle both depth
30 formats for eglCreateImage()".

This is mostly to allow "NVidia Optimus" at depth 30, as Intel/AMD
gpu's prefer xRGB2101010 ordering, whereas NVidia gpu's prefer
xBGR2101010 ordering, so we can offload to nouveau without getting
funky colors.

Tested on Intel single gpu, NVidia single gpu, Intel + NVidia prime
offload with DRI3/Present.

Note: An unintended but pleasant surprise of this patch is that it also
seems to make the modesetting-ddx of server 1.20.0 work at depth 30
on nouveau, at least with unredirected "classic" X rendering, and
with redirected desktop compositing under XRender accel, and with OpenGL
compositing under GLX. Only X11 compositing via OpenGL + EGL still gives
funky colors. modesetting-ddx + glamor are not yet ready to deal with
nouveau's ABGR2101010 format, and treat it as ARGB2101010, also exposing
X-visuals with ARGB2101010 style channel masks. Seems somehow this triggers
the logic in this patch on modesetting-ddx + depth 30 + DRI3 buffer sharing
and does the "wrong" channel swizzling that then cancels out the "wrong"
swizzling of glamor and we end up with the proper pixel formatting in
the scanout buffer :). This so far tested on a NVA5 Tesla card under KDE5
Plasma as shipping with Ubuntu 16.04.4 LTS.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoegl/x11: Handle both depth 30 formats for eglCreateImage(). (v4)
Mario Kleiner [Wed, 13 Jun 2018 04:04:13 +0000 (06:04 +0200)]
egl/x11: Handle both depth 30 formats for eglCreateImage(). (v4)

We need to distinguish if the backing storage of a pixmap
is XRGB2101010 or XBGR2101010, as different gpu hw supports
different formats. NVidia hw prefers XBGR, whereas AMD and
Intel are happy with XRGB.

Use the red channel mask of the first depth 30 visual of
the x-screen to distinguish which hw format to choose.

This fixes desktop composition of color depth 30 windows
when the X11 compositor uses EGL.

v2: Switch from using the visual of the root window to simply
    using the first depth 30 visual for the x-screen, as testing
    shows that each driver only exports either xrgb ordering or
    xbgr ordering for the channel masks of its depth 30 visuals,
    so this should be unambiguous and avoid trouble if X ever
    supports depth 30 pixmaps on screens with a non-depth 30 root
    window visual. This per Michels suggestion.

v3: No change to v2, but spent some time testing this more on
    AMD hw, with my software hacked up to intentionally choose
    pixel formats/visual with the non-preferred xBGR2101010
    ordering on the ati-ddx, also with a standard non-OpenGL
    X-Window with depth 30 visual, to make sure that things show
    up properly with the right colors on the screen when going
    through EGL+OpenGL based compositing on KDE-5. Iow. to confirm
    that my explanation to the v2 patch on the mailing list of why
    it should work and the actual practice agree (or possibly that
    i am good at fooling myself during testing ;).

v4: Drop the local `red_mask` and just `return visual->red_mask`/
    `return 0`, as suggested by Eric Engestrom.

    Rebased onto current master, to take the cleanup via the new
    function dri2_format_for_depth() into account.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogbm: Add support for 10bpp BGR formats
Daniel Stone [Wed, 13 Jun 2018 04:04:12 +0000 (06:04 +0200)]
gbm: Add support for 10bpp BGR formats

Add support for XBGR2101010 and ABGR2101010 formats.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoegl/wayland: Add 10bpc BGR configs
Daniel Stone [Wed, 13 Jun 2018 04:04:11 +0000 (06:04 +0200)]
egl/wayland: Add 10bpc BGR configs

Add support for XBGR2101010 and ABGR2101010.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agointel/compiler: implement 8-bit constant load
Iago Toral Quiroga [Fri, 27 Jul 2018 11:38:39 +0000 (13:38 +0200)]
intel/compiler: implement 8-bit constant load

Fixes VK-GL-CTS CL#2567

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agointel/compiler: add setup_imm_(u)b helpers
Iago Toral Quiroga [Fri, 27 Jul 2018 11:38:38 +0000 (13:38 +0200)]
intel/compiler: add setup_imm_(u)b helpers

The hardware doesn't support byte immediates, so similar to setup_imm_df()
for doubles, these helpers work by loading the constant value into a
VGRF.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agoglsl: fix function inlining with opaque parameters
Rhys Perry [Wed, 6 Jun 2018 19:55:08 +0000 (20:55 +0100)]
glsl: fix function inlining with opaque parameters

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
5 years agoglsl, glsl_to_tgsi: fix sampler/image constants
Rhys Perry [Wed, 6 Jun 2018 19:55:07 +0000 (20:55 +0100)]
glsl, glsl_to_tgsi: fix sampler/image constants

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
5 years agoglsl: allow ?: operator with images and samplers when bindless is enabled
Rhys Perry [Wed, 6 Jun 2018 19:55:06 +0000 (20:55 +0100)]
glsl: allow ?: operator with images and samplers when bindless is enabled

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
5 years agoglsl_to_tgsi: allow bound samplers and images to be used as l-values
Rhys Perry [Wed, 6 Jun 2018 19:55:05 +0000 (20:55 +0100)]
glsl_to_tgsi: allow bound samplers and images to be used as l-values

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
5 years agogallium: add new SAMP2HND and IMG2HND opcodes
Rhys Perry [Wed, 6 Jun 2018 19:55:03 +0000 (20:55 +0100)]
gallium: add new SAMP2HND and IMG2HND opcodes

This commit does not add support for the opcodes in gallivm or tgsi_to_nir.c

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
5 years agodocs/features: update virgl GLES 3.1/3.2 status
Dave Airlie [Mon, 30 Jul 2018 19:07:23 +0000 (05:07 +1000)]
docs/features: update virgl GLES 3.1/3.2 status

virgl now exposes GLES3.1 and 3.2

5 years agodocs/features: update virgl GL 4.3 support
Dave Airlie [Mon, 30 Jul 2018 19:07:06 +0000 (05:07 +1000)]
docs/features: update virgl GL 4.3 support

virgl with up to date host renderer now exposes GL 4.3.

5 years agovirgl: enable FBFETCH if virglrenderer supports it
Erik Faye-Lund [Fri, 20 Jul 2018 10:10:56 +0000 (11:10 +0100)]
virgl: enable FBFETCH if virglrenderer supports it

This fixes the following dEQP-GLES31 cases from NotSupported to
Pass for me:

- dEQP-GLES31.functional.blend_equation_advanced.state_query.*
- dEQP-GLES31.functional.blend_equation_advanced.basic.*
- dEQP-GLES31.functional.blend_equation_advanced.srgb.*
- dEQP-GLES31.functional.blend_equation_advanced.msaa.*
- dEQP-GLES31.functional.blend_equation_advanced.barrier.*
- dEQP-GLES31.functional.draw_buffers_indexed.overwrite_*advanced_blend_eq*
- dEQP-GLES31.functional.state_query.indexed.blend_equation_advanced_*
- dEQP-GLES31.functional.debug.negative_coverage.*.advanced_blend.*

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
5 years agovirgl: add texture_barrier stub
Erik Faye-Lund [Fri, 20 Jul 2018 10:10:20 +0000 (11:10 +0100)]
virgl: add texture_barrier stub

In gallium, supporting FBFETCH means supporting non-coherent fetches, but
in virglrenderer, due to technical reasons this is backed by coherent
fetches instead. This means we don't need to do anything for the barriers.

However, if we don't have a texture_barrier implementation, we get crashes
because the non-coherent extensions is exposed.

So, let's leave this as a NOP for now.

[airlied: I've got a more complete impl of this somewhere, once we
land the host side].
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agovirgl: enable robustness if the host exposes it
Dave Airlie [Mon, 30 Jul 2018 18:45:15 +0000 (04:45 +1000)]
virgl: enable robustness if the host exposes it

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
5 years agovirgl: Support ARB_framebuffer_no_attachments
Dave Airlie [Wed, 18 Jul 2018 19:35:53 +0000 (05:35 +1000)]
virgl: Support ARB_framebuffer_no_attachments

This uses new protocol to send the default sizes to the host.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
5 years agovirgl: add initial ARB_compute_shader support
Dave Airlie [Fri, 15 Jun 2018 01:20:53 +0000 (11:20 +1000)]
virgl: add initial ARB_compute_shader support

This hooks up compute shader creation and launch grid support.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
5 years agoutil: don't use __builtin_clz unconditionally
Marek Olšák [Wed, 1 Aug 2018 02:50:44 +0000 (22:50 -0400)]
util: don't use __builtin_clz unconditionally

This fixes the build if __builtin_clz is unsupported.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agoac/surface: fix MSAA corruption on Vega due to FMASK tile swizzle
Marek Olšák [Fri, 27 Jul 2018 02:46:21 +0000 (22:46 -0400)]
ac/surface: fix MSAA corruption on Vega due to FMASK tile swizzle

a needle in the haystack?

Cc: 18.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agov3d: use snprintf(..., "%s", ...) instead of strncpy
Eric Anholt [Tue, 31 Jul 2018 23:41:28 +0000 (16:41 -0700)]
v3d: use snprintf(..., "%s", ...) instead of strncpy

Fixes a compiler warning about terminator NUL, based on f836d799f906
("intel/decoder: use snprintf(..., "%s", ...) instead of strncpy")

5 years agov3d: Add support for the TMUWT instruction.
Eric Anholt [Thu, 14 Dec 2017 17:28:42 +0000 (09:28 -0800)]
v3d: Add support for the TMUWT instruction.

This instruction is used to ensure that TMU stores have been processed
before moving on.  In particular, you need any TMU ops to be done by the
time the shader ends.

5 years agoradeonsi: report supported EQAA combinations from is_format_supported
Marek Olšák [Thu, 24 May 2018 02:56:25 +0000 (22:56 -0400)]
radeonsi: report supported EQAA combinations from is_format_supported

Framebuffer without attachments now supports 16 samples.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agoradeonsi: use storage_samples instead of color_samples in most places
Marek Olšák [Thu, 24 May 2018 02:42:49 +0000 (22:42 -0400)]
radeonsi: use storage_samples instead of color_samples in most places

and use pipe_resource::nr_storage_samples instead of
r600_texture::num_color_samples.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agogallium: add storage_sample_count parameter into is_format_supported
Marek Olšák [Wed, 23 May 2018 22:46:19 +0000 (18:46 -0400)]
gallium: add storage_sample_count parameter into is_format_supported

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agogallium: add pipe_resource::nr_storage_samples, and set it same as nr_samples
Marek Olšák [Thu, 24 May 2018 02:25:12 +0000 (22:25 -0400)]
gallium: add pipe_resource::nr_storage_samples, and set it same as nr_samples

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agogallium: add PIPE_CAP_FRAMEBUFFER_MSAA_CONSTRAINTS
Marek Olšák [Wed, 23 May 2018 21:45:50 +0000 (17:45 -0400)]
gallium: add PIPE_CAP_FRAMEBUFFER_MSAA_CONSTRAINTS

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agodocs: update radeonsi features and release notes
Marek Olšák [Tue, 24 Jul 2018 00:07:20 +0000 (20:07 -0400)]
docs: update radeonsi features and release notes

5 years agost/mesa: implement ASTC 2D LDR fallback for all drivers
Marek Olšák [Tue, 13 Feb 2018 03:25:29 +0000 (04:25 +0100)]
st/mesa: implement ASTC 2D LDR fallback for all drivers

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-By: Gert Wollny<gert.wollny@collabora.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-By: Gert Wollny <gw.fossdev@gmail.com>
5 years agost/mesa: add ETC2 & ASTC fast path for GetTex(Sub)Image
Marek Olšák [Tue, 13 Feb 2018 16:37:56 +0000 (17:37 +0100)]
st/mesa: add ETC2 & ASTC fast path for GetTex(Sub)Image

Not sure if GL/GLES can hit this path, but it's just decompression.

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-By: Gert Wollny<gert.wollny@collabora.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-By: Gert Wollny <gw.fossdev@gmail.com>
5 years agost/mesa: generalize fallback_copy_image for compressed textures
Marek Olšák [Wed, 14 Feb 2018 00:49:33 +0000 (01:49 +0100)]
st/mesa: generalize fallback_copy_image for compressed textures

in order to support ASTC

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-By: Gert Wollny<gert.wollny@collabora.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-By: Gert Wollny <gw.fossdev@gmail.com>
5 years agost/mesa: generalize code for the compressed texture map/unmap fallback
Marek Olšák [Tue, 13 Feb 2018 15:39:11 +0000 (16:39 +0100)]
st/mesa: generalize code for the compressed texture map/unmap fallback

in order to support ASTC

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-By: Gert Wollny<gert.wollny@collabora.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-By: Gert Wollny <gw.fossdev@gmail.com>
5 years agost/mesa: use st_compressed_format_fallback more
Marek Olšák [Tue, 13 Feb 2018 03:19:05 +0000 (04:19 +0100)]
st/mesa: use st_compressed_format_fallback more

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-By: Gert Wollny<gert.wollny@collabora.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-By: Gert Wollny <gw.fossdev@gmail.com>
5 years agost/mesa: generalize st_etc_fallback -> st_compressed_format_fallback
Marek Olšák [Tue, 13 Feb 2018 03:00:17 +0000 (04:00 +0100)]
st/mesa: generalize st_etc_fallback -> st_compressed_format_fallback

for ASTC support later

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-By: Gert Wollny<gert.wollny@collabora.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-By: Gert Wollny <gw.fossdev@gmail.com>
5 years agomesa: add ASTC 2D LDR decoder
Marek Olšák [Tue, 13 Feb 2018 15:02:14 +0000 (16:02 +0100)]
mesa: add ASTC 2D LDR decoder

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-By: Gert Wollny <gert.wollny@collabora.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agodocs/features: mark virgl image features and GL4.2 as done
Dave Airlie [Mon, 30 Jul 2018 19:04:56 +0000 (05:04 +1000)]
docs/features: mark virgl image features and GL4.2 as done

5 years agovirgl: also mark sampler views as dirty
Gurchetan Singh [Tue, 10 Jul 2018 23:19:24 +0000 (16:19 -0700)]
virgl: also mark sampler views as dirty

When texture buffers are used as images in compute shaders, the guest
never sees the modified data since the TBO is always marked as clean.

Fixes most dEQP-GLES31.functional.image_load_store.buffer.* tests.

Example test cases:
   dEQP-GLES31.functional.image_load_store.buffer.load_store.r32ui
   dEQP-GLES31.functional.image_load_store.buffer.qualifiers.coherent_r32f
   dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.rgba8_rgba8ui

Note: virglrenderer side patch also needed to bind TBOs correctly

Reviewed-by: Dave Airlie <airlied@redhat.com>