platform/upstream/mesa.git
3 years agonir/algebraic: Make some notes about comparison rearrangements versus infinity
Ian Romanick [Wed, 8 Jul 2020 00:30:42 +0000 (17:30 -0700)]
nir/algebraic: Make some notes about comparison rearrangements versus infinity

The original comment was a little terse and a little incorrect.  The
rearrangements are fine w.r.t. NaN.  However, they produce incorrect
results if one operand is +Inf and the other is -Inf.

A later commit, "nir/algebraic: Add some compare-with-zero optimizations
that are exact", will add some more patterns here.  It may be reasonable
to squash this commit (forward) into that commit.

v2: Fix some incorrect comparisons operators in the comment (<= vs >=).
Add commentary that subtraction works like addition w.r.t. NaN.  Both
noticed / suggested by Caio.

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

3 years agonir: Make some notes about fsign versus NaN
Ian Romanick [Tue, 18 Feb 2020 18:18:57 +0000 (10:18 -0800)]
nir: Make some notes about fsign versus NaN

This commit only documents the current behavior, even if that behavior
is not the behavior preferred by the relevant specs.

In SPIR-V, there are two flavors of the sign instruction, and each lives
in an extended instruction set.  The GLSL.std.450 FSign instruction is
defined as:

    Result is 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.

This also matches the GLSL 4.60 definition.

However, the OpenCL.ExtendedInstructionSet.100 sign instruction is
defined as:

    Returns 1.0 if x > 0, -0.0 if x = -0.0, +0.0 if x = +0.0, or -1.0 if
    x < 0. Returns 0.0 if x is a NaN.

There are two differences.  Each treats -0.0 differently, and each also
treats NaN differently.  Specifically, GLSL.std.450 FSign does not
define any specific behavior for NaN.

There has been some discussion in Khronos about the NaN behavior of
GLSL.std.450 FSign.  As part of that discussion, I did some research
into how we treat NaN for nir_op_fsign, and this commit just captures
some of those notes.

v2: Document the expected behavior of nir_op_fsign more thoroughly.
Suggested by Rhys.  Note that the current implementation of constant
folding does not produce the expected result for NaN.  Suggested by
Caio.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> [v1]
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6358>

3 years agost/mesa: don't affect original st_CompressedTexSubImage parameters
Andrii Simiklit [Mon, 28 Dec 2020 13:58:24 +0000 (15:58 +0200)]
st/mesa: don't affect original st_CompressedTexSubImage parameters

The fallback path is still possible here so let keep them as is.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3952
Fixes: 4b02f165 ("st/mesa: implement PBO upload for glCompressedTex(Sub)Image")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8258>

3 years agogallium: remove PIPE_CAP_INFO_START_WITH_USER_INDICES and fix all drivers
Marek Olšák [Sat, 28 Nov 2020 05:44:19 +0000 (00:44 -0500)]
gallium: remove PIPE_CAP_INFO_START_WITH_USER_INDICES and fix all drivers

Drivers aren't allowed to ignore start with user index buffers anymore.
This is required by the new fast path where mesa/main is using pipe_draw_info.

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

3 years agost/mesa: implement Driver.DrawGallium callbacks
Marek Olšák [Tue, 3 Nov 2020 18:04:03 +0000 (13:04 -0500)]
st/mesa: implement Driver.DrawGallium callbacks

This is the new fast path replacing the _mesa_prim path.

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

3 years agovirgl: fix handling draw info
Marek Olšák [Sun, 22 Nov 2020 03:08:50 +0000 (22:08 -0500)]
virgl: fix handling draw info

index_bias is undefined if index_size == 0.
index bounds are undefined if index_bounds_valid == false.

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

3 years agov3d: don't use index_bias if not indexed
Marek Olšák [Sun, 22 Nov 2020 06:45:11 +0000 (01:45 -0500)]
v3d: don't use index_bias if not indexed

index_bias is undefined if index_size == 0.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>

3 years agovc4: don't use index_bias if indexed
Marek Olšák [Sun, 22 Nov 2020 06:53:18 +0000 (01:53 -0500)]
vc4: don't use index_bias if indexed

index_bias is undefined if index_size == 0.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>

3 years agosvga: fix handling draw info
Marek Olšák [Sun, 22 Nov 2020 07:09:58 +0000 (02:09 -0500)]
svga: fix handling draw info

