platform/upstream/mesa.git
17 months agopvr: Add PVR_SELECT() helper macro
Karmjit Mahil [Thu, 5 Jan 2023 11:41:26 +0000 (11:41 +0000)]
pvr: Add PVR_SELECT() helper macro

For pvr_setup_descriptor_mappings_new() there will be quite a few
variables of which the value depend on the stage so rather than
having all that selection in the `switch` at the beginning of the
function the helper macro provides a compact selection in the
desired scope.

Signed-off-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/21331>

17 months agopvr: Write descriptor set addrs table dev addr into shareds
Karmjit Mahil [Wed, 7 Dec 2022 16:13:30 +0000 (16:13 +0000)]
pvr: Write descriptor set addrs table dev addr into shareds

Previously UBOs and various buffers, as well as the native
descriptor sets were DMAed into the shared registers. This added
complexity in allocating the registers and various other places.
We also ended up being in situations were we wouldn't know the size
of a buffer by the time the shaders were being compiled. It would
be possible to determine the size by inspecting the shader but
that would introduce more complexity in the compiler.
To get things working sooner, avoid extra complexity for
now, a different approach was devised.

The driver will write the addresses of the currently bound
descriptor sets into a device buffer. The device buffer is referred
to as the descriptor set addrs table. The dev addr of the table is
written into a shared register. To access the buffers the shader
will first get the address of the descriptor set from the in memory
table. Then get the primary descriptor from the descriptor set. And
finally access the in memory buffer with the address it read from
the descriptor. Essentially there's three level of indirection and
all the buffers are in memory. The shader will know what offset the
primary descriptor is located based on the descriptor set layout.
The descriptor set address could have been written into the shareds
directly but that would require extra handling on the compiler side
so opted to just write the table address instead.

Signed-off-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/21331>

17 months agopvr: Change last_DMA to last_dma
Karmjit Mahil [Mon, 13 Feb 2023 16:43:21 +0000 (16:43 +0000)]
pvr: Change last_DMA to last_dma

Signed-off-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/21331>

17 months agopvr: Put old descriptor set approach behind a hardcoding check
Karmjit Mahil [Tue, 6 Dec 2022 15:54:30 +0000 (15:54 +0000)]
pvr: Put old descriptor set approach behind a hardcoding check

This commit sets up the infrastructure to introduce the new
descriptor set approach while keeping the old paths so the
hard coded apps are still operational. The old paths will be
removed once the compiler can compiler shaders for those apps
and the driver-compiler interface is fully flushed out.

Signed-off-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/21331>

17 months agopvr: Store enum pvr_stage_allocation instead of VkShaderStageFlags
Karmjit Mahil [Tue, 6 Dec 2022 15:34:40 +0000 (15:34 +0000)]
pvr: Store enum pvr_stage_allocation instead of VkShaderStageFlags

This commit changes the pipeline layout, desc. set layout,
and desc. set layout binding to keep track of shader stage usage
with a mask of enum pvr_stage_allocation instead of
VkShaderStageFlags.

This commit also makes renames the relevant fields to
'shader_stage_mask' to make the naming uniform across stucts.

Signed-off-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/21331>

17 months agoradv/ci: move CI lists for external GPUs in separate folder
Samuel Pitoiset [Mon, 20 Feb 2023 10:11:27 +0000 (11:11 +0100)]
radv/ci: move CI lists for external GPUs in separate folder

A bunch of CI lists are maintained by ourselves with GPUs outside of
Mesa CI. Move them to a separate folder to avoid confusion.

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

17 months agoradv/ci: disable vkcts-kabini-valve
Samuel Pitoiset [Mon, 20 Feb 2023 10:23:27 +0000 (11:23 +0100)]
radv/ci: disable vkcts-kabini-valve

It's no longer reachable.

Suggested-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21417>

17 months agoasahi: Fix rendering into mipmapped framebuffers
Alyssa Rosenzweig [Thu, 9 Feb 2023 19:29:29 +0000 (14:29 -0500)]
asahi: Fix rendering into mipmapped framebuffers

batch->key.width will be minified, but then the PBE::level field will
incorrectly minify again.

Fixes dEQP-GLES31.functional.shaders.framebuffer_fetch.basic.framebuffer_texture_level

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

17 months agoagx: Do more work in agx_preprocess_nir
Alyssa Rosenzweig [Sun, 18 Dec 2022 04:55:08 +0000 (23:55 -0500)]
agx: Do more work in agx_preprocess_nir

agx_preprocess_nir runs once per shader, whereas agx_optimize_nir runs once per
variant. That means we want to do as much work as possible in agx_preprocess_nir
to make shader variants as cheap as possible to compiler. So, move our standard
suite of lowering and optimizing to the preprocess loop, leaving just a single
(easy) trip through the optimizer for simple variant processing.

Plus, we can remove variables when preprocessing, since we no longer use
variables anywhere. We remove them to reduce the RAM and disk cache footprint of
shader variants.

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

