platform/upstream/mesa.git
3 years agolavapipe: fix some void ptr arithmetic
Dave Airlie [Thu, 18 Feb 2021 01:06:39 +0000 (17:06 -0800)]
lavapipe: fix some void ptr arithmetic

msvc disagrees with it, and they are trivial to fix.

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

3 years agolavapipe/meson: drop megadrivers build req
Dave Airlie [Thu, 18 Feb 2021 01:05:07 +0000 (17:05 -0800)]
lavapipe/meson: drop megadrivers build req

This just seems to be cut-n-paste, so lose it.

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

3 years agolavapipe: implement physical device group enumeration
Dave Airlie [Fri, 19 Feb 2021 00:25:13 +0000 (10:25 +1000)]
lavapipe: implement physical device group enumeration

This was missing when I added physical device groups, and
was causing crashes on win32.

Fixes: 6af87193c ("lavapipe: add basic vulkan device group support.")
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>

3 years agozink: be more explicit with image barriers for copy operations
Mike Blumenkrantz [Thu, 10 Sep 2020 18:45:04 +0000 (14:45 -0400)]
zink: be more explicit with image barriers for copy operations

we know the access and pipeline stage here, so we can pass those along
to ensure synchronization

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

3 years agozink: add general zink_resource_barrier() wrapper
Mike Blumenkrantz [Tue, 8 Sep 2020 14:08:45 +0000 (10:08 -0400)]
zink: add general zink_resource_barrier() wrapper

this simplifies a bit of code where we may want to be throwing in barriers
regardless of the resource type

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

3 years agozink: zink_resource_barrier -> zink_resource_image_barrier
Mike Blumenkrantz [Tue, 8 Sep 2020 14:05:43 +0000 (10:05 -0400)]
zink: zink_resource_barrier -> zink_resource_image_barrier

need this namespace

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

3 years agozink: improve barrier usage for clear functions
Mike Blumenkrantz [Mon, 7 Sep 2020 14:40:21 +0000 (10:40 -0400)]
zink: improve barrier usage for clear functions

ensure that we're always using the right layout for images that are
being cleared

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

3 years agozink: add batch references for resources in clear functions
Mike Blumenkrantz [Mon, 7 Sep 2020 14:39:43 +0000 (10:39 -0400)]
zink: add batch references for resources in clear functions

need to make sure we track these writes

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

3 years agozink: add access info for update_descriptor image barriers
Mike Blumenkrantz [Mon, 7 Sep 2020 14:35:20 +0000 (10:35 -0400)]
zink: add access info for update_descriptor image barriers

this forces resources to transition where necessary to ensure that
data from previous ops have been made available (e.g., clear -> shader image)

we also switch needs_barrier over to a more accurate signature here since we
can now do it without breaking update_descriptors()

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

3 years agozink: add access param for image resource barriers
Mike Blumenkrantz [Mon, 7 Sep 2020 14:34:24 +0000 (10:34 -0400)]
zink: add access param for image resource barriers

we need more detail on some of these to ensure proper synchronization
and availability/visibility of image data between commands/stages

the signature for needs_barrier() is still funky here to avoid breaking
usage in update_descriptors()

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

3 years agozink: add barriers for index and draw param buffers
Mike Blumenkrantz [Thu, 20 Aug 2020 13:53:54 +0000 (09:53 -0400)]
zink: add barriers for index and draw param buffers

need to ensure synchronization here too

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

3 years agozink: assert batch is not in a renderpass when emitting pipeline barrier
Mike Blumenkrantz [Wed, 19 Aug 2020 18:50:05 +0000 (14:50 -0400)]
zink: assert batch is not in a renderpass when emitting pipeline barrier

this is only valid for subpasses which have self-dependencies set, and we
don't currently do that

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

3 years agozink: take struct zink_batch param instead of direct cmdbuf in barrier helpers
Mike Blumenkrantz [Wed, 19 Aug 2020 18:45:09 +0000 (14:45 -0400)]
zink: take struct zink_batch param instead of direct cmdbuf in barrier helpers

this is weird and prevents us from verifying batch states

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

3 years agozink: combine resource barriers where possible during update_descriptors
Mike Blumenkrantz [Wed, 19 Aug 2020 19:46:08 +0000 (15:46 -0400)]
zink: combine resource barriers where possible during update_descriptors

if we have a resource in the same state for multiple shader stages, we can
emit a single barrier for all the stage bits instead of multiple barriers