index_bias is undefined if index_size == 0.
index bounds are undefined if index_bounds_valid == false.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>

3 years agoswr: fix handling draw info
Marek Olšák [Sun, 22 Nov 2020 07:01:18 +0000 (02:01 -0500)]
swr: fix handling draw info

index_bias is undefined if index_size == 0.
index bounds are undefined if index_bounds_valid == false.

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

3 years agor600: fix handling draw info
Marek Olšák [Sun, 22 Nov 2020 06:40:26 +0000 (01:40 -0500)]
r600: fix handling draw info

has_user_indices is undefined if index_size == 0.

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

3 years agopanfrost: don't use index_bias if not indexed
Marek Olšák [Sun, 22 Nov 2020 03:21:26 +0000 (22:21 -0500)]
panfrost: don't use index_bias if not indexed

index_bias is undefined if index_size == 0.

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

3 years agonouveau: fix handling draw info
Marek Olšák [Sun, 22 Nov 2020 07:22:45 +0000 (02:22 -0500)]
nouveau: fix handling draw info

index_bias is undefined if index_size == 0.
index bounds are undefined if index_bounds_valid == false.

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

3 years agoiris: don't use index_bias if not indexed
Marek Olšák [Sun, 22 Nov 2020 06:37:34 +0000 (01:37 -0500)]
iris: don't use index_bias if not indexed

index_bias is undefined if index_size == 0.

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

3 years agofreedreno: fixes handling draw info
Marek Olšák [Sun, 22 Nov 2020 02:49:00 +0000 (21:49 -0500)]
freedreno: fixes handling draw info

index_bias is undefined if index_size == 0.
index bounds are undefined if index_bounds_valid == false.

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

3 years agogallium: fix draw info setup in draw and utilities
Marek Olšák [Sun, 22 Nov 2020 04:26:43 +0000 (23:26 -0500)]
gallium: fix draw info setup in draw and utilities

index_bias is undefined if index_size == 0.
index bounds are undefined if index_bounds_valid == false.

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

3 years agogallium: remove and emulate PIPE_CAP_MULTI_DRAW
Marek Olšák [Tue, 17 Nov 2020 22:19:06 +0000 (17:19 -0500)]
gallium: remove and emulate PIPE_CAP_MULTI_DRAW

To remove PIPE_CAP checking in the common code.

It's better if drivers lower multi draws even if the hardware doesn't
support it beause the multi draw loop can be moved deeper into the driver
to remove more overhead.

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

3 years agogallium/u_threaded: clear vertices_per_patch if prim type != PATCHES
Marek Olšák [Sun, 22 Nov 2020 03:19:46 +0000 (22:19 -0500)]
gallium/u_threaded: clear vertices_per_patch if prim type != PATCHES

We use memcmp when combining back-to-back draws into a multi draw.
Clear vertices_per_patch if it's irrelevant to help memcmp return
a match.

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

3 years agovbo: switch immediate Begin/End to DrawGallium
Marek Olšák [Mon, 2 Nov 2020 07:00:37 +0000 (02:00 -0500)]
vbo: switch immediate Begin/End to DrawGallium

This makes gallium faster because st/mesa doesn't have to translate
_mesa_prim.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>

3 years agovbo: remove _mesa_prim parameter from vbo_copy_vertices
Marek Olšák [Mon, 2 Nov 2020 06:46:24 +0000 (01:46 -0500)]
vbo: remove _mesa_prim parameter from vbo_copy_vertices

glBegin/End won't use _mesa_prim, so we need to stop using it.

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

3 years agovbo: remove _mesa_prim parameter from vbo_merge_draws
Marek Olšák [Mon, 2 Nov 2020 06:46:24 +0000 (01:46 -0500)]
vbo: remove _mesa_prim parameter from vbo_merge_draws

glBegin/End won't use _mesa_prim, so we need to stop using it.

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

3 years agovbo: remove _mesa_prim parameter from vbo_try_prim_conversion
Marek Olšák [Mon, 2 Nov 2020 06:46:24 +0000 (01:46 -0500)]
vbo: remove _mesa_prim parameter from vbo_try_prim_conversion

glBegin/End won't use _mesa_prim, so we need to stop using it.

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

