platform/upstream/mesa.git
3 years agozink: fix device codegen extension detection
Mike Blumenkrantz [Tue, 16 Feb 2021 16:09:35 +0000 (11:09 -0500)]
zink: fix device codegen extension detection

the logic for this was broken and failed to detect any extensions other
than the first one listed. instead, we must follow this logic chain:
1. check the extension name
  2a. if this is an extension that got promoted to core, check the @since version
    3a. if current version >= @since version
      4a. if the extension has required features/properties, check those
      4b. else set supported
    3b. else
      4a. if the extension has required features/properties, check those
      4b. else set supported
  2b. else
    4a. if the extension has required features/properties, check those
    4b. else set supported

Fixes: efe6f00e345 ("zink/codegen: do not enable extensions that are now core")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9081>

3 years agonir/algebraic: Covert up-cast of down-cast to extract on Intel
Jason Ekstrand [Thu, 4 Feb 2021 19:27:08 +0000 (13:27 -0600)]
nir/algebraic: Covert up-cast of down-cast to extract on Intel

This starts generating extract for bit sizes other than 32 but our
back-end handles that just fine.

Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8872>

3 years agonir/algebraic: Clean up up-cast of down-cast when we can
Jason Ekstrand [Thu, 4 Feb 2021 17:55:43 +0000 (11:55 -0600)]
nir/algebraic: Clean up up-cast of down-cast when we can

There are a bunch of cases where we can pretty quickly determine that
the high bits don't matter.  In these cases, delete the casts.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8872>

3 years agonir: Add some range analysis for used bits
Jason Ekstrand [Thu, 4 Feb 2021 17:38:40 +0000 (11:38 -0600)]
nir: Add some range analysis for used bits

This isn't 100% accurate, of course, but it should be good enough for
what we're about to do with it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8872>

3 years agointel/nir: Lower 8-bit phis on Gen11+
Jason Ekstrand [Thu, 4 Feb 2021 16:41:21 +0000 (10:41 -0600)]
intel/nir: Lower 8-bit phis on Gen11+

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8872>

3 years agonir/lower_bit_size: Support phi instructions
Jason Ekstrand [Thu, 4 Feb 2021 16:38:37 +0000 (10:38 -0600)]
nir/lower_bit_size: Support phi instructions

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8872>

3 years agonir: Add a couple helpers for phis and cursors
Jason Ekstrand [Thu, 4 Feb 2021 16:38:21 +0000 (10:38 -0600)]
nir: Add a couple helpers for phis and cursors

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8872>

3 years agovirgl: Return total video memory if available
Rohan Garg [Fri, 12 Feb 2021 11:49:28 +0000 (12:49 +0100)]
virgl: Return total video memory if available

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9009>

3 years agovirgl: update headers
Rohan Garg [Fri, 12 Feb 2021 11:49:19 +0000 (12:49 +0100)]
virgl: update headers

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9009>

3 years agofrontends/va/config: Fix check for packed header config
Thong Thai [Fri, 12 Feb 2021 18:42:42 +0000 (13:42 -0500)]
frontends/va/config: Fix check for packed header config

Fixes: b4651890be4 ("frontends/va: Update conditional checks for code stability.")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: James Zhu <James.Zhu@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4285
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9020>

3 years agogitlab-ci: add intel APL and GLK devices with manual triggers
Gustavo Padovan [Fri, 18 Dec 2020 03:40:02 +0000 (00:40 -0300)]
gitlab-ci: add intel APL and GLK devices with manual triggers

This add support for the Intel Apollo Lake and Gemini Lake families,
however the job will be disabled by default unless the developer
manually hit play for the iris-apl-traces and iris-glk-traces jobs in
GitLab CI.

These devices are still under experimental level support in
the Lava lab and are not guaranteed to work reliably yet. Once they
become reliable and more resilient we will enable them by default in
MesaCI.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8162>

3 years agogitlab-ci: build the iris gallium driver as well
Gustavo Padovan [Wed, 16 Dec 2020 17:05:15 +0000 (14:05 -0300)]
gitlab-ci: build the iris gallium driver as well

For now we will start with iris. Our main focus is to enable the devices
to be used in MesaCI.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8162>

3 years agogitlab-ci: extend x86_64 kernel config to suport Intel devices
Gustavo Padovan [Wed, 16 Dec 2020 10:39:19 +0000 (07:39 -0300)]
gitlab-ci: extend x86_64 kernel config to suport Intel devices

There are extra kernel config options we need to enable for Intel.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8162>

3 years agointel/compiler: Free resources on test teardown
Rohan Garg [Wed, 10 Feb 2021 15:43:08 +0000 (16:43 +0100)]
intel/compiler: Free resources on test teardown

Ensure that all resources are properly released by
properly parenting them to a memory context and releasing
the context during test teardown.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8162>