this also helps with detecting potentially redundant barriers when we go to
emit them later on

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

3 years agozink: break out barrier transitioning in update_descriptors
Mike Blumenkrantz [Wed, 19 Aug 2020 15:47:08 +0000 (11:47 -0400)]
zink: break out barrier transitioning in update_descriptors

this hopefully makes the code a little more readable

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

3 years agozink: avoid emitting unnecessary pipeline barriers during update_descriptors
Mike Blumenkrantz [Wed, 19 Aug 2020 19:44:37 +0000 (15:44 -0400)]
zink: avoid emitting unnecessary pipeline barriers during update_descriptors

if the current state of the resource matches the desired state, we don't need
to emit anything, and we can potentially avoid ending a renderpass

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

3 years agozink: add generic wrapper for checking whether a resource needs a barrier
Mike Blumenkrantz [Wed, 19 Aug 2020 19:41:41 +0000 (15:41 -0400)]
zink: add generic wrapper for checking whether a resource needs a barrier

handy to not need to check ahead of time

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

3 years agozink: use define for max descriptor array size
Mike Blumenkrantz [Wed, 19 Aug 2020 15:46:31 +0000 (11:46 -0400)]
zink: use define for max descriptor array size

this was getting a bit unwieldy

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

3 years agozink: add helper for image resource barriers and avoid unnecessary barriers
Mike Blumenkrantz [Wed, 19 Aug 2020 15:28:58 +0000 (11:28 -0400)]
zink: add helper for image resource barriers and avoid unnecessary barriers

same as buffer barriers now

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

3 years agozink: add a VkPipelineStageFlags param to zink_resource_barrier()
Mike Blumenkrantz [Wed, 19 Aug 2020 15:27:41 +0000 (11:27 -0400)]
zink: add a VkPipelineStageFlags param to zink_resource_barrier()

this matches the buffer variant in its flexibility now

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

3 years agozink: remove aspect param from zink_resource_barrier
Mike Blumenkrantz [Wed, 19 Aug 2020 15:14:46 +0000 (11:14 -0400)]
zink: remove aspect param from zink_resource_barrier

we have a helper function for this now that we can reuse

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

3 years agozink: rework xfb barrier transitions when reusing as vertex inputs
Mike Blumenkrantz [Wed, 19 Aug 2020 14:49:58 +0000 (10:49 -0400)]
zink: rework xfb barrier transitions when reusing as vertex inputs

if we have proper barrier usage to start with, then we don't need to do
any kind of weird flushing upon changing vertex inputs and can also remove
a flag from zink_resource

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

3 years agozink: rework xfb counter resource barriers
Mike Blumenkrantz [Wed, 19 Aug 2020 14:40:58 +0000 (10:40 -0400)]
zink: rework xfb counter resource barriers

using the new helper functions, we can now more accurately determine
exactly which barriers we need/want and avoid setting unnecessary barriers
or ending a renderpass early

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

3 years agozink: set buffer resource barriers for descriptor resources in update_descriptors()
Mike Blumenkrantz [Mon, 17 Aug 2020 20:10:03 +0000 (16:10 -0400)]
zink: set buffer resource barriers for descriptor resources in update_descriptors()

need to make sure these are properly synchronized

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

3 years agozink: add helper function for getting pipeline stage from shader stage
Mike Blumenkrantz [Mon, 17 Aug 2020 20:08:02 +0000 (16:08 -0400)]
zink: add helper function for getting pipeline stage from shader stage

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

3 years agopanfrost/ci: Mark flaky test
Alyssa Rosenzweig [Thu, 18 Feb 2021 16:01:19 +0000 (11:01 -0500)]
panfrost/ci: Mark flaky test

I cannot reproduce the issue in local runs.

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

3 years agodocs/features: Mark atomics/images done on Bifrost
Alyssa Rosenzweig [Tue, 16 Feb 2021 18:34:17 +0000 (13:34 -0500)]
docs/features: Mark atomics/images done on Bifrost

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

3 years agopanfrost: Advertise FRAMEBUFFER_NO_ATTACHMENTS
Alyssa Rosenzweig [Wed, 17 Feb 2021 16:54:18 +0000 (11:54 -0500)]
panfrost: Advertise FRAMEBUFFER_NO_ATTACHMENTS

Passes dEQP-GLES31.functional.fbo.no_attachments.*, it doesn't look like
we need to do anything special.

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