3 years agomesa: switch MultiDrawElements(BaseVertex) to DrawGallium*
Marek Olšák [Sun, 1 Nov 2020 22:07:03 +0000 (17:07 -0500)]
mesa: switch MultiDrawElements(BaseVertex) to DrawGallium*

This makes gallium faster because st/mesa doesn't have to translate
_mesa_prim.

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

3 years agomesa: switch Draw(Range)Elements(BaseVertex) calls to DrawGallium
Marek Olšák [Sun, 1 Nov 2020 21:37:23 +0000 (16:37 -0500)]
mesa: switch Draw(Range)Elements(BaseVertex) calls to DrawGallium

This makes gallium faster because st/mesa doesn't have to translate
_mesa_prim.

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

3 years agomesa: switch (Multi)DrawArrays to DrawGallium
Marek Olšák [Tue, 3 Nov 2020 16:02:51 +0000 (11:02 -0500)]
mesa: switch (Multi)DrawArrays to DrawGallium

This makes gallium faster because st/mesa doesn't have to translate
_mesa_prim.

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

3 years agovbo: add vbo_get_minmax_indices_gallium
Marek Olšák [Tue, 3 Nov 2020 18:03:28 +0000 (13:03 -0500)]
vbo: add vbo_get_minmax_indices_gallium

to be used by st/mesa to get index bounds because it won't have _mesa_prim
with the new draw interface.

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

3 years agomesa: add a fallback for drivers not implementing Driver.DrawGallium*
Marek Olšák [Sun, 1 Nov 2020 20:39:16 +0000 (15:39 -0500)]
mesa: add a fallback for drivers not implementing Driver.DrawGallium*

This is for classic drivers and it translates pipe_draw_info to the old
interface using _mesa_prim.

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

3 years agogallium: add pipe_draw_info::index::gl_bo
Marek Olšák [Tue, 1 Dec 2020 18:51:09 +0000 (13:51 -0500)]
gallium: add pipe_draw_info::index::gl_bo

mesa/main will fill pipe_draw_info but it has no access to pipe_resources,
so we need gl_buffer_object here.

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

3 years agomesa: add Driver.DrawGallium* functions to be used by main/draw.c
Marek Olšák [Tue, 3 Nov 2020 17:14:12 +0000 (12:14 -0500)]
mesa: add Driver.DrawGallium* functions to be used by main/draw.c

This is a new Draw interface using the same parameters as draw_vbo.

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

3 years agovbo: change the parameters of vbo_get_minmax_index to get rid of _mesa_prim
Marek Olšák [Sun, 1 Nov 2020 19:46:53 +0000 (14:46 -0500)]
vbo: change the parameters of vbo_get_minmax_index to get rid of _mesa_prim

This will be used by a new Draw interface.

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

3 years agovbo: only set count and end when closing _mesa_prim
Marek Olšák [Mon, 2 Nov 2020 06:57:48 +0000 (01:57 -0500)]
vbo: only set count and end when closing _mesa_prim

It's already set everywhere except vbo_exec_wrap_buffers.
This is a small optimization removing superfluous code.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>

3 years agomesa: fix an overflow check for MultiDrawElements
Marek Olšák [Wed, 4 Nov 2020 04:15:41 +0000 (23:15 -0500)]
mesa: fix an overflow check for MultiDrawElements

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>

3 years agoCI: Enable d3d12 driver for Linux CI builds
Jesse Natalie [Mon, 28 Dec 2020 19:04:31 +0000 (11:04 -0800)]
CI: Enable d3d12 driver for Linux CI builds

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8251>

3 years agoCI: Install DirectX-Headers package for x86 container
Jesse Natalie [Mon, 28 Dec 2020 19:21:06 +0000 (11:21 -0800)]
CI: Install DirectX-Headers package for x86 container

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8251>

3 years agodrisw: Use debug_screen_wrap like everybody else
Adam Jackson [Fri, 18 Dec 2020 14:45:41 +0000 (09:45 -0500)]
drisw: Use debug_screen_wrap like everybody else

I tried to use GALLIUM_TRACE with llvmpipe and it didn't work, because
we were never letting the debug wrappers initialize.

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

3 years agomicrosoft/clc: Fix const violations from ralloc_steal
Jesse Natalie [Thu, 19 Nov 2020 22:44:08 +0000 (14:44 -0800)]
microsoft/clc: Fix const violations from ralloc_steal

Fixes: ff05da7f8dc ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")

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

