mesa.git
3 years agopanfrost: Move pool routines to common code
Alyssa Rosenzweig [Tue, 7 Jul 2020 20:24:41 +0000 (16:24 -0400)]
panfrost: Move pool routines to common code

We finally have it decoupled from Galliumisms (and OpenGLisms, indeed)
so we can share the file.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>

3 years agopanfrost: Drop Gallium-local pan_bo_create wrapper
Alyssa Rosenzweig [Tue, 7 Jul 2020 20:19:39 +0000 (16:19 -0400)]
panfrost: Drop Gallium-local pan_bo_create wrapper

We can handle pandecode in shared code now, which will matter for
tracing non-Gallium drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>

3 years agopanfrost: Move debug flags into the device
Alyssa Rosenzweig [Tue, 7 Jul 2020 20:15:45 +0000 (16:15 -0400)]
panfrost: Move debug flags into the device

Removes random global state flying about which doesn't really work for
common code. We cleanup some debug messages while we're at it because
the mostly-unused DBG macro relies on magic state.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>

3 years agopanfrost: Expose pool-based allocation API
Alyssa Rosenzweig [Tue, 7 Jul 2020 19:20:35 +0000 (15:20 -0400)]
panfrost: Expose pool-based allocation API

Pass pools instead of batches, and rename in terms of pools instead of
transient memory for consistency while we're find-and-replacing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>

3 years agopanfrost: Track the device through the pool
Alyssa Rosenzweig [Tue, 7 Jul 2020 19:15:04 +0000 (15:15 -0400)]
panfrost: Track the device through the pool

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>

3 years agopanfrost: Allocate pool BOs against the pool
Alyssa Rosenzweig [Tue, 7 Jul 2020 19:11:42 +0000 (15:11 -0400)]
panfrost: Allocate pool BOs against the pool

Instead of against the owning batch, to decouple.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>

3 years agopanfrost: Introduce pan_pool struct
Alyssa Rosenzweig [Tue, 7 Jul 2020 18:46:40 +0000 (14:46 -0400)]
panfrost: Introduce pan_pool struct

As a first step towards separating pools from batches, let's collect
pool-related state together.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>

3 years agodocs/features: Track Panfrost
Alyssa Rosenzweig [Tue, 7 Jul 2020 14:56:36 +0000 (10:56 -0400)]
docs/features: Track Panfrost

Mark support for Panfrost with the PAN_MESA_DEBUG=gles3 flag set (which
exposes a few buggier features for GLES 3.0, but we're actually quite
close to conformance. I expect this to become default in a few weeks),
based on what's supported for Mali T860 (our flagship). Less features
are supported on Mali T720 due to h/w limitations, and Bifrost support
is very much still in the pipes but will support all this soon enough.

Closes: #255
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5791>

3 years agodocs: fix a bunch of typos
Eric Engestrom [Wed, 8 Jul 2020 22:52:27 +0000 (00:52 +0200)]
docs: fix a bunch of typos

Saw a couple myself, and a quick round of vimspell showed a bunch more.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5814>

3 years agoglsl: declare gl_Layer/gl_ViewportIndex/gl_ViewportMask as vs builtins
Pierre-Eric Pelloux-Prayer [Tue, 19 May 2020 12:42:19 +0000 (14:42 +0200)]
glsl: declare gl_Layer/gl_ViewportIndex/gl_ViewportMask as vs builtins

Otherwise a VS doing the following:

out gl_PerVertex {
    vec4 gl_Position;
    int gl_ViewportIndex;
};

cannot be compiled because of the following error:
  "redeclaration of gl_PerVertex must be a subset of the built-in
  members of gl_PerVertex"

v2: add GLSL_PRECISION_HIGH param to add_varying() for "gl_Layer" in
    generate_fs_special_vars.
v3: add GLSL_PRECISION_HIGH param to add_varying() for "gl_Layer" in
    generate_varyings.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2946
Tested-by: John Galt <johngalt@fake.mail>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v3)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v3)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5167>

3 years agoturnip: fix active_desc_sets not being set for compute pipeline
Jonathan Marek [Thu, 9 Jul 2020 00:53:46 +0000 (20:53 -0400)]
turnip: fix active_desc_sets not being set for compute pipeline

This resulted in the load state being always empty. Its an optimization,
so it didn't result in any failures.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5816>

3 years agodocs: add some missing stuff to sourcetree.rst
Miklós Máté [Wed, 8 Jul 2020 22:39:15 +0000 (00:39 +0200)]
docs: add some missing stuff to sourcetree.rst

