platform/upstream/mesa.git
2 years agozink: don't add resource to pending barrier set if no barrier will be generated
Mike Blumenkrantz [Tue, 14 Sep 2021 13:33:04 +0000 (09:33 -0400)]
zink: don't add resource to pending barrier set if no barrier will be generated

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

2 years agozink: split out bvci creation from object creation
Mike Blumenkrantz [Fri, 10 Sep 2021 20:29:22 +0000 (16:29 -0400)]
zink: split out bvci creation from object creation

make this reusable like the others

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

2 years agozink: force lazy descriptor set rebinds if pipeline compatibility changes
Mike Blumenkrantz [Fri, 17 Sep 2021 15:54:09 +0000 (11:54 -0400)]
zink: force lazy descriptor set rebinds if pipeline compatibility changes

if the pipeline layout changes, it's technically illegal to not rebind the descriptor
set even if it hasn't changed

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

2 years agozink: remove duplicated struct member set
Mike Blumenkrantz [Fri, 17 Sep 2021 18:58:05 +0000 (14:58 -0400)]
zink: remove duplicated struct member set

this should only happen in zink_descriptors_update_lazy_masked

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

2 years agoac/surface: correct a comment about DCC image stores
Marek Olšák [Mon, 20 Sep 2021 11:38:24 +0000 (07:38 -0400)]
ac/surface: correct a comment about DCC image stores

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13013>

2 years agoac/surface: use DCC compatible with image stores for < 4K resolutions
Marek Olšák [Thu, 16 Sep 2021 00:38:43 +0000 (20:38 -0400)]
ac/surface: use DCC compatible with image stores for < 4K resolutions

We don't have to use the special DCC settings for lower resolutions.

This will cause corruption if X and an windowed app use different Mesa
versions. The fix is to restart the X server. I expect to get false bug
reports due to this.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13013>

2 years agoradeonsi: remove the unused cs parameter from remaining packet functions
Marek Olšák [Thu, 23 Sep 2021 11:17:58 +0000 (07:17 -0400)]
radeonsi: remove the unused cs parameter from remaining packet functions

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13015>

2 years agoradeonsi: remove the unused cs parameter from radeon_set_uconfig_reg
Marek Olšák [Thu, 23 Sep 2021 11:17:58 +0000 (07:17 -0400)]
radeonsi: remove the unused cs parameter from radeon_set_uconfig_reg

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13015>

2 years agoradeonsi: remove the unused cs parameter from radeon_set_sh_reg
Marek Olšák [Thu, 23 Sep 2021 11:17:58 +0000 (07:17 -0400)]
radeonsi: remove the unused cs parameter from radeon_set_sh_reg

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13015>

2 years agoradeonsi: remove the unused cs parameter from radeon_set_(config|context)_reg
Marek Olšák [Thu, 23 Sep 2021 11:17:58 +0000 (07:17 -0400)]
radeonsi: remove the unused cs parameter from radeon_set_(config|context)_reg

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13015>

2 years agoradeonsi: remove the unused cs parameter from radeon_emit_array
Marek Olšák [Thu, 23 Sep 2021 11:17:58 +0000 (07:17 -0400)]
radeonsi: remove the unused cs parameter from radeon_emit_array

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13015>

2 years agoradeonsi: remove the unused cs parameter from radeon_emit
Marek Olšák [Thu, 23 Sep 2021 11:17:58 +0000 (07:17 -0400)]
radeonsi: remove the unused cs parameter from radeon_emit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13015>

2 years agodocs: mark off GL_EXT_multisampled_render_to_texture for zink
Mike Blumenkrantz [Mon, 20 Sep 2021 13:07:32 +0000 (09:07 -0400)]
docs: mark off GL_EXT_multisampled_render_to_texture for zink

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: implement GL_EXT_multisampled_render_to_texture
Mike Blumenkrantz [Wed, 15 Sep 2021 19:12:09 +0000 (15:12 -0400)]
zink: implement GL_EXT_multisampled_render_to_texture

this requires allocating and using a lazily-allocated msaa surface as a transient
attachment for the base render operation, resolving it

...except vulkan has no "replicate" renderpass attachment mechanism, so for now we're
just gonna allocate a transient surface and hang on to it. sorry tilers!

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: stop setting nr_samples for shader image surface creation
Mike Blumenkrantz [Fri, 24 Sep 2021 19:53:44 +0000 (15:53 -0400)]
zink: stop setting nr_samples for shader image surface creation

that's not what this should be used for

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: move fb attachment init to new function
Mike Blumenkrantz [Fri, 17 Sep 2021 13:12:39 +0000 (09:12 -0400)]
zink: move fb attachment init to new function