3 years agopanfrost: Comment on state of ARB_shader_clock
Alyssa Rosenzweig [Tue, 16 Feb 2021 18:49:04 +0000 (13:49 -0500)]
panfrost: Comment on state of ARB_shader_clock

Pending on kernel work.

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

3 years agopan/bi: Use explicit move even for RT#0 of MRT
Alyssa Rosenzweig [Wed, 17 Feb 2021 02:16:26 +0000 (21:16 -0500)]
pan/bi: Use explicit move even for RT#0 of MRT

Otherwise we get a bad RA if RT 0 = RT 3 (for example), fixes
dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.const_literal.fragment.sampler2d

Fixes: a6f1500bedd ("pan/bi: Workaround BLEND precolour with explicit moves")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/bi: Allow dynamically uniform tex indices
Alyssa Rosenzweig [Wed, 17 Feb 2021 01:40:42 +0000 (20:40 -0500)]
pan/bi: Allow dynamically uniform tex indices

Passes the relevant tests of
dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.*, a few
failures that seem to relate to MRT instead of this.

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

3 years agopan/bi: Implement interpolateAtOffset
Alyssa Rosenzweig [Wed, 17 Feb 2021 00:55:12 +0000 (19:55 -0500)]
pan/bi: Implement interpolateAtOffset

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

3 years agopan/bi: Add imm_f16 helper
Alyssa Rosenzweig [Wed, 17 Feb 2021 00:55:00 +0000 (19:55 -0500)]
pan/bi: Add imm_f16 helper

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

3 years agopan/bi: Implement interpolateAtSample
Alyssa Rosenzweig [Tue, 16 Feb 2021 23:58:22 +0000 (18:58 -0500)]
pan/bi: Implement interpolateAtSample

Passes dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.*

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

3 years agopan/bi: Preload sample ID for sample shading
Alyssa Rosenzweig [Tue, 16 Feb 2021 23:45:46 +0000 (18:45 -0500)]
pan/bi: Preload sample ID for sample shading

Used in the LD_VAR_IMM. Wondering if preload requirements shouldn't
instead be pushed from the compiler based on actual usage instead of
guessing from the NIR...

Fixes dEQP-GLES31.functional.shaders.multisample_interpolation.sample_qualifier.*

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

3 years agopan/bi: Elucidate slot 6/7 operation
Alyssa Rosenzweig [Tue, 16 Feb 2021 23:11:45 +0000 (18:11 -0500)]
pan/bi: Elucidate slot 6/7 operation

Used to order fragments. With that clarified it's clear that we need to
wait on slot 7 for LD_TILE too (outside the limited context of a blend
shader).

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

3 years agopan/bi: Flesh out LD_TILE emit
Alyssa Rosenzweig [Tue, 16 Feb 2021 23:12:30 +0000 (18:12 -0500)]
pan/bi: Flesh out LD_TILE emit

Needs to support non-blend shader operation (conversion descriptor
sourced from a sysval), as well as MRT. Fixes fbfetch on Bifrost.

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

3 years agopan/bi: Fix blend shaders using LD_TILE with MRT
Alyssa Rosenzweig [Tue, 16 Feb 2021 23:19:29 +0000 (18:19 -0500)]
pan/bi: Fix blend shaders using LD_TILE with MRT

Don't hardcode the RT to 0. Affects ES3.0 which already exposes MRT --
despite no dEQP coverage of this particular corner case, apps could hit
this in the wild on 21.0. Fixes

dEQP-GLES31.functional.draw_buffers_indexed.overwrite_indexed.common_blend_func_buffer_blend_func

Fixes: c7e1ef7c0c5 ("panfrost: Advertise ES3.0 on Bifrost")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/bi: Implement shader_clock intrinsic
Alyssa Rosenzweig [Tue, 16 Feb 2021 18:48:57 +0000 (13:48 -0500)]
pan/bi: Implement shader_clock intrinsic

Trivial.

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

3 years agopan/bi: Implement image_atomic_comp_swap
Alyssa Rosenzweig [Tue, 16 Feb 2021 14:54:19 +0000 (09:54 -0500)]
pan/bi: Implement image_atomic_comp_swap

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

3 years agopan/bi: Implement image_atomic_exchange
Alyssa Rosenzweig [Tue, 16 Feb 2021 14:50:39 +0000 (09:50 -0500)]
pan/bi: Implement image_atomic_exchange

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

3 years agopan/bi: nir_intrinsic_image_size support
Icecream95 [Mon, 28 Dec 2020 12:05:05 +0000 (01:05 +1300)]
pan/bi: nir_intrinsic_image_size support

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