3 years agointel/genxml: Free resource before exiting
Rohan Garg [Wed, 10 Feb 2021 14:20:25 +0000 (15:20 +0100)]
intel/genxml: Free resource before exiting

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8162>

3 years agopan/bi: Use the correct size for UBO loads
Icecream95 [Thu, 11 Feb 2021 10:51:10 +0000 (23:51 +1300)]
pan/bi: Use the correct size for UBO loads

Multiply by the destination bit size to get the number of bits to
load instead of assuming 32 bits.

Fixes: 2e57684d2d3 ("pan/bi: Implement load_ubo with the builder")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9071>

3 years agoradv: Do pipe misalignment check per plane.
Bas Nieuwenhuizen [Tue, 16 Feb 2021 12:46:55 +0000 (13:46 +0100)]
radv: Do pipe misalignment check per plane.

Fixes: 4c99d6ff54b ("radv: flush L2 for images affected by the pipe misaligned issue on GFX10+")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9078>

3 years agobroadcom/compiler: Merge instructions more efficiently
Arcady Goldmints-Orlov [Sun, 31 Jan 2021 19:53:55 +0000 (14:53 -0500)]
broadcom/compiler: Merge instructions more efficiently

Instructions are allowed to access up to two rf registers, or one rf
register and a small immediate. This change allows qpu_merge_inst to
take full advantage of this by allowint the merging of two instructions
if they have no more than two different rf registers between them,
or one rf register and one small immediate. qpu_merge_inst rewrites
the instructions as needed to pack everything into raddr_a and raddr_b
in the merged instruction.

shader-db stats:
total instructions in shared programs: 19938769 -> 18929664 (-5.06%)
instructions in affected programs: 17929438 -> 16920333 (-5.63%)
helped: 95008
HURT: 242
helped stats (abs) min: 1 max: 785 x̄: 10.62 x̃: 7
helped stats (rel) min: 0.30% max: 21.25% x̄: 5.37% x̃: 4.98%
HURT stats (abs)   min: 1 max: 2 x̄: 1.10 x̃: 1
HURT stats (rel)   min: 0.30% max: 3.12% x̄: 1.62% x̃: 1.54%
95% mean confidence interval for instructions value: -10.67 -10.52
95% mean confidence interval for instructions %-change: -5.37% -5.33%
Instructions are helped.

total max-temps in shared programs: 3122664 -> 3112446 (-0.33%)
max-temps in affected programs: 124881 -> 114663 (-8.18%)
helped: 5445
HURT: 0
helped stats (abs) min: 1 max: 15 x̄: 1.88 x̃: 1
helped stats (rel) min: 1.49% max: 40.54% x̄: 8.97% x̃: 6.67%
95% mean confidence interval for max-temps value: -1.91 -1.84
95% mean confidence interval for max-temps %-change: -9.12% -8.81%
Max-temps are helped.

total sfu-stalls in shared programs: 38028 -> 41231 (8.42%)
sfu-stalls in affected programs: 6053 -> 9256 (52.92%)
helped: 664
HURT: 3380
helped stats (abs) min: 1 max: 2 x̄: 1.04 x̃: 1
helped stats (rel) min: 9.09% max: 100.00% x̄: 70.81% x̃: 100.00%
HURT stats (abs)   min: 1 max: 4 x̄: 1.15 x̃: 1
HURT stats (rel)   min: 0.00% max: 300.00% x̄: 46.39% x̃: 25.00%
95% mean confidence interval for sfu-stalls value: 0.76 0.82
95% mean confidence interval for sfu-stalls %-change: 25.03% 29.26%
Sfu-stalls are HURT.

total inst-and-stalls in shared programs: 19976797 -> 18970895 (-5.04%)
inst-and-stalls in affected programs: 17963129 -> 16957227 (-5.60%)
helped: 95017
HURT: 245
helped stats (abs) min: 1 max: 785 x̄: 10.59 x̃: 7
helped stats (rel) min: 0.30% max: 21.25% x̄: 5.35% x̃: 4.95%
HURT stats (abs)   min: 1 max: 2 x̄: 1.09 x̃: 1
HURT stats (rel)   min: 0.30% max: 3.12% x̄: 1.61% x̃: 1.54%
95% mean confidence interval for inst-and-stalls value: -10.64 -10.48
95% mean confidence interval for inst-and-stalls %-change: -5.35% -5.31%
Inst-and-stalls are helped.

v2 (Iago):
 - moved early return for naddrs > 2 even earlier.
 - only update {add,mul}.b mux if instruction has more than one operand.
 - don't OR b->raddr_{a,b} if we are not merging add/mul instructions.
 - don't initialize packed to 0.
 - minor style fixes.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9026>