this is going to get more complicated

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: remove fbfetch layout thingy from zs renderpass init
Mike Blumenkrantz [Fri, 17 Sep 2021 13:11:35 +0000 (09:11 -0400)]
zink: remove fbfetch layout thingy from zs renderpass init

zs doesn't do fbfetch

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: reorder draw state updates
Mike Blumenkrantz [Fri, 17 Sep 2021 12:31:55 +0000 (08:31 -0400)]
zink: reorder draw state updates

starting a renderpass can trigger recursion and other draws, so do all
state updates/binds after the renderpass has begun

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: improve handling of buffer rebinds using tc info
Mike Blumenkrantz [Thu, 16 Sep 2021 00:27:09 +0000 (20:27 -0400)]
zink: improve handling of buffer rebinds using tc info

tc rebind info can't distinguish between buffers bound multiple times
in a given bind point (e.g., for multiple vertex buffers), so ensure all
rebinds are processed and the global rebind isn't triggered if multiple rebinds
are processed for a given buffer

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: add ZINK_BIND_TRANSIENT
Mike Blumenkrantz [Wed, 15 Sep 2021 19:10:07 +0000 (15:10 -0400)]
zink: add ZINK_BIND_TRANSIENT

this is used to create lazily allocated images for use as transient
renderpass attachments

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: add ZINK_HEAP_DEVICE_LOCAL_LAZY
Mike Blumenkrantz [Wed, 15 Sep 2021 19:09:48 +0000 (15:09 -0400)]
zink: add ZINK_HEAP_DEVICE_LOCAL_LAZY

this is for lazily allocated resources

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agozink: repack zink_render_pass_state
Mike Blumenkrantz [Wed, 15 Sep 2021 15:41:58 +0000 (11:41 -0400)]
zink: repack zink_render_pass_state

saves a couple wasted bits

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>

2 years agospirv: don't fail on CapabilitySubgroupDispatch if supported
Lionel Landwerlin [Fri, 24 Sep 2021 14:26:23 +0000 (17:26 +0300)]
spirv: don't fail on CapabilitySubgroupDispatch if supported

Since only Anv uses the value, I'm only enabling this on anv.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 518693c3eca195 ("spirv: Handle the SubgroupSize execution mode")
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13034>

2 years agozink: split vk debug logging into separate functions
Mike Blumenkrantz [Fri, 24 Sep 2021 19:29:46 +0000 (15:29 -0400)]
zink: split vk debug logging into separate functions

being able to breakpoint these easily is crucial to debugging, and it sucks to
always have to go back and check the line numbers, so now there's easily-rememberable
functions for it

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

2 years agozink/codegen: do not enable extensions based on vulkan version
Hoe Hao Cheng [Thu, 23 Sep 2021 19:02:46 +0000 (03:02 +0800)]
zink/codegen: do not enable extensions based on vulkan version

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

2 years agoturnip: Swizzle in 0, 1 for D24S8 STENCIL_ASPECT sampling.
Emma Anholt [Fri, 24 Sep 2021 00:26:49 +0000 (17:26 -0700)]
turnip: Swizzle in 0, 1 for D24S8 STENCIL_ASPECT sampling.

This seems to be what is expected by the CTS, but I haven't found a
citation.

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

2 years agozink: enable timeline ext features
Mike Blumenkrantz [Fri, 24 Sep 2021 14:56:08 +0000 (10:56 -0400)]
zink: enable timeline ext features

this is required by spec even though nobody cares

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

2 years agonir/opt_if: add opt_if_rewrite_uniform_uses
Rhys Perry [Wed, 18 Aug 2021 18:08:54 +0000 (19:08 +0100)]
nir/opt_if: add opt_if_rewrite_uniform_uses

Turns:
if (a == (b=readfirstlane(a)))
   use(a)
into:
if (a == (b=readfirstlane(a)))
   use(b)

Improves divergence analysis and lets us scalarize use(a). Improves
Cyberpunk 2077 performance.