3 years agopan/bi: Implement image load/store
Icecream95 [Sat, 26 Dec 2020 04:09:07 +0000 (17:09 +1300)]
pan/bi: Implement image load/store

v2 (Alyssa): Split out functions, support 3D/array

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

3 years agopan/bi: Materialize *DTSEL_IMM in the scheduler
Alyssa Rosenzweig [Thu, 18 Feb 2021 14:49:57 +0000 (09:49 -0500)]
pan/bi: Materialize *DTSEL_IMM in the scheduler

We want to be able to set a descriptor table and have the instruction
pair "magically" come to be. To do so, we adjust the definition of
DTSEL_IMM (deviating a bit from the architectural definition but in
practice simplifying disassembly immensely) and add a scheduler
lowering. This ensures DTSEL is always paired correctly.

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

3 years agopan/bi: Remove check for first_ubo_is_default_ubo
Icecream95 [Fri, 12 Feb 2021 10:37:08 +0000 (23:37 +1300)]
pan/bi: Remove check for first_ubo_is_default_ubo

It won't be set for OpenCL.

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

3 years agopan/bi: Handle computational atomics
Alyssa Rosenzweig [Tue, 16 Feb 2021 16:02:24 +0000 (11:02 -0500)]
pan/bi: Handle computational atomics

All the same formula: calculate an address, emit a pseudoinstruction for
the atomic, emit a postprocess that can be DCE'd if not needed.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/bi: Add ATOM_C1 promotion check
Alyssa Rosenzweig [Wed, 17 Feb 2021 18:51:55 +0000 (13:51 -0500)]
pan/bi: Add ATOM_C1 promotion check

Optimizes atomic counters.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/bi: Extract bi_atom_opc from NIR intrinsic
Alyssa Rosenzweig [Tue, 16 Feb 2021 13:18:40 +0000 (08:18 -0500)]
pan/bi: Extract bi_atom_opc from NIR intrinsic

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/bi: Lower atomic pseudo-instructions
Alyssa Rosenzweig [Tue, 16 Feb 2021 16:01:57 +0000 (11:01 -0500)]
pan/bi: Lower atomic pseudo-instructions

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/bi: Add 32-bit atomic pseudoinstruction
Alyssa Rosenzweig [Tue, 16 Feb 2021 16:00:43 +0000 (11:00 -0500)]
pan/bi: Add 32-bit atomic pseudoinstruction

To enable scheduler lowering to an ATOM_CX pair.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/bi: Add SEG_ADD.i64 pseudoinstruction
Alyssa Rosenzweig [Tue, 16 Feb 2021 13:48:34 +0000 (08:48 -0500)]
pan/bi: Add SEG_ADD.i64 pseudoinstruction

Expands to a pair *SEG_ADD/+SEG_ADD, which is used for lowering shared
atomics.

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

3 years agopan/bi: Allow @rNULL with tied operands
Alyssa Rosenzweig [Wed, 17 Feb 2021 19:45:44 +0000 (14:45 -0500)]
pan/bi: Allow @rNULL with tied operands

Will enable DCE of atomics.

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

3 years agopan/bi: Don't read alpha out of bounds
Alyssa Rosenzweig [Wed, 17 Feb 2021 04:38:52 +0000 (23:38 -0500)]
pan/bi: Don't read alpha out of bounds

RT#0 may not have alpha, do something safe instead of risking issues
with RA later.

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

3 years agopan/bi: Fix LD_GCLK staging count
Alyssa Rosenzweig [Tue, 16 Feb 2021 18:47:09 +0000 (13:47 -0500)]
pan/bi: Fix LD_GCLK staging count

64-bit result

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

3 years agopan/bi: Don't inline 64-bit constants
Alyssa Rosenzweig [Wed, 17 Feb 2021 19:13:30 +0000 (14:13 -0500)]
pan/bi: Don't inline 64-bit constants

Will drop the upper bits incorrectly.

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

3 years agopan/bi: Fix RA of node 0 again
Alyssa Rosenzweig [Tue, 16 Feb 2021 15:46:19 +0000 (10:46 -0500)]
pan/bi: Fix RA of node 0 again

Botched rebase.

Fixes: c578ca73939 ("pan/bi: Add interference per clause")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopanfrost: Remove useless check
Alyssa Rosenzweig [Wed, 17 Feb 2021 04:02:11 +0000 (23:02 -0500)]
panfrost: Remove useless check