17 months agoagx: Don't treat clip distances specially
Alyssa Rosenzweig [Fri, 3 Feb 2023 16:57:01 +0000 (11:57 -0500)]
agx: Don't treat clip distances specially

We've been using the clip lowering, but it's been broken upstream because of
this artefact from the (non-lowered implementation) sneaking in from downstream.

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

17 months agoasahi: Only apply FS lowerings to fragment shaders
Asahi Lina [Sat, 14 Jan 2023 09:22:38 +0000 (18:22 +0900)]
asahi: Only apply FS lowerings to fragment shaders

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>

17 months agoasahi: Move agx_preprocess_nir to CSO create
Alyssa Rosenzweig [Sun, 18 Dec 2022 04:08:48 +0000 (23:08 -0500)]
asahi: Move agx_preprocess_nir to CSO create

Now we preprocess shaders once at link time, rather than every time we spawn a
variant. This should reduce variant pain.

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

17 months agoasahi: Lower clip distances late
Alyssa Rosenzweig [Fri, 3 Feb 2023 14:41:30 +0000 (09:41 -0500)]
asahi: Lower clip distances late

This pass works either early or late, so run it late. It creates some
nir_variables as a side effect, which is weird, but it doesn't matter because
the AGX backend doesn't look at variables and the metadata and lowered I/O
intrinsics are all correct.

This is the last step to moving I/O lowering (and hence shader preprocessing) to
CSO create time.

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

17 months agodocs/release-calendar: drop the last 22.2.x, it won't happen
Eric Engestrom [Mon, 20 Feb 2023 09:26:14 +0000 (09:26 +0000)]
docs/release-calendar: drop the last 22.2.x, it won't happen

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

17 months agozink/ci: set RADV_PERFTEST=gpl for RADV jobs
Samuel Pitoiset [Wed, 15 Feb 2023 09:05:51 +0000 (10:05 +0100)]
zink/ci: set RADV_PERFTEST=gpl for RADV jobs

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

17 months agozink/ci: skip KHR-GL46.texture_swizzle.functional with RADV
Samuel Pitoiset [Wed, 15 Feb 2023 16:04:39 +0000 (17:04 +0100)]
zink/ci: skip KHR-GL46.texture_swizzle.functional with RADV

They usually timeout.

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

17 months agoci: uprev vkd3d-proton
Samuel Pitoiset [Fri, 17 Feb 2023 13:21:35 +0000 (14:21 +0100)]
ci: uprev vkd3d-proton

This adds test coverage for VK_EXT_image_sliced_view_of_3d.

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

17 months agov3d: support r{g,gba}16f formats for vertex buffers
Iago Toral Quiroga [Thu, 16 Feb 2023 10:01:38 +0000 (11:01 +0100)]
v3d: support r{g,gba}16f formats for vertex buffers

These are supported, and in fact we are exposing them through
Vulkan. Makes SuperTuxKart significantly faster in GL, I've
observed an FPS increase from ~100% to ~500% depending on the
track.

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

17 months agogallium: create query_memory_info implementation for sw drivers
Yusuf Khan [Sat, 18 Feb 2023 22:05:45 +0000 (16:05 -0600)]
gallium: create query_memory_info implementation for sw drivers

For ATI_meminfo or NVX_gpu_memory_info on llvmpipe and softpipe.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21373>

17 months agointel: Use common helpers for TCS passthrough shaders
Kenneth Graunke [Fri, 20 Jan 2023 07:25:20 +0000 (23:25 -0800)]
intel: Use common helpers for TCS passthrough shaders

Rob added these new helpers a while back, which freedreno and radeonsi
both share.  We should use them too.  The new helpers use variables and
system value intrinsics, so we can drop the explicit binding table
creation and just use the normal paths.

Because we have to rewrite the system value uploading anyway, we drop
the scrambling of the default tessellation levels on upload, and instead
let the compiler go ahead and remap components like any normal shader.
In theory, this results in more shuffling in the shader.  In practice,
we already do MOVs for message setup.  In the passthrough shaders I
looked at, this resulted in no extra instructions on Icelake (SIMD8
SINGLE_PATCH) and Tigerlake (8_PATCH).  On Haswell, one shader grew by
a single instruction for a pittance of cycles in a stage that isn't a
performance bottleneck anyway.  Avoiding remapping wasn't so much of an
optimization as just the way that I originally wrote it.  Not worth it.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20809>

17 months agoglsl: isolate object macro replacments
Timothy Arceri [Wed, 15 Feb 2023 12:14:13 +0000 (23:14 +1100)]
glsl: isolate object macro replacments

Here we use a leading space to isolate them from
the code they will be inserted into. For example:

    #define VALUE -1.0
    int a = -VALUE;

Should be evaluated to int a = - -1.0; not int a = --1.0;

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

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>

17 months agoglsl: add _token_list_prepend() helper to the parser
Timothy Arceri [Wed, 15 Feb 2023 12:13:06 +0000 (23:13 +1100)]
glsl: add _token_list_prepend() helper to the parser