fossil-db (Sienna Cichlid, Cyberpunk 2077):
Totals from 57 (10.56% of 540) affected shaders:
VGPRs: 4904 -> 4040 (-17.62%)
CodeSize: 624360 -> 626828 (+0.40%); split: -0.06%, +0.46%
MaxWaves: 656 -> 824 (+25.61%)
Instrs: 119770 -> 119447 (-0.27%); split: -0.49%, +0.22%
Latency: 1950256 -> 1633110 (-16.26%); split: -16.26%, +0.00%
InvThroughput: 364852 -> 292089 (-19.94%)
VClause: 1512 -> 1008 (-33.33%)
SClause: 2693 -> 3196 (+18.68%)
Copies: 10050 -> 9955 (-0.95%); split: -3.34%, +2.40%
Branches: 3476 -> 3547 (+2.04%)
PreSGPRs: 4003 -> 5076 (+26.80%)
PreVGPRs: 4709 -> 3810 (-19.09%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12472>

2 years agonir: add nir_src_components_read()
Rhys Perry [Thu, 19 Aug 2021 13:33:02 +0000 (14:33 +0100)]
nir: add nir_src_components_read()

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12472>

2 years agoradv: Reduce NGG culling small draw threshold to 128.
Timur Kristóf [Tue, 14 Sep 2021 17:08:33 +0000 (19:08 +0200)]
radv: Reduce NGG culling small draw threshold to 128.

Many modern games use draw calls with only a few vertices.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12859>

2 years agoradv: Select PC oversubscription rate based on number of PS params.
Timur Kristóf [Tue, 14 Sep 2021 17:06:10 +0000 (19:06 +0200)]
radv: Select PC oversubscription rate based on number of PS params.

Decide the oversubscription rate similarly to how RadeonSI does it:
Oversubscribe a smaller amount of PC (parameter cache) when there are
fewer params.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12859>

2 years agoturnip: Set the VK_DRIVER_ID to our new enum.
Emma Anholt [Thu, 23 Sep 2021 22:13:46 +0000 (15:13 -0700)]
turnip: Set the VK_DRIVER_ID to our new enum.

This hasn't been exposed yet, but would be with vulkan 1.2 or
VK_KHR_driver_properties

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

2 years agovulkan: Update the XML and headers to 1.2.193
Emma Anholt [Thu, 23 Sep 2021 22:12:44 +0000 (15:12 -0700)]
vulkan: Update the XML and headers to 1.2.193

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

2 years agoac/nir/nggc: Don't reuse uniform values from divergent control flow.
Timur Kristóf [Fri, 24 Sep 2021 15:37:45 +0000 (17:37 +0200)]
ac/nir/nggc: Don't reuse uniform values from divergent control flow.

With NGG culling, the shaders are split into two parts:
the top part that computes just the position output,
and the bottom part which produces the other outputs.

To reduce redundancy between the two, I added some code
to reuse uniform variables between them. However, there is
an edge case I didn't think about: because of vertex repacking,
it is possible for the bottom part to process a different vertex.
Therefore it can take a different divergent code path
(though it must still take the same uniform code path).
Due to this, when a uniform value comes from divergent control
flow, this may be undefined in the bottom part.

This commit stops reusing uniform variables from
divergent control flow, to fix issues that arise from this.

Fossil DB stats on Sienna Cichlid with NGGC on:

Totals from 1723 (1.34% of 128647) affected shaders:
VGPRs: 89312 -> 89184 (-0.14%); split: -0.15%, +0.01%
SpillSGPRs: 4575 -> 120 (-97.38%)
CodeSize: 10846424 -> 10873836 (+0.25%); split: -0.68%, +0.93%
MaxWaves: 34582 -> 34602 (+0.06%); split: +0.06%, -0.01%
Instrs: 2124471 -> 2128835 (+0.21%); split: -0.51%, +0.72%
Latency: 7274569 -> 7293899 (+0.27%); split: -0.22%, +0.48%
InvThroughput: 1637130 -> 1635490 (-0.10%); split: -0.17%, +0.07%
VClause: 25141 -> 25414 (+1.09%); split: -0.02%, +1.10%
SClause: 56367 -> 59503 (+5.56%); split: -1.36%, +6.93%
Copies: 230704 -> 219313 (-4.94%); split: -5.49%, +0.55%
Branches: 72781 -> 72681 (-0.14%); split: -0.21%, +0.07%
PreSGPRs: 118766 -> 100176 (-15.65%); split: -15.70%, +0.05%
PreVGPRs: 76876 -> 76833 (-0.06%)

Fixes: 0bb543bb60f93bea5b1c0ed6382ced49e659273e
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13001>

2 years agoac/nir/nggc: Refactor save_reusable_variables.
Timur Kristóf [Fri, 24 Sep 2021 15:23:17 +0000 (17:23 +0200)]
ac/nir/nggc: Refactor save_reusable_variables.

This makes the code more elegant and also fixes the mistake of
skipping the blocks that come before loops.

Fossil DB changes on Sienna Cichlid with NGGC on:

Totals from 1026 (0.80% of 128647) affected shaders:
SpillSGPRs: 3817 -> 4035 (+5.71%)
CodeSize: 5582856 -> 5538732 (-0.79%); split: -0.89%, +0.10%
Instrs: 1106907 -> 1100180 (-0.61%); split: -0.68%, +0.07%
Latency: 10084948 -> 10052197 (-0.32%); split: -0.37%, +0.05%
InvThroughput: 1567012 -> 1564949 (-0.13%); split: -0.16%, +0.03%
SClause: 39789 -> 39075 (-1.79%); split: -2.33%, +0.54%
Copies: 95184 -> 96456 (+1.34%); split: -0.19%, +1.53%
Branches: 44087 -> 44093 (+0.01%); split: -0.01%, +0.02%
PreSGPRs: 47584 -> 51009 (+7.20%); split: -0.61%, +7.80%

Fixes: 0bb543bb60f93bea5b1c0ed6382ced49e659273e
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13001>

2 years agoradv/llvm: stop using vs_common_out.export_prim_id
Samuel Pitoiset [Fri, 24 Sep 2021 12:17:49 +0000 (14:17 +0200)]
radv/llvm: stop using vs_common_out.export_prim_id

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13028>

2 years agoradv,aco: stop using vs_common_out.export_clip_dists
Samuel Pitoiset [Fri, 24 Sep 2021 12:10:39 +0000 (14:10 +0200)]
radv,aco: stop using vs_common_out.export_clip_dists

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13028>

2 years agoradv: add export_clip_dists for VS and TES to radv_shader_info
Samuel Pitoiset [Fri, 24 Sep 2021 11:55:10 +0000 (13:55 +0200)]
radv: add export_clip_dists for VS and TES to radv_shader_info

To be able to remove radv_vs_out_key entirely.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13028>

2 years agoradv: Fix gs_vgpr_comp_cnt for NGG culling in vertex shaders.
Timur Kristóf [Fri, 24 Sep 2021 13:54:03 +0000 (15:54 +0200)]
radv: Fix gs_vgpr_comp_cnt for NGG culling in vertex shaders.

Previously these shaders always took the path to gs_vgpr_comp_cnt=3,
but now they are 0 when they don't use primitive id.

Fixes: 7ad69e2f7ee10c0e7afc302b9324e7a320424dcb
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13031>

2 years agonir/lower_io_to_vector: Allow Task/Mesh to load from outputs
Caio Marcelo de Oliveira Filho [Fri, 13 Aug 2021 19:22:52 +0000 (12:22 -0700)]
nir/lower_io_to_vector: Allow Task/Mesh to load from outputs

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12951>

2 years agoradv/llvm: stop using vs_common_out.as_ngg_passthrough
Samuel Pitoiset [Fri, 24 Sep 2021 10:06:44 +0000 (12:06 +0200)]
radv/llvm: stop using vs_common_out.as_ngg_passthrough

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13025>

2 years agoradv: remove useless as_ngg_passthrough init when lowering NGG in NIR
Samuel Pitoiset [Fri, 24 Sep 2021 10:04:36 +0000 (12:04 +0200)]
radv: remove useless as_ngg_passthrough init when lowering NGG in NIR

Nothing reads the value after that, except LLVM but we don't lower it
in NIR (yet).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13025>

2 years agoclc: use the defined version for the parser
Lionel Landwerlin [Fri, 24 Sep 2021 07:55:05 +0000 (10:55 +0300)]
clc: use the defined version for the parser

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13018>

2 years agomicrosoft/clc: small compile fix on Linux
Lionel Landwerlin [Fri, 24 Sep 2021 08:11:22 +0000 (11:11 +0300)]
microsoft/clc: small compile fix on Linux

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13018>

2 years agoradv: stop using the shader keys for as_ls/as_es/as_ngg when possible
Samuel Pitoiset [Fri, 24 Sep 2021 09:17:40 +0000 (11:17 +0200)]
radv: stop using the shader keys for as_ls/as_es/as_ngg when possible

radv_shader_info should be initialized correctly at this point.
There is still few occurences earlier in the pipeline but they aren't
easy to remove right now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13023>

2 years agopanfrost: Fix incorrect test condition
Alyssa Rosenzweig [Thu, 23 Sep 2021 20:53:47 +0000 (16:53 -0400)]
panfrost: Fix incorrect test condition

Oh, the irony. I linked to this file in a software design class as an
example of how unit testing works under the hood, since it's not using
any particular testing framework. In doing so I realized the test is
totally broken. It doesn't matter -- the tests passed before, pass now,
and the code being tested is correct. But let's still fix the
embarassing logic error for future Panfrost hackers.

Fixes: d42e53c77a2 ("panfrost: Unit test clear colour packing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13006>

2 years agoaco/tests: add idep_amdgfxregs_h
Rhys Perry [Thu, 22 Jul 2021 10:13:31 +0000 (11:13 +0100)]
aco/tests: add idep_amdgfxregs_h

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 9bf30c4a5cb ("aco/tests: add tests for form_hard_clauses()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12017>

2 years agoradv: remove unused radv_tcs_variant_key:primitive_mode
Samuel Pitoiset [Fri, 24 Sep 2021 09:19:58 +0000 (11:19 +0200)]
radv: remove unused radv_tcs_variant_key:primitive_mode

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13022>

2 years agobroadcom/compiler: remove qpu_acc helper
Alejandro Piñeiro [Mon, 13 Sep 2021 23:15:58 +0000 (01:15 +0200)]
broadcom/compiler: remove qpu_acc helper

It is really small, and used just twice, so we just call qpu_magic.

We also update how it is used:

  * QFILE_NULL is an undef so we can just load anything. Previously we
    were using accumulator 0, but there isn't any real reason to use
    an accumulator for this. Using reg 0.

  * QFILE_LOAD_IMM: it seems that we don't use at all right now, so
    let's add an assert

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

2 years agobroadcom/compiler: remove commented out vir_LOAD_IMM methods
Alejandro Piñeiro [Wed, 22 Sep 2021 23:13:13 +0000 (01:13 +0200)]
broadcom/compiler: remove commented out vir_LOAD_IMM methods

It has been commented several years now. Let's remove it to reduce the
noise.

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

2 years agoradv: stop loading invocation ID for NGG vertex shaders
Samuel Pitoiset [Thu, 23 Sep 2021 10:40:57 +0000 (12:40 +0200)]
radv: stop loading invocation ID for NGG vertex shaders

This is unnecessary and was copied from RadeonSI which needs it for
edge flags. RADV should never to read the invocation ID for VS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12997>

2 years agoradv: Remove dead min waves code.
Georg Lehmann [Thu, 23 Sep 2021 20:31:26 +0000 (22:31 +0200)]
radv: Remove dead min waves code.

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

2 years agolavapipe/ci: drop some fails I fixed recently
Dave Airlie [Fri, 24 Sep 2021 02:53:03 +0000 (12:53 +1000)]
lavapipe/ci: drop some fails I fixed recently

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13011>

2 years agoanv: Switch to new debug message helpers
Yevhenii Kolesnikov [Thu, 13 May 2021 18:39:09 +0000 (21:39 +0300)]
anv: Switch to new debug message helpers

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10318>

2 years agovulkan: Add convenience debug message helpers
Yevhenii Kolesnikov [Tue, 21 Sep 2021 22:56:38 +0000 (01:56 +0300)]
vulkan: Add convenience debug message helpers

Forwards the message to both VK_EXT_debug_utils and
VK_EXT_debug_report provided callbacks.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10318>

2 years agovulkan: Add vk_asprintf and vk_vasprintf helpers
Yevhenii Kolesnikov [Thu, 23 Sep 2021 17:23:33 +0000 (20:23 +0300)]
vulkan: Add vk_asprintf and vk_vasprintf helpers

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10318>

2 years agovulkan/enum_to_str: Add generator for VkObjectType to Vulkan Handle
Yevhenii Kolesnikov [Tue, 21 Sep 2021 22:50:23 +0000 (01:50 +0300)]
vulkan/enum_to_str: Add generator for VkObjectType to Vulkan Handle

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10318>

2 years agovulkan: Implement VK_EXT_debug_utils
Yevhenii Kolesnikov [Fri, 2 Apr 2021 15:07:22 +0000 (18:07 +0300)]
vulkan: Implement VK_EXT_debug_utils

This implements all the necessary features of VK_EXT_debug_utils in
common code.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10318>

2 years agogallium/format: move two vertex formats into the proper place.
Dave Airlie [Thu, 23 Sep 2021 06:07:46 +0000 (16:07 +1000)]
gallium/format: move two vertex formats into the proper place.

These two can be vertex formats with vulkan so lavapipe can
expose them.

Fixes
dEQP-VK.pipeline.vertex_input.single_attribute.uvec4.as_a2r10g10b10_uint_pack32_rate_vertex

Fixes: e002f5a086c7 ("gallium: change pipe_vertex_element::src_format to uint8_t")

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

2 years agoradv: Use the shared now-in-core feature/prop extension helper functions.
Emma Anholt [Tue, 21 Sep 2021 22:07:46 +0000 (15:07 -0700)]
radv: Use the shared now-in-core feature/prop extension helper functions.

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

2 years agoanv: Use the shared now-in-core feature/prop extension helper functions.
Emma Anholt [Tue, 21 Sep 2021 22:04:38 +0000 (15:04 -0700)]
anv: Use the shared now-in-core feature/prop extension helper functions.

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

2 years agoturnip: Use the shared now-in-core feature/prop extension helper functions.
Emma Anholt [Tue, 21 Sep 2021 22:04:10 +0000 (15:04 -0700)]
turnip: Use the shared now-in-core feature/prop extension helper functions.

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

2 years agovulkan: Support PHYSICAL_DEVICE_1_n_ features/properties in the helpers.
Emma Anholt [Tue, 21 Sep 2021 23:42:40 +0000 (16:42 -0700)]
vulkan: Support PHYSICAL_DEVICE_1_n_ features/properties in the helpers.

Since we have a filled out struct available, just memcpy it over so the
driver doesn't have to fill it out again.

Suggested by Jason, this is code that isn't copy-and-paste from anv.

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

2 years agovulkan: Add helpers for filling exts for core features and properties.
Emma Anholt [Tue, 21 Sep 2021 22:03:21 +0000 (15:03 -0700)]
vulkan: Add helpers for filling exts for core features and properties.

This is boilerplate that drivers have to replicate, so make a nice helper.
The feature/property macro lists are are copy and pasted from anv, though
the helper functions has been split between 1.1 and 1.2 (and thus the macros
refactored).

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

2 years agolavapipe: Use a common vk_queue structure
Yevhenii Kolesnikov [Tue, 6 Apr 2021 12:32:55 +0000 (15:32 +0300)]
lavapipe: Use a common vk_queue structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agov3dv: Use a common vk_queue structure
Yevhenii Kolesnikov [Tue, 6 Apr 2021 12:30:32 +0000 (15:30 +0300)]
v3dv: Use a common vk_queue structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agoturnip: Use a common vk_queue structure
Yevhenii Kolesnikov [Tue, 6 Apr 2021 12:28:28 +0000 (15:28 +0300)]
turnip: Use a common vk_queue structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agoradv: Use a common vk_queue structure
Yevhenii Kolesnikov [Tue, 6 Apr 2021 12:26:12 +0000 (15:26 +0300)]
radv: Use a common vk_queue structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agoanv: Use a common vk_queue structure
Yevhenii Kolesnikov [Fri, 2 Apr 2021 15:01:01 +0000 (18:01 +0300)]
anv: Use a common vk_queue structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agovulkan: Add a common vk_queue structure
Yevhenii Kolesnikov [Fri, 2 Apr 2021 14:55:14 +0000 (17:55 +0300)]
vulkan: Add a common vk_queue structure

This can be used e.g. for storing debug labels for the common
implementation of VK_EXT_debug_utils.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agolavapipe: Use a common vk_command_buffer structure
Yevhenii Kolesnikov [Tue, 6 Apr 2021 12:19:12 +0000 (15:19 +0300)]
lavapipe: Use a common vk_command_buffer structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agov3dv: Use a common vk_command_buffer structure
Yevhenii Kolesnikov [Tue, 6 Apr 2021 12:13:14 +0000 (15:13 +0300)]
v3dv: Use a common vk_command_buffer structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agoturnip: Use a common vk_command_buffer structure
Yevhenii Kolesnikov [Tue, 6 Apr 2021 12:09:20 +0000 (15:09 +0300)]
turnip: Use a common vk_command_buffer structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agoradv: Use a common vk_command_buffer structure
Yevhenii Kolesnikov [Tue, 6 Apr 2021 12:00:53 +0000 (15:00 +0300)]
radv: Use a common vk_command_buffer structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agoanv: Use a common vk_command_buffer structure
Yevhenii Kolesnikov [Fri, 2 Apr 2021 14:57:54 +0000 (17:57 +0300)]
anv: Use a common vk_command_buffer structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agovulkan: Add a common vk_command_buffer structure
Yevhenii Kolesnikov [Fri, 2 Apr 2021 14:52:34 +0000 (17:52 +0300)]
vulkan: Add a common vk_command_buffer structure

This can be used e.g. for storing debug labels for the common
implementation of VK_EXT_debug_utils.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

2 years agoradv/llvm: Don't read edge flags anymore.
Timur Kristóf [Thu, 23 Sep 2021 13:33:02 +0000 (15:33 +0200)]
radv/llvm: Don't read edge flags anymore.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12998>

2 years agoac/nir: Emit edge flag instructions conditionally.
Timur Kristóf [Fri, 17 Sep 2021 19:36:21 +0000 (21:36 +0200)]
ac/nir: Emit edge flag instructions conditionally.

They are not needed by RADV but will be needed by RadeonSI.

Fossil DB results on Sienna Cichlid (with NGGC on):
Totals from 56917 (44.24% of 128647) affected shaders:
VGPRs: 1982664 -> 1975936 (-0.34%); split: -0.43%, +0.09%
CodeSize: 152790880 -> 149510316 (-2.15%); split: -2.15%, +0.00%
MaxWaves: 1617984 -> 1621900 (+0.24%)
Instrs: 29272825 -> 28907038 (-1.25%); split: -1.26%, +0.01%
Latency: 128744182 -> 127565678 (-0.92%); split: -1.14%, +0.22%
InvThroughput: 20125915 -> 19805168 (-1.59%); split: -1.63%, +0.03%
VClause: 521312 -> 519804 (-0.29%); split: -0.77%, +0.48%
SClause: 688861 -> 688897 (+0.01%); split: -0.04%, +0.05%
Copies: 3205421 -> 3177799 (-0.86%); split: -1.68%, +0.82%
Branches: 1181457 -> 1183147 (+0.14%); split: -0.03%, +0.17%
PreVGPRs: 1626681 -> 1595406 (-1.92%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12998>

2 years agoradv: Disable HW generated edge flags for NGG shaders.
Timur Kristóf [Fri, 17 Sep 2021 19:35:25 +0000 (21:35 +0200)]
radv: Disable HW generated edge flags for NGG shaders.

Vulkan doesn't support user edge flags, and also doesn't have
any decomposed primitives where drawing internal edges should
be disallowed. Hence, we don't need this.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12998>

2 years agomicrosoft/clc: Add a test for specializing via SPIRV-Tools
Jesse Natalie [Mon, 19 Apr 2021 12:38:42 +0000 (05:38 -0700)]
microsoft/clc: Add a test for specializing via SPIRV-Tools

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agomicrosoft/clc: Add API to independently specialize SPIR-V
Jesse Natalie [Mon, 19 Apr 2021 14:14:24 +0000 (07:14 -0700)]
microsoft/clc: Add API to independently specialize SPIR-V

We need the ability to specialize unlinked SPIR-V, so use SPIR-V tools
to specialize prior to linking.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agomicrosoft/clc: Support passing specialization consts to spirv_to_nir
Jesse Natalie [Mon, 19 Apr 2021 14:10:59 +0000 (07:10 -0700)]
microsoft/clc: Support passing specialization consts to spirv_to_nir

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agomicrosoft/clc: Parse SPIR-V specialization consts into metadata
Jesse Natalie [Mon, 19 Apr 2021 14:09:58 +0000 (07:09 -0700)]
microsoft/clc: Parse SPIR-V specialization consts into metadata

We need to be able to validate at the API that set specialization consts
have a valid ID and the value is the correct size.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agomicrosoft/clc: Support SPIR intermediates in the compilation APIs
Jesse Natalie [Mon, 19 Apr 2021 13:58:56 +0000 (06:58 -0700)]
microsoft/clc: Support SPIR intermediates in the compilation APIs

We can now export SPIR (mainly just for testing) or import SPIR and
convert to SPIR-V.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agomicrosoft/clc: Split clc_object and rename entrypoints
Jesse Natalie [Mon, 19 Apr 2021 13:54:13 +0000 (06:54 -0700)]
microsoft/clc: Split clc_object and rename entrypoints

clc_object was overloaded, containing SPIR-V binary and metadata,
and it would only sometimes contain metadata (after linking). Split
it into a more generic clc_binary class which holds some type of data
(the kind depends on where it came from), and clc_metadata which can
be independently parsed on compiled or linked data.

Rename a couple entrypoints to be more explicit about what they're
actually transforming (c_to_spirv, link_spirv, spirv_to_dxil).

Add a logger to SPIR-V binary parsing so it can report errors on app-
provided SPIR-V.

Re-order helper function parameters to be more consistent (out params last).

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agomicrosoft/clc: Stop heap-allocating tiny fixed-size transparent structs
Jesse Natalie [Mon, 19 Apr 2021 13:31:05 +0000 (06:31 -0700)]
microsoft/clc: Stop heap-allocating tiny fixed-size transparent structs

The caller can allocate these however they want. They don't need
independent allocations. Removes some unnecessary failure handling.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agomicrosoft/clc: Clean up clc_context
Jesse Natalie [Mon, 19 Apr 2021 13:00:50 +0000 (06:00 -0700)]
microsoft/clc: Clean up clc_context

1. Rename it to libclc to match what it is
2. Make it opaque externally
3. Remove it from non-essential entrypoints (compile/link)

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agomicrosoft/clc: Rename compiler DLL to clon12compiler
Jesse Natalie [Sat, 17 Apr 2021 14:03:17 +0000 (07:03 -0700)]
microsoft/clc: Rename compiler DLL to clon12compiler

I no longer think there's value in trying to share code on disk here between
CL and GL at runtime, especially since we're now just building GL without LLVM

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322>

2 years agozink: check for pending memory barrier before trying to flush it
Mike Blumenkrantz [Fri, 17 Sep 2021 13:06:49 +0000 (09:06 -0400)]
zink: check for pending memory barrier before trying to flush it

this function is surprisingly heavy to call unnecessarily

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

2 years agozink: clean up texture_barrier hook a little
Mike Blumenkrantz [Mon, 13 Sep 2021 14:02:11 +0000 (10:02 -0400)]
zink: clean up texture_barrier hook a little

this looked dumb

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

2 years agomesa: GL_ARB_ES3_2_compatibility GL compat profile support
Tapani Pälli [Thu, 16 Sep 2021 10:49:25 +0000 (13:49 +0300)]
mesa: GL_ARB_ES3_2_compatibility GL compat profile support

Patch removes 'desktop=false' from aliased function, otherwise
glPrimitiveBoundingBox[ARB] cannot be retrieved via GetProcAddress.
This was seen with new OpenGL 4.5 tests that utilize
GL_ARB_ES3_2_compatibility and bounding box API.

v2: fixes to display list support (Ilia Mirkin)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12846>

2 years agoradv: Push box traversal results onto stack in correct order
Joshua Ashton [Tue, 21 Sep 2021 15:05:53 +0000 (16:05 +0100)]
radv: Push box traversal results onto stack in correct order

Currently, it's pushing from lowest distance to highest distance, so when these are popped off the stack, we start at the highest distance to lowest.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12960>

2 years agointel: Finish off the last scraps of bacon
Kenneth Graunke [Thu, 23 Sep 2021 04:47:19 +0000 (21:47 -0700)]
intel: Finish off the last scraps of bacon

The bacon is long past its expiration date and has got to go.
Composting it in the flower-beds was probably inadvisable.
So we shall throw it away.

(Originally, I imported libdrm_intel into i965, but to avoid symbol
conflicts, renamed drm_intel_* to drm_bacon_* as it was the same number
of letters and we needed an arbitrary name.  After slicing-and-dicing
away most of the fat, er, code, we renamed it to brw_bufmgr...except
for apparently this comment, which then got replicated to both iris
and crocus.  Originally it served to indicate what file contained these
functions, but bufmgr.h having prototypes for bufmgr.c is obvious, so
just delete the silly comment.  No bacon for you!)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12985>

2 years agolavapipe: don't access pColorBlendState when not legal
Dave Airlie [Thu, 23 Sep 2021 02:48:57 +0000 (12:48 +1000)]
lavapipe: don't access pColorBlendState when not legal

This state isn't valid unless some conditions are met.

Fixes VK-GL-CTS
dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs.graphics

Fixes: 578190c0fedd ("lavapipe: implement VK_EXT_color_write_enable")

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

2 years agolavapipe: fix vertex attributes/descriptor binding
Dave Airlie [Thu, 23 Sep 2021 01:05:18 +0000 (11:05 +1000)]
lavapipe: fix vertex attributes/descriptor binding

Yo' dawg, I heard you like bindings in your bindings.

When you have VertexAttribs with a binding, it's not an index into
the VertexBindings, you have to match it to the VertexBinding
with the same binding value.

This fixes
dEQP-VK.pipeline.extended_dynamic_state.after_pipelines.vertex_input_multiple_bindings
and some others.

Fixes: 5951d2abacd3 ("lavapipe: implement EXT_vertex_input_dynamic_state")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12983>

2 years agoradv: remove useless shader variant key copies for VS+TCS
Samuel Pitoiset [Wed, 22 Sep 2021 13:40:14 +0000 (15:40 +0200)]
radv: remove useless shader variant key copies for VS+TCS

It's unnecessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12976>

2 years agoturnip: Move to common DEFINE_HANDLE_CASTS casting macro
Danylo Piliaiev [Tue, 21 Sep 2021 11:36:32 +0000 (14:36 +0300)]
turnip: Move to common DEFINE_HANDLE_CASTS casting macro

We create some VK objects internally, so we have to set type
for them.

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

2 years agovirgl: Add an option to disable coherent
Lepton Wu [Tue, 21 Sep 2021 23:30:34 +0000 (16:30 -0700)]
virgl: Add an option to disable coherent

This breaks almost every android apps when running with crosvm+minigbm.
Add an option so we can disable it.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12968>

2 years agovenus: amend supported extensions list
Yiwei Zhang [Wed, 22 Sep 2021 18:13:32 +0000 (18:13 +0000)]
venus: amend supported extensions list

Below were missed in the last update:
VK_KHR_incremental_present
VK_KHR_swapchain_mutable_format

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12980>

2 years agozink: don't use legacy scanout with modifiers
Mike Blumenkrantz [Fri, 17 Sep 2021 19:51:15 +0000 (15:51 -0400)]
zink: don't use legacy scanout with modifiers

legacy_scanout is for adding implicit modifiers when modifiers aren't provided,
so it can't be used with explicit modifiers

also jekstrand said no.

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