Already checked in format_supported (only difference being cube map
arrays but the extension isn't advertised yet anyway due to missing
geometry shaders.)

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

3 years agopanfrost: Set border colour on Bifrost sampler
Alyssa Rosenzweig [Wed, 17 Feb 2021 02:28:34 +0000 (21:28 -0500)]
panfrost: Set border colour on Bifrost sampler

Passes dEQP-GLES31.functional.texture.border_clamp.*

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

3 years agopanfrost: Take panfrost_dev for AFBC selection
Alyssa Rosenzweig [Wed, 17 Feb 2021 03:47:01 +0000 (22:47 -0500)]
panfrost: Take panfrost_dev for AFBC selection

This appears to be architecture dependent.

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

3 years agopanfrost: Spell fix
Alyssa Rosenzweig [Wed, 17 Feb 2021 03:35:43 +0000 (22:35 -0500)]
panfrost: Spell fix

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

3 years agopanfrost: Fix NULL deref for an empty frag shader
Alyssa Rosenzweig [Wed, 17 Feb 2021 03:30:42 +0000 (22:30 -0500)]
panfrost: Fix NULL deref for an empty frag shader

Fixes debug builds of dEQP-GLES31.functional.stencil_texturing.render.*

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

3 years agopanfrost: Add RT conversion sysval
Alyssa Rosenzweig [Tue, 16 Feb 2021 23:11:07 +0000 (18:11 -0500)]
panfrost: Add RT conversion sysval

Contains the InternalConversionDescriptor corresponding to the selected
render target, ready to be fed into LD_TILE.

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

3 years agopanfrost: Export bifrost_get_blend_desc with type size
Alyssa Rosenzweig [Tue, 16 Feb 2021 23:10:43 +0000 (18:10 -0500)]
panfrost: Export bifrost_get_blend_desc with type size

Will be used to lower EXT_shader_framebuffer_fetch on Bifrost.

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

3 years agopanfrost: Flesh out allow_forward_pixel_to_kill check
Alyssa Rosenzweig [Tue, 16 Feb 2021 23:10:08 +0000 (18:10 -0500)]
panfrost: Flesh out allow_forward_pixel_to_kill check

A few cases missed, probably some more bugs hidden here!

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

3 years agopanfrost: Handle PIPE_FORMAT_NONE as 'constant'
Alyssa Rosenzweig [Tue, 16 Feb 2021 19:07:26 +0000 (14:07 -0500)]
panfrost: Handle PIPE_FORMAT_NONE as 'constant'

We can use the constant format anywhere safely as a 0-component format,
which will map fine for PIPE_FORMAT_NONE. Used so
ARB_framebuffer_no_attachments can probe.

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

3 years agopanfrost: Flesh out pixel kill / zs update
Alyssa Rosenzweig [Tue, 16 Feb 2021 18:23:34 +0000 (13:23 -0500)]
panfrost: Flesh out pixel kill / zs update

Add some notes on what the useful combinations do and flesh out the
logic. Fixes fails in
dEQP-GLES31.functional.image_load_store.early_fragment_tests.*

It's still not entirely clear to me what the difference between "force
early" and "weak early" is from the driver's perspective, though I
suspect there are performance implications to getting it wrong. Follow
what the blob does in case of doubt..

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

3 years agopanfrost: Track coverage, early fragment tests
Alyssa Rosenzweig [Tue, 16 Feb 2021 18:23:08 +0000 (13:23 -0500)]
panfrost: Track coverage, early fragment tests

These extra pieces of data are needed to correctly compute pixel kill /
zs update settings.

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

3 years agopanfrost: Label groups in GenXML
Alyssa Rosenzweig [Tue, 16 Feb 2021 18:11:30 +0000 (13:11 -0500)]
panfrost: Label groups in GenXML

Helps debug pandecode issues.

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

3 years agopan/decode: Disambiguate border colours
Alyssa Rosenzweig [Wed, 17 Feb 2021 03:18:04 +0000 (22:18 -0500)]
pan/decode: Disambiguate border colours

Can be small ints that will just be 0.0 if interpreted as float.

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

3 years agopan/decode: Pretty print 22-bit pixel formats
Alyssa Rosenzweig [Wed, 17 Feb 2021 02:54:35 +0000 (21:54 -0500)]
pan/decode: Pretty print 22-bit pixel formats

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/decode: Fix tiler printing on Bifrost
Alyssa Rosenzweig [Tue, 16 Feb 2021 18:09:59 +0000 (13:09 -0500)]
pan/decode: Fix tiler printing on Bifrost