This will be used in the following patch.

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>

17 months agoaco/optimizer: Change v_cmp with subgroup invocation to constant.
Timur Kristóf [Sun, 22 Jan 2023 18:50:46 +0000 (19:50 +0100)]
aco/optimizer: Change v_cmp with subgroup invocation to constant.

When a shader has a comparison with the subgroup invocation id,
we can use a constant instead, saving a VALU instruction.
When the constant can't be represented as a 64-bit literal,
use the s_bfm_b64 instruction to generate it instead, which
is still a win.

Fossil DB stats on GFX11:
Totals from 300 (0.22% of 134913) affected shaders:
CodeSize: 2223052 -> 2214336 (-0.39%); split: -0.43%, +0.04%
Instrs: 430216 -> 429882 (-0.08%); split: -0.14%, +0.06%
Latency: 5881180 -> 5878181 (-0.05%); split: -0.05%, +0.00%
InvThroughput: 731846 -> 729293 (-0.35%)
Copies: 31662 -> 31847 (+0.58%); split: -0.03%, +0.61%
Branches: 8241 -> 8100 (-1.71%)
PreVGPRs: 15788 -> 15786 (-0.01%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20843>

17 months agoglthread: don't restore non-VBO vertex arrays after all draws
Marek Olšák [Tue, 27 Dec 2022 07:37:20 +0000 (02:37 -0500)]
glthread: don't restore non-VBO vertex arrays after all draws

glthread takes care of all uploads, so it's OK to leave uploaded VBOs
bound. The only thing that will be wrong is the bound vertex buffer
returned by glGet, but the only case when that would be wrong is when
an app that doesn't use VBOs queries the current VBO. That never happens.

However, this adds code to unbind all internal VBOs for the case when
glthread is abruptly disabled (e.g. for GL_DEBUG_OUTPUT_SYNCHRONOUS).

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

17 months agoglthread: don't free glthread for GL_DEBUG_OUTPUT_SYNCHRONOUS, only disable it
Marek Olšák [Sat, 31 Dec 2022 07:31:53 +0000 (02:31 -0500)]
glthread: don't free glthread for GL_DEBUG_OUTPUT_SYNCHRONOUS, only disable it

and enable it when GL_DEBUG_OUTPUT_SYNCHRONOUS is disabled.

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

17 months agoglthread: remove unnecessary debug code
Marek Olšák [Sat, 31 Dec 2022 07:29:15 +0000 (02:29 -0500)]
glthread: remove unnecessary debug code

_mesa_glthread_destroy won't be called for GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB,
so the "reason" parameter will be useless.

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

17 months agoglthread: convert (Multi)DrawIndirect into direct if user buffers are present
Marek Olšák [Mon, 26 Dec 2022 14:53:28 +0000 (09:53 -0500)]
glthread: convert (Multi)DrawIndirect into direct if user buffers are present

so that user buffers are uploaded without syncing.

Now glthread fully handles non-VBO uploads, so that we can disable user
buffer codepaths in st/mesa.

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

17 months agoglthread: add API to allow passing DrawID from glthread to mesa
Marek Olšák [Mon, 26 Dec 2022 14:48:02 +0000 (09:48 -0500)]
glthread: add API to allow passing DrawID from glthread to mesa

This will be needed for lowering DrawIndirect in glthread, which is
needed if non-VBO vertex arrays are present.

This only adds the drawid parameter in glthread's draw_arrays and
draw_elements functions, and implements where needed.

New GL API functions are added because we want to use separate
DISPATCH_CMD_* enums for draws with DrawID, so that we don't increase
the memory footprint of draws in glthread batches if drawid == 0.

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

17 months agoglthread: handle non-VBO uploads for glMultiModeDraw{Arrays,Elements}IBM
Marek Olšák [Mon, 26 Dec 2022 09:08:21 +0000 (04:08 -0500)]
glthread: handle non-VBO uploads for glMultiModeDraw{Arrays,Elements}IBM

This was unimplemented, and this implementation matches exactly what we do
in main/draw.c.

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

17 months agoglthread: don't execute Draw and BufferSubData calls if the context is lost
Marek Olšák [Mon, 26 Dec 2022 08:58:37 +0000 (03:58 -0500)]
glthread: don't execute Draw and BufferSubData calls if the context is lost

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

17 months agoglthread: inline draw functions that have only one use
Marek Olšák [Mon, 26 Dec 2022 10:13:36 +0000 (05:13 -0500)]
glthread: inline draw functions that have only one use

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

17 months agoglthread: remove goto statements and add unlikely() into draw functions
Marek Olšák [Mon, 26 Dec 2022 08:43:37 +0000 (03:43 -0500)]
glthread: remove goto statements and add unlikely() into draw functions

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

17 months agoglthread: add ctx->GLThread.draw_always_async to simplify draw checking
Marek Olšák [Mon, 26 Dec 2022 08:57:20 +0000 (03:57 -0500)]
glthread: add ctx->GLThread.draw_always_async to simplify draw checking

This just precomputes 3 terms of the condition to draw asynchronously.

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

17 months agoglthread: reorder draw code a little
Marek Olšák [Mon, 26 Dec 2022 08:36:04 +0000 (03:36 -0500)]
glthread: reorder draw code a little

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

17 months agoglthread: add a vertex upload path that unrolls indices for glDrawElements
Marek Olšák [Wed, 21 Dec 2022 07:42:57 +0000 (02:42 -0500)]
glthread: add a vertex upload path that unrolls indices for glDrawElements

u_vbuf does this too. This is the last big missing piece to stop using
u_vbuf.

If the vertex range to upload is much larger than the draw vertex count and
if all attribs are not in VBOs, convert glDrawElements to glBegin/End.

This is a path that makes the Cogs game go from 1 FPS to ~197 FPS. There is
no change in FPS because u_vbuf does this, but it will be disabled.

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

17 months agoglthread: track vertex formats for all attributes
Marek Olšák [Wed, 21 Dec 2022 06:51:49 +0000 (01:51 -0500)]
glthread: track vertex formats for all attributes

We'll need this for a special vertex upload fallback.

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

17 months agoglthread: don't bind/unbind uploaded indexbuf, pass it to glMultiDraw directly
Marek Olšák [Sun, 18 Dec 2022 22:45:01 +0000 (17:45 -0500)]
glthread: don't bind/unbind uploaded indexbuf, pass it to glMultiDraw directly

MultiDrawElementsUserBuf is changed to mean the same thing as
glMultiDrawElementsBaseVertex, but "gl_buffer_object *index_buffer" is
passed via a parameter instead of using the bound GL_ELEMENT_ARRAY_BUFFER.

This skips binding and unbinding the index buffer around every draw
where glthread uploads indices.

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

17 months agoglthread: don't bind/unbind uploaded indexbuf, pass it to glDraw directly
Marek Olšák [Sun, 18 Dec 2022 22:45:01 +0000 (17:45 -0500)]
glthread: don't bind/unbind uploaded indexbuf, pass it to glDraw directly

DrawElementsUserBuf is changed to mean the same thing as
glDrawElementsInstancedBaseVertexBaseInstance, but "gl_buffer_object *
index_buffer" is passed via a parameter instead of using the bound
GL_ELEMENT_ARRAY_BUFFER.

This skips binding and unbinding the index buffer around every draw
where glthread uploads indices.

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

17 months agoglthread: move some draw call parameters closer to their use
Marek Olšák [Sun, 18 Dec 2022 22:33:09 +0000 (17:33 -0500)]
glthread: move some draw call parameters closer to their use

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

17 months agoglthread: don't pass index bounds to the driver for async calls
Marek Olšák [Sun, 18 Dec 2022 22:14:41 +0000 (17:14 -0500)]
glthread: don't pass index bounds to the driver for async calls

They are never used with vertex uploads in glthread.
For example, glDrawRangeElements is converted to glDrawElements.

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

17 months agoglthread: don't execute glDraw code if we're inside glBegin/End
Marek Olšák [Mon, 19 Dec 2022 04:35:26 +0000 (23:35 -0500)]
glthread: don't execute glDraw code if we're inside glBegin/End

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

17 months agoglthread: change glMultiDrawElements to execute draw_count < 0 asynchronously
Marek Olšák [Tue, 13 Dec 2022 05:00:28 +0000 (00:00 -0500)]
glthread: change glMultiDrawElements to execute draw_count < 0 asynchronously

also clean up the conditions.

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

17 months agoglthread: rewrite glMultiDrawArrays to never fail to upload vertices
Marek Olšák [Tue, 13 Dec 2022 04:18:37 +0000 (23:18 -0500)]
glthread: rewrite glMultiDrawArrays to never fail to upload vertices

The main goal is to never fail to upload non-VBO vertex arrays.
When glthread synchronized, it didn't upload vertices, expecting st/mesa
to do that. This keeps the required sync, and then upload vertices
in glthread.

Also, reorder the code and remove goto statements. This is pretty much
a rewrite.

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

17 months agoRevert "ci/zink: Disable Amnesia trace until the linked issue gets fixed."
Marek Olšák [Wed, 1 Feb 2023 13:12:16 +0000 (08:12 -0500)]
Revert "ci/zink: Disable Amnesia trace until the linked issue gets fixed."

This reverts commit 2e807a028aa9366be39a4c9445377dbb11e1dcf5.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>

17 months agoglthread: ignore non-VBO vertex arrays with NULL data pointers
Marek Olšák [Wed, 1 Feb 2023 13:00:01 +0000 (08:00 -0500)]
glthread: ignore non-VBO vertex arrays with NULL data pointers

This can happen when an attrib is enabled, but the shader doesn't use it,
so it's ignored by mesa/state_tracker, and should be ignored here as well.

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

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>

17 months agoglthread: add a heuristic to stop locking global mutexes with multiple contexts
Marek Olšák [Wed, 1 Feb 2023 11:29:00 +0000 (06:29 -0500)]
glthread: add a heuristic to stop locking global mutexes with multiple contexts

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4516
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8035

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>

17 months agoglthread: upload non-BO indices in the core profile to fix GStreamer
Marek Olšák [Wed, 1 Feb 2023 09:06:58 +0000 (04:06 -0500)]
glthread: upload non-BO indices in the core profile to fix GStreamer

Only apply the core profile checking to non-VBO vertices.

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

Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>

17 months agoglthread: initialize indices[i] for no-op MultiDrawElements
Marek Olšák [Fri, 3 Feb 2023 15:40:30 +0000 (10:40 -0500)]
glthread: initialize indices[i] for no-op MultiDrawElements

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

17 months agomesa: ignore indices[i] if count[i] == 0 for MultiDrawElements
Marek Olšák [Fri, 3 Feb 2023 15:34:09 +0000 (10:34 -0500)]
mesa: ignore indices[i] if count[i] == 0 for MultiDrawElements

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

17 months agoglthread: track the current element array buffer in the Core profile too
Marek Olšák [Sat, 18 Feb 2023 13:03:04 +0000 (08:03 -0500)]
glthread: track the current element array buffer in the Core profile too

This is a prerequisite for:
    "glthread: upload non-BO indices in the core profile to fix GStreamer"

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

17 months agohasvk: Fix gfx8/9 VB range > 32bits workaround detection.
Emma Anholt [Thu, 16 Feb 2023 19:05:44 +0000 (11:05 -0800)]
hasvk: Fix gfx8/9 VB range > 32bits workaround detection.

Since the dirty range started out as 0..0, you would have 0..VBend as the
new dirty range on the first draw, and if your VB was >32b then you'd
flush every time you used it.  Instead, if there's no existing dirty range
then just set it to our new VB's range.

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

17 months agoanv: Fix gfx8/9 VB range > 32bits workaround detection.
Emma Anholt [Thu, 16 Feb 2023 18:39:47 +0000 (10:39 -0800)]
anv: Fix gfx8/9 VB range > 32bits workaround detection.

Since the dirty range started out as 0..0, you would have 0..VBend as the
new dirty range on the first draw, and if your VB was >32b then you'd
flush every time you used it.  Instead, if there's no existing dirty range
then just set it to our new VB's range.

Perf results with zink+anv on my CFL:

sauerbraten:       +24.8182% +/- 0.602077% (n=5)
portal-2-v2.trace: +4.64289% +/- 0.285285% (n=5)

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

17 months agozink: enable renderpass optimizing on lavapipe
Mike Blumenkrantz [Wed, 15 Feb 2023 16:12:42 +0000 (11:12 -0500)]
zink: enable renderpass optimizing on lavapipe

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

17 months agollvmpipe: do additional checks in lp_state_fs_analysis.c for linear shaders
Brian Paul [Tue, 14 Feb 2023 20:26:48 +0000 (13:26 -0700)]
llvmpipe: do additional checks in lp_state_fs_analysis.c for linear shaders

Check if the FS output color comes from an FS input.  If so, don't tag
the shader as linear.  See code comments for more details.

During testing I added extra counters to check the number of times
linear shaders were used to be sure we're not accidentally disallowing
too many shaders.  Things looked good with our in-house mksReplay test
suite.

This fixes some OpenGL CTS test failures with llvmpipe.

Signed-off-by: Brian Paul <brianp@vmware.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7489
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21340>

17 months agobroadcom/ci: use deqp-runner to run piglit tests
Eric Engestrom [Mon, 13 Feb 2023 16:07:43 +0000 (16:07 +0000)]
broadcom/ci: use deqp-runner to run piglit tests

This is what other jobs are standardizing to.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>

17 months agobroadcom/ci: fold .vc4-rpi3-piglit:armhf into its only user
Eric Engestrom [Mon, 13 Feb 2023 16:06:23 +0000 (16:06 +0000)]
broadcom/ci: fold .vc4-rpi3-piglit:armhf into its only user

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>

17 months agobroadcom/ci: refactor a bit
Eric Engestrom [Mon, 13 Feb 2023 21:05:34 +0000 (21:05 +0000)]
broadcom/ci: refactor a bit

Just moving things around, no functional change.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>

17 months agomeson: improve formatting of options file
Eric Engestrom [Fri, 19 Aug 2022 16:10:52 +0000 (17:10 +0100)]
meson: improve formatting of options file

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21321>

17 months agoci: stop watching for changes in removed script
Eric Engestrom [Fri, 19 Aug 2022 15:45:00 +0000 (16:45 +0100)]
ci: stop watching for changes in removed script

Removed in a79e6457d8aa6eb10b0c ("meson: use builtin support for reading
version from a file").

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21321>

17 months agoEGL: implement Haiku driver over Gallium
X512 [Tue, 17 May 2022 22:37:42 +0000 (07:37 +0900)]
EGL: implement Haiku driver over Gallium

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

17 months agohaiku: fix build
X512 [Thu, 10 Mar 2022 15:48:05 +0000 (00:48 +0900)]
haiku: fix build

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

17 months agohgl: remove
X512 [Sun, 13 Nov 2022 09:13:21 +0000 (18:13 +0900)]
hgl: remove

Use EGL and glvnd instead on Haiku platform.

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

17 months agomesa: optimize out _mesa_is_desktop_gl*() and _mesa_is_gles*() calls when not built
Eric Engestrom [Wed, 15 Feb 2023 19:23:21 +0000 (19:23 +0000)]
mesa: optimize out _mesa_is_desktop_gl*() and _mesa_is_gles*() calls when not built

This will in turn optimize out anything that's gated on those.

Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomesa: make more use of the new _mesa_is_gles2() helper
Eric Engestrom [Wed, 15 Feb 2023 20:12:54 +0000 (20:12 +0000)]
mesa: make more use of the new _mesa_is_gles2() helper

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomesa: make more use of the new _mesa_is_gles1() helper
Eric Engestrom [Wed, 15 Feb 2023 20:12:54 +0000 (20:12 +0000)]
mesa: make more use of the new _mesa_is_gles1() helper

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomesa: add & use new _mesa_is_gles1() & _mesa_is_gles2() helpers
Eric Engestrom [Wed, 15 Feb 2023 20:12:54 +0000 (20:12 +0000)]
mesa: add & use new _mesa_is_gles1() & _mesa_is_gles2() helpers

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomesa: make more use of the existing _mesa_is_gles* helpers
Eric Engestrom [Wed, 15 Feb 2023 19:40:01 +0000 (19:40 +0000)]
mesa: make more use of the existing _mesa_is_gles* helpers

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomesa: make use of the new _mesa_is_desktop_gl_core() helper
Eric Engestrom [Wed, 15 Feb 2023 19:56:13 +0000 (19:56 +0000)]
mesa: make use of the new _mesa_is_desktop_gl_core() helper

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomesa: make use of the new _mesa_is_desktop_gl_compat() helper
Eric Engestrom [Wed, 15 Feb 2023 19:52:25 +0000 (19:52 +0000)]
mesa: make use of the new _mesa_is_desktop_gl_compat() helper

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomesa: add _mesa_is_desktop_gl_compat() and _mesa_is_desktop_gl_core() helpers
Eric Engestrom [Wed, 15 Feb 2023 19:53:18 +0000 (19:53 +0000)]
mesa: add _mesa_is_desktop_gl_compat() and _mesa_is_desktop_gl_core() helpers

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomeson: allow building GLES without GL
Eric Engestrom [Tue, 14 Feb 2023 21:52:07 +0000 (21:52 +0000)]
meson: allow building GLES without GL

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomeson/windows: only build libgl-gdi for desktop gl
Eric Engestrom [Fri, 17 Feb 2023 21:08:25 +0000 (21:08 +0000)]
meson/windows: only build libgl-gdi for desktop gl

Suggested-by: Jesse Natalie <jenatali@microsoft.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agomeson: make GLX require OpenGL
Eric Engestrom [Wed, 15 Feb 2023 19:18:27 +0000 (19:18 +0000)]
meson: make GLX require OpenGL

This isn't strictly true, but making that work isn't worth the effort;
see https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343#note_1774683

Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>

17 months agonir/lower_blend,agx,panfrost: Use lowered I/O
Alyssa Rosenzweig [Tue, 29 Nov 2022 03:28:13 +0000 (22:28 -0500)]
nir/lower_blend,agx,panfrost: Use lowered I/O

This is one step towards lowering I/O during shader preprocess rather than at
variant create time, which helps mitigate shader variant jank. It's also a lot
simpler.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> [v1]
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>

17 months agonir/lower_blend: Don't handle gl_FragColor
Alyssa Rosenzweig [Wed, 15 Feb 2023 15:27:48 +0000 (10:27 -0500)]
nir/lower_blend: Don't handle gl_FragColor

In OpenGL, FRAG_RESULT_COLOR implicitly broadcasts to every render target. Our
existing lower_blend code (somewhat arbitrarily) aliases to the the first render
target's format and blend settings. That said, I don't think that works if
different render targets have different settings -- or blend with their
different destinations -- though I don't have relevant spec text right now.

The actual reason this works is that all users of this pass either call
nir_lower_fragcolor first (panfrost, asahi) or don't have FRAG_RESULT_COLOR as
part of their API (panvk, soon agxv). Unless/until we actually have a use case
for nir_lower_blend with gl_FragColor, assert that gl_FragColor is lowered first
so we don't need to worry about this imaginary case.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>

17 months agonir/lower_blend: Don't touch store->dest
Alyssa Rosenzweig [Wed, 15 Feb 2023 15:10:45 +0000 (10:10 -0500)]
nir/lower_blend: Don't touch store->dest

Stores don't have destinations, and if they did, it would be invalid to change
their ssa_def's num_components without also changing the SSA def. Remove the
nonsensical (but harmless) assignment.

This fixes 25249e8be2c ("nir/lower_blend: Expand or shrink output variables as
needed"), but as the bug is harmless in practice, it does not need to be
backported.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>

17 months agopan/lower_framebuffer: Operate on lowered I/O
Alyssa Rosenzweig [Mon, 6 Feb 2023 16:27:37 +0000 (11:27 -0500)]
pan/lower_framebuffer: Operate on lowered I/O

This turns the early pass into a late pass, which is important because it
depends on the shader key and therefore should be called by the driver instead
of the compiler preprocessing. It's also simpler this way.

The shader key work is waiting for review in another merge request. In the mean
time, this patch will let us run blend lowering early for blend shaders on
Midgard.

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

17 months agonir: Augment raw_output_pan with IO_SEMANTICS+BASE
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:35 +0000 (10:49 -0500)]
nir: Augment raw_output_pan with IO_SEMANTICS+BASE

This is a form of lowered I/O, it needs I/O semantics so we can know the
location to store to instead of passing via a sideband.

Over in !20906, we will use the BASE to lower blend shader with multisampling in
NIR instead of passing the number of samples and framebuffer format along a
sideband to the Midgard compiler. That's not needed for this series (this patch
was cherry-picked to avoid regressions in the lower_blend changes) but it's good
to model the full form of the I/O lowered intrinsic here.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>

17 months agonir/loop_analyze: Simplify some logic in compute_induction_information
Ian Romanick [Wed, 8 Feb 2023 19:33:45 +0000 (11:33 -0800)]
nir/loop_analyze: Simplify some logic in compute_induction_information

This part now looks more like it did before 0b9639c35d0a.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/loop_analyze: Track induction variables with uniform initializer
Ian Romanick [Tue, 7 Feb 2023 22:32:37 +0000 (14:32 -0800)]
nir/loop_analyze: Track induction variables with uniform initializer

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/loop_analyze: Eliminate nir_basic_induction_var
Ian Romanick [Tue, 7 Feb 2023 21:11:51 +0000 (13:11 -0800)]
nir/loop_analyze: Eliminate nir_basic_induction_var

No longer used. All of the information that was previously track here is
tracked directly in nir_loop_variable... and, technically speaking, has
been tracked there ever since 0b9639c35d0a.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/loop_analyze: Use nir_loop_variable::init_src instead of nir_basic_induction_var...
Ian Romanick [Tue, 7 Feb 2023 21:10:22 +0000 (13:10 -0800)]
nir/loop_analyze: Use nir_loop_variable::init_src instead of nir_basic_induction_var::def_outside_loop

These track the same information in a slightly different way. Since
nir_loop_variable::init_src is visible outside this module, it cannot
be eliminated.

As an intentional side effect, induction variables with constant
initializers will now have their nir_loop_induction_variable::init_src
field point to the load_const source. Previously this pointer would be
NULL.

v2: Update unit tests and commit message. Remove the now unused ind_var
variable in find_trip_count.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/loop_analyze: Use nir_loop_variable::update_src instead of nir_basic_induction_va...
Ian Romanick [Tue, 7 Feb 2023 18:10:59 +0000 (10:10 -0800)]
nir/loop_analyze: Use nir_loop_variable::update_src instead of nir_basic_induction_var::alu

These track the same information in a slightly different way. Since
nir_loop_variable::update_src is visible outside this module, it cannot
be eliminated.

This leads to some nice simplification in find_trip_count. Previously
this code only had access to the ALU instruction that performs the
increment. It had to "search" the parameters to determine which (if any)
was the constant. With this change, this code has access to the
nir_alu_src of the ALU instruction that performs the increment. It no
longer needs to search the parameters for the constant. It's either the
supplied nir_alu_src or nothing.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/loop_analyze: Track induction variables with uniform increments
Ian Romanick [Tue, 7 Feb 2023 17:18:45 +0000 (09:18 -0800)]
nir/loop_analyze: Track induction variables with uniform increments

As an intentional side effect, induction variables with constant
increments will now have their nir_loop_induction_variable::update_src
field point to the load_const source. Previously this pointer would be
NULL.

v2: Update unit tests and commit message.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/tests: Add tests for nir_loop_info::induction_vars tracking
Ian Romanick [Fri, 17 Feb 2023 18:10:41 +0000 (10:10 -0800)]
nir/tests: Add tests for nir_loop_info::induction_vars tracking

Later commits in this MR will change the way some data is track, and
these tests will verify this behavior change.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/tests: Add tests for "inverted" loops
Ian Romanick [Wed, 1 Feb 2023 02:12:06 +0000 (18:12 -0800)]
nir/tests: Add tests for "inverted" loops

A couple basic tests for loops with the exit condition after the
increment. In compiler literature, the optimization that moves the exit
condition from the top to the bottom is called "loop inversion."

v2: Pass parameters to loop_builder_invert using a struct. Add a comment
describing the loop being constructed to loop_builder_invert. Both
suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/tests: Refactor creation of loops for loop_analyze test cases
Ian Romanick [Wed, 1 Feb 2023 01:50:11 +0000 (17:50 -0800)]
nir/tests: Refactor creation of loops for loop_analyze test cases

Inspired heavily by the work by Yevhenii Kolesnikov in the original
versions of !3445.

v2: Pass parameters to loop_builder using a struct. Add a comment
describing the loop being constructed to loop_builder. Both suggested by
Caio.

v3: mscv C++ designated initializer lolz.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agonir/tests: Don't unconditionally log shaders from this one CF test
Ian Romanick [Wed, 1 Feb 2023 21:40:13 +0000 (13:40 -0800)]
nir/tests: Don't unconditionally log shaders from this one CF test

All of the other tests only log the shader when validation fails, so
having that shader scroll by in the output is very distracting.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

17 months agodocs: add 23.1 branchpoint & rc dates
Eric Engestrom [Tue, 14 Feb 2023 12:42:41 +0000 (12:42 +0000)]
docs: add 23.1 branchpoint & rc dates

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

17 months agoanv: fix vma heap memory leak
Lionel Landwerlin [Fri, 17 Feb 2023 14:34:10 +0000 (16:34 +0200)]
anv: fix vma heap memory leak

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a5f9e59ce3 ("anv: Use vma_heap for descriptor pool host allocation")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21385>

17 months agoci: bump tags of deqp images
Eric Engestrom [Fri, 17 Feb 2023 17:38:47 +0000 (17:38 +0000)]
ci: bump tags of deqp images

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>

17 months agoci: fix grouping of image tags
Eric Engestrom [Fri, 17 Feb 2023 17:37:31 +0000 (17:37 +0000)]
ci: fix grouping of image tags

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>

17 months agoci: remove no-op sed
Eric Engestrom [Fri, 17 Feb 2023 17:35:59 +0000 (17:35 +0000)]
ci: remove no-op sed

This is a duplicate from the first patch applied above.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>

17 months agoci: simplify adding & removing deqp patches
Eric Engestrom [Fri, 17 Feb 2023 17:09:28 +0000 (17:09 +0000)]
ci: simplify adding & removing deqp patches

Instead of everyone having to copy the curl command from somewhere else
when a new deqp version needs new patches; now all they need to do is
paste the commit hash in the array.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>

17 months agovenus: temporarily redirect VkDrmFormatModifierPropertiesListEXT to "2" variant
Ryan Neph [Tue, 14 Feb 2023 22:47:36 +0000 (14:47 -0800)]
venus: temporarily redirect VkDrmFormatModifierPropertiesListEXT to "2" variant

Temporarily remove driver-side uses of
VkDrmFormatModifierPropertiesListEXT so the encode/decode procedures can
be fixed asynchronously in a follow-up.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21367>

17 months agopanfrost: Fix prim restart XML on Valhall
Alyssa Rosenzweig [Fri, 17 Feb 2023 19:10:47 +0000 (14:10 -0500)]
panfrost: Fix prim restart XML on Valhall

Harmless in practice (so no need to backport) but still very wrong. Noticed
looking at traces of Dolphin trying to debug acute misrendering.

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

17 months agoradv: add a size check in radv_create_buffer for Android
Chia-I Wu [Wed, 15 Feb 2023 19:11:16 +0000 (11:11 -0800)]
radv: add a size check in radv_create_buffer for Android

This is to make dEQP-VK.api.buffer.basic.size_max_uint64 pass on
android.

The test creates a buffer of size UINT64_MAX and makes sure the memory
requirement for the buffer is sane.  It fails because our memory
requirement is "align64(UINT64_MAX, 16)" which is 0 after overflow.

The test checks maintenance4's maxBufferSize and is skipped normally.
But the extension can be disabled on an android build.

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

17 months agoradv: Call nir_lower_array_deref_of_vec in radv_lower_io_to_scalar_early.
Timur Kristóf [Wed, 1 Feb 2023 00:02:09 +0000 (01:02 +0100)]
radv: Call nir_lower_array_deref_of_vec in radv_lower_io_to_scalar_early.

This fixes an issue when a vector component of an arrayed output has a deref.

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

17 months agoradv: Advertise ray query support with LLVM
Konstantin Seurer [Sat, 11 Feb 2023 21:27:45 +0000 (22:27 +0100)]
radv: Advertise ray query support with LLVM

What could go wrong?

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

17 months agoradv: Pre-compile BVH build shaders if there is a cache
Konstantin Seurer [Fri, 17 Feb 2023 16:14:32 +0000 (17:14 +0100)]
radv: Pre-compile BVH build shaders if there is a cache

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