3 years agomeson: invalid keyword argument dependencies
Michel Zou [Tue, 2 Feb 2021 08:52:47 +0000 (09:52 +0100)]
meson: invalid keyword argument dependencies

Fixes: e4cc52c0 (vulkan: Add common extension tables)
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8821>

3 years agoradv: only apply the MRT output NaN fixup to non-meta shaders
Samuel Pitoiset [Mon, 15 Feb 2021 10:40:45 +0000 (11:40 +0100)]
radv: only apply the MRT output NaN fixup to non-meta shaders

We only want this workaround to be applied for game shaders.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4163
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/9048>

3 years agoci: Update baremetal kernel to 5.11 plus patches
Christian Gmeiner [Mon, 15 Feb 2021 12:59:02 +0000 (13:59 +0100)]
ci: Update baremetal kernel to 5.11 plus patches

For imx6 we need the following fec ethernet fix:
 c730ab423bfa ("net: fec: Fix temporary RMII clock reset on link up")

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9046>

3 years agolavapipe: add support for missing 10/10/10/2 formats.
Dave Airlie [Mon, 8 Feb 2021 00:26:42 +0000 (10:26 +1000)]
lavapipe: add support for missing 10/10/10/2 formats.

The snorm formats don't work for blitting, so don't expose
them for that.

This passes all CTS tests that it enables.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8907>

3 years agolavapipe: add support for 2/10/10/10 scaled formats.
Dave Airlie [Mon, 8 Feb 2021 00:26:13 +0000 (10:26 +1000)]
lavapipe: add support for 2/10/10/10 scaled formats.

These will be used for zink CI testing.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8907>

3 years agollvmpipe: don't support scaled formats outside vertex buffers
Dave Airlie [Mon, 8 Feb 2021 00:24:25 +0000 (10:24 +1000)]
llvmpipe: don't support scaled formats outside vertex buffers

Scaled formats are usually only needed as vertex buffer formats,
don't expose them as supported for other things.

Lavapipe will use this to export the correct formats support.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8907>

3 years agoutil/format: add helper to check if a format is scaled.
Dave Airlie [Mon, 8 Feb 2021 04:58:50 +0000 (14:58 +1000)]
util/format: add helper to check if a format is scaled.

lavapipe/llvmpipe need this to rule out scaled formats for non-vertex
format usage. Note NONE is defined as scaled in u_format, but for
the purposes of this helper I don't want it to be considered scaled.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8907>

3 years agozink: support nir_intrinsic_group_memory_barrier
Mike Blumenkrantz [Tue, 16 Feb 2021 01:25:02 +0000 (20:25 -0500)]
zink: support nir_intrinsic_group_memory_barrier

needed for cts

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9073>

3 years agofeatures: mark off GL 4.6 and ES 3.1 for zink
Mike Blumenkrantz [Tue, 16 Feb 2021 01:03:04 +0000 (20:03 -0500)]
features: mark off GL 4.6 and ES 3.1 for zink

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>

3 years agozink: GLSL 460
Mike Blumenkrantz [Thu, 20 Aug 2020 20:09:31 +0000 (16:09 -0400)]
zink: GLSL 460

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>

3 years agozink: PIPE_CAP_GL_SPIRV
Mike Blumenkrantz [Thu, 20 Aug 2020 20:05:11 +0000 (16:05 -0400)]
zink: PIPE_CAP_GL_SPIRV

still needs a bunch of fixing, but 75% of tests pass

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>

3 years agozink: enable pipeline statistics cap
Mike Blumenkrantz [Thu, 20 Aug 2020 19:13:31 +0000 (15:13 -0400)]
zink: enable pipeline statistics cap

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>

3 years agozink: enable PIPE_CAP_QUERY_SO_OVERFLOW
Mike Blumenkrantz [Thu, 20 Aug 2020 17:39:10 +0000 (13:39 -0400)]
zink: enable PIPE_CAP_QUERY_SO_OVERFLOW

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>

3 years agozink: enable PIPE_CAP_POLYGON_OFFSET_CLAMP
Mike Blumenkrantz [Thu, 20 Aug 2020 12:54:53 +0000 (08:54 -0400)]
zink: enable PIPE_CAP_POLYGON_OFFSET_CLAMP

this is already handled

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>

3 years agozink: enable PIPE_CAP_DRAW_PARAMETERS
Mike Blumenkrantz [Wed, 19 Aug 2020 18:51:31 +0000 (14:51 -0400)]
zink: enable PIPE_CAP_DRAW_PARAMETERS

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>

3 years agozink: enable PIPE_CAP_TGSI_VOTE
Mike Blumenkrantz [Wed, 19 Aug 2020 18:33:28 +0000 (14:33 -0400)]
zink: enable PIPE_CAP_TGSI_VOTE

ARB_shader_group_vote

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>

