platform/upstream/mesa.git
21 months agoradv: Always create ray query vars as shader temp
Konstantin Seurer [Wed, 20 Jul 2022 17:19:16 +0000 (19:19 +0200)]
radv: Always create ray query vars as shader temp

Avoid the whole "is this function or shader scope" code and fix some
memory leaks in the process.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17663>

21 months agoradv: Add a field for the max shared memory size
Konstantin Seurer [Mon, 31 Oct 2022 17:07:45 +0000 (18:07 +0100)]
radv: Add a field for the max shared memory size

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17663>

21 months agospirv: Add MESA_SPIRV_DEBUG environment variable processing
Caio Oliveira [Tue, 8 Nov 2022 18:40:00 +0000 (10:40 -0800)]
spirv: Add MESA_SPIRV_DEBUG environment variable processing

This is similar to what NIR_DEBUG uses.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19603>

21 months agoci: remove duplicate entries from Fedora build
David Heidelberg [Mon, 7 Nov 2022 18:15:18 +0000 (19:15 +0100)]
ci: remove duplicate entries from Fedora build

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19583>

21 months agopvr: Use common pipeline & dynamic state frameworks
Matt Coster [Mon, 5 Sep 2022 14:47:31 +0000 (15:47 +0100)]
pvr: Use common pipeline & dynamic state frameworks

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19342>

21 months agopvr: Use PVRX(TA_PASSTYPE) for pvr_fragment_shader_state.pass_type
Matt Coster [Fri, 11 Nov 2022 10:55:55 +0000 (10:55 +0000)]
pvr: Use PVRX(TA_PASSTYPE) for pvr_fragment_shader_state.pass_type

Replaces the current uint32_t value.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19342>

21 months agopvr: Store format aspects on render pass attachments
Matt Coster [Fri, 28 Oct 2022 16:13:43 +0000 (17:13 +0100)]
pvr: Store format aspects on render pass attachments

This expands the existing has_stencil field on struct
pvr_render_pass_attachment to be a complete set of VkImageApsectFlags.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19342>

21 months agopvr: Remove scissor_accum dynamic state
Matt Coster [Fri, 30 Sep 2022 09:13:31 +0000 (10:13 +0100)]
pvr: Remove scissor_accum dynamic state

This state is only required for an as-yet-unimplemented optimization.
If that optimization is ever implemented in the future, these
structures can be added back.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19342>

21 months agopvr: VDMCTRL_INDEX_LIST[5-9] are not needed
Matt Coster [Thu, 27 Oct 2022 12:38:55 +0000 (13:38 +0100)]
pvr: VDMCTRL_INDEX_LIST[5-9] are not needed

An investigation turned up no need for these values on the currently
supported hardware configurations, so remove this comment for now.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19673>

21 months agoaco: Don't create useless exec movs while creating v_cmpx.
Georg Lehmann [Sat, 10 Sep 2022 09:35:56 +0000 (11:35 +0200)]
aco: Don't create useless exec movs while creating v_cmpx.

In a lot of situations the previous exec value was already copied from the
same registers that exec should be saved to. In that case we don't have to
insert an extra copy to save exec.

This breaks ssa but this pass is going out of ssa anyway.

Foz-DB Navi21:
Totals from 16129 (11.96% of 134913) affected shaders:
CodeSize: 128184044 -> 128054468 (-0.10%)
Instrs: 23902694 -> 23870325 (-0.14%)
Latency: 387124324 -> 387095955 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 79949118 -> 79945859 (-0.00%); split: -0.01%, +0.00%
Copies: 1620768 -> 1588752 (-1.98%); split: -1.99%, +0.01%