3 years agovirgl: Enable GL_EXT_texture_sRGB_RG8
Adam Jackson [Wed, 16 Dec 2020 23:24:52 +0000 (18:24 -0500)]
virgl: Enable GL_EXT_texture_sRGB_RG8

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

3 years agozink: Enable GL_EXT_texture_sRGB_RG8
Adam Jackson [Wed, 16 Dec 2020 22:54:31 +0000 (17:54 -0500)]
zink: Enable GL_EXT_texture_sRGB_RG8

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

3 years agozink: Enable GL_EXT_texture_sRGB_R8
Adam Jackson [Wed, 16 Dec 2020 22:53:49 +0000 (17:53 -0500)]
zink: Enable GL_EXT_texture_sRGB_R8

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

3 years agomesa: Implement GL_EXT_texture_sRGB_RG8 for softpipe and llvmpipe
Adam Jackson [Tue, 15 Dec 2020 18:49:37 +0000 (13:49 -0500)]
mesa: Implement GL_EXT_texture_sRGB_RG8 for softpipe and llvmpipe

sRGB_RG8 is not registered for big-GL yet, see this Khronos issue
for updates on that:

https://github.com/KhronosGroup/OpenGL-Registry/issues/450

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

3 years agomesa: Cosmetic cleanups to GL_EXT_texture_sRGB_R8
Adam Jackson [Tue, 15 Dec 2020 17:35:33 +0000 (12:35 -0500)]
mesa: Cosmetic cleanups to GL_EXT_texture_sRGB_R8

This extension dates to 2015 not 2018, and since there's only one
texture format to check for the additional GL_TRUE is meaningless.

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

3 years agotreewide: Disambiguate various variables named "debug_options"
Adam Jackson [Thu, 17 Dec 2020 16:07:30 +0000 (11:07 -0500)]
treewide: Disambiguate various variables named "debug_options"

Name them after what they control so 'vi -t' can take you somewhere
useful.

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

3 years agozink: handle gl_SampleMaskIn loading in ntv
Mike Blumenkrantz [Fri, 24 Jul 2020 13:52:34 +0000 (09:52 -0400)]
zink: handle gl_SampleMaskIn loading in ntv

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

3 years agozink: set PIPE_CAP_MAX_VIEWPORTS
Mike Blumenkrantz [Mon, 3 Aug 2020 15:53:44 +0000 (11:53 -0400)]
zink: set PIPE_CAP_MAX_VIEWPORTS

enables ARB_viewport_array

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

3 years agozink: handle fs interpolation functions in ntv
Mike Blumenkrantz [Fri, 24 Jul 2020 12:43:08 +0000 (08:43 -0400)]
zink: handle fs interpolation functions in ntv

basically load_deref but with different ops

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

3 years agozink: only emit each cap once
Erik Faye-Lund [Mon, 4 Jan 2021 15:27:59 +0000 (16:27 +0100)]
zink: only emit each cap once

This just prevents us from emitting some caps a bunch of times. Since
there's few caps in use, it seems reasonable to use this mechanism for
all caps, as it's unlikely to add up to anything worth worrying about.

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

3 years agoandroid: pan/bi: Remove old IR opcode table
Mauro Rossi [Sat, 2 Jan 2021 12:20:46 +0000 (13:20 +0100)]
android: pan/bi: Remove old IR opcode table

Fixes the following building error:

clang: error: no such file or directory: 'external/mesa/src/panfrost/bifrost/bi_tables.c'
clang: error: no input files

Fixes: b691aeaacf93 ("pan/bi: Remove old IR opcode table")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8294>

3 years agoandroid: pan/bi: Remove NIR->old IR
Mauro Rossi [Sat, 2 Jan 2021 12:19:56 +0000 (13:19 +0100)]
android: pan/bi: Remove NIR->old IR

Fixes the following building error:

clang: error: no such file or directory: 'external/mesa/src/panfrost/bifrost/bi_special.c'
clang: error: no input files

Fixes: e5ec0dc18320 ("pan/bi: Remove NIR->old IR")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8294>

3 years agoandroid: pan/bi: Remove old IR packs
Mauro Rossi [Sat, 2 Jan 2021 12:18:50 +0000 (13:18 +0100)]
android: pan/bi: Remove old IR packs

Necessary for Android build after commit a1e150fc4d4e