3 years agozink: add util function for submitting the compute batch
Mike Blumenkrantz [Sun, 6 Sep 2020 14:55:12 +0000 (10:55 -0400)]
zink: add util function for submitting the compute batch

sometimes we just want to submit this and not wait on it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9063>

3 years agozink: rewrite drawid based on shader key value
Mike Blumenkrantz [Fri, 29 Jan 2021 22:10:03 +0000 (17:10 -0500)]
zink: rewrite drawid based on shader key value

same as basevertex

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: break out push constant creation in compiler and add drawid value
Mike Blumenkrantz [Fri, 29 Jan 2021 22:09:34 +0000 (17:09 -0500)]
zink: break out push constant creation in compiler and add drawid value

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: add a vs shader key for rewriting gl_DrawID
Mike Blumenkrantz [Fri, 29 Jan 2021 22:03:14 +0000 (17:03 -0500)]
zink: add a vs shader key for rewriting gl_DrawID

if we get a direct draw, we have to rewrite the drawid for it to work as expected

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: add a draw_id param to vs push constants
Mike Blumenkrantz [Wed, 19 Aug 2020 22:41:06 +0000 (18:41 -0400)]
zink: add a draw_id param to vs push constants

gallium always gives us multidraws as individual draws, so we need to feed
this through to the shader

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: wrap shader gl_BaseVertex access with a bcsel based on push constant state
Mike Blumenkrantz [Wed, 19 Aug 2020 21:59:13 +0000 (17:59 -0400)]
zink: wrap shader gl_BaseVertex access with a bcsel based on push constant state

vulkan has different mechanics than gl for this variable based on whether the
current draw is indexed, so we need to rewrite the access here for that case

this also requires that we add some padding to the tcs shader injection to
account for new members being added to the push constant

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: add push constant value to indicate whether the current draw is indexed
Mike Blumenkrantz [Wed, 19 Aug 2020 21:58:22 +0000 (17:58 -0400)]
zink: add push constant value to indicate whether the current draw is indexed

due to semantic differences between gl and vk variables, this is going to be
necessary for gl_BaseVertex

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: rework tcs injection to be more compatible with new push const struct
Mike Blumenkrantz [Wed, 2 Sep 2020 16:54:30 +0000 (12:54 -0400)]
zink: rework tcs injection to be more compatible with new push const struct

we can simplify the push constant loader to directly take the struct member
index here and then pass that directly to simplify things for future use

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: create a struct for tracking push constant layout
Mike Blumenkrantz [Wed, 19 Aug 2020 20:42:04 +0000 (16:42 -0400)]
zink: create a struct for tracking push constant layout

it'll be helpful to update this as we add more values here so we can
avoid having to update all the users

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: add handling for ARB_shader_draw_parameters variables in ntv
Mike Blumenkrantz [Wed, 19 Aug 2020 18:50:47 +0000 (14:50 -0400)]
zink: add handling for ARB_shader_draw_parameters variables in ntv

* gl_DrawID
* gl_BaseVertex
* gl_BaseInstance (was already semi-handled)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>

3 years agozink: handle 1bit undef values in ntv
Mike Blumenkrantz [Mon, 15 Feb 2021 20:22:46 +0000 (15:22 -0500)]
zink: handle 1bit undef values in ntv

spirv requires that 1bit values be bool types, not uints

Fixes: 93af00502eb ("zink: use uvec for undefs")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9059>

3 years agozink: fix slot mapping for legacy gl io with tess stages
Mike Blumenkrantz [Fri, 12 Feb 2021 17:27:47 +0000 (12:27 -0500)]
zink: fix slot mapping for legacy gl io with tess stages

e.g., gl_BackColor is a thing

Fixes: aec03553e1b ("zink: fix tess shader i/o variables")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9019>

3 years agozink: add support for pipeline statistics queries
Mike Blumenkrantz [Thu, 20 Aug 2020 19:11:57 +0000 (15:11 -0400)]
zink: add support for pipeline statistics queries

so easy!

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9010>

3 years agozink: hook up cs invocation queries to the compute batch
Mike Blumenkrantz [Thu, 20 Aug 2020 19:10:55 +0000 (15:10 -0400)]
zink: hook up cs invocation queries to the compute batch

compute batches are separate, so we have to run these queries on the
appropriate batch to see the expected results

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9010>

3 years agozink: unset generated TCS if its parent TESS is unset
Mike Blumenkrantz [Mon, 15 Feb 2021 19:09:51 +0000 (14:09 -0500)]
zink: unset generated TCS if its parent TESS is unset

ensure this doesn't get pulled in during the next program update

Fixes: 334759d8509 ("zink: implement passthrough tcs shader injection")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9057>

3 years agoaco: fix assertion in insert_exec_mask pass
Daniel Schürmann [Mon, 15 Feb 2021 10:31:13 +0000 (11:31 +0100)]
aco: fix assertion in insert_exec_mask pass