I alphabetised some lists, but did not attempt to fix the inconsistent
formatting.

v2: added more info
v3: rework for the new format

Signed-off-by: Miklós Máté <mtmkls@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5367>

3 years agodocs: update calendar and link releases notes for 20.1.3
Eric Engestrom [Wed, 8 Jul 2020 21:49:39 +0000 (23:49 +0200)]
docs: update calendar and link releases notes for 20.1.3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5811>

3 years agodocs: add release notes for 20.1.3
Eric Engestrom [Wed, 8 Jul 2020 21:33:40 +0000 (23:33 +0200)]
docs: add release notes for 20.1.3

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5811>

3 years agoglsl: only allow 32 bits atomic operations on images
Pierre-Eric Pelloux-Prayer [Fri, 19 Jun 2020 16:37:00 +0000 (18:37 +0200)]
glsl: only allow 32 bits atomic operations on images

EXT_shader_image_load_store says:
   The format of the image unit must be in the "1x32" equivalence class
   otherwise the atomic operation is invalid.

ARB_shader_image_load_store says:
   We will only support 32-bit atomic operations on images

Fixes: fc0a2e5d017 ("glsl: add EXT_shader_image_load_store new image functions")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688>

3 years agoglsl: don't expose imageAtomicIncWrap for signed image
Pierre-Eric Pelloux-Prayer [Fri, 19 Jun 2020 16:34:51 +0000 (18:34 +0200)]
glsl: don't expose imageAtomicIncWrap for signed image

The spec says that it's only allowed for unsigned ones.
Same from imageAtomicDecWrap.

Fixes: fc0a2e5d017 ("glsl: add EXT_shader_image_load_store new image functions")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688>

3 years agoac/llvm: remove the -1 hack from ac_atomic_inc_wrap
Pierre-Eric Pelloux-Prayer [Fri, 19 Jun 2020 16:33:32 +0000 (18:33 +0200)]
ac/llvm: remove the -1 hack from ac_atomic_inc_wrap

To match the behavior of proprietary drivers.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688>

3 years agoglsl: reject size1x8 for image variable with floating-point data types
Pierre-Eric Pelloux-Prayer [Fri, 19 Jun 2020 16:29:19 +0000 (18:29 +0200)]
glsl: reject size1x8 for image variable with floating-point data types