Fixes: a1e150fc4d4e ("pan/bi: Remove old IR packs")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8294>

3 years agoandroid: pan/bi: Remove combine lowering
Mauro Rossi [Sat, 2 Jan 2021 12:17:42 +0000 (13:17 +0100)]
android: pan/bi: Remove combine lowering

Fixes the following building error:

clang: error: no such file or directory: 'external/mesa/src/panfrost/bifrost/bi_lower_combine.c'
clang: error: no input files

Fixes: 8b0d0a931b80 ("pan/bi: Remove combine lowering")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8294>

3 years agoandroid: pan/bi: Generate instruction packer for new IR
Mauro Rossi [Sat, 2 Jan 2021 12:16:48 +0000 (13:16 +0100)]
android: pan/bi: Generate instruction packer for new IR

Necessary for Android build after commit 82328a524519

Fixes: 82328a524519 ("pan/bi: Generate instruction packer for new IR")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8294>

3 years agoandroid: pan/bi: Generate builder routines
Mauro Rossi [Sat, 2 Jan 2021 11:08:34 +0000 (12:08 +0100)]
android: pan/bi: Generate builder routines

Fixes the following building error:

external/mesa/src/panfrost/bifrost/bifrost_compile.c:38:10: fatal error: 'bi_builder.h' file not found
         ^~~~~~~~~~~~~~
1 error generated.

Fixes: 8ef0d411708a ("pan/bi: Generate builder routines")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8294>

3 years agoandroid: pan/bi: Generate instruction printer
Mauro Rossi [Sat, 2 Jan 2021 11:01:36 +0000 (12:01 +0100)]
android: pan/bi: Generate instruction printer

To avoid building errors in Android

Fixes: 1893a3805e41 ("pan/bi: Generate instruction printer")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8294>

3 years agoradv: disable A2 SNORM/SSCALED/SINT for texel buffers & images on all gens
Samuel Pitoiset [Mon, 4 Jan 2021 15:22:23 +0000 (16:22 +0100)]
radv: disable A2 SNORM/SSCALED/SINT for texel buffers & images on all gens

AMDVLK and AMDGPU-PRO also don't support these formats for texel
buffers and images.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3386
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8315>

3 years agoaco: fix incorrect address calculation for load_barycentric_at_sample
Rhys Perry [Mon, 4 Jan 2021 10:41:39 +0000 (10:41 +0000)]
aco: fix incorrect address calculation for load_barycentric_at_sample

Fix address calculation for indirect load_barycentric_at_sample on GFX6-8
with a uniform sample index.

A non-zero uniform sample index does not seem to be tested by CTS.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3966
Fixes: 93c8ebfa780 ("aco: Initial commit of independent AMD compiler")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8302>

3 years agopan/bi: Fix TEXS register counts
Alyssa Rosenzweig [Mon, 4 Jan 2021 15:22:27 +0000 (10:22 -0500)]
pan/bi: Fix TEXS register counts

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: cffc1d90da0 ("pan/bi: Add staging register counts to ISA.xml")
Reported-by: Icecream95
Tested-by: macc24
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8310>

3 years agopanfrost: Allow 3D AFBC on Bifrost v7
Boris Brezillon [Fri, 18 Dec 2020 13:40:31 +0000 (14:40 +0100)]
panfrost: Allow 3D AFBC on Bifrost v7

This feature doesn't seem to work properly on Midgard, and is flagged
as unsupported on Bifrost v6.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Fix calculation of body/header pointers for 3D AFBC
Boris Brezillon [Wed, 16 Dec 2020 13:48:57 +0000 (14:48 +0100)]
panfrost: Fix calculation of body/header pointers for 3D AFBC

When using 3D AFBC, all headers are placed at the beginning instead of
being interleaved with each surface body, which forces us to adjust
the calculation in that case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Allow AFBC on 2D arrays
Boris Brezillon [Wed, 16 Dec 2020 09:50:02 +0000 (10:50 +0100)]
panfrost: Allow AFBC on 2D arrays

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Fix panfrost_should_linear_convert()
Boris Brezillon [Fri, 18 Dec 2020 20:38:44 +0000 (21:38 +0100)]
panfrost: Fix panfrost_should_linear_convert()

Take 3D/array textures into accound when checking for entire overwrite.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Initialize AFBC headers to zero
Boris Brezillon [Mon, 4 Jan 2021 08:53:45 +0000 (09:53 +0100)]
panfrost: Initialize AFBC headers to zero