Fixes: a56ddca4e80a6ef7bb0c44edb4e5b6169510aaca ('aco: make all exec accesses non-temporaries ')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9047>

3 years agoaco: fix transition_to_{WQM,Exact} if exec.back() is not in exec
Rhys Perry [Mon, 15 Feb 2021 11:24:22 +0000 (11:24 +0000)]
aco: fix transition_to_{WQM,Exact} if exec.back() is not in exec

This can happen at merge blocks.

fossil-db (GFX10.3):
Totals from 25229 (17.25% of 146267) affected shaders:
CodeSize: 58575920 -> 58571376 (-0.01%); split: -0.01%, +0.00%
Instrs: 10979245 -> 10978109 (-0.01%); split: -0.01%, +0.00%
SClause: 591817 -> 591816 (-0.00%)
Copies: 604987 -> 603851 (-0.19%); split: -0.19%, +0.00%
Cycles: 96088796 -> 96084252 (-0.00%); split: -0.00%, +0.00%
VMEM: 10470372 -> 10470368 (-0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: a56ddca4e80 ("aco: make all exec accesses non-temporaries")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4299
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9047>

3 years agomesa: add debug code to catch missing _mesa_update_valid_to_render_state calls
Marek Olšák [Wed, 3 Feb 2021 19:41:56 +0000 (14:41 -0500)]
mesa: add debug code to catch missing _mesa_update_valid_to_render_state calls

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: inline draw validate functions
Marek Olšák [Tue, 26 Jan 2021 06:34:45 +0000 (01:34 -0500)]
mesa: inline draw validate functions

This just moves the functions to draw.c.

Our CPU overhead is so low now that this increases performance by a few %.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: inline _mesa_set_draw_vao and set_varying_vp_inputs for draw calls
Marek Olšák [Tue, 26 Jan 2021 06:22:30 +0000 (01:22 -0500)]
mesa: inline _mesa_set_draw_vao and set_varying_vp_inputs for draw calls

This just moves the functions to draw.c. It's inlined because the function
name disappears in the profiler. It improves performance.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: gather errors and call _mesa_error only once in validate_Draw
Marek Olšák [Mon, 25 Jan 2021 04:48:06 +0000 (23:48 -0500)]
mesa: gather errors and call _mesa_error only once in validate_Draw

This mainly skips all the jumping around various _mesa_error calls that
are never taken. There is a tiny measurable improvement in CPU overhead.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: precompute draw time determination of enabled vertex arrays
Marek Olšák [Mon, 25 Jan 2021 22:07:29 +0000 (17:07 -0500)]
mesa: precompute draw time determination of enabled vertex arrays

Another draw time optimization that precomputes the value only when
_VPMode is changed.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: precompute _mesa_get_vao_vp_inputs
Marek Olšák [Tue, 26 Jan 2021 00:02:39 +0000 (19:02 -0500)]
mesa: precompute _mesa_get_vao_vp_inputs

It's called for every draw, so this is important.

All inputs of _mesa_get_vao_vp_inputs are changed when
update_attribute_map_mode is called, so we can just compute
the value there.

The assertion ensures correct behavior in debug builds.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: set _DrawVAOEnabledAttribs only when it changes
Marek Olšák [Mon, 25 Jan 2021 22:15:43 +0000 (17:15 -0500)]
mesa: set _DrawVAOEnabledAttribs only when it changes

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move gl_context::varying_vp_inputs into ctx->VertexProgram._VaryingInputs
Marek Olšák [Mon, 25 Jan 2021 21:53:34 +0000 (16:53 -0500)]
mesa: move gl_context::varying_vp_inputs into ctx->VertexProgram._VaryingInputs

This is where it belongs.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: optimize set_varying_vp_inputs by precomputing the conditions
Marek Olšák [Mon, 25 Jan 2021 21:47:38 +0000 (16:47 -0500)]
mesa: optimize set_varying_vp_inputs by precomputing the conditions

set_varying_vp_inputs is called every draw call, which checks
_Maintain*Program. Let's move that checking out of there.

This adds a new flag that determines whether set_varying_vp_inputs
should do anything.

All code that changes _Maintain*Program must now reinitialize the new
flag. This is done by new function _mesa_reset_vertex_processing_mode.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: validate numInstances in common functions to unify code
Marek Olšák [Mon, 25 Jan 2021 18:48:51 +0000 (13:48 -0500)]
mesa: validate numInstances in common functions to unify code

Just a cleanup.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move disallowed TFB in DrawElements on GLES from draws to state changes
Marek Olšák [Mon, 25 Jan 2021 18:27:01 +0000 (13:27 -0500)]
mesa: move disallowed TFB in DrawElements on GLES from draws to state changes

glDrawElements is disallowed by GLES when transform feedback is active
and GS is not supported.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: add a separate valid primitive mask just for glDrawElements
Marek Olšák [Mon, 25 Jan 2021 18:25:17 +0000 (13:25 -0500)]
mesa: add a separate valid primitive mask just for glDrawElements

No change in behavior.

This will be used for draw validation required by glDrawElements but not
glDrawArrays.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: don't skip draws with count == 0 or numInstances == 0
Marek Olšák [Mon, 25 Jan 2021 18:08:20 +0000 (13:08 -0500)]
mesa: don't skip draws with count == 0 or numInstances == 0

These are checked by drivers (all gallium drivers and
_mesa_draw_gallium_fallback), so they are redundant here.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: skip MultiDrawArrays with primcount == 0
Marek Olšák [Mon, 25 Jan 2021 18:03:52 +0000 (13:03 -0500)]
mesa: skip MultiDrawArrays with primcount == 0

This is the only zero parameter that gallium can't handle.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: remove an optional GL error about mapped buffers during execution
Marek Olšák [Mon, 25 Jan 2021 16:55:19 +0000 (11:55 -0500)]
mesa: remove an optional GL error about mapped buffers during execution

Not having this here, even if the branch is not taken, increases
CPU performance by 2% on radeonsi. If some drivers need this, the spec
does allow GL termination, meaning abort(), which is a more effective
alternative given that this never happens.

You may ask, do we really pay a 2% performance hit for every conditional
not taken? For some of them, we do.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: call _mesa_update_state() before validation
Marek Olšák [Mon, 25 Jan 2021 16:14:09 +0000 (11:14 -0500)]
mesa: call _mesa_update_state() before validation

It's called in both the no_error path and the draw validation path, so we
might as well call it before the no_error conditional.

This decreases CPU overhead a lot, which I'm unable to explain. It seems
to be random gcc behavior, which I've seen quite a lot now.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: remove optional draw validation code to increase performance
Marek Olšák [Mon, 25 Jan 2021 16:22:24 +0000 (11:22 -0500)]
mesa: remove optional draw validation code to increase performance

Some drivers do similar validation in their draw calls.

If drivers need some of this, we can do it in the drivers or even in
_mesa_draw_gallium_fallback for classic drivers.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: remove VERBOSE_DRAW
Marek Olšák [Mon, 25 Jan 2021 01:14:28 +0000 (20:14 -0500)]
mesa: remove VERBOSE_DRAW

Let's declutter the code.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: optimize the dual source blend error checking using a bitmask
Marek Olšák [Tue, 26 Jan 2021 04:55:55 +0000 (23:55 -0500)]
mesa: optimize the dual source blend error checking using a bitmask

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: inline _mesa_valid_to_render now that it doesn't do validation
Marek Olšák [Sun, 24 Jan 2021 23:09:19 +0000 (18:09 -0500)]
mesa: inline _mesa_valid_to_render now that it doesn't do validation

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move blending validation from draws to state changes
Marek Olšák [Sun, 24 Jan 2021 21:48:13 +0000 (16:48 -0500)]
mesa: move blending validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move GL_FILL_RECTANGLE validation from draws to state changes
Marek Olšák [Sun, 31 Jan 2021 00:18:06 +0000 (19:18 -0500)]
mesa: move GL_FILL_RECTANGLE validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move ARB program and integer FBO validation from draws to state changes
Marek Olšák [Sun, 31 Jan 2021 00:16:06 +0000 (19:16 -0500)]
mesa: move ARB program and integer FBO validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move FBO completeness checking from draws to state changes
Marek Olšák [Sun, 31 Jan 2021 00:09:37 +0000 (19:09 -0500)]
mesa: move FBO completeness checking from draws to state changes

_mesa_update_framebuffer_visual already calls _mesa_update_valid_to_render-
_state, so we just need to call it where FBOs are marked incomplete.

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move some uniform debug code from draws to state changes
Marek Olšák [Sun, 31 Jan 2021 00:01:36 +0000 (19:01 -0500)]
mesa: move some uniform debug code from draws to state changes

This is a step towards removing _mesa_valid_to_render.

I don't know what this code does. This commit probably breaks it, but it
doesn't seem important. We could remove the code.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move sampler uniform validation from draws to state changes
Marek Olšák [Sat, 30 Jan 2021 23:59:10 +0000 (18:59 -0500)]
mesa: move sampler uniform validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move shader pipeline validation from draws to state changes
Marek Olšák [Sat, 30 Jan 2021 23:59:10 +0000 (18:59 -0500)]
mesa: move shader pipeline validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: don't report 1 for GL_VALIDATE_STATUS if user didn't validate pipeline
Marek Olšák [Sun, 31 Jan 2021 04:22:10 +0000 (23:22 -0500)]
mesa: don't report 1 for GL_VALIDATE_STATUS if user didn't validate pipeline

dEQP expects GL_VALIDATE_STATUS to be set to 0 if the user didn't call
glValidateProgramPipeline even if the pipeline is valid, but we will
validate pipeline objects in state changes, not draw calls.

This will fix a failure in this test caused by the next commit:
dEQP-GLES31.functional.state_query.program_pipeline.validate_status_get_program_pipelineiv

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: add skeleton code for DrawPixels/CopyPixels/Bitmap precomputed validation
Marek Olšák [Sat, 30 Jan 2021 23:56:38 +0000 (18:56 -0500)]
mesa: add skeleton code for DrawPixels/CopyPixels/Bitmap precomputed validation

This is for precomputing draw time validation in state changes.
The next commit will use this.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: inline check_valid_to_render
Marek Olšák [Sun, 24 Jan 2021 20:13:04 +0000 (15:13 -0500)]
mesa: inline check_valid_to_render

because it has only one use.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: fold most of check_valid_to_render into _mesa_update_valid_to_render_state
Marek Olšák [Sat, 16 Jan 2021 16:30:44 +0000 (11:30 -0500)]
mesa: fold most of check_valid_to_render into _mesa_update_valid_to_render_state

Set the mask (ValidPrimMask) to 0 if draw calls should generate
GL_INVALID_OPERATION. The mask is updated when states are changed.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move check_valid_to_render call into _mesa_valid_prim_mode
Marek Olšák [Sun, 24 Jan 2021 19:55:10 +0000 (14:55 -0500)]
mesa: move check_valid_to_render call into _mesa_valid_prim_mode

It's going to be mostly eliminated by ValidPrimMask, so let's put them
together.

This also enables check_valid_to_render for glBegin, which seems to have
been omitted accidentally.

_mesa_valid_to_render is now always called by _mesa_valid_prim_mode.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: precompute draw time prim validation during state changes
Marek Olšák [Sat, 16 Jan 2021 14:36:45 +0000 (09:36 -0500)]
mesa: precompute draw time prim validation during state changes

This moves the body of _mesa_valid_prim_mode into new function
_mesa_update_valid_to_render_state, which is called when the affected
states are changed and sets new variable gl_context::ValidPrimMask,
which determines errors reported by draw calls.

_mesa_valid_prim_mode only has to check ValidPrimMask and choose
between GL_INVALID_ENUM and GL_INVALID_OPERATION depending on whether
the primitive would be allowed by the GL version and extensions
(GL_INVALID_OPERATION) or not (GL_INVALID_ENUM).

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: precompute all valid primitive types at context creation
Marek Olšák [Sat, 16 Jan 2021 12:58:17 +0000 (07:58 -0500)]
mesa: precompute all valid primitive types at context creation

New variable gl_context::MaxValidPrimMask is set at context creation
and determines the valid primitive types for that context.

The Max prefix indicates that the mask doesn't mask out primitives
disallowed by current states and shaders.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: optimize draw index type checking
Marek Olšák [Sat, 16 Jan 2021 12:16:08 +0000 (07:16 -0500)]
mesa: optimize draw index type checking

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agofreedreno: Add missing dep on freedreno tracepoints.
Eric Anholt [Mon, 15 Feb 2021 18:36:49 +0000 (10:36 -0800)]
freedreno: Add missing dep on freedreno tracepoints.

We were only get guaranteed that libfreedreno (and thus the tracepoints
generation) was ready when we linked, not when we compiled the gmemtool.c
that also used it.

Fixes: a02dcb970fff ("freedreno: Add GPU tracepoints")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9056>

3 years agovulkan: document flags choice for vkGetDeviceQueue
Lionel Landwerlin [Mon, 15 Feb 2021 16:25:16 +0000 (18:25 +0200)]
vulkan: document flags choice for vkGetDeviceQueue

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9053>

3 years agoci/v3d: Add V3D and V3DV testing
Juan A. Suarez Romero [Fri, 12 Feb 2021 12:29:19 +0000 (13:29 +0100)]
ci/v3d: Add V3D and V3DV testing

Add OpenGL and Vulkan testing for V3D and V3DV respectively.

Add also a couple of manual piglit jobs for V3D.

v2:
 - Replace custom mustpass with running fraction of tests (Eric)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8745>

3 years agoci: add option to overwrite CPU arch
Juan A. Suarez Romero [Tue, 26 Jan 2021 18:13:21 +0000 (19:13 +0100)]
ci: add option to overwrite CPU arch

When loading Vulkan ICD file, it uses the CPU machine identifier to
load the correct one, in case multiple versions are installed.

This is fine if the machine where Mesa has been built and the machine
where the test is run are exactly the same. But this is not always the
case. As example, for armhf architecture, the machine where Mesa is
built is identified as `arm7hlf`, but the Raspberry Pi 4 is identified
as `armv7l`, so it will fail to load the ICD file, though both are
totally compatible.

This allow to define the architecture instead.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8745>

3 years agoaco: add DeviceInfo
Rhys Perry [Thu, 28 Jan 2021 13:07:11 +0000 (13:07 +0000)]
aco: add DeviceInfo

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/8761>

3 years agoaco: consider that GFX10.3 allocates LDS in 1024 byte blocks
Rhys Perry [Fri, 11 Dec 2020 17:33:03 +0000 (17:33 +0000)]
aco: consider that GFX10.3 allocates LDS in 1024 byte blocks

fossil-db (GFX10.3):
Totals from 3 (0.00% of 139391) affected shaders:
VMEM: 513 -> 511 (-0.39%)
SMEM: 94 -> 92 (-2.13%)
VClause: 31 -> 30 (-3.23%)

fossil-db (GFX10.3, wave32):
Totals from 4 (0.00% of 139391) affected shaders:
VClause: 82 -> 81 (-1.22%)

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/8761>

3 years agoradv,aco: add radv_nir_compiler_options::wgp_mode
Rhys Perry [Mon, 1 Feb 2021 15:14:01 +0000 (15:14 +0000)]
radv,aco: add radv_nir_compiler_options::wgp_mode

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8761>

3 years agoaco: add Program::wgp_mode
Rhys Perry [Thu, 28 Jan 2021 11:07:26 +0000 (11:07 +0000)]
aco: add Program::wgp_mode

Instead of assuming WGP mode on GFX10+ in different places, add a member
to Program that can be used instead.

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/8761>

3 years agoaco: fix waves calculation for wave32
Rhys Perry [Thu, 28 Jan 2021 11:04:02 +0000 (11:04 +0000)]
aco: fix waves calculation for wave32

fossil-db (GFX10.3, wave32):
Totals from 176 (0.13% of 139391) affected shaders:
SGPRs: 16648 -> 16640 (-0.05%)
VGPRs: 18920 -> 19076 (+0.82%); split: -0.30%, +1.12%
CodeSize: 2354172 -> 2354288 (+0.00%); split: -0.01%, +0.01%
MaxWaves: 1618 -> 1627 (+0.56%); split: +0.68%, -0.12%
Instrs: 435756 -> 435761 (+0.00%); split: -0.02%, +0.02%
Cycles: 8858360 -> 8869960 (+0.13%); split: -0.01%, +0.14%
VMEM: 55899 -> 57220 (+2.36%); split: +2.53%, -0.17%
SMEM: 10323 -> 10374 (+0.49%); split: +0.73%, -0.23%
VClause: 8307 -> 8290 (-0.20%); split: -0.24%, +0.04%
SClause: 16573 -> 16577 (+0.02%); split: -0.01%, +0.03%
Copies: 24641 -> 24652 (+0.04%); split: -0.24%, +0.28%

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/8761>

3 years agoradv: round up max_lds_per_simd / lds_per_wave
Rhys Perry [Thu, 28 Jan 2021 13:31:33 +0000 (13:31 +0000)]
radv: round up max_lds_per_simd / lds_per_wave

If each SIMD has to get an different number of waves, report the maximum.

One example of a situation is when a single-wave workgroup uses more than
max_lds_per_simd. This change causes radv_get_max_waves() to report a
single wave per SIMD instead of none.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8761>

3 years agoradv: use lds_{encode,alloc}_granularity
Rhys Perry [Thu, 28 Jan 2021 12:03:03 +0000 (12:03 +0000)]
radv: use lds_{encode,alloc}_granularity

This fixes a issue in radv_get_max_waves() where it aligned the LDS
allocation to 512 bytes instead of 1024 on GFX10.3.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8761>

3 years agoac: split lds_granularity into encode and allocation granularities
Rhys Perry [Thu, 28 Jan 2021 11:59:21 +0000 (11:59 +0000)]
ac: split lds_granularity into encode and allocation granularities

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/8761>

3 years agoradv: switch MaxWaves statistic to wave32 waves
Rhys Perry [Thu, 28 Jan 2021 11:42:35 +0000 (11:42 +0000)]
radv: switch MaxWaves statistic to wave32 waves

Always return the wave32 waves instead of wave64 waves because the wave32
wave count is more precise in the case of wave32.

This also fixes usage of lds_per_wave in wave32.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8761>

3 years agoradv: fix max_lds_per_simd on GFX10
Rhys Perry [Thu, 28 Jan 2021 11:44:43 +0000 (11:44 +0000)]
radv: fix max_lds_per_simd on GFX10

num_simd_per_compute_unit was the number of SIMDs per compute unit, but
lds_size_per_workgroup was the bytes of LDS per WGP.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8761>