Fixes: 9d682ad7f99 ("pan/decode: Only print local storage for vertex jobs")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

3 years agopan/bi: Implement barriers
Alyssa Rosenzweig [Tue, 16 Feb 2021 19:18:10 +0000 (14:18 -0500)]
pan/bi: Implement barriers

Only control barriers are meaningful upon a closer read.

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

3 years agopan/bi: Stub scoreboarding
Alyssa Rosenzweig [Fri, 12 Feb 2021 21:50:08 +0000 (16:50 -0500)]
pan/bi: Stub scoreboarding

This is not a real implementation. But I'm working on barriers right
now.

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

3 years agomicrosoft/clc: Use driver_location for metadata instead of re-computing offsets
Jesse Natalie [Thu, 18 Feb 2021 19:13:25 +0000 (11:13 -0800)]
microsoft/clc: Use driver_location for metadata instead of re-computing offsets

Fixes: ff05da7f ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9138>

3 years agomicrosoft/clc: Move inline samplers to the end of the variable list
Jesse Natalie [Thu, 18 Feb 2021 19:05:43 +0000 (11:05 -0800)]
microsoft/clc: Move inline samplers to the end of the variable list

Since inline samplers are uniforms, just like kernel args, and
nir_lower_vars_to_explicit_types will assign driver_location based
on order in the variable list, move the inline samplers to the end
of the list to prevent them from creating gaps in the kernel arg
offsets.

Fixes: ff05da7f ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9138>

3 years agomicrosoft/clc: Fix wrap modes for inline samplers for integer textures
Jesse Natalie [Thu, 18 Feb 2021 19:04:23 +0000 (11:04 -0800)]
microsoft/clc: Fix wrap modes for inline samplers for integer textures

Fixes: ff05da7f ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9138>

3 years agomicrosoft/clc: Let lower_vars_to_explicit_types fill kernel input driver_location
Jesse Natalie [Thu, 18 Feb 2021 18:28:20 +0000 (10:28 -0800)]
microsoft/clc: Let lower_vars_to_explicit_types fill kernel input driver_location

Importantly, also run that before mucking with the variable list via image lowering,
which removes and inserts variables, making the driver_location no longer line up
with metadata.

Fixes: ff05da7f ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9138>

3 years agointel/mi_builder: Add tests for gen_mi_z and gen_mi_nz
Jason Ekstrand [Thu, 18 Feb 2021 00:20:41 +0000 (18:20 -0600)]
intel/mi_builder: Add tests for gen_mi_z and gen_mi_nz

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

3 years agointel/mi_builder: Rewrite unit tests in terms of constant folding
Jason Ekstrand [Thu, 18 Feb 2021 00:20:24 +0000 (18:20 -0600)]
intel/mi_builder: Rewrite unit tests in terms of constant folding

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

3 years agointel/mi_builder: Add constant folding
Jason Ekstrand [Thu, 18 Feb 2021 00:19:54 +0000 (18:19 -0600)]
intel/mi_builder: Add constant folding

This also serves as pretty clear documentation of each helper's
semantics.

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

3 years agointel/mi_builder: Short-circuit shifts in more cases
Jason Ekstrand [Thu, 18 Feb 2021 15:34:34 +0000 (09:34 -0600)]
intel/mi_builder: Short-circuit shifts in more cases

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

3 years agointel/mi_builder: Fix a misleading comment
Jason Ekstrand [Thu, 18 Feb 2021 15:37:44 +0000 (09:37 -0600)]
intel/mi_builder: Fix a misleading comment

This doesn't actually assume the top 32 bits of the source value are
zero.  Instead, it does (src >> shift) & UINT32_MAX regardless of what
the top bits of src are.

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

3 years agointel/mi_builder: Delete a bogus comment
Jason Ekstrand [Thu, 18 Feb 2021 00:18:56 +0000 (18:18 -0600)]
intel/mi_builder: Delete a bogus comment

It actually returns ~0/0.  We're about to make things more self-
documenting so we can delete the comment instead of fixing it.

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

3 years agointel/mi_builder: Create a context in the tests
Jason Ekstrand [Thu, 18 Feb 2021 02:00:53 +0000 (20:00 -0600)]
intel/mi_builder: Create a context in the tests

This makes them work on the simulator

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