This way we can load uninitialized AFBC surfaces without causing GPU
faults.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Use panfrost_get_layer_stride() instead of open-coding it
Boris Brezillon [Fri, 18 Dec 2020 13:25:51 +0000 (14:25 +0100)]
panfrost: Use panfrost_get_layer_stride() instead of open-coding it

If we don't do that we don't account for CRC buffers.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Enable AFBC support on Bifrost
Boris Brezillon [Mon, 14 Dec 2020 10:43:22 +0000 (11:43 +0100)]
panfrost: Enable AFBC support on Bifrost

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Fix AFBC support on Bifrost
Boris Brezillon [Wed, 16 Dec 2020 09:31:11 +0000 (10:31 +0100)]
panfrost: Fix AFBC support on Bifrost

Bifrost and Midgard render target and ZS extension descriptors are a bit
different, adjust the code to take those differences into account.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Use proper format for Z16_UNORM
Boris Brezillon [Wed, 16 Dec 2020 07:24:39 +0000 (08:24 +0100)]
panfrost: Use proper format for Z16_UNORM

R16_UNORM isn't compatible with AFBC, we need to use the native Z16
format if we want to allow AFBC on those resources.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Fix ZS block format v7 definition
Boris Brezillon [Wed, 16 Dec 2020 09:57:05 +0000 (10:57 +0100)]
panfrost: Fix ZS block format v7 definition

This field takes 4 bits, not 2.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Adjust the format for AFBC textures on Bifrost v7
Boris Brezillon [Fri, 18 Dec 2020 09:42:07 +0000 (10:42 +0100)]
panfrost: Adjust the format for AFBC textures on Bifrost v7

On Bifrost v7, AFBC textures can't be used with a non-identity component
order. Let's patch the format so the component order is always RGB[A].
That means we're lying about the internal format, but that shouldn't be
a problem as long as we don't share the resource.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Pass a pipe-like swizzle to panfrost_new_texture()
Boris Brezillon [Fri, 18 Dec 2020 09:37:11 +0000 (10:37 +0100)]
panfrost: Pass a pipe-like swizzle to panfrost_new_texture()

And let the function translate it to a mali swizzle. This way we will
be able to adjust the swizzle if needed.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Add R5G6B5_UNORM entries to the format tables
Boris Brezillon [Fri, 18 Dec 2020 10:56:25 +0000 (11:56 +0100)]
panfrost: Add R5G6B5_UNORM entries to the format tables

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Adjust surface stride calculation to take AFBC into account
Boris Brezillon [Wed, 16 Dec 2020 09:27:02 +0000 (10:27 +0100)]
panfrost: Adjust surface stride calculation to take AFBC into account

AFBC strides are different from tiled/linear stride and we need to
use the value defined in slice.afbc.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Add AFBC slice.body_size and slice.{row,surface}_stride fields
Boris Brezillon [Wed, 16 Dec 2020 09:22:20 +0000 (10:22 +0100)]
panfrost: Add AFBC slice.body_size and slice.{row,surface}_stride fields

Those are needed for render target and texture descriptors and can't be
easily extracted from the other fields present in panfrost_slice

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Fix AFBC header_size and slice size calculation
Boris Brezillon [Wed, 16 Dec 2020 09:06:44 +0000 (10:06 +0100)]
panfrost: Fix AFBC header_size and slice size calculation

3D AFBC textures have their AFBC headers grouped together at the
beginning of the buffer which means the header_size should be multiplied
by the depth. 2D arrays have their AFBC headers placed at the beginning
of each slice, meaning that the slice size should take them into account.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Move AFBC header_size to a sub-struct
Boris Brezillon [Mon, 14 Dec 2020 18:52:48 +0000 (19:52 +0100)]
panfrost: Move AFBC header_size to a sub-struct

So we can add more AFBC related fields under this struct.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Add a pan_image_layout object
Boris Brezillon [Thu, 17 Dec 2020 11:12:28 +0000 (12:12 +0100)]
panfrost: Add a pan_image_layout object

Group the slices, dimension, modifier and array stride in a an object
representing the image layout. This way we shrink the number of
arguments passed to various pan_texture helpers and simplifies some
of the logic along the way.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Stop mixing depth and number of samples
Boris Brezillon [Wed, 16 Dec 2020 08:57:52 +0000 (09:57 +0100)]
panfrost: Stop mixing depth and number of samples