Fixes: 8d07d66180b ("glsl,nir: Switch the enum representing shader image formats to PIPE_FORMAT.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688>

3 years agogitlab-ci: Remove left-behind rules:
Tomeu Vizoso [Wed, 8 Jul 2020 07:57:44 +0000 (09:57 +0200)]
gitlab-ci: Remove left-behind rules:

It's something that was added to ease development, but that was supposed
to be removed before merging.

It also causes problems when arm-related jobs aren't enabled, as
arm_build is needed by these jobs but in that case isn't there.

Also extend from .ci-run-policy.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5802>

3 years agoradv: compute prim_vertex_count at draw time
Samuel Pitoiset [Tue, 7 Jul 2020 16:31:58 +0000 (18:31 +0200)]
radv: compute prim_vertex_count at draw time

In preparation for the dynamic topology state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>

3 years agoradv: adjust IA_MULTI_VGT_PARAM.PARTIAL_VS_WAVE at draw time
Samuel Pitoiset [Tue, 7 Jul 2020 16:10:40 +0000 (18:10 +0200)]
radv: adjust IA_MULTI_VGT_PARAM.PARTIAL_VS_WAVE at draw time

In preparation for the dynamic topology state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>

3 years agoradv: adjust IA_MULTI_VGT_PARAM.WD_SWITCH_ON_EOP at draw time
Samuel Pitoiset [Tue, 7 Jul 2020 16:10:00 +0000 (18:10 +0200)]
radv: adjust IA_MULTI_VGT_PARAM.WD_SWITCH_ON_EOP at draw time

In preparation for the dynamic topology state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>

3 years agoradv: store the primitive topology hardware value in the pipeline
Samuel Pitoiset [Wed, 8 Jul 2020 07:36:00 +0000 (09:36 +0200)]
radv: store the primitive topology hardware value in the pipeline

Will help for upcoming changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>

3 years agoradv: implement missing VK_ACCESS_MEMORY_{READ,WRITE}_BIT
Samuel Pitoiset [Wed, 8 Jul 2020 16:24:16 +0000 (18:24 +0200)]
radv: implement missing VK_ACCESS_MEMORY_{READ,WRITE}_BIT

From the Vulkan spec 1.2.146:
    "VK_ACCESS_MEMORY_READ_BIT specifies all read accesses. It is
     always valid in any access mask, and is treated as equivalent
     to setting all READ access flags that are valid where it is
     used."

    "VK_ACCESS_MEMORY_WRITE_BIT specifies all write accesses.
     It is always valid in any access mask, and is treated as
     equivalent to setting all WRITE access flags that are valid
     where it is used."

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3241
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5807>

3 years agonv50/ir: fix memset on non trivial types warning
Karol Herbst [Fri, 20 Sep 2019 17:45:02 +0000 (19:45 +0200)]
nv50/ir: fix memset on non trivial types warning

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Rhys Kidd <rhyskidd@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5819>

3 years agonine: remove unused var
Timothy Arceri [Wed, 8 Jul 2020 10:57:54 +0000 (20:57 +1000)]
nine: remove unused var

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5819>

3 years agozink: fix missing fallthrough comment
Timothy Arceri [Wed, 8 Jul 2020 10:44:37 +0000 (20:44 +1000)]
zink: fix missing fallthrough comment

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5819>

3 years agov3d: remove redefine of VG(x)
Timothy Arceri [Wed, 8 Jul 2020 10:11:32 +0000 (20:11 +1000)]
v3d: remove redefine of VG(x)

Instead just depend on the one in v3d_packet_helpers.h

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5819>

3 years agofreedreno: fix missing fallthrough comments
Timothy Arceri [Wed, 8 Jul 2020 09:00:55 +0000 (19:00 +1000)]
freedreno: fix missing fallthrough comments

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5819>

3 years agoamd/llvm: Mark pointer function arguments as 32-byte aligned.
Bas Nieuwenhuizen [Thu, 19 Dec 2019 00:39:56 +0000 (01:39 +0100)]
amd/llvm: Mark pointer function arguments as 32-byte aligned.

Otherwise LLVM does not see the pointers as allowing speculative
loads.

The pipeline-db results are pretty wild, but mostly what is to be
expected from allowing more code movement in LLVM:

Totals from affected shaders:
SGPRS: 157728 -> 168336 (6.73 %)
VGPRS: 158628 -> 158664 (0.02 %)
Spilled SGPRs: 10845 -> 24753 (128.24 %)
Spilled VGPRs: 13 -> 13 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 8 -> 8 (0.00 %) dwords per thread
Code Size: 17189180 -> 17313712 (0.72 %) bytes
LDS: 204 -> 204 (0.00 %) blocks
Max Waves: 5700 -> 5687 (-0.23 %)
Wait states: 0 -> 0 (0.00 %)

This gives some boosts for shaders we can move a descriptor load
outside a loop.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3159>

3 years agoglsl: don't validate array types in ir_dereference_variable
Marek Olšák [Wed, 8 Jul 2020 22:37:34 +0000 (18:37 -0400)]
glsl: don't validate array types in ir_dereference_variable

Fixes: 8d62969cfe8 - glsl: validate more stuff
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3245
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5813>

3 years agoradv: use bitshifts for debug enum values
Simon Ser [Fri, 3 Jul 2020 13:24:05 +0000 (15:24 +0200)]
radv: use bitshifts for debug enum values

Explicit values are getting out of hand.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5735>

3 years agofreedreno/layout: layout simplifications and pitch from level 0 pitch
Jonathan Marek [Tue, 7 Jul 2020 22:27:32 +0000 (18:27 -0400)]
freedreno/layout: layout simplifications and pitch from level 0 pitch

This updates a3xx/a4xx/a5xx to fix the fetchsize to "PITCHALIGN" (called
"MINLINEOFFSET" by the a3xx docs), and some simplifications to make things
more like a6xx. Also similar simplifications for a2xx layout code.

The pitch can always be determined using a simple calculation from the base
level pitch, so don't pre-calculate a pitch for each mipmap level.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5796>

3 years agofreedreno: add a fd_resource_pitch helper
Jonathan Marek [Tue, 7 Jul 2020 17:38:18 +0000 (13:38 -0400)]
freedreno: add a fd_resource_pitch helper

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5796>

3 years agofreedreno/a2xx: fix compressed textures
Jonathan Marek [Tue, 7 Jul 2020 22:00:55 +0000 (18:00 -0400)]
freedreno/a2xx: fix compressed textures

Two problems:
* Multiply has higher priority than shift
* rsc->layout.format isn't initialized for a2xx

Fixes: 5a8718f01b397 ("freedreno: Make the slice pitch be bytes, not pixels.")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5796>

3 years agodocs: Document how to interact with docker containers.
Eric Anholt [Tue, 16 Jun 2020 23:42:41 +0000 (16:42 -0700)]
docs: Document how to interact with docker containers.

There's some text in gitlab-ci.yml, but expand on things a bit here.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5510>

3 years agodocs: Relax the expectations of HW CI farms.
Eric Anholt [Tue, 16 Jun 2020 23:34:11 +0000 (16:34 -0700)]
docs: Relax the expectations of HW CI farms.

We've been doing pretty well at around half an hour per pipeline, no need
to be too harsh.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5510>

3 years agodocs: Move the gitlab-ci docs to RST.
Eric Anholt [Tue, 16 Jun 2020 22:51:52 +0000 (15:51 -0700)]
docs: Move the gitlab-ci docs to RST.

I tried not to edit too much meaning in the process, but I did shuffle
some stuff around to work as structured documentation.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5510>

3 years agodocs: Move the conformance and the CI docs to a top level Testing section.
Eric Anholt [Tue, 7 Jul 2020 04:04:05 +0000 (21:04 -0700)]
docs: Move the conformance and the CI docs to a top level Testing section.

They're related subjects, and deserve top level display.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5510>

3 years agodocs: Move the current CI .rst doc to docs/ci/ and link to it from .gitlab-ci.
Eric Anholt [Tue, 7 Jul 2020 03:53:31 +0000 (20:53 -0700)]
docs: Move the current CI .rst doc to docs/ci/ and link to it from .gitlab-ci.

I want the docs to be discoverable next to the code, and sphinx insists
that all docs are under the top-level docs dir (sigh).  We can't symlink
from that dir to .gitlab-ci because windows builds can't do symlinks, so
link back the other direction.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5510>

3 years agonir/validate: Don't abort() until after the shader has printed
Jason Ekstrand [Wed, 8 Jul 2020 16:56:32 +0000 (11:56 -0500)]
nir/validate: Don't abort() until after the shader has printed

In the case where SSA use/def chains are broken, NIR prints out a very
cryptic error and then aborts.  This abort happens during validation
rather than after the print is complete, hiding any other errors that
may have been found.  One might think, "So what?  Fix your use/def issue
first."  However, what makes this especially bad is that, when use/def
chains are broken, there's usually a much nicer error inline in the
shader that would have been printed had we not aborted early so the
current behavior simply ensures you get the most cryptic error possible
in an already difficult-to-debug case.

While we're at it, we remove the one other case of abort() which is in
the validation of phi instruction sources.

Reviewed-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5809>

3 years agoRevert "ac/surface: require that gfx8 doesn't have DCC in order to be displayable"
Marek Olšák [Mon, 6 Jul 2020 22:01:25 +0000 (18:01 -0400)]
Revert "ac/surface: require that gfx8 doesn't have DCC in order to be displayable"

This reverts commit 7406ea37e6b666d474ab62982ca333d518c84231.

Fixes: 7406ea37 "ac/surface: require that gfx8 doesn't have DCC in order to be displayable"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3190
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5780>

3 years agozink: translate gl_FragColor to gl_FragData before ntv to fix multi-rt output
Mike Blumenkrantz [Mon, 6 Jul 2020 12:58:28 +0000 (08:58 -0400)]
zink: translate gl_FragColor to gl_FragData before ntv to fix multi-rt output

according to EXT_multiview_draw_buffers, gl_FragColor outputs to all available
render targets when used, so we need to translate this to gl_FragData[PIPE_MAX_COLOR_BUFS]
in order to correctly handle more than one color buffer attachment

this fixes the rest of spec@arb_framebuffer_object tests in piglit

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5687>

3 years agonir: add lowering pass for fragcolor -> fragdata
Mike Blumenkrantz [Mon, 6 Jul 2020 12:56:16 +0000 (08:56 -0400)]
nir: add lowering pass for fragcolor -> fragdata

this is needed for zink and other drivers which can support fragcolor but
not fragdata and want to correctly handle EXT_multiview_draw_buffers

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5687>

3 years agozink: expose depth-clip if supported
Erik Faye-Lund [Mon, 3 Feb 2020 16:42:04 +0000 (17:42 +0100)]
zink: expose depth-clip if supported

We already set up the state as needed, so it should only be a matter of
exposing it.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5495>

3 years agoradv: Use correct semaphore handle type for Android import.
Bas Nieuwenhuizen [Mon, 6 Jul 2020 23:51:50 +0000 (01:51 +0200)]
radv: Use correct semaphore handle type for Android import.

Coincidentally got a bugreport of a game that is broken without the import
fix below, but it turns out I made a copy-paste error as well ..

In good news it is clearly tested now.

Fixes: ad151499583 "radv: Set handle types in Android semaphore/fence import."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5783>

3 years agoradv: set depth/stencil enable values correctly for the meta clear path
Samuel Pitoiset [Wed, 8 Jul 2020 11:12:37 +0000 (13:12 +0200)]
radv: set depth/stencil enable values correctly for the meta clear path

They are booleans.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5803>

3 years agofreedreno/regs: document CS shared storage size bit
Jonathan Marek [Wed, 8 Jul 2020 02:31:44 +0000 (22:31 -0400)]
freedreno/regs: document CS shared storage size bit

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5797>

3 years agov3d/compiler: Fix sorting the gs and fs inputs
Neil Roberts [Tue, 7 Jul 2020 00:02:19 +0000 (02:02 +0200)]
v3d/compiler: Fix sorting the gs and fs inputs

ntq_setup_fs_inputs and ntq_setup_gs_inputs sort the inputs according to
the driver location. This input array is then used to calculate the VPM
offset for the outputs in the previous stage. However, it wasn’t taking
into account variables that are packed into a single varying slot. In
that case they would have the same driver_location and are
distinguished by location_frac.

This patch makes it additionally sort by location_frac when the driver
locations are equal. This can happen when the compiler packs varyings
that are sized less than vec4. Without this fix, when the VPM is used to
transmit data free-form between the stages (such as VS->GS) then it
would end up writing to inconsistent locations.

Fixes dEQP tests such as:
dEQP-GLES31.functional.primitive_bounding_box.lines.global_state.
vertex_geometry_fragment.default_framebuffer_bbox_equal

Fixes: 5d578c27cec ("v3d: add initial compiler plumbing for geometry shaders")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5787>

3 years agopanfrost: add some missing fallthrough comments to bi_pack.c
Timothy Arceri [Mon, 6 Jul 2020 04:00:30 +0000 (14:00 +1000)]
panfrost: add some missing fallthrough comments to bi_pack.c

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>

3 years agopanfrost: hide more unused code in bi_lower_combine.c
Timothy Arceri [Mon, 6 Jul 2020 03:50:06 +0000 (13:50 +1000)]
panfrost: hide more unused code in bi_lower_combine.c

Fixes some unused-function warnings.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>

3 years agopanfrost: add some missing fallthrough comments
Timothy Arceri [Mon, 6 Jul 2020 03:44:56 +0000 (13:44 +1000)]
panfrost: add some missing fallthrough comments

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>

3 years agonouveau/nvc0: silence maybe-uninitialized warning
Timothy Arceri [Mon, 6 Jul 2020 03:20:04 +0000 (13:20 +1000)]
nouveau/nvc0: silence maybe-uninitialized warning

gcc is not smart enough to see that

   enum pipe_format dst_fmt;
   ...

   switch (data_size) {
   case 16:
      dst_fmt = PIPE_FORMAT_R32G32B32A32_UINT;
      ...
      break;
   case 12:
      /* RGB32 is not a valid RT format. This will be handled by the pushbuf
       * uploader.
       */
      break;
   case 8:
      dst_fmt = PIPE_FORMAT_R32G32_UINT;
      ...
      break;
   case 4:
      dst_fmt = PIPE_FORMAT_R32_UINT;
      ...
      break;
   case 2:
      dst_fmt = PIPE_FORMAT_R16_UINT;
      ...
      break;
   case 1:
      dst_fmt = PIPE_FORMAT_R8_UINT;
      break;
   default:
      assert(!"Unsupported element size");
      return;
   }

   ...

   if (data_size == 12) {
      ...
      return;
   }

Does not result in dst_fmt being uninitialized when it is used so
lets just initialise it to silence the warning.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>

3 years agoiris: silence maybe-uninitialized for stc_dst_aux_usage variable
Timothy Arceri [Mon, 6 Jul 2020 03:11:14 +0000 (13:11 +1000)]
iris: silence maybe-uninitialized for stc_dst_aux_usage variable

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>

3 years agoiris: fix maybe-uninitialized warning for initial_state variable
Timothy Arceri [Mon, 6 Jul 2020 03:02:34 +0000 (13:02 +1000)]
iris: fix maybe-uninitialized warning for initial_state variable

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>

3 years agoradeonsi: fix SI_NUM_ATOMS
Timothy Arceri [Tue, 7 Jul 2020 00:00:47 +0000 (10:00 +1000)]
radeonsi: fix SI_NUM_ATOMS

This is not used anywhere so maybe we should just drop it instead.

Fixes: 639b673fc3b8 ("radeonsi: don't use an indirect table for state atoms")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>

3 years agor600/radeonsi: silence zero-length-bounds gcc warnings
Timothy Arceri [Fri, 3 Jul 2020 02:06:09 +0000 (12:06 +1000)]
r600/radeonsi: silence zero-length-bounds gcc warnings

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>

3 years agofreedreno/ir3: add support for a650 tess shared storage
Jonathan Marek [Mon, 6 Jul 2020 02:53:39 +0000 (22:53 -0400)]
freedreno/ir3: add support for a650 tess shared storage

A650 uses LDL/STL, and the "local_primitive_id" in tess ctrl shader comes
from bits 16-21 in the header instead of 0-5.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5764>

3 years agogallium: add PIPE_SHADER_CAP_GLSL_16BIT_TEMPS for LowerPrecisionTemporaries
Marek Olšák [Tue, 7 Jul 2020 00:45:27 +0000 (20:45 -0400)]
gallium: add PIPE_SHADER_CAP_GLSL_16BIT_TEMPS for LowerPrecisionTemporaries

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: lower mediump temporaries to 16 bits except structures (v2)
Marek Olšák [Wed, 24 Jun 2020 12:09:48 +0000 (08:09 -0400)]
glsl: lower mediump temporaries to 16 bits except structures (v2)

Without this, NIR contains non-lowerable 32-bit phis for mediump variables.

Structures are not lowered yet.

v2: add the LowerPrecisionTemporaries option

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: Handle 16-bit types in loop analysis
Alyssa Rosenzweig [Mon, 6 Jul 2020 21:56:38 +0000 (17:56 -0400)]
glsl: Handle 16-bit types in loop analysis

Fixes crash with mediump lowering in:

dEQP-GLES2.functional.shaders.loops.do_while_constant_iterations.basic_mediump_float_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: add capability to lower mediump array types
Marek Olšák [Wed, 1 Jul 2020 20:49:04 +0000 (16:49 -0400)]
glsl: add capability to lower mediump array types

This is not needed for lowering expressions, because they always work with
basic types, but it will be needed for lowering variables.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: lower builtins to mediump that always return mediump or lowp
Marek Olšák [Wed, 1 Jul 2020 18:09:32 +0000 (14:09 -0400)]
glsl: lower builtins to mediump that always return mediump or lowp

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: lower builtins to mediump that ignore precision of certain parameters
Marek Olšák [Wed, 1 Jul 2020 17:11:33 +0000 (13:11 -0400)]
glsl: lower builtins to mediump that ignore precision of certain parameters

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: don't lower builtins to mediump that don't allow it
Marek Olšák [Wed, 1 Jul 2020 00:24:44 +0000 (20:24 -0400)]
glsl: don't lower builtins to mediump that don't allow it

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: don't lower precision of textureSize
Marek Olšák [Fri, 26 Jun 2020 11:19:46 +0000 (07:19 -0400)]
glsl: don't lower precision of textureSize

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: flatten a tautological conditional in lower_precision
Marek Olšák [Fri, 26 Jun 2020 11:16:41 +0000 (07:16 -0400)]
glsl: flatten a tautological conditional in lower_precision

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: cleanups in lower_precision
Marek Olšák [Fri, 26 Jun 2020 07:43:25 +0000 (03:43 -0400)]
glsl: cleanups in lower_precision

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: remove the return type from lower_precision
Marek Olšák [Wed, 24 Jun 2020 07:26:31 +0000 (03:26 -0400)]
glsl: remove the return type from lower_precision

It's unused.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: convert reusable lower_precision util code into helper functions
Marek Olšák [Wed, 24 Jun 2020 07:20:59 +0000 (03:20 -0400)]
glsl: convert reusable lower_precision util code into helper functions

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: validate more stuff
Marek Olšák [Wed, 24 Jun 2020 06:39:38 +0000 (02:39 -0400)]
glsl: validate more stuff

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: run validate_ir_tree if GLSL_VALIDATE=1 regardless of the build config
Marek Olšák [Wed, 24 Jun 2020 06:37:34 +0000 (02:37 -0400)]
glsl: run validate_ir_tree if GLSL_VALIDATE=1 regardless of the build config

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: fix evaluating float16 constant expression matrices
Marek Olšák [Sat, 4 Jul 2020 21:43:50 +0000 (17:43 -0400)]
glsl: fix evaluating float16 constant expression matrices

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: fix the type of ir_constant_data::u16
Marek Olšák [Sat, 4 Jul 2020 18:01:12 +0000 (14:01 -0400)]
glsl: fix the type of ir_constant_data::u16

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: print constant initializers
Marek Olšák [Sat, 4 Jul 2020 21:13:27 +0000 (17:13 -0400)]
glsl: print constant initializers

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: print precision qualifiers in IR dumps
Marek Olšák [Wed, 24 Jun 2020 03:10:16 +0000 (23:10 -0400)]
glsl: print precision qualifiers in IR dumps

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoglsl: make print_type non-static for debugging
Marek Olšák [Sat, 4 Jul 2020 23:12:13 +0000 (19:12 -0400)]
glsl: make print_type non-static for debugging

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

3 years agoanv: Handle clamping of inverted depth ranges
Jason Ekstrand [Tue, 7 Jul 2020 16:08:31 +0000 (11:08 -0500)]
anv: Handle clamping of inverted depth ranges

Tested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5792>

3 years agollvmpipe: add ARB_post_depth_coverage support.
Dave Airlie [Thu, 26 Mar 2020 03:27:17 +0000 (13:27 +1000)]
llvmpipe: add ARB_post_depth_coverage support.

This doesn't pass thie piglits because currently they are broken
for case where GL upgrades 2 samples to 4

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5767>

3 years agoci/virgl: update results after streams fixes.
Dave Airlie [Fri, 3 Jul 2020 23:52:28 +0000 (09:52 +1000)]
ci/virgl: update results after streams fixes.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agodraw/gs: use mask to limit vertex emission.
Dave Airlie [Mon, 6 Jul 2020 02:06:46 +0000 (12:06 +1000)]
draw/gs: use mask to limit vertex emission.

When executing for a single primitive, the mask has only one active
lane, however the vertex emit emits for all the lanes, pass in
the active mask and write the excess lanes to the overflow slot.

Fixes:
glsl-1.50-gs-max-output -scan 1 20

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agodraw: free vertex info from geometry streams.
Dave Airlie [Fri, 19 Jun 2020 05:24:59 +0000 (15:24 +1000)]
draw: free vertex info from geometry streams.

This info needs to be freed for the non-0 stream.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agodraw: use common exit path in pipeline finish.
Dave Airlie [Fri, 19 Jun 2020 05:22:18 +0000 (15:22 +1000)]
draw: use common exit path in pipeline finish.

I need to add a missing free here, and it seems pointless duplication

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agodraw/gs: reverse the polarity of the invocation/prims execution
Dave Airlie [Tue, 14 Apr 2020 02:39:42 +0000 (12:39 +1000)]
draw/gs: reverse the polarity of the invocation/prims execution

The current code runs primitives per invocation, but the spec wants
invocations per primitive. However it means having to flush
after each invocation to get correct XFB behaviour

Fixes:
GTF-GL41.gtf40.GL3Tests.transform_feedback3.transform_feedback3_geometry_instanced

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agodraw: account primitive lengths for all streams.
Dave Airlie [Fri, 19 Jun 2020 05:04:19 +0000 (15:04 +1000)]
draw: account primitive lengths for all streams.

For correct XFB queries all streams must get primitive lengths
recorded. This allocates larger memory for per-stream lengths
and the shader write into them.

Fixes:
GTF-GL41.gtf40.GL3Tests.transform_feedback3.transform_feedback3_streams_queried
GTF-GL41.gtf40.GL3Tests.transform_feedback3.transform_feedback3_streams_overflow

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agogallivm/nir: end primitive for all streams.
Dave Airlie [Fri, 19 Jun 2020 05:03:25 +0000 (15:03 +1000)]
gallivm/nir: end primitive for all streams.

Call the end primitive for all streams so it can be accounted properly

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agogallivm/nir: don't access stream var outside bounds
Dave Airlie [Fri, 19 Jun 2020 06:18:22 +0000 (16:18 +1000)]
gallivm/nir: don't access stream var outside bounds

Since we allocate only enough for streams we see, don't access
out of bounds when streams are given

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agogallivm/gs_iface: pass stream into end primitive interface.
Dave Airlie [Fri, 19 Jun 2020 05:02:25 +0000 (15:02 +1000)]
gallivm/gs_iface: pass stream into end primitive interface.

This is just an API change for now

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agodraw/gs: only allocate memory for streams needed.
Dave Airlie [Fri, 19 Jun 2020 06:17:48 +0000 (16:17 +1000)]
draw/gs: only allocate memory for streams needed.

This just allocates the sizeing for streams that are needed.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agogallivm/draw/gs: pass vertex stream count into shader build
Dave Airlie [Fri, 19 Jun 2020 04:54:16 +0000 (14:54 +1000)]
gallivm/draw/gs: pass vertex stream count into shader build

The shader builder can avoid iterations using this info.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agodraw/gs: fix up current verts in output fetching.
Dave Airlie [Fri, 19 Jun 2020 04:44:59 +0000 (14:44 +1000)]
draw/gs: fix up current verts in output fetching.

This was wrong since I added multi-stream support in
draw/gs: track emitted prims + verts per stream

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agodraw: emit so primitives before ending empty pipeline.
Dave Airlie [Fri, 19 Jun 2020 04:37:19 +0000 (14:37 +1000)]
draw: emit so primitives before ending empty pipeline.

There may be non-stream 0 emitted primitives that have to be processed.

Fixes:
KHR-GL42.transform_feedback_overflow_query_ARB.multiple-streams-one-buffer-per-stream
KHR-GL42.transform_feedback_overflow_query_ARB.multiple-streams-multiple-buffers-per-stream

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agogallivm/nir: call end prim at end on all GS streams.
Dave Airlie [Thu, 26 Mar 2020 06:18:27 +0000 (16:18 +1000)]
gallivm/nir: call end prim at end on all GS streams.

Fixes: KHR-GL45.transform_feedback.draw_xfb_stream_test
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

3 years agobroadcom/qpu: set VC5_QPU_RADDR_A out of the switch at _pack_branch
Neil Roberts [Sun, 5 Jul 2020 13:45:19 +0000 (15:45 +0200)]
broadcom/qpu: set VC5_QPU_RADDR_A out of the switch at _pack_branch

Detected after mesa added Wimplicit-fallthrough project wide.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5769>

3 years agoaco: use VOP2 version of v_mbcnt_hi_u32_b32 on GFX6/7
Rhys Perry [Wed, 24 Jun 2020 10:26:22 +0000 (11:26 +0100)]
aco: use VOP2 version of v_mbcnt_hi_u32_b32 on GFX6/7

fossil-db (Pitcairn):
Totals from 2172 (1.58% of 137414) affected shaders:
CodeSize: 7109080 -> 7100100 (-0.13%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5623>

3 years agoutil: Share a single function pointer for the 4-byte rgba unpack function.
Eric Anholt [Wed, 1 Jul 2020 20:33:21 +0000 (13:33 -0700)]
util: Share a single function pointer for the 4-byte rgba unpack function.

Everyone wants the same behavior, and this helps shrink the size of our
format description tables.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>

3 years agoutil: Remove the stub pack/unpack functions for YUV formats.
Eric Anholt [Thu, 2 Jul 2020 00:44:36 +0000 (17:44 -0700)]
util: Remove the stub pack/unpack functions for YUV formats.

If we can't pack/unpack them, the field is supposed to be NULL.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>

3 years agollvmpipe: Generalize "could llvmpipe fetch this format" check in unit testing.
Eric Anholt [Thu, 2 Jul 2020 23:39:02 +0000 (16:39 -0700)]
llvmpipe: Generalize "could llvmpipe fetch this format" check in unit testing.

This set of checks matched the "access" list in u_format_table.py that
controls initializing this this function pointer, so just use the function
pointer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>

3 years agoutil: Use designated initializers to clean up the format tables' pack/unpack.
Eric Anholt [Wed, 1 Jul 2020 20:14:42 +0000 (13:14 -0700)]
util: Use designated initializers to clean up the format tables' pack/unpack.

The generated .c had a bunch of NULLs and notes for what kind of function
was being skipped, when we can just skip them by filling in the fields
with names.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>

3 years agoutil: Merge util_format_read_4* functions.
Eric Anholt [Wed, 1 Jul 2020 23:50:02 +0000 (16:50 -0700)]
util: Merge util_format_read_4* functions.

Everyone wants the same thing: unpack 4-bytes-per-channel data based on the
base type of the format.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>