Foz-DB Vega10:
Totals from 15546 (11.51% of 135041) affected shaders:
CodeSize: 120322524 -> 120200568 (-0.10%)
Instrs: 23448344 -> 23417855 (-0.13%)
Latency: 414018749 -> 413639289 (-0.09%); split: -0.09%, +0.00%
InvThroughput: 183819363 -> 183726539 (-0.05%); split: -0.05%, +0.00%
Copies: 2194937 -> 2164448 (-1.39%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18528>

21 months agoaco: Make vcmpx definition handling clearer.
Georg Lehmann [Fri, 11 Nov 2022 15:13:56 +0000 (16:13 +0100)]
aco: Make vcmpx definition handling clearer.

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

21 months agointel/fs: use nir_opt_ray_query_ranges
Lionel Landwerlin [Thu, 10 Nov 2022 14:32:50 +0000 (16:32 +0200)]
intel/fs: use nir_opt_ray_query_ranges

Results on DG2 q2rtx shaders:

Totals from 6 (12.24% of 49) affected shaders:
Instrs: 88927 -> 54088 (-39.18%)
Cycles: 4115088 -> 2536902 (-38.35%)
Send messages: 2639 -> 1609 (-39.03%)
Spill count: 1321 -> 613 (-53.60%)
Fill count: 3130 -> 1104 (-64.73%)
Scratch Memory Size: 22528 -> 18432 (-18.18%)

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

21 months agoradv: Use nir_opt_ray_query_ranges
Konstantin Seurer [Wed, 18 May 2022 18:15:06 +0000 (20:15 +0200)]
radv: Use nir_opt_ray_query_ranges

Quake II RTX:

Totals from 6 (12.24% of 49) affected shaders:
VGPRs: 584 -> 568 (-2.74%)
CodeSize: 152408 -> 152224 (-0.12%); split: -0.21%, +0.09%
Scratch: 252928 -> 116736 (-53.85%)
MaxWaves: 58 -> 60 (+3.45%)
Instrs: 28914 -> 28874 (-0.14%); split: -0.21%, +0.08%
Latency: 443165 -> 442141 (-0.23%)
InvThroughput: 97155 -> 94797 (-2.43%)
SClause: 719 -> 720 (+0.14%)
Copies: 4560 -> 4498 (-1.36%); split: -1.40%, +0.04%
PreVGPRs: 544 -> 535 (-1.65%)

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16593>

21 months agonir: Add a pass for combining ray queries
Konstantin Seurer [Thu, 18 Aug 2022 18:18:39 +0000 (20:18 +0200)]
nir: Add a pass for combining ray queries

We can determice scopes/ranges of the use of ray queries and use this information to combine ray queries.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16593>

21 months agonir: Add and use nir_intrinsic_is_ray_query helper
Konstantin Seurer [Wed, 18 May 2022 18:06:31 +0000 (20:06 +0200)]
nir: Add and use nir_intrinsic_is_ray_query helper

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16593>

21 months agonir: Remove gather_info after removing dead vars
Konstantin Seurer [Sat, 16 Jul 2022 11:33:41 +0000 (13:33 +0200)]
nir: Remove gather_info after removing dead vars

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16593>

21 months agonir: fix typo in lower_double options handling
Timothy Arceri [Thu, 10 Nov 2022 10:24:48 +0000 (21:24 +1100)]
nir: fix typo in lower_double options handling

Seems the intention was to check that both flags were not enabled
instead we were checking that the floor flag was both set and not
set so the result would always be false.

Fixes: 3749a6ecd282 ("nir: honor lower_double options for ffloor and ffract")

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

21 months agofreedreno/cffdec: Add NOP debug messages
Mark Collins [Thu, 20 Oct 2022 18:35:57 +0000 (18:35 +0000)]
freedreno/cffdec: Add NOP debug messages

We want to encode special messages into the CS that can be printed
by cffdec, these messages have identifiers that describe their
usage (message, scope begin and scope end) which allow for an
improved trace navigation experience due to the additional
information.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

21 months agotu: Implement utrace CS marker support
Mark Collins [Thu, 20 Oct 2022 18:28:33 +0000 (18:28 +0000)]
tu: Implement utrace CS marker support

Adds support for emitting utrace markers into the CS, this allows
for useful debug information that can be decoded from a recorded
command stream.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

21 months agocommon/utrace: Add CS logging support
Mark Collins [Thu, 20 Oct 2022 18:26:47 +0000 (18:26 +0000)]
common/utrace: Add CS logging support

Viewing CS traces retrieved from the driver is common practice to
determine driver bugs but there is no way to determine what
function a certain part of the CS was emitted by. This is crucial
information to determine what function is responsible for emitting
broken CS packets and to help with navigation of the CS trace.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

21 months agocommon/utrace: Prefix all environment variables with `MESA_`
Mark Collins [Thu, 20 Oct 2022 12:16:39 +0000 (12:16 +0000)]
common/utrace: Prefix all environment variables with `MESA_`

To be more consistent with other environment variables and ensure
better scoping, all environment variables in utrace have now been
prefixed with `MESA_`.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

21 months agocommon/utrace: Rename `u_trace_context_actively_tracing` to `u_trace_should_process`
Mark Collins [Thu, 20 Oct 2022 12:13:51 +0000 (12:13 +0000)]
common/utrace: Rename `u_trace_context_actively_tracing` to `u_trace_should_process`

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

21 months agocommon/utrace: Refactor and combine all envvars into `GPU_TRACES`
Mark Collins [Wed, 19 Oct 2022 11:29:36 +0000 (19:29 +0800)]
common/utrace: Refactor and combine all envvars into `GPU_TRACES`

All environment variables involved in utrace usage were very
fragmented and convoluted to decode the meaning of, this commit has
simplified them down into easier to understand flags which directly
indicate the resulting behavior (such as `perfetto` enabling queued
logs rather than needing to set a `queued` flag) while combining
them into a single envvar `GPU_TRACES` and updating existing
terminology in utrace to match up with the new options.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

21 months agotu: Move utrace arguments to `start` from `end`
Mark Collins [Fri, 16 Sep 2022 14:18:42 +0000 (14:18 +0000)]
tu: Move utrace arguments to `start` from `end`

All arguments in Turnip code are fit to be moved to the start
event where they fit better as any sequential logging should print
the arguments with the scope start as it makes more sense than
printing arguments with the end of a scope.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

21 months agotu/perfetto: Handle tracepoint args from start and end
Mark Collins [Fri, 16 Sep 2022 14:06:52 +0000 (14:06 +0000)]
tu/perfetto: Handle tracepoint args from start and end

Perfetto's tracing backend was designed to only handle arguments
at the end event, we want to cover arguments both at the start
and end of the trace.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

21 months agov3dv: ignore imported BOs when tracking BO memory usage
Iago Toral Quiroga [Fri, 11 Nov 2022 11:58:10 +0000 (12:58 +0100)]
v3dv: ignore imported BOs when tracking BO memory usage

Imported BOs are not allocated by the device so we don't
update BO stats when they are imported. Therefore, we should
not be updating them when they are freed either.

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

21 months agodraw: Prevent index buffer overflow.
Jose Fonseca [Wed, 9 Nov 2022 09:22:06 +0000 (09:22 +0000)]
draw: Prevent index buffer overflow.

This prevents segfaults running wgf11draw DrawMethod=DrawIndexed tests
cases.

This change is not, however, sufficient to pass all tests.  That is,
there must remain code paths where indices read beyond the end of the
index buffer do not return zero index.

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

21 months agov3dv: fix debug dump on BO free
Iago Toral Quiroga [Fri, 11 Nov 2022 10:36:29 +0000 (11:36 +0100)]
v3dv: fix debug dump on BO free

We were resetting the BO struct right before dumping its data. Fix
this by moving the reset later.

Fixes: 44fa8304d45 ('v3dv: add a refcount mechanism to BOs')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19672>

21 months agopvr: Implement new firmware stream interface
Matt Coster [Wed, 3 Aug 2022 08:52:17 +0000 (09:52 +0100)]
pvr: Implement new firmware stream interface

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19530>

21 months agopvr: Set all compute sub-command registers in the same place
Matt Coster [Tue, 5 Jul 2022 09:09:12 +0000 (10:09 +0100)]
pvr: Set all compute sub-command registers in the same place

This moves the first group of registers from
pvr_sub_cmd_compute_job_init() to just before the second group in
pvr_compute_job_ws_submit_info_init().

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19530>

21 months agodisable zinks shader cache when the needed functions do not exist
noasakurajin [Tue, 8 Nov 2022 09:16:22 +0000 (09:16 +0000)]
disable zinks shader cache when the needed functions do not exist

 Fixes: 4e14da056d6 ("zink: Enable mesa/st frontend shader caching.")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19592>

21 months agoanv: remove dg2 condition for Wa_22011440098
Tapani Pälli [Thu, 10 Nov 2022 16:27:14 +0000 (18:27 +0200)]
anv: remove dg2 condition for Wa_22011440098

We need same workaround for MTL.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19636>

21 months agoiris: remove dg2 condition for Wa_22011440098
Tapani Pälli [Thu, 10 Nov 2022 16:25:15 +0000 (18:25 +0200)]
iris: remove dg2 condition for Wa_22011440098

We need same workaround for MTL.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19636>

21 months agoanv: setup stage bitmask for Wa_22011440098
Tapani Pälli [Thu, 10 Nov 2022 16:23:21 +0000 (18:23 +0200)]
anv: setup stage bitmask for Wa_22011440098

Fixes: 40b66a44998 ("anv, iris: Add Wa_22011440098 for DG2")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19636>

21 months agoiris: setup stage bitmask for Wa_22011440098
Tapani Pälli [Thu, 10 Nov 2022 16:22:12 +0000 (18:22 +0200)]
iris: setup stage bitmask for Wa_22011440098

Fixes: 40b66a44998 ("anv, iris: Add Wa_22011440098 for DG2")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19636>

21 months agoanv: split internal surface states from descriptors
Lionel Landwerlin [Mon, 24 Oct 2022 11:12:28 +0000 (14:12 +0300)]
anv: split internal surface states from descriptors

On Intel HW we use the same mechanism for internal operations surfaces
as well as application surfaces (VkDescriptor).

This change splits the surface pool in 2, one part dedicated to
internal allocations, the other to application VkDescriptors.

To do so, the STATE_BASE_ADDRESS::SurfaceStateBaseAddress points to a
4Gb area, with the following layout :
   - 1Gb of binding table pool
   - 2Gb of internal surface states
   - 1Gb of bindless surface states

That way any entry from the binding table can refer to both internal &
bindless surface states but none of the driver allocations interfere
with the allocation of the application.

Based off a change from Sviatoslav Peleshko.

v2: Allocate image view null surface state from bindless heap (Sviatoslav)
    Removed debug stuff (Sviatoslav)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7110
Cc: mesa-stable
Tested-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19275>

21 months agonir/algeraic_opt: use double options too for lowering ftrunc@64
Gert Wollny [Thu, 10 Nov 2022 12:06:08 +0000 (13:06 +0100)]
nir/algeraic_opt: use double options too for lowering ftrunc@64

ftrunc@64 also might need lowering on fp64 only, especially now
that it might be introduced by nir_lower_int64.

Fixes: 29da9856826fa6a4b5117c43c78b4301a49bc6dd
   nir/lower_int64: Enable lowering of 64-bit float to 64-bit integer conversions.

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

21 months agoradv: advertise extendedDynamicState3ProvokingVertexMode with NGG
Samuel Pitoiset [Wed, 19 Oct 2022 13:55:00 +0000 (15:55 +0200)]
radv: advertise extendedDynamicState3ProvokingVertexMode with NGG

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

21 months agoradv: add support for dynamic provoking vertex mode with NGG
Samuel Pitoiset [Wed, 19 Oct 2022 13:57:52 +0000 (15:57 +0200)]
radv: add support for dynamic provoking vertex mode with NGG

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

21 months agoradv: add lowering support for load_provoking_vtx_in_prim_amd when dynamic
Samuel Pitoiset [Wed, 19 Oct 2022 13:45:21 +0000 (15:45 +0200)]
radv: add lowering support for load_provoking_vtx_in_prim_amd when dynamic

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

21 months agoradv: declare shader arguments/locations for provoking vertex
Samuel Pitoiset [Wed, 19 Oct 2022 13:44:54 +0000 (15:44 +0200)]
radv: declare shader arguments/locations for provoking vertex

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

21 months agoradv: add radv_pipeline_key::dynamic_provoking_vtx_mode
Samuel Pitoiset [Wed, 19 Oct 2022 12:25:55 +0000 (14:25 +0200)]
radv: add radv_pipeline_key::dynamic_provoking_vtx_mode

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

21 months agoradv: re-emit NGG culling settings when conservative rast mode is dynamic
Samuel Pitoiset [Thu, 10 Nov 2022 14:24:24 +0000 (15:24 +0100)]
radv: re-emit NGG culling settings when conservative rast mode is dynamic

Found by inspection.

Fixes: fbed3aed4aa ("radv: add support for dynamic conservative rasterization 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/19651>

21 months agomeson: only enable intel-clc for x86_64 builds
Luis Felipe Strano Moraes [Thu, 10 Nov 2022 23:57:05 +0000 (15:57 -0800)]
meson: only enable intel-clc for x86_64 builds

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

21 months agoutil: Replace the usage of boolean with c11 bool in u_cpu_detect.c
Yonggang Luo [Sun, 6 Nov 2022 14:35:30 +0000 (22:35 +0800)]
util: Replace the usage of boolean with c11 bool in u_cpu_detect.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>

21 months agomicrosoft: Fixes error: unknown type name ‘boolean’ in nir_to_dxil.c
Yonggang Luo [Mon, 7 Nov 2022 05:46:48 +0000 (13:46 +0800)]
microsoft: Fixes error: unknown type name ‘boolean’ in nir_to_dxil.c

error message:
../../src/microsoft/compiler/nir_to_dxil.c:1711:8: error: unknown type name ‘boolean’
 1711 | static boolean

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>

21 months agoutil: Replace usage of boolean with c11 bool in src/util/format/* and src/util/tests...
Yonggang Luo [Mon, 7 Nov 2022 05:34:30 +0000 (13:34 +0800)]
util: Replace usage of boolean with c11 bool in src/util/format/* and src/util/tests/format/*

This is done by find and replace:
boolean -> bool
TRUE -> true
FALSE -> false

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>

21 months agoutil: Replace the usage of boolean with c11 bool in u_debug_symbol.c
Yonggang Luo [Wed, 9 Nov 2022 09:43:16 +0000 (17:43 +0800)]
util: Replace the usage of boolean with c11 bool in u_debug_symbol.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>

21 months agoutil: Replace the usage of boolean with c11 bool in u_debug_memory.c
Yonggang Luo [Sun, 6 Nov 2022 13:23:22 +0000 (21:23 +0800)]
util: Replace the usage of boolean with c11 bool in u_debug_memory.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>

21 months agoutil: Replace all usage of __FUNCTION__ with __func__ in src/util/*
Yonggang Luo [Thu, 10 Nov 2022 08:31:11 +0000 (16:31 +0800)]
util: Replace all usage of __FUNCTION__ with __func__ in src/util/*

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>

21 months agoutil: Remove va_copy fixup because of c11 is required
Yonggang Luo [Thu, 10 Nov 2022 08:26:09 +0000 (16:26 +0800)]
util: Remove va_copy fixup because of c11 is required

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>

21 months agoutil: Replace TAB with space in compiler.h
Yonggang Luo [Thu, 10 Nov 2022 08:24:16 +0000 (16:24 +0800)]
util: Replace TAB with space in compiler.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>

21 months agoutil: Cleanup util/compiler.h
Yonggang Luo [Thu, 10 Nov 2022 08:01:35 +0000 (16:01 +0800)]
util: Cleanup util/compiler.h

Remove MESA_*_ENDIAN
Use UTIL_ARCH_*_ENDIAN to define CPU_TO_LE32

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>

21 months agowsi: Use UTIL_ARCH_LITTLE_ENDIAN instead MESA_LITTLE_ENDIAN
Yonggang Luo [Thu, 10 Nov 2022 08:00:41 +0000 (16:00 +0800)]
wsi: Use UTIL_ARCH_LITTLE_ENDIAN instead MESA_LITTLE_ENDIAN

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>

21 months agomeson: Fixes name_prefix for clover on mingw
Yonggang Luo [Wed, 9 Nov 2022 03:24:32 +0000 (11:24 +0800)]
meson: Fixes name_prefix for clover on mingw

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>

21 months agoclover: Fixes building with mingw-x86
Yonggang Luo [Tue, 8 Nov 2022 11:07:35 +0000 (19:07 +0800)]
clover: Fixes building with mingw-x86

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>

21 months agoclover: Rename *OpenCL.def to *OpenCL.def.in
Yonggang Luo [Wed, 9 Nov 2022 02:30:57 +0000 (10:30 +0800)]
clover: Rename *OpenCL.def to *OpenCL.def.in

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>

21 months agomeson: fixes mingw-clang32 building
Yonggang Luo [Tue, 8 Nov 2022 12:48:30 +0000 (20:48 +0800)]
meson: fixes mingw-clang32 building

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>

21 months agomeson: Refactoring shared gen_vs_module_defs_normal_command out
Yonggang Luo [Tue, 8 Nov 2022 12:32:07 +0000 (20:32 +0800)]
meson: Refactoring shared gen_vs_module_defs_normal_command out

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>

21 months agoradv: Fixes prototypes
Yonggang Luo [Tue, 8 Nov 2022 12:15:10 +0000 (20:15 +0800)]
radv: Fixes prototypes

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>

21 months agopvr: use common command buffer status
Dave Airlie [Wed, 8 Jun 2022 00:52:36 +0000 (10:52 +1000)]
pvr: use common command buffer status

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agopvr: Hook up vk_command_buffer_ops::reset
Jason Ekstrand [Fri, 9 Sep 2022 23:43:38 +0000 (18:43 -0500)]
pvr: Hook up vk_command_buffer_ops::reset

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agopvr: Call command buffer reset conditionally
Jason Ekstrand [Fri, 9 Sep 2022 23:36:39 +0000 (18:36 -0500)]
pvr: Call command buffer reset conditionally

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agoturnip: use common command buffer status code.
Dave Airlie [Wed, 8 Jun 2022 00:46:26 +0000 (10:46 +1000)]
turnip: use common command buffer status code.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agoturnip: Initialize push descriptors in tu_create_cmd_buffer()
Jason Ekstrand [Tue, 8 Nov 2022 20:32:56 +0000 (14:32 -0600)]
turnip: Initialize push descriptors in tu_create_cmd_buffer()

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agopanvk: move to using common command buffer status
Dave Airlie [Wed, 8 Jun 2022 00:49:09 +0000 (10:49 +1000)]
panvk: move to using common command buffer status

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agopanvk: Use common code for command buffer lifecycle management
Jason Ekstrand [Sat, 10 Sep 2022 00:14:13 +0000 (19:14 -0500)]
panvk: Use common code for command buffer lifecycle management

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agopanvk: Drop panvk_cmd_buffer::queue_family_index
Jason Ekstrand [Mon, 12 Sep 2022 10:17:42 +0000 (05:17 -0500)]
panvk: Drop panvk_cmd_buffer::queue_family_index

Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agolavapipe: use common command buffer status code.
Dave Airlie [Wed, 8 Jun 2022 00:46:43 +0000 (10:46 +1000)]
lavapipe: use common command buffer status code.

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

21 months agoradv: use common command buffer status code.
Dave Airlie [Wed, 8 Jun 2022 00:46:11 +0000 (10:46 +1000)]
radv: use common command buffer status code.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agovulkan: Add common cmd buffer state tracking
Dave Airlie [Wed, 8 Jun 2022 00:45:44 +0000 (10:45 +1000)]
vulkan: Add common cmd buffer state tracking

For drivers already using vk_common_ResetCommandBuffer(), it now only
calls the driver's reset hook if the command buffer is not in the
INITIAL state.  Pulled this trick from the PowerVR driver.

v2 (Jason Ekstrand):
 - Rename from "status" to "state" since that's what's in the spec
 - Add vk_command_buffer_begin/end instead of drivers setting it all
   manually

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>

21 months agoradeonsi: move param assign offset to si_get_nir_shader
Qiang Yu [Thu, 27 Oct 2022 13:57:58 +0000 (21:57 +0800)]
radeonsi: move param assign offset to si_get_nir_shader

We need this info for gfx11 param export soon and nir vertex
export lowering in the future.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agoradeonsi: pack code into si_assign_param_offsets
Qiang Yu [Thu, 3 Nov 2022 02:28:13 +0000 (10:28 +0800)]
radeonsi: pack code into si_assign_param_offsets

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agoradeonsi: small refine for si_nir_assign_param_offsets
Qiang Yu [Thu, 3 Nov 2022 02:26:30 +0000 (10:26 +0800)]
radeonsi: small refine for si_nir_assign_param_offsets

Pass si_shader as arg directly, move primitive id pending
inside it.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agoradeonsi: move si_nir_assign_param_offsets above
Qiang Yu [Thu, 3 Nov 2022 02:18:41 +0000 (10:18 +0800)]
radeonsi: move si_nir_assign_param_offsets above

It's going to be called by si_get_nir_shader.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agoradeonsi: implement nir_load_ring_attr_amd
Qiang Yu [Thu, 27 Oct 2022 07:34:44 +0000 (15:34 +0800)]
radeonsi: implement nir_load_ring_attr_amd

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agoac/llvm: implement intrinsic for gfx11 param export
Qiang Yu [Thu, 27 Oct 2022 07:08:56 +0000 (15:08 +0800)]
ac/llvm: implement intrinsic for gfx11 param export

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agoradeonsi: use si_nir_clamp_vertex_color
Qiang Yu [Fri, 28 Oct 2022 03:42:05 +0000 (11:42 +0800)]
radeonsi: use si_nir_clamp_vertex_color

Clamp vertex color in nir. Now only GS copy shader use
si_vertex_color_clamping, so move it there. It will be
completely removed after we switch to nir GS copy shader.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agoradeonsi: add si_nir_clamp_vertex_color pass
Qiang Yu [Fri, 28 Oct 2022 03:15:03 +0000 (11:15 +0800)]
radeonsi: add si_nir_clamp_vertex_color pass

To replace the LLVM si_vertex_color_clamping.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agonir,ac/llvm,radeonsi: add nir_load_clamp_vertex_color_amd
Qiang Yu [Fri, 28 Oct 2022 02:15:21 +0000 (10:15 +0800)]
nir,ac/llvm,radeonsi: add nir_load_clamp_vertex_color_amd

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agoradeonsi: remove lower_fsat nir option
Qiang Yu [Tue, 8 Nov 2022 02:05:20 +0000 (10:05 +0800)]
radeonsi: remove lower_fsat nir option

We implemented nir_op_fsat nir to llvm translation.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19429>

21 months agomeson: enable Wmisleading-indentation
Lucas Stach [Tue, 1 Nov 2022 13:42:12 +0000 (14:42 +0100)]
meson: enable Wmisleading-indentation

Clang enables it by default, but GCC does not. Enable it explicitly to
have some consistency between the supported compilers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Eric Engestrom <eric@igalia.com>
Acked-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19439>

21 months agofreedreno/drm/virtio: Pre-allocate cmdstream buffers
Rob Clark [Thu, 10 Nov 2022 15:36:22 +0000 (07:36 -0800)]
freedreno/drm/virtio: Pre-allocate cmdstream buffers

We know cmdstream buffers are immediately mmap'd, which is both
expensive on the host, and breaks the pipelining as guest is forced
to stall waiting for the host.  So pre-allocate some cmdestream
buffers, so that we have something that is (hopefully) already
allocated and mapped to guest's physical memory before we need it.
The older buffer from the head of the prealloc list replaces the
newly allocated buffer which is pushed to the tail of the prealloc
list.

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

21 months agofreedreno/drm: Use same-sized "chunks" for growable rings
Rob Clark [Wed, 9 Nov 2022 23:47:25 +0000 (15:47 -0800)]
freedreno/drm: Use same-sized "chunks" for growable rings

Using the same size that we suballoc from for suballoc'd streaming and
long-lived stateobjs should help improve bo cache usage, by making more
of the backing BOs the same size and interchangable.

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

21 months agoci/broadcom: v3dv-rpi4-vk:arm64 flakes too often
David Heidelberg [Thu, 10 Nov 2022 19:45:36 +0000 (20:45 +0100)]
ci/broadcom: v3dv-rpi4-vk:arm64 flakes too often

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/7403

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19659>

21 months agoutil/glsl2spirv: pass path to glslangValidator into the script
Dylan Baker [Tue, 1 Nov 2022 20:37:06 +0000 (13:37 -0700)]
util/glsl2spirv: pass path to glslangValidator into the script

This allows users to override the location of glslang using normal meson
mechanisms.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agomeson: prog_glslang should always be for the build machine
Dylan Baker [Tue, 1 Nov 2022 20:35:24 +0000 (13:35 -0700)]
meson: prog_glslang should always be for the build machine

It doesn't produce different code when compiled for the host machine,
and this avoids needing two copies and possibly a host machine emulator
in cross compilation settings

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: cleanup list extension
Dylan Baker [Tue, 1 Nov 2022 20:29:48 +0000 (13:29 -0700)]
util/glsl2spirv: cleanup list extension

- consistently use list.extend instead of list +=, which has gotchas
- condense list extension calls when possible

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: use f-strings
Dylan Baker [Tue, 1 Nov 2022 20:29:21 +0000 (13:29 -0700)]
util/glsl2spirv: use f-strings

Which are both faster and easier to read

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: use if `x in str` instead of `str.find`
Dylan Baker [Tue, 1 Nov 2022 20:28:18 +0000 (13:28 -0700)]
util/glsl2spirv: use if `x in str` instead of `str.find`

The latter is only idiomatically used when a start and/or stop position
is required.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: simplify subprocess handling
Dylan Baker [Tue, 1 Nov 2022 20:02:41 +0000 (13:02 -0700)]
util/glsl2spirv: simplify subprocess handling

Since we're not doing anything fancy, we can just use `subprocess.run`.
I've also removed the custom error class, we're not going to catch it,
so just printing and exiting is fine.

v2:
  - Print stdout as well as stderr in case of a glslang failure

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: close resources as soon as possible
Dylan Baker [Tue, 1 Nov 2022 20:00:26 +0000 (13:00 -0700)]
util/glsl2spirv: close resources as soon as possible

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: add type annotations
Dylan Baker [Tue, 1 Nov 2022 19:59:06 +0000 (12:59 -0700)]
util/glsl2spirv: add type annotations

Which are all clean

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: add some error handling for unexpected code paths
Dylan Baker [Tue, 1 Nov 2022 19:58:19 +0000 (12:58 -0700)]
util/glsl2spirv: add some error handling for unexpected code paths

We expect that convert_to_static_variable and override_version will find
and replace something, so let's fail loudly if they don't.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spriv: make --vn required
Dylan Baker [Tue, 1 Nov 2022 19:55:12 +0000 (12:55 -0700)]
util/glsl2spriv: make --vn required

I'm not 100% sure whether it's right to make --vn required, or to avoid
the static conversion, but this seems correct. Mypy (type checking
coming soon) points out that if --vn is None then the
convert_to_static_variable function will fail. Our one use of this sets
--vn, so there is no change there. Making --vn required
ensures that it will never be None, avoiding the problem.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: fix appending extra flags
Dylan Baker [Tue, 1 Nov 2022 19:49:53 +0000 (12:49 -0700)]
util/glsl2spirv: fix appending extra flags

The variable is called `extra`, but what's written is `extra - flags`,
and `flags` is undefined, so if the variable was ever passed there would
be an uncaught exception.

fixes: 9786d9ef2abb45a4e832cf1347581e3ca3aae9f0

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: let argparse actually enforce the restrictions we've set
Dylan Baker [Tue, 1 Nov 2022 19:47:21 +0000 (12:47 -0700)]
util/glsl2spirv: let argparse actually enforce the restrictions we've set

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: drop inconsistent use of `io.open`
Dylan Baker [Tue, 1 Nov 2022 19:41:44 +0000 (12:41 -0700)]
util/glsl2spirv: drop inconsistent use of `io.open`

In Python 3 (the only python we support) `io.open` is an alias of the
builtin `open` function, so it's not getting us anything, and we're not
using it consistently.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoutil/glsl2spirv: fix type error in argument handling
Dylan Baker [Tue, 1 Nov 2022 19:40:21 +0000 (12:40 -0700)]
util/glsl2spirv: fix type error in argument handling

args.Olib is set to `store_true`, which means it will always be `True`
or `False`, this means that the we always, unconditionally, add
`--keep-uncalled` to the command line.

fixes: 9786d9ef2abb45a4e832cf1347581e3ca3aae9f0

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

21 months agoci/freedreno: disable antichambers trace
David Heidelberg [Thu, 10 Nov 2022 17:23:46 +0000 (18:23 +0100)]
ci/freedreno: disable antichambers trace

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7668
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19627

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19634>