Texture depth and MSAA are two different concepts even if they are
exclusive on Mali GPUs (depth field is repurposed for sample index
there). Let's not mix them and adjust the slice_full_size calculation
to take both into account.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Use PAN_V6_SWIZZLE() in pan_blit.c
Boris Brezillon [Thu, 17 Dec 2020 11:03:42 +0000 (12:03 +0100)]
panfrost: Use PAN_V6_SWIZZLE() in pan_blit.c

Suggested-by: Icecream95
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: s/panfrost_slice.size0/panfrost_slice.surface_stride/
Boris Brezillon [Thu, 17 Dec 2020 09:46:38 +0000 (10:46 +0100)]
panfrost: s/panfrost_slice.size0/panfrost_slice.surface_stride/

This field is encoding the stride between two consecutive surface
in a 3D texture. Let's use a name reflecting that.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Merge panfrost_new_texture() and panfrost_new_texture_bifrost()
Boris Brezillon [Wed, 16 Dec 2020 08:44:43 +0000 (09:44 +0100)]
panfrost: Merge panfrost_new_texture() and panfrost_new_texture_bifrost()

There's no reason to keep both now that the internal logic has been
deduplicated.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Adjust the compression tag creation for Bifrost
Boris Brezillon [Wed, 16 Dec 2020 07:45:36 +0000 (08:45 +0100)]
panfrost: Adjust the compression tag creation for Bifrost

Bifrost has a few more compression flags that are worth specifying.
Extend panfrost_compression_tag() to deal with those too.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Define AFBC surface flags
Boris Brezillon [Fri, 18 Dec 2020 11:19:07 +0000 (12:19 +0100)]
panfrost: Define AFBC surface flags

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Pass a dev object to panfrost_needs_explicit_stride()
Boris Brezillon [Wed, 16 Dec 2020 07:40:33 +0000 (08:40 +0100)]
panfrost: Pass a dev object to panfrost_needs_explicit_stride()

So we can soon use the same path for Bifrost and Midgard.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Merge emit_texture_payload() and emit_texture_payload_v7()
Boris Brezillon [Wed, 16 Dec 2020 08:14:48 +0000 (09:14 +0100)]
panfrost: Merge emit_texture_payload() and emit_texture_payload_v7()

The only reason we have two different functions to prepare the texture
payload is the different ordering between pre-v7 and v7+ GPUs. Abstract
the surface iteration so we can merge panfrost_emit_texture_payload_v7()
and panfrost_emit_texture_payload().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Pass a device object to panfrost_new_texture()
Boris Brezillon [Wed, 16 Dec 2020 07:36:46 +0000 (08:36 +0100)]
panfrost: Pass a device object to panfrost_new_texture()

We will need it to merge some of the Bifrost and Midgard logic.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Group CRC fields in a struct
Boris Brezillon [Mon, 14 Dec 2020 18:50:08 +0000 (19:50 +0100)]
panfrost: Group CRC fields in a struct

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agopanfrost: Move checksum_bo to panfrost_resource
Boris Brezillon [Thu, 17 Dec 2020 09:33:50 +0000 (10:33 +0100)]
panfrost: Move checksum_bo to panfrost_resource

There's no reason to have the checksum_bo at the slice level since there
can only be one external CRC BO per resource. Move this field to the
panfrost_resource struct.

Suggested-by: Icecream95
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>

3 years agofeatures: mark off textureGather for zink
Mike Blumenkrantz [Mon, 4 Jan 2021 14:46:07 +0000 (09:46 -0500)]
features: mark off textureGather for zink

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

3 years agozink: enable PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS
Mike Blumenkrantz [Mon, 4 Jan 2021 14:45:34 +0000 (09:45 -0500)]
zink: enable PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS

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

3 years agozink: handle textureGather with Shadow-type samplers
Mike Blumenkrantz [Fri, 24 Jul 2020 13:48:36 +0000 (09:48 -0400)]
zink: handle textureGather with Shadow-type samplers

these have to go through OpImageDrefGather without composite construction
on the result

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

3 years agozink: implement ARB_texture_gather
Mike Blumenkrantz [Wed, 15 Jul 2020 19:25:45 +0000 (15:25 -0400)]
zink: implement ARB_texture_gather