3 years agonouveau: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 19:30:28 +0000 (14:30 -0500)]
nouveau: Silence a warning at -Og

   ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp: In member function ‘void nv50_ir::AlgebraicOpt::handleCVT_EXTBF(nv50_ir::Instruction*)’:
   ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2238:57: warning: ‘offset’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Just set it to 0 to handle the corner case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8724>

3 years agonouveau: Silence some warnings at -Og
Adam Jackson [Tue, 26 Jan 2021 19:27:48 +0000 (14:27 -0500)]
nouveau: Silence some warnings at -Og

   ../src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp: In member function ‘bool {anonymous}::Converter::handleInstruction(const tgsi_full_instruction*)’:
   ../src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp:3419:22: warning: ‘src1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    3419 |          geni = mkOp3(op, dstTy, dst0[c], fetchSrc(0, c), src1, mkImm(0x1f));
   ../src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp:3272:15: warning: ‘val1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    3272 |          mkOp1(OP_EX2, TYPE_F32, dst0[1], val1);

Can't happen, just initialize them to NULL.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8724>

3 years agogallivm: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 19:20:30 +0000 (14:20 -0500)]
gallivm: Silence a warning at -Og

   ../src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c: In function ‘lp_build_sample_image_linear’:
   ../src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c:1412:24: warning: ‘have_corners’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    1412 |          have_corner = LLVMBuildLoad(builder, have_corners, "");

I don't think you can get here and really not have it initialized, but
if you _could_ then it would clearly be wrong to do anything, so do
nothing instead.

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

3 years agovl: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 19:17:52 +0000 (14:17 -0500)]
vl: Silence a warning at -Og

   ../src/gallium/auxiliary/vl/vl_winsys_dri.c: In function ‘vl_dri2_screen_texture_from_drawable’:
   ../src/gallium/auxiliary/vl/vl_winsys_dri.c:239:34: warning: ‘back_left’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     239 |    dri2_handle.stride = back_left->pitch;

The server would be broken if it failed to inform us of the back left
buffer, but let's leave nothing to chance.

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

3 years agonir/ttn: Silence some warnings at -Og
Adam Jackson [Tue, 26 Jan 2021 19:16:05 +0000 (14:16 -0500)]
nir/ttn: Silence some warnings at -Og

   ../src/gallium/auxiliary/nir/tgsi_to_nir.c: In function ‘ttn_mem’:
   ../src/gallium/auxiliary/nir/tgsi_to_nir.c:1724:15: warning: ‘op’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    1724 |       instr = nir_intrinsic_instr_create(b->shader, op);
   ../src/gallium/auxiliary/nir/tgsi_to_nir.c:1697:15: warning: ‘op’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    1697 |       instr = nir_intrinsic_instr_create(b->shader, op);

Add some more unreachable() to make this go away.

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

3 years agogallivm: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 19:14:02 +0000 (14:14 -0500)]
gallivm: Silence a warning at -Og

   ../src/gallium/auxiliary/gallivm/lp_bld_arit.c: In function ‘lp_build_round_arch’:
   ../src/gallium/auxiliary/gallivm/lp_bld_arit.c:2042:7: warning: ‘intrinsic_root’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    2042 |       lp_format_intrinsic(intrinsic, sizeof intrinsic, intrinsic_root, bld->vec_type);

Can't happen, mark it unreachable.

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

3 years agoloader: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 19:11:52 +0000 (14:11 -0500)]
loader: Silence a warning at -Og

   ../src/loader/loader_dri3_helper.c: In function ‘dri3_free_buffers’:
   ../src/loader/loader_dri3_helper.c:2022:46: warning: ‘n_id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    2022 |    for (buf_id = first_id; buf_id < first_id + n_id; buf_id++) {

Can't happen, mark it unreachable.

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

3 years agoglsl: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 19:11:04 +0000 (14:11 -0500)]
glsl: Silence a warning at -Og

   ../src/compiler/glsl/gl_nir_link_uniforms.c:1786:50: warning: ‘blocks’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    1786 |             const struct gl_uniform_block *const block =

Just do nothing if we somehow fail to initialize blocks.

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

