platform/upstream/mesa.git
3 years agoradv: fix format feature reporting for modifiers
Simon Ser [Thu, 1 Apr 2021 15:06:31 +0000 (17:06 +0200)]
radv: fix format feature reporting for modifiers

The format_feature_flags bitfield is derived from the modifier if
the tiling is set to VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT.
However radv will reset the tiling to either LINEAR or OPTIMAL if
the caller supplied a VkPhysicalDeviceImageDrmFormatModifierInfoEXT
in the chain.

Stop resetting the tiling, so that we can compute the correct feature
flags.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 6c83e3ea98b7 ("radv: Add format modifier format queries.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9978>

3 years agonir/lower_tex: handle deref casts
Rhys Perry [Mon, 5 Apr 2021 13:56:46 +0000 (14:56 +0100)]
nir/lower_tex: handle deref casts

A RDR2 shader has a undef->texture cast which is eventually optimized out.
Without handling NULL from nir_deref_instr_get_variable(), compiling this
shader will result in a crash.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Fixes: bc438c91d9b ("nir/lower_tex: ignore texture_index if tex_instr has deref src")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10038>

3 years agozink: reset queries when suspending if >50% of total pool is used
Mike Blumenkrantz [Mon, 5 Apr 2021 23:13:34 +0000 (19:13 -0400)]
zink: reset queries when suspending if >50% of total pool is used

this is a great time for resets since there's never a renderpass active,
so an early reset here may mean avoiding a renderpass split later

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

3 years agozink: defer timestamp query pool resets to end_query
Mike Blumenkrantz [Mon, 5 Apr 2021 23:25:44 +0000 (19:25 -0400)]
zink: defer timestamp query pool resets to end_query

we don't do a tc context unwrap in create_query(), so this isn't a good place
to be doing anything that needs the ctx

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

3 years agozink: check last_finished first in fence_finish early out case
Mike Blumenkrantz [Mon, 5 Apr 2021 23:12:40 +0000 (19:12 -0400)]
zink: check last_finished first in fence_finish early out case

a fence's completed flag is irrelevant if we already know it has completed

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

3 years agozink: relax maybe_flush batch count threshold
Mike Blumenkrantz [Fri, 2 Apr 2021 15:18:38 +0000 (11:18 -0400)]
zink: relax maybe_flush batch count threshold

10 batch states isn't actually that many if an app happens to be flushing
a lot, so let's multiply that to catch outlier cases

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

3 years agozink: relax maybe_flush mem threshold
Mike Blumenkrantz [Fri, 2 Apr 2021 15:15:37 +0000 (11:15 -0400)]
zink: relax maybe_flush mem threshold

10% of video mem ends up being way too aggressive and causes constant
stalls

really this is supposed to be a failsafe against ooming in a single batch, so
using 50% here ends up serving that purpose much more effectively

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

3 years agozink: split total_mem off to total_video_mem, use total_mem for tc
Mike Blumenkrantz [Fri, 2 Apr 2021 15:08:46 +0000 (11:08 -0400)]
zink: split total_mem off to total_video_mem, use total_mem for tc

tc needs the total host memory available, not the total video memory

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

3 years agozink: move cmdpool reset to batch state reset
Mike Blumenkrantz [Thu, 7 Jan 2021 18:01:45 +0000 (13:01 -0500)]
zink: move cmdpool reset to batch state reset

this is a more logical place for it

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

3 years agozink: only use host mem for staging resources with linear tiling
Mike Blumenkrantz [Wed, 3 Feb 2021 22:29:24 +0000 (17:29 -0500)]
zink: only use host mem for staging resources with linear tiling

VK_EXT_4444_formats strikes again

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

3 years agozink: use 2 variant to check image format props during create
Mike Blumenkrantz [Wed, 3 Feb 2021 22:28:48 +0000 (17:28 -0500)]
zink: use 2 variant to check image format props during create

just to be pedantic

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

3 years agozink: use vkGetPhysicalDeviceFormatProperties2 when available
Mike Blumenkrantz [Wed, 3 Feb 2021 20:30:27 +0000 (15:30 -0500)]
zink: use vkGetPhysicalDeviceFormatProperties2 when available

technically shouldn't matter but whatever

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

3 years agozink: use better usage flags for staging resources
Mike Blumenkrantz [Tue, 2 Feb 2021 17:46:51 +0000 (12:46 -0500)]
zink: use better usage flags for staging resources

enforce linear bind more logically and mark with more accurate usage

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

3 years agozink: hook up cs push constant for nir_intrinsic_load_work_dim
Mike Blumenkrantz [Sat, 5 Dec 2020 14:41:26 +0000 (09:41 -0500)]
zink: hook up cs push constant for nir_intrinsic_load_work_dim

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

3 years agoutil/threaded_context: support pipe_context::set_sample_locations
Mike Blumenkrantz [Fri, 2 Apr 2021 21:24:46 +0000 (17:24 -0400)]
util/threaded_context: support pipe_context::set_sample_locations

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

3 years agovulkan: track number of bindings instead of max binding for CreateDescriptorSetLayout
Alejandro Piñeiro [Mon, 29 Mar 2021 10:10:46 +0000 (12:10 +0200)]
vulkan: track number of bindings instead of max binding for CreateDescriptorSetLayout

As that handles better, and more clear, the case of bindingCount being
zero. For the case of Anvil and Turnip, this avoids allocating a
non-needed binding when bindingCount is zero.

Inspired on radv, that was what it was doing so far.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4526

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9905>

3 years agozink/ci: handle getting correct drisw driver.
Dave Airlie [Mon, 5 Apr 2021 17:55:49 +0000 (03:55 +1000)]
zink/ci: handle getting correct drisw driver.

With zink not being autopicked, fixup the CI to pick the
correct drivers for zink testing, noting that xvfb really
doesn't want zink to be chosen.

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

3 years agodrisw: move zink down the list below the sw drivers.
Dave Airlie [Wed, 24 Mar 2021 22:34:28 +0000 (08:34 +1000)]
drisw: move zink down the list below the sw drivers.

We don't ever want drisw path picking zink as the driver,
we can revisit this when the penny wrapper work gets further
along.

This selection causes systems with nvidia/intel dual-gpus
to try and pick the intel gpu for rendering in the nvidia
context if there is no nvidia GL driver or accel doesn't work.

This is a partial revert of the original commit.

Fixes: 4a3b42a717ce ("drisw: Prefer hardware-layered sw-winsys drivers over pure sw")
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9816>

3 years agoradv: Flush caches for shader read operations.
Bas Nieuwenhuizen [Mon, 5 Apr 2021 15:48:56 +0000 (17:48 +0200)]
radv: Flush caches for shader read operations.

As part of the fmask expand we very much read from the images as
well ...

Fixes: 8f8d72af555 ("radv: Use access helpers for flushing with meta operations.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10042>

3 years agoturnip: fix alignment of non-32b types in workgroup memory
Danylo Piliaiev [Mon, 5 Apr 2021 13:52:41 +0000 (16:52 +0300)]
turnip: fix alignment of non-32b types in workgroup memory

Fixes tests:
 dEQP-VK.spirv_assembly.instruction.compute.workgroup_memory.float16

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10039>

3 years agoradv: init CMASK/FMASK/DCC in parallel
Samuel Pitoiset [Fri, 2 Apr 2021 13:41:25 +0000 (15:41 +0200)]
radv: init CMASK/FMASK/DCC in parallel

To remove bubbles during layout transitions from UNDEFINED, especially
with MSAA because we might have all.

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

3 years agomicrosoft/compiler: Fix barrier flag for shared memory
Jesse Natalie [Fri, 2 Apr 2021 18:48:59 +0000 (11:48 -0700)]
microsoft/compiler: Fix barrier flag for shared memory

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

3 years agoci/broadcom: update expected list
Juan A. Suarez Romero [Mon, 5 Apr 2021 13:49:45 +0000 (15:49 +0200)]
ci/broadcom: update expected list

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10041>

3 years agoradv: handle implicit subpass dependencies per attachment
Samuel Pitoiset [Fri, 19 Mar 2021 16:07:19 +0000 (17:07 +0100)]
radv: handle implicit subpass dependencies per attachment

From the Vulkan spec 1.2.172:

"If there is no subpass dependency from VK_SUBPASS_EXTERNAL to the
 first subpass that uses an attachment, then an implicit subpass
 dependency exists from VK_SUBPASS_EXTERNAL to the first subpass
 it is used in."

"Similarly, if there is no subpass dependency from the last subpass
 that uses an attachment to VK_SUBPASS_EXTERNAL, then an implicit
 subpass dependency exists from the last subpass it is used in to
 VK_SUBPASS_EXTERNAL."

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

3 years agodocs: mark float_controls,float16_int8,16bit_storage as done on Turnip
Danylo Piliaiev [Thu, 1 Apr 2021 18:37:20 +0000 (21:37 +0300)]
docs: mark float_controls,float16_int8,16bit_storage as done on Turnip

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9993>

3 years agoradv: allow DCC for storage images on GFX10.3 with RADV_PERFTEST=dccstores
Samuel Pitoiset [Tue, 30 Mar 2021 12:50:58 +0000 (14:50 +0200)]
radv: allow DCC for storage images on GFX10.3 with RADV_PERFTEST=dccstores

It's not enabled by default because it requires performance testing.

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

3 years agoaco: implement a workaround for the image load DCC hw bug on GFX10.3
Samuel Pitoiset [Wed, 24 Mar 2021 18:15:52 +0000 (19:15 +0100)]
aco: implement a workaround for the image load DCC hw bug on GFX10.3

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

3 years agoaco: fix get_sampler_desc() for image loads
Samuel Pitoiset [Wed, 24 Mar 2021 18:15:04 +0000 (19:15 +0100)]
aco: fix get_sampler_desc() for image loads

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

3 years agoac: add ac_gpu_info::has_image_load_dcc_bug
Samuel Pitoiset [Wed, 24 Mar 2021 16:56:27 +0000 (17:56 +0100)]
ac: add ac_gpu_info::has_image_load_dcc_bug

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

3 years agomesa/st: ignore texture_index if tex_instr has deref src
Pierre-Eric Pelloux-Prayer [Tue, 30 Mar 2021 19:50:04 +0000 (21:50 +0200)]
mesa/st: ignore texture_index if tex_instr has deref src

texture_index is meaningless when a tex_instr has deref src.
Use var->data.binding instead.

CC: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9931>

3 years agomesa/st: fix st_nir_lower_tex_src_plane arguments
Pierre-Eric Pelloux-Prayer [Tue, 30 Mar 2021 19:42:15 +0000 (21:42 +0200)]
mesa/st: fix st_nir_lower_tex_src_plane arguments

st_nir_lower_tex_src_plane expects a mask, no a boolean.

CC: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9931>

3 years agonir/lower_tex: ignore texture_index if tex_instr has deref src
Pierre-Eric Pelloux-Prayer [Tue, 30 Mar 2021 19:37:32 +0000 (21:37 +0200)]
nir/lower_tex: ignore texture_index if tex_instr has deref src

texture_index is meaningless when a tex_instr has deref src.
Use var->data.binding instead.

This fixes the incorrect lowering on radeonsi where the same
lowering steps was applied to all tex_instr based on the needs
of the first one (since texture_index is always 0).

CC: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9931>

3 years agoradv: clean up fence syncobj code
Samuel Pitoiset [Wed, 31 Mar 2021 13:43:06 +0000 (15:43 +0200)]
radv: clean up fence syncobj code

Since RADV requires DRM 3.35+, this code can be simplified.

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

3 years agoradv: try to keep HTILE compressed with DEPTH_STENCIL_READ_ONLY_OPTIMAL
Samuel Pitoiset [Fri, 2 Apr 2021 16:11:28 +0000 (18:11 +0200)]
radv: try to keep HTILE compressed with DEPTH_STENCIL_READ_ONLY_OPTIMAL

From the Vulkan spec:
    "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL specifies a
     layout for both the depth and stencil aspects of a depth/stencil
     format image allowing read only access as a depth/stencil
     attachment or in shaders as a sampled image, combined
     image/sampler, or input attachment. It is equivalent to
     VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL and
     VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL."

So, it should be safe to keep HTILE compressed if the depth/stencil
image isn't going to be sampled. We could probably extend this
to separate depth/stencil layout but that seems a bit more
complicated.

This gives a huge boost to the deferredmultisampling Vulkan demo.

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

3 years agoradv: change RADV_FORCE_FAMILY to use family name instead of LLVM processor name
Samuel Pitoiset [Thu, 1 Apr 2021 12:35:23 +0000 (14:35 +0200)]
radv: change RADV_FORCE_FAMILY to use family name instead of LLVM processor name

gfx1030 doesn't allow us to specify e.g. dimgrey.

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

3 years agoac: add ac_get_family_name() helper
Samuel Pitoiset [Thu, 1 Apr 2021 12:29:46 +0000 (14:29 +0200)]
ac: add ac_get_family_name() helper

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

3 years agobroadcom/compiler: optimize branch emission for uniform break/continue
Iago Toral Quiroga [Wed, 31 Mar 2021 07:09:45 +0000 (09:09 +0200)]
broadcom/compiler: optimize branch emission for uniform break/continue

A break/continue in a loop is typically emitted like this:

if (cond) {
    break/continue;
} else {
}

If cond is uniform, we'll emit code for a uniform if statement and
that will emit a branch right before the if to jump directly to the
else (or the block after the else in this case, since the else is
empty) in case cond evaluates to false. This means we end up emitting
two consecutive branch instructions, one before the if and one for the
THEN block right after:

branch(!cond) -> jump to else (or after else) if cond is false
nop
nop
nop
branch -> unconditional jump to break/continue
nop
nop
nop

Instead, if we are in this scenario, we can do better by emitting the
conditional jump directly and avoiding the "jump to else" case:

branch(cond) -> jump to break/continue if cond is true
nop
nop
nop

We need to be careful when emitting the break/continue for the case
where all lanes are disabled to avoid infinite loops: if we have a
break we always want to take the jump, but we don't want to take it
if it is a continue.

total instructions in shared programs: 13563672 -> 13557348 (-0.05%)
instructions in affected programs: 348034 -> 341710 (-1.82%)
helped: 1158
HURT: 10
Instructions are helped.

total uniforms in shared programs: 3779137 -> 3777535 (-0.04%)
uniforms in affected programs: 90583 -> 88981 (-1.77%)
helped: 1169
HURT: 0
Uniforms are helped.

total max-temps in shared programs: 2317670 -> 2317575 (<.01%)
max-temps in affected programs: 1943 -> 1848 (-4.89%)
helped: 85
HURT: 4
Max-temps are helped.

total sfu-stalls in shared programs: 32247 -> 32247 (0.00%)
sfu-stalls in affected programs: 69 -> 69 (0.00%)
helped: 7
HURT: 9
Inconclusive result (value mean confidence interval includes 0).

total inst-and-stalls in shared programs: 13595919 -> 13589595 (-0.05%)
inst-and-stalls in affected programs: 350674 -> 344350 (-1.80%)
helped: 1154
HURT: 11
Inst-and-stalls are helped.

total nops in shared programs: 358202 -> 354325 (-1.08%)
nops in affected programs: 17367 -> 13490 (-22.32%)
helped: 1168
HURT: 1
Nops are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9948>

3 years agobroadcom/compiler: implement restriction for branch after setmsf
Iago Toral Quiroga [Wed, 31 Mar 2021 09:55:40 +0000 (11:55 +0200)]
broadcom/compiler: implement restriction for branch after setmsf

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9948>

3 years agozink: avoid cached memory allocations when not requested
Mike Blumenkrantz [Thu, 28 Jan 2021 21:32:45 +0000 (16:32 -0500)]
zink: avoid cached memory allocations when not requested

don't rely on driver orderings to not pick this

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

3 years agolavapipe: add support for KHR_imageless_framebuffer
Dave Airlie [Fri, 5 Mar 2021 05:14:16 +0000 (15:14 +1000)]
lavapipe: add support for KHR_imageless_framebuffer

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

3 years agofeatures: mark off ARB_shader_viewport_layer_array for zink
Mike Blumenkrantz [Sun, 4 Apr 2021 13:21:47 +0000 (09:21 -0400)]
features: mark off ARB_shader_viewport_layer_array for zink

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

3 years agozink: enable PIPE_CAP_TGSI_TES_LAYER_VIEWPORT
Mike Blumenkrantz [Sun, 4 Apr 2021 13:20:03 +0000 (09:20 -0400)]
zink: enable PIPE_CAP_TGSI_TES_LAYER_VIEWPORT

should've done this when PIPE_CAP_TGSI_VS_LAYER_VIEWPORT was enabled

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

3 years agozink: only emit SpvCapabilitySampleMaskPostDepthCoverage if the mode is set
Mike Blumenkrantz [Sat, 3 Apr 2021 14:26:49 +0000 (10:26 -0400)]
zink: only emit SpvCapabilitySampleMaskPostDepthCoverage if the mode is set

this isn't always applicable

Fixes: 3c72c867422 ("zink: Wire up ARB_post_depth_coverage")

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

3 years agozink: store shader_info to ntv_context struct
Mike Blumenkrantz [Sat, 3 Apr 2021 14:26:17 +0000 (10:26 -0400)]
zink: store shader_info to ntv_context struct

tired of adding more and more bool flags here

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

3 years agolavapipe: enable KHR_image_format_list
Joshua Ashton [Sun, 4 Apr 2021 17:31:16 +0000 (18:31 +0100)]
lavapipe: enable KHR_image_format_list

Needed for DXVK.

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

3 years agolavapipe: implement CmdBindVertexBuffers with CmdBindVertexBuffers2EXT
Joshua Ashton [Sun, 4 Apr 2021 17:52:24 +0000 (18:52 +0100)]
lavapipe: implement CmdBindVertexBuffers with CmdBindVertexBuffers2EXT

Easier than fixing the broken size logic here.

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

3 years agolavapipe: handle NULL pStrides in CmdBindVertexBuffers2EXT
Joshua Ashton [Sun, 4 Apr 2021 17:50:50 +0000 (18:50 +0100)]
lavapipe: handle NULL pStrides in CmdBindVertexBuffers2EXT

Fixes: 20bd9fc54700950cab88bc13f0446b2c14f86033

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

3 years agoanv: Fix coverage masks for VK_EXT_conservative_rasterization
Jason Ekstrand [Sat, 3 Apr 2021 02:40:19 +0000 (21:40 -0500)]
anv: Fix coverage masks for VK_EXT_conservative_rasterization

Earlier, I just tried to copy what iris was doing and, as it turns out,
copied it wrong.  Also, Vulkan doesn't have a concept of getting the
conservative coverage in the shader.  The spec for SampleMask says:

    "Decorating a variable with the SampleMask built-in decoration will
    make any variable contain the coverage mask for the current fragment
    shader invocation."

And the spec for conservative rasterization says

    "When overestimate conservative rasterization is enabled, rather
    than evaluating coverage at individual sample locations, a
    determination is made of whether any portion of the pixel (including
    its edges and corners) is covered by the primitive. If any portion
    of the pixel is covered, then all bits of the coverage mask for the
    fragment corresponding to that pixel are enabled."

Putting these two together and you get what the Intel HW docs say for
ICMS_NORMAL:

    "Input Coverage masks based on inner conservatism and factors in
    SAMPLE_MASKs. If Pixel is conservatively fully covered all samples
    are enabled."

So I'm pretty sure based on this that the right thing to do here is to
ignore conservative rasterization and leave it set to ICMS_NORMAL
whenever we're not in the post-depth-coverage special case.

While we're here, fix the silly indentation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4565
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d5b56debde30 "anv: Implement VK_EXT_conservative_rasterization"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10017>

3 years agovulkan/util: Fix implicit declaration of ffs for Android build
Mauro Rossi [Sat, 3 Apr 2021 20:05:22 +0000 (22:05 +0200)]
vulkan/util: Fix implicit declaration of ffs for Android build

Similar to 641320ce02ff and 68bb26af63ac to avoid Android build errors

Fixes the following building error:

In file included from external/mesa/src/vulkan/util/vk_util.c:28:
external/mesa/src/vulkan/util/vk_util.h:248:30: error: implicit declaration of function 'ffs' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   return (gl_shader_stage) (ffs((uint32_t) vk_stage) - 1);
                             ^
1 error generated.

Fixes: 06ebbde63048 ("vulkan: Deduplicate mesa stage conversion")
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10023>

3 years agopan/bi: Lower large arrays to scratch
Alyssa Rosenzweig [Fri, 5 Mar 2021 21:55:18 +0000 (21:55 +0000)]
pan/bi: Lower large arrays to scratch

No shader-db changes.

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

3 years agopan/bi: Split writemasks for memory stores
Alyssa Rosenzweig [Sat, 3 Apr 2021 19:00:59 +0000 (15:00 -0400)]
pan/bi: Split writemasks for memory stores

Will avoid a regression in the following commit, and probably fixes some
GLES3.1 stuff.

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

3 years agopan/bi: Enable all nir_opt_move/sink optimizations
Alyssa Rosenzweig [Tue, 2 Mar 2021 16:54:33 +0000 (16:54 +0000)]
pan/bi: Enable all nir_opt_move/sink optimizations

total instructions in shared programs: 116716 -> 116716 (0.00%)

total nops in shared programs: 86280 -> 84996 (-1.49%)
nops in affected programs: 50485 -> 49201 (-2.54%)
Nops are helped.

total clauses in shared programs: 20993 -> 20732 (-1.24%)
clauses in affected programs: 7737 -> 7476 (-3.37%)
Clauses are helped.

total quadwords in shared programs: 91697 -> 91155 (-0.59%)
quadwords in affected programs: 52123 -> 51581 (-1.04%)
Quadwords are helped.

total spills in shared programs: 0 -> 0
total fills in shared programs: 0 -> 0

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

3 years agoci/bare-metal: no need to use tee
Christian Gmeiner [Thu, 1 Apr 2021 14:37:25 +0000 (16:37 +0200)]
ci/bare-metal: no need to use tee

fastboot_run.py will watch results/serial-output.txt.

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

3 years agovulkan: Deduplicate mesa stage conversion
Alyssa Rosenzweig [Tue, 9 Mar 2021 14:30:09 +0000 (14:30 +0000)]
vulkan: Deduplicate mesa stage conversion

Across every driver...

v2: Add casts to appease -fpermissive used on CI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9477>

3 years agopanfrost: Only check blend work count on midgard
Alyssa Rosenzweig [Fri, 5 Mar 2021 01:26:02 +0000 (01:26 +0000)]
panfrost: Only check blend work count on midgard

Bifrost will handle this "automatically" by virtue of the blend ABI.

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

3 years agopanfrost: Deduplicate Bifrost fau_count
Alyssa Rosenzweig [Fri, 5 Mar 2021 00:26:57 +0000 (00:26 +0000)]
panfrost: Deduplicate Bifrost fau_count

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

3 years agopanfrost: Deduplicate UBO count assignment
Alyssa Rosenzweig [Fri, 5 Mar 2021 00:26:08 +0000 (00:26 +0000)]
panfrost: Deduplicate UBO count assignment

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

3 years agopan/bi: Remove stale todo/assert
Alyssa Rosenzweig [Thu, 4 Mar 2021 23:21:46 +0000 (23:21 +0000)]
pan/bi: Remove stale todo/assert

Was already handled, just untested.

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

3 years agopan/bi: Remove TODO: RA warnings
Alyssa Rosenzweig [Thu, 4 Mar 2021 23:20:48 +0000 (23:20 +0000)]
pan/bi: Remove TODO: RA warnings

We'll make this perfectly valid syntax for precolouring.

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

3 years agopan/bi: Only run DCE once
Alyssa Rosenzweig [Tue, 2 Mar 2021 20:22:26 +0000 (20:22 +0000)]
pan/bi: Only run DCE once

No more progress loop needed. I'm skeptical we really want a dataflow
approach long-term, though, this is annoyingly expensive.

No shader-db changes.

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

3 years agopan/bi: Only run copyprop once
Alyssa Rosenzweig [Tue, 2 Mar 2021 17:59:49 +0000 (17:59 +0000)]
pan/bi: Only run copyprop once

We need to update `replacement` with the results of copyprop earlier
within the pass, but after that there's no point running more than once
if we're not going to materialize any new moves.

No shader-db changes.

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

3 years agopan/bi: Handle 16-bit blend sr_count
Alyssa Rosenzweig [Mon, 22 Feb 2021 19:47:42 +0000 (19:47 +0000)]
pan/bi: Handle 16-bit blend sr_count

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

3 years agopan/bi: Add bi_foreach_block_rev
Alyssa Rosenzweig [Fri, 5 Mar 2021 02:30:56 +0000 (02:30 +0000)]
pan/bi: Add bi_foreach_block_rev

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

3 years agopan/bi: Document register conventions
Alyssa Rosenzweig [Mon, 1 Mar 2021 19:55:07 +0000 (19:55 +0000)]
pan/bi: Document register conventions

Should motiviate RA decisions.

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

3 years agoturnip: handle format list for compressed formats
Danylo Piliaiev [Fri, 2 Apr 2021 18:40:07 +0000 (21:40 +0300)]
turnip: handle format list for compressed formats

Compressed formats may have compatible formats, however they could
only be sampled, so we should not call tu6_format_color with them.

tu6_format_texture should have the same behaviour for checking swap
so use it for all cases.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10009>

3 years agogallium: Fix broken trace XML output
Matti Hamalainen [Thu, 1 Apr 2021 20:38:09 +0000 (23:38 +0300)]
gallium: Fix broken trace XML output

Each call argument in the trace dump should be a separate <arg>
element. In this case the trace_dump_struct_array() needs to have
trace_dump_arg_begin() and trace_dump_arg_end() surrounding it,
otherwise it becomes just random data inside the parent call.

Also fix another case where one <arg> element erraneously contains
another <arg> element by moving trace_dump_arg_end() to its
proper place.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9994>

3 years agor600/sfn: Only fetch the constants that are needed in fdd*
Gert Wollny [Fri, 2 Apr 2021 12:27:38 +0000 (14:27 +0200)]
r600/sfn: Only fetch the constants that are needed in fdd*

The number of source components can be deternmined based on the number
of dest components, and copying other components to the gradient get
call is not required.

Closes #4557

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10011>

3 years agoci: Uprev piglit to 6a4be9e9946d ("piglit: NOTE! Default branch is now main")
Eric Anholt [Wed, 24 Mar 2021 17:16:26 +0000 (10:16 -0700)]
ci: Uprev piglit to 6a4be9e9946d ("piglit: NOTE! Default branch is now main")

Along with other new tests, brings in the perf improvement for
gl-1.3-texture-env so we can stop skipping it.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9806>

3 years agoci: Uprev deqp runner to 0.6.5.
Eric Anholt [Wed, 24 Mar 2021 17:14:01 +0000 (10:14 -0700)]
ci: Uprev deqp runner to 0.6.5.

Works around the other Missing case we've seen in CI, possibly fixes the
underlying issue, and adds support for comments in xfails lists.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9806>

3 years agoci/freedreno: Fix up the a5xx border color flake annotation.
Eric Anholt [Mon, 29 Mar 2021 21:43:28 +0000 (14:43 -0700)]
ci/freedreno: Fix up the a5xx border color flake annotation.

Looks like I put it in the wrong file back when I first caught it.  It's a
one-or-twice-a-week back flake that seems to happen.  The upcoming
deqp-runner uprev would have caught this mistake.

Fixes: 957132294f0e ("ci/a5xx: Increase the gles3/31 coverage.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9806>

3 years agointel: Rename WA_### to Wa_###
Anuj Phogat [Tue, 30 Mar 2021 00:24:46 +0000 (17:24 -0700)]
intel: Rename WA_### to Wa_###

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "WA_[[:digit:]]{10}" -rIl $SEARCH_PATH | xargs sed -ie "s/WA_\([[:digit:]]\{10\}\)/Wa_\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename GEN:BUG:### to Wa_###
Anuj Phogat [Tue, 30 Mar 2021 00:15:41 +0000 (17:15 -0700)]
intel: Rename GEN:BUG:### to Wa_###

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN:BUG:" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN\(:BUG:\)/Wa_/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename GEN_{ALL, LT, ..} macros to GFX_{ALL, LT, ..}
Anuj Phogat [Sat, 20 Mar 2021 00:27:26 +0000 (17:27 -0700)]
intel: Rename GEN_{ALL, LT, ..} macros to GFX_{ALL, LT, ..}

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN_" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN_\(ALL\|GE\|GT\|LT\|LE\)\([^[:alnum:]]\)/GFX_\1\2/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Remove unused MAKE_GEN macro
Anuj Phogat [Tue, 30 Mar 2021 18:01:48 +0000 (11:01 -0700)]
intel: Remove unused MAKE_GEN macro

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Make line wrapping changes due to IS_GFX_VER_BETWEEN
Anuj Phogat [Tue, 30 Mar 2021 17:49:49 +0000 (10:49 -0700)]
intel: Make line wrapping changes due to IS_GFX_VER_BETWEEN

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename IS_GEN* macros to IS_GFX_VER*
Anuj Phogat [Tue, 30 Mar 2021 17:43:38 +0000 (10:43 -0700)]
intel: Rename IS_GEN* macros to IS_GFX_VER*

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "IS_GEN" -rIl $SEARCH_PATH | xargs sed -ie "s/IS_GEN/IS_GFX_VER/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename GENx keyword to GFXx
Anuj Phogat [Mon, 29 Mar 2021 23:02:30 +0000 (16:02 -0700)]
intel: Rename GENx keyword to GFXx

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN[[:digit:]]+" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN\([[:digit:]]\+\)/GFX\1/g"

Exclude the changes to modifiers:
grep -E "I915_.*GFX" -rIl $SEARCH_PATH | xargs sed -ie "s/\(I915_.*\)GFX/\1GEN/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename Genx keyword to Gfxx
Anuj Phogat [Mon, 29 Mar 2021 22:46:12 +0000 (15:46 -0700)]
intel: Rename Genx keyword to Gfxx

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "Gen[[:digit:]]+" -rIl $SEARCH_PATH | xargs sed -ie "s/Gen\([[:digit:]]\+\)/Gfx\1/g"

Exclude changes in src/intel/perf/oa-*.xml:
find src/intel/perf -type f \( -name "*.xml" \) | xargs sed -ie "s/Gfx/Gen/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename genx keyword to gfxx in source files
Anuj Phogat [Mon, 29 Mar 2021 22:40:04 +0000 (15:40 -0700)]
intel: Rename genx keyword to gfxx in source files

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "gen[[:digit:]]+" -rIl $SEARCH_PATH | xargs sed -ie "s/gen\([[:digit:]]\+\)/gfx\1/g"

Exclude pack.h and xml changes in this patch:
grep -E "gfx[[:digit:]]+_pack\.h" -rIl $SEARCH_PATH | xargs sed -ie "s/gfx\([[:digit:]]\+_pack\.h\)/gen\1/g"
grep -E "gfx[[:digit:]]+\.xml" -rIl $SEARCH_PATH | xargs sed -ie "s/gfx\([[:digit:]]\+\.xml\)/gen\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename genx keyword to gfxx in build files
Anuj Phogat [Thu, 18 Mar 2021 22:00:33 +0000 (15:00 -0700)]
intel: Rename genx keyword to gfxx in build files

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
find $SEARCH_PATH -type f \( -name "*.mk" -o -name "*.sources" -o -name "*.build" \) | xargs sed -ie "s/gen\([[:digit:]]\+\)/gfx\1/g"

Exclude --device-prefix, xml and _pack.h changes in this patch:
find $SEARCH_PATH -type f \( -name "*.mk" -o -name "*.sources" -o -name "*.build" \) | xargs sed -ie "s/gfx\([[:digit:]]\+_pack\.h\)/gen\1/g"
find $SEARCH_PATH -type f \( -name "*.mk" -o -name "*.sources" -o -name "*.build" \) | xargs sed -ie "s/gfx\([[:digit:]]\+\.xml\)/gen\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename GENx prefix in macros to GFXx in source files
Anuj Phogat [Mon, 29 Mar 2021 22:16:59 +0000 (15:16 -0700)]
intel: Rename GENx prefix in macros to GFXx in source files

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN" -rIl src/intel/genxml | grep -E ".*py" |  xargs sed -ie "s/GEN\([%{]\)/GFX\1/g"
grep -E "[^_]GEN[[:digit:]]+" -rIl $SEARCH_PATH | grep -E ".*(\.c|\.h|\.y|\.l)" | xargs sed -ie "s/\([^_]\)GEN\([[:digit:]]\+\)/\1GFX\2/g"

Leave out renaming GFX12_CCS_E macros. They fall under renaming pattern like "_GEN[[:digit:]]+":
grep -E "GFX12_CCS_E" -rIl $SEARCH_PATH | xargs sed -ie "s/GFX12_CCS_E/GEN12_CCS_E/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename GENx prefix in macros to GFXx in build files
Anuj Phogat [Tue, 30 Mar 2021 19:22:33 +0000 (12:22 -0700)]
intel: Rename GENx prefix in macros to GFXx in build files

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN[[:digit:]]+[[:alpha:]_]*_FILES" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN\([[:digit:]]\+[[:alpha:]_]*_FILES\)/GFX\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename genx keyword in filenames to gfxx
Anuj Phogat [Tue, 30 Mar 2021 19:12:22 +0000 (12:12 -0700)]
intel: Rename genx keyword in filenames to gfxx

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
find $SEARCH_PATH -type f -name "*gen[[:digit:]]*.*[cph]" -exec sh -c 'f="{}"; mv -- "$f" "${f/gen/gfx}"' \;
grep -E "gen[[:digit:]]+_[[:alnum:]_]*\.(c|h|cpp)" -rIl $SEARCH_PATH | xargs sed -ie "s/gen\([[:digit:]]\+_[[:alnum:]_]*\.\)\(c\|h\|cpp\)/gfx\1\2/g"
grep -E "_gen[[:digit:]]+[[:alnum:]_]*\.(c|h|cpp)" -rIl $SEARCH_PATH | xargs sed -ie "s/\(_\)gen\([[:digit:]]\+[[:alnum:]_]*\.\)\(c\|h\|cpp\)/\1gfx\2\3/g"
grep -E "GEN[[:digit:]]+[[:alnum:]_]*_H( |$)" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN\([[:digit:]]\+[[:alnum:]_]*_H\)\( \|$\)/GFX\1\2/g"

Exclude the "_pack.h" changes:
grep -E "gfx[[:digit:]]+_pack\.h" -rIl $SEARCH_PATH | xargs sed -ie "s/gfx\([[:digit:]]\+_pack\.h\)/gen\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename gen field in gen_device_info struct to ver
Anuj Phogat [Mon, 29 Mar 2021 21:41:58 +0000 (14:41 -0700)]
intel: Rename gen field in gen_device_info struct to ver

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "info\)*(.|->)gen" -rIl $SEARCH_PATH | xargs sed -ie "s/info\()*\)\(\.\|->\)gen/info\1\2ver/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename genx10 field in gen_device_info struct to verx10
Anuj Phogat [Mon, 29 Mar 2021 20:43:47 +0000 (13:43 -0700)]
intel: Rename genx10 field in gen_device_info struct to verx10

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "info\)*(.|->)genx10" -rIl $SEARCH_PATH | xargs sed -ie "s/info\()*\)\(\.\|->\)genx10/info\1\2verx10/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename ISL_DEV_GEN to ISL_GFX_VER
Anuj Phogat [Mon, 29 Mar 2021 20:17:58 +0000 (13:17 -0700)]
intel: Rename ISL_DEV_GEN to ISL_GFX_VER

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "ISL_DEV_GEN" -rIl $SEARCH_PATH | xargs sed -ie "s/ISL_DEV_GEN/ISL_GFX_VER/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename GEN_GEN macro to GFX_VER
Anuj Phogat [Tue, 16 Mar 2021 17:14:30 +0000 (10:14 -0700)]
intel: Rename GEN_GEN macro to GFX_VER

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN_GEN" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN_GEN/GFX_VER/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agointel: Rename GEN_VERSIONx10 macro to GFX_VERx10
Anuj Phogat [Tue, 16 Mar 2021 17:09:00 +0000 (10:09 -0700)]
intel: Rename GEN_VERSIONx10 macro to GFX_VERx10

Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN_VERSION" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN_VERSION/GFX_VER/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>

3 years agomesa: fix restoring of texture attributes for msaa binding points
Ilia Mirkin [Fri, 2 Apr 2021 04:53:35 +0000 (00:53 -0400)]
mesa: fix restoring of texture attributes for msaa binding points

This fixes rendering in Unigine Tropics with MSAA enabled. Since the
binding for MSAA does not get restored, we can't rely on the "defaults
get restored below" logic in that case.

Fixes: 81e6f6ef0c (mesa: don't push/pop default texture attributes redundantly)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4558
Reported-by: Andrew Randrianasulu <randrianasulu@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10001>

3 years agospirv_to_dxil: Handle clip/cull distance
Jesse Natalie [Fri, 26 Mar 2021 01:27:22 +0000 (18:27 -0700)]
spirv_to_dxil: Handle clip/cull distance

Clip/cull only needs a little bit of lowering before nir_to_dxil can
handle it. Specifically, we just need to split apart arrays that
straddle the 4-component boundary of location, so that the signature
builder can handle it.

To do that cleanly, we need to add some lowering and optimization passes:
* nir_lower_clip_cull_distance_arrays: Merge clip/cull into a single array,
  which is similar to DXIL's requirements here.
* nir_lower_io_to_temporaries: Ensure that we only have one non-indirect write
  to the clip/cull output.
* nir_split_var_copies and nir_lower_var_copies: Ensure that each array entry
  has an independent write with a constant index
* Optimization loop: Make sure that there's no extra derefs in the way between
  deref_var for the output, deref_array for the component, and store_deref.
Then we can actually lower the clip/cull array cleanly.

Still to do is to sort the variables and add driver_location.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agomicrosoft/spirv_to_dxil: Implement TODO for removing dead functions
Jesse Natalie [Fri, 26 Mar 2021 01:22:44 +0000 (18:22 -0700)]
microsoft/spirv_to_dxil: Implement TODO for removing dead functions

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agod3d12: Use compact arrays for clip/cull distance
Jesse Natalie [Fri, 26 Mar 2021 01:21:37 +0000 (18:21 -0700)]
d3d12: Use compact arrays for clip/cull distance

This puts us more in line with other drivers, and matches what
SPIR-V would produce rather than the GLSL compiler. It also means
we can delete the current fixup pass, since previously clip distance
was always float4s but some components could go unused. Now, clip
distance is an array that's appropriately sized for what's actually
written.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agomicrosoft/compiler: Support compact arrays for clip/cull in nir_to_dxil
Jesse Natalie [Fri, 26 Mar 2021 01:21:10 +0000 (18:21 -0700)]
microsoft/compiler: Support compact arrays for clip/cull in nir_to_dxil

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agomicrosoft/compiler: Enable dxil_nir.h to be included from C++
Jesse Natalie [Fri, 26 Mar 2021 01:20:27 +0000 (18:20 -0700)]
microsoft/compiler: Enable dxil_nir.h to be included from C++

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agomicrosoft/compiler: Add a lowering pass to split clip/cull distance compact arrays
Jesse Natalie [Fri, 26 Mar 2021 01:19:53 +0000 (18:19 -0700)]
microsoft/compiler: Add a lowering pass to split clip/cull distance compact arrays

As the pass's comment explains, NIR compact arrays are a better match
to represent the GLSL float[] design of clip/cull distance arrays, compared
to the float4[2] approach. This pass adjusts the variables to more closely
match what DXIL signatures would look like for that representation.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agomicrosoft/compiler: Add copy_prop_vars to optimization loop
Jesse Natalie [Fri, 26 Mar 2021 01:17:19 +0000 (18:17 -0700)]
microsoft/compiler: Add copy_prop_vars to optimization loop

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agomicrosoft/compiler: Move blob_init earlier to prevent crash on failure
Jesse Natalie [Fri, 26 Mar 2021 01:16:54 +0000 (18:16 -0700)]
microsoft/compiler: Move blob_init earlier to prevent crash on failure

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agomicrosoft/spirv_to_dxil: Add extra lowering functions according to the docs on nir_in...
Michael Tang [Tue, 23 Mar 2021 21:42:03 +0000 (14:42 -0700)]
microsoft/spirv_to_dxil: Add extra lowering functions according to the docs on nir_inline_functions

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agomicrosoft/spirv_to_dxil: Add lowering pass to handle gl_PerVertex
Michael Tang [Tue, 23 Mar 2021 21:39:09 +0000 (14:39 -0700)]
microsoft/spirv_to_dxil: Add lowering pass to handle gl_PerVertex

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>

3 years agofeatures: mark off GL_OES_viewport_array for zink
Mike Blumenkrantz [Fri, 2 Apr 2021 15:35:44 +0000 (11:35 -0400)]
features: mark off GL_OES_viewport_array for zink

also done for a while

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