again pretty straightforward, just hooking up tg4 tex op in ntv

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

3 years agozink: use Offset param for txf ops
Mike Blumenkrantz [Wed, 15 Jul 2020 19:18:24 +0000 (15:18 -0400)]
zink: use Offset param for txf ops

there's an image operand for handling offsets, so we can use this when it
hasn't previously been lowered away

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

3 years agozink: run nir_lower_tex for offsets if shaderImageGatherExtended is missing
Mike Blumenkrantz [Thu, 24 Dec 2020 15:38:15 +0000 (10:38 -0500)]
zink: run nir_lower_tex for offsets if shaderImageGatherExtended is missing

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

3 years agonir: fix missing nir_lower_pntc_ytransform.c in the makefile
Danylo Piliaiev [Mon, 4 Jan 2021 14:16:32 +0000 (16:16 +0200)]
nir: fix missing nir_lower_pntc_ytransform.c in the makefile

Fixes: 33fd9e5d "nir: account for point-coord origin when lowering it"
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8308>

3 years agozink: handle dynamic sampler array indexing for arb_gpu_shader5
Mike Blumenkrantz [Tue, 28 Jul 2020 18:50:45 +0000 (14:50 -0400)]
zink: handle dynamic sampler array indexing for arb_gpu_shader5

this requires that arrays of samplers be declared as single variables with
a single binding point, which is then propagated through to the descriptor
set updates

constant sampler array indexing is now un-lowered during access so we can
construct an access chain for both constant and dynamic offset paths

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

3 years agoradv: avoid oob read during clear
Mike Blumenkrantz [Thu, 31 Dec 2020 20:44:32 +0000 (15:44 -0500)]
radv: avoid oob read during clear

when clearing a depth/stencil image the passed colorvalue pointer is
smaller than the VkClearValue struct size

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

3 years agonir: account for point-coord origin when lowering it
Danylo Piliaiev [Tue, 22 Dec 2020 12:37:45 +0000 (14:37 +0200)]
nir: account for point-coord origin when lowering it

The resulting point-coord origin not only depends on whether
the draw buffer is flipped but also on GL_POINT_SPRITE_COORD_ORIGIN
state. Which makes its transform differ from a transform of wpos.

On freedreno fixes:
 gl-3.2-pointsprite-origin
 gl-3.2-pointsprite-origin -fbo

Fixes: d934d320 "nir: Add flipping of gl_PointCoord.y in nir_lower_wpos_ytransform."
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8200>

3 years agoradv: Use VRAM for the initial gfx cmdbuffer.
Bas Nieuwenhuizen [Mon, 28 Dec 2020 02:14:18 +0000 (03:14 +0100)]
radv: Use VRAM for the initial gfx cmdbuffer.

Not expect it to make any real difference, but lets be consistent.

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

3 years agoradv: Put commandbuffers in VRAM if all VRAM is CPU visible.
Bas Nieuwenhuizen [Mon, 7 Dec 2020 23:09:29 +0000 (00:09 +0100)]
radv: Put commandbuffers in VRAM if all VRAM is CPU visible.

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

3 years agoradv: Use VRAM for upload buffers if entire VRAM is CPU-visible.
Bas Nieuwenhuizen [Mon, 7 Dec 2020 23:25:56 +0000 (00:25 +0100)]
radv: Use VRAM for upload buffers if entire VRAM is CPU-visible.

Not doing this for APUs because spilling is quite likely, due to
overall VRAM pressure.

Also adding a flag to disable for performance debugging.

Finally adds some memset for places where we depended on the memory
being initialized to zero, which we won't get with VRAM anymore.
(I think these places should stop depending on it since it hides
 issues with executing the cmdbuffer multiple times, but this
  preserves behavior)

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

3 years agomicrosoft/compiler: Fix clang fallthrough warnings
Jesse Natalie [Mon, 28 Dec 2020 20:52:00 +0000 (12:52 -0800)]
microsoft/compiler: Fix clang fallthrough warnings

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

3 years agomicrosoft/resource_state_manager: Remove unused private variable
Jesse Natalie [Mon, 28 Dec 2020 18:57:02 +0000 (10:57 -0800)]
microsoft/resource_state_manager: Remove unused private variable

Clang detects that this variable is unused. We can re-add it if
we end up needing it but for now let's just remove it.

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