3 years agoglsl: Silence some warnings at -Og
Adam Jackson [Tue, 26 Jan 2021 19:04:14 +0000 (14:04 -0500)]
glsl: Silence some warnings at -Og

   ./src/compiler/glsl/link_uniforms.cpp: In member function ‘virtual void parcel_out_uniform_storage::visit_field(const glsl_type*, const char*, bool, const glsl_type*, glsl_interface_packing, bool)’:
   ../src/compiler/glsl/link_uniforms.cpp:1171:61: warning: ‘id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    1171 |       calculate_array_size_and_stride(prog, &this->uniforms[id],

   ../src/compiler/glsl/link_uniform_initializers.cpp: In function ‘gl_uniform_storage* linker::get_storage(gl_shader_program*, const char*)’:
   ../src/compiler/glsl/link_uniform_initializers.cpp:41:42: warning: ‘id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      41 |       return &prog->data->UniformStorage[id];

Can't happen, but flow control apparently can't prove it.

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

3 years agoglsl: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 19:01:26 +0000 (14:01 -0500)]
glsl: Silence a warning at -Og

   ../src/compiler/glsl/gl_nir_link_uniforms.c: In function ‘gl_nir_link_uniforms’:
   ../src/compiler/glsl/gl_nir_link_uniforms.c:1747:39: warning: ‘num_blocks’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    1747 |                for (unsigned i = 0; i < num_blocks; i++) {

Don't have the patience to seee how you'd hit this but doing nothing is
clearly the right edge case behavior.

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

3 years agosoftfloat: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 18:48:22 +0000 (13:48 -0500)]
softfloat: Silence a warning at -Og

   ../src/util/softfloat.c: In function ‘_mesa_shift_right_jam_m’:
   ../src/util/softfloat.c:432:16: warning: ‘tmp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     432 |         *tmp++ = 0;

You could actually hit this if you called _mesa_shift_right_jam_m with
size_words = 0 and dist < 32. Not that you'd _do_ that, but. In this
case do nothing instead of writing through an uninitialized pointer.

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

3 years agonir: Silence a warning at -Og
Adam Jackson [Tue, 26 Jan 2021 18:18:29 +0000 (13:18 -0500)]
nir: Silence a warning at -Og

This throws a curious warning:

   In file included from ../src/compiler/nir/nir.h:32,
                    from ../src/compiler/nir/nir_opt_if.c:24:
   ../src/compiler/nir/nir_opt_if.c: In function ‘opt_if_loop_last_continue’:
   ../src/compiler/glsl/list.h:415:64: warning: ‘nif’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     415 |    return !exec_list_is_empty(list) ? list->tail_sentinel.prev : NULL;
         |                                                                ^

What's going on here is not enough of the optimizer has run to be able
to prove that nif is always initialized. So just handle the "can't
happen" case as if it could.

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

3 years agogallium/trace: remove transfer_map assert
Mike Blumenkrantz [Wed, 17 Feb 2021 18:58:27 +0000 (13:58 -0500)]
gallium/trace: remove transfer_map assert

this breaks tracing with tc due to the "latest" mechanism which maintains
copies of resources

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

3 years agopanfrost: Fix uniform_count on Midgard
Alyssa Rosenzweig [Wed, 17 Feb 2021 20:36:13 +0000 (15:36 -0500)]
panfrost: Fix uniform_count on Midgard

The compiler ABI specifies push uniforms at a 4-byte granularity (like
Bifrost), but Midgard require a 16-byte granularity. As such if the
number of pushed words is not a multiple of 4, there is a buffer overrun
at shader load time. Ordinarily this is inaccessible so the garbage is
ignored.

However, there was a great deal of confusion around the `uniform_cutoff`
variable. In some cases (such a full glmark2 run on a 64-bit processor),
the push uniforms would be at the end of a BO and the overrun would
cause a page fault.

Remove uniform_cutoff entirely and work with count directly to avoid
faulting, and round the count up to be defensive.

Closes: #4289
Fixes: ed810eb0a0c ("panfrost: Don't truncate uniform_count")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Robin Murphy <robin.murphy@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9109>

3 years agozink: enable GL_CLAMP cap
Mike Blumenkrantz [Thu, 28 Jan 2021 04:40:40 +0000 (23:40 -0500)]
zink: enable GL_CLAMP cap

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

3 years agomesa/st: add PIPE_CAP_GL_CLAMP
Mike Blumenkrantz [Mon, 25 Jan 2021 22:37:29 +0000 (17:37 -0500)]
mesa/st: add PIPE_CAP_GL_CLAMP

when this is not set, this triggers shader and sampler state updates any time a sampler
starts or stops using GL_CLAMP, applying bitmasks needed to run nir_lower_tex
and setting CLAMP_TO_BORDER/CLAMP_TO_EDGE as necessary to mimic the behavior

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8756>