platform/upstream/mesa.git
3 years agodocs: inline contents.rst into index.rst
Erik Faye-Lund [Fri, 20 Nov 2020 13:29:00 +0000 (14:29 +0100)]
docs: inline contents.rst into index.rst

The idea of having a single file containing the ToC is not really how
things are done in Sphinx, and kinda makes it harder to structure
documentation more naturally. This was just something I did to mirror
what we used to do for the old HTML-only version of the docs, to ease
the transition and to de-clutter index.rst.

Now that the transition is far behind us, and index.rst is much cleaner,
we can finally start inlining this.

In the long run, I expect most of these to be moved to separate "chapter
articles" that summarize what these topics are, and thus disappear from
here.

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

3 years agodocs: mention egl in api-list
Erik Faye-Lund [Fri, 20 Nov 2020 13:20:47 +0000 (14:20 +0100)]
docs: mention egl in api-list

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

3 years agodocs: do not explicitly call out es-versions
Erik Faye-Lund [Fri, 20 Nov 2020 13:01:27 +0000 (14:01 +0100)]
docs: do not explicitly call out es-versions

There's no reason to explicitly call out GL ES versions here, as these
are all major versions there are, and it's very unlikely that more
versions will emerge.

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

3 years agodocs: use external link-references
Erik Faye-Lund [Fri, 20 Nov 2020 12:58:40 +0000 (13:58 +0100)]
docs: use external link-references

The rST code here is much more to the point and easy to read if we
define the links as external link-references instead of inlining them.

This will make the next few patches much easier to grok.

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

3 years agodocs: move major versions history out of front-page
Erik Faye-Lund [Fri, 20 Nov 2020 12:44:53 +0000 (13:44 +0100)]
docs: move major versions history out of front-page

The features added in each major version is also unlikely the first things
someone wants to know about Mesa. So let's move this into the
versions.rst article.

This documentation is severely out of date anyway, and as it doesn't
seem like anyone is interested in documenting this any more, we should
probably consider driopping versions.rst entirely in the longer run.

But for now, this makes the front-page much more approachable.

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

3 years agodocs: break project history out of front-page
Erik Faye-Lund [Fri, 20 Nov 2020 12:35:36 +0000 (13:35 +0100)]
docs: break project history out of front-page

The project history isn't usually what a user wants to read first when
they read about a project, so let's remove it from the front-page of the
documentation.

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

3 years agozink: revert to old load_ubo implementation
Erik Faye-Lund [Thu, 26 Nov 2020 19:54:02 +0000 (20:54 +0100)]
zink: revert to old load_ubo implementation

It turns out, the load_ubo to load_ubo_vec4 implementation isn't quite
enough for us, for a few reasons:

1. We use a single array of uvec4s for our UBOs, and to handle 64-bit
   values in UBOs, we need further lowering.
2. The whole vec4 stuff seems a bit hard to reconsile with glsl 4.3
   packing as well as PackedDriverUniformStorage.

In addition to the above, this fixes several piglit tests that *aren't*
part of quick_gl, which is what I've been running. So this doesn't even
work correctly right now.

So let's go back to what we had before instead.

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

3 years agozink: add alternate ubo loader in ntv
Mike Blumenkrantz [Fri, 26 Jun 2020 19:53:30 +0000 (15:53 -0400)]
zink: add alternate ubo loader in ntv

This is a loader that handles more cases than the current vec4-based
loader, that is a bit easier to extend to more features.

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

3 years agoutil/slab: do not dereference NULL-pointer
Erik Faye-Lund [Tue, 1 Dec 2020 09:59:48 +0000 (10:59 +0100)]
util/slab: do not dereference NULL-pointer

This used to not be a problem, because these mutexes were the first
members of this array, meaning that we ended up trying to lock/unlock
NULL mutexes. But this isn't guaranteed to be allowed, so we were
relying on luck here.

Recently, this changed. We introduced asserts for NULL-pointers, and
changed the behavior in a way that leads to crashes in release-builds.
This means we can't rely on luck any longer.

Fixes: e3171037539 ("c11/threads: Remove Win32 null checks")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3903
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7853>

3 years agoradeon/vcn: hevc main10 profile decoding pitch fix
Ruijing Dong [Fri, 27 Nov 2020 17:08:30 +0000 (12:08 -0500)]
radeon/vcn: hevc main10 profile decoding pitch fix

for hevc main10 profile decoding, dpb buffer alignment fix

Signed-off-by: Ruijing Dong <Ruijing.Dong@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7827>

3 years agod3d12: Fix GCC warnings for missing function prototypes
Jesse Natalie [Thu, 26 Nov 2020 01:18:26 +0000 (17:18 -0800)]
d3d12: Fix GCC warnings for missing function prototypes

Most of these are adding 'static', for functions that are local
to a translation unit but weren't declared static.

There's one instance of a missing include for bringing the prototype
into the translation unit, one function missing a return type (default-int),
and one which added inline to avoid it being considered unused in some sources.

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

3 years agomicrosoft/compiler: Add missing 'return' to switch case
Jesse Natalie [Sat, 28 Nov 2020 16:29:18 +0000 (08:29 -0800)]
microsoft/compiler: Add missing 'return' to switch case

Fixes: b9c61379 ("microsoft/compiler: translate nir to dxil")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>

3 years agod3d12: Fix use of incorrect clear color variable
Jesse Natalie [Sat, 28 Nov 2020 16:26:43 +0000 (08:26 -0800)]
d3d12: Fix use of incorrect clear color variable

Fixes: 2ea15cd6 ("d3d12: introduce d3d12 gallium driver")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>

3 years agomicrosoft/compiler: Misc fixes caught by GCC
Jesse Natalie [Tue, 1 Dec 2020 16:44:40 +0000 (08:44 -0800)]
microsoft/compiler: Misc fixes caught by GCC

* Fix const-correctness on dxil_mdnode pointer arrays
* Fix warning for a missing scope in a case block

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

3 years agod3d12: Misc fixes caught by GCC warnings / code inspection
Jesse Natalie [Thu, 26 Nov 2020 01:15:11 +0000 (17:15 -0800)]
d3d12: Misc fixes caught by GCC warnings / code inspection

* A const-correctness issue
* Some uninitialized variables
* A missing copyright header
* A comment with a /* in it when only * was needed

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

3 years agomicrosoft/compiler: Fix unhandled switch case warnings
Jesse Natalie [Sat, 28 Nov 2020 16:20:27 +0000 (08:20 -0800)]
microsoft/compiler: Fix unhandled switch case warnings

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

3 years agod3d12: Fix unhandled switch case warnings
Jesse Natalie [Thu, 26 Nov 2020 01:10:39 +0000 (17:10 -0800)]
d3d12: Fix unhandled switch case warnings

Some D3D enums have invalid values (e.g. NONE) in the enum,
so default: makes sense to catch invalid values in those cases.

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

3 years agod3d12: Clean up d3d12_compiler.h
Jesse Natalie [Thu, 26 Nov 2020 01:07:05 +0000 (17:07 -0800)]
d3d12: Clean up d3d12_compiler.h

Move some stuff from d3d12_context.h to d3d12_compiler.h, and
fix d3d12_compiler.h to not include d3d12_context.h.

This serves two purposes:
1. Putting declarations and definitions where they really belong.
2. Making it so only C++ code needs d3d12.h simplifies the helpers
   we need to add to add to support d3d12.h for Linux.

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

3 years agod3d12: Remove Windows-specific macros
Jesse Natalie [Thu, 26 Nov 2020 01:05:29 +0000 (17:05 -0800)]
d3d12: Remove Windows-specific macros

These all have trivial standard or Mesa replacements

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

3 years agod3d12: Fix signed-unsigned comparison warnings
Jesse Natalie [Thu, 26 Nov 2020 01:02:25 +0000 (17:02 -0800)]
d3d12: Fix signed-unsigned comparison warnings

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

3 years agod3d12: Fix brace-initialization issues
Jesse Natalie [Thu, 26 Nov 2020 00:57:47 +0000 (16:57 -0800)]
d3d12: Fix brace-initialization issues

For C++ code, we shouldn't use {0}, instead use {} to default-
initialize everything. For code with nested structs/unions, make
sure there's enough braces to appropriately scope initialization.

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

3 years agomicrosoft/compiler: Remove dead code/variables
Jesse Natalie [Thu, 26 Nov 2020 00:52:52 +0000 (16:52 -0800)]
microsoft/compiler: Remove dead code/variables

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

3 years agod3d12: Delete unused local variables
Jesse Natalie [Thu, 26 Nov 2020 00:49:43 +0000 (16:49 -0800)]
d3d12: Delete unused local variables

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

3 years agogallium/tests: fix unused-but-set-variable warning
Michel Zou [Sun, 29 Nov 2020 10:41:04 +0000 (11:41 +0100)]
gallium/tests: fix unused-but-set-variable warning

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>

3 years agosoftpipe: fix maybe-uninitialized warning
Michel Zou [Wed, 25 Nov 2020 11:18:37 +0000 (12:18 +0100)]
softpipe: fix maybe-uninitialized warning

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>

3 years agowgl: fix maybe-uninitialized warning
Michel Zou [Tue, 24 Nov 2020 17:59:11 +0000 (18:59 +0100)]
wgl: fix maybe-uninitialized warning

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>

3 years agoglsl: fix redefinition warning on win32
Michel Zou [Tue, 24 Nov 2020 15:06:07 +0000 (16:06 +0100)]
glsl: fix redefinition warning on win32

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>

3 years agoglapi: fix unused-function warning
Michel Zou [Sun, 22 Nov 2020 09:38:38 +0000 (10:38 +0100)]
glapi: fix unused-function warning

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>

3 years agoutil: fix mingw format-extra-args warning
Michel Zou [Sat, 21 Nov 2020 12:34:18 +0000 (13:34 +0100)]
util: fix mingw format-extra-args warning

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>

3 years agonir: don't sink instructions into loops
Daniel Schürmann [Thu, 19 Nov 2020 11:21:17 +0000 (12:21 +0100)]
nir: don't sink instructions into loops

Repeatedly loading constants or evaluating ALU operations
in loops doesn't seem beneficial. This might increase the register
pressure, but the tradeoff seems worth it.

Totals from 13629 (9.77% of 139517) affected shaders (RAVEN):
SGPRs: 1179481 -> 1184697 (+0.44%); split: -0.03%, +0.47%
VGPRs: 978776 -> 978732 (-0.00%); split: -0.02%, +0.02%
SpillSGPRs: 51036 -> 50943 (-0.18%); split: -1.35%, +1.17%
CodeSize: 113775020 -> 113428812 (-0.30%); split: -0.34%, +0.04%
MaxWaves: 49877 -> 49881 (+0.01%); split: +0.02%, -0.01%
Instrs: 22295979 -> 22204936 (-0.41%); split: -0.42%, +0.02%
Cycles: 1637198832 -> 1626916048 (-0.63%); split: -0.64%, +0.01%
VMEM: 2403434 -> 2507645 (+4.34%); split: +4.76%, -0.42%
SMEM: 849676 -> 834576 (-1.78%); split: +0.60%, -2.38%
VClause: 412396 -> 398139 (-3.46%); split: -3.46%, +0.01%
SClause: 810480 -> 817349 (+0.85%); split: -0.19%, +1.04%
Copies: 2188260 -> 2166716 (-0.98%); split: -1.18%, +0.19%
Branches: 761204 -> 760475 (-0.10%); split: -0.15%, +0.05%
PreSGPRs: 972892 -> 981054 (+0.84%); split: -0.05%, +0.89%
PreVGPRs: 925390 -> 925420 (+0.00%); split: -0.02%, +0.02%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7694>

3 years agod3d12: do not inspect NULL samplers
Erik Faye-Lund [Tue, 1 Dec 2020 13:37:06 +0000 (14:37 +0100)]
d3d12: do not inspect NULL samplers

We can risk having NULL samplers in this range, so let's ignore them
while we're populating the shader-key.

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

3 years agoaco: Fix NGG GS assert failure from the WG scan.
Timur Kristóf [Fri, 27 Nov 2020 20:31:50 +0000 (21:31 +0100)]
aco: Fix NGG GS assert failure from the WG scan.

There was a temp which was defined in a branch but used outside,
without a phi.

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

3 years agointel/tools/aubinator_error_decode: allow 0 arguments
Marcin Ślusarz [Mon, 30 Nov 2020 12:21:35 +0000 (13:21 +0100)]
intel/tools/aubinator_error_decode: allow 0 arguments

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7833>

3 years agointel/tools/aubinator_error_decode: allow "-" as an input file
Marcin Ślusarz [Mon, 30 Nov 2020 12:18:42 +0000 (13:18 +0100)]
intel/tools/aubinator_error_decode: allow "-" as an input file

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7833>

3 years agointel/tools/aubinator_error_decode: exit with an error on unknown option
Marcin Ślusarz [Mon, 30 Nov 2020 12:15:18 +0000 (13:15 +0100)]
intel/tools/aubinator_error_decode: exit with an error on unknown option

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7833>

3 years agod3d12: lower bitfield_extract to shifts
Erik Faye-Lund [Tue, 1 Dec 2020 12:13:20 +0000 (13:13 +0100)]
d3d12: lower bitfield_extract to shifts

This wasn't implemented yet, because we hadn't encountered it yet. But
now it seems we can trigger this, thanks to the nv_copy_depth_to_color
piglit tests.

This makes the test go from crash to fail, which isn't perfect, but it's
better than nothing.

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

3 years agoRevert "radv/llvm,aco: always split typed vertex buffer loads on GFX6 and GFX10+"
Samuel Pitoiset [Tue, 1 Dec 2020 12:00:00 +0000 (13:00 +0100)]
Revert "radv/llvm,aco: always split typed vertex buffer loads on GFX6 and GFX10+"

It introduces regressions.

This reverts commit 6fb4babfe98e222e648eb2ab210136b7540bf039.

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

3 years agoci: disable check-commits
Samuel Pitoiset [Tue, 1 Dec 2020 13:27:42 +0000 (14:27 +0100)]
ci: disable check-commits

Otherwise the CI sanity check fails if the commit title exceed
80 characters

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

3 years agoetnaviv/drm: add some locking asserts
Christian Gmeiner [Mon, 30 Nov 2020 08:55:39 +0000 (09:55 +0100)]
etnaviv/drm: add some locking asserts

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>

3 years agoetnaviv/drm: convert to simple_mtx
Christian Gmeiner [Mon, 30 Nov 2020 08:39:35 +0000 (09:39 +0100)]
etnaviv/drm: convert to simple_mtx

We do not need a full blown pthread mutex.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>

3 years agoetnaviv/drm: fix evil-twin etna_drm_table_lock
Christian Gmeiner [Tue, 1 Dec 2020 10:50:22 +0000 (11:50 +0100)]
etnaviv/drm: fix evil-twin etna_drm_table_lock

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>

3 years agov3dv: don't log out of pool memory errors for internal driver pools
Iago Toral Quiroga [Tue, 1 Dec 2020 10:52:28 +0000 (11:52 +0100)]
v3dv: don't log out of pool memory errors for internal driver pools

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

3 years agov3dv: move error string definition to debug path
Iago Toral Quiroga [Tue, 1 Dec 2020 10:51:02 +0000 (11:51 +0100)]
v3dv: move error string definition to debug path

No point in computing this if debug is disabled.

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

3 years agomesa: replace ParameterValueOffset[i] with Parameters[i].ValueOffset
Marek Olšák [Sun, 22 Nov 2020 08:39:56 +0000 (03:39 -0500)]
mesa: replace ParameterValueOffset[i] with Parameters[i].ValueOffset

to merge both arrays and remove malloc because both arrays have
the same size.

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

3 years agocompiler: decrease STATE_LENGTH from 5 to 4
Marek Olšák [Thu, 12 Nov 2020 21:41:15 +0000 (16:41 -0500)]
compiler: decrease STATE_LENGTH from 5 to 4

The rework of matrix state vars made the last element unused.

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

3 years agost/mesa: fix uninitialized/random clip plane state vars in lower_ucp
Marek Olšák [Thu, 12 Nov 2020 21:37:40 +0000 (16:37 -0500)]
st/mesa: fix uninitialized/random clip plane state vars in lower_ucp

Fixes: 584f27326c1 - st/mesa: factor ucp-lowering logic into helper

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

3 years agomesa: allocate the attribute stack on demand
Marek Olšák [Thu, 12 Nov 2020 00:11:09 +0000 (19:11 -0500)]
mesa: allocate the attribute stack on demand

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

3 years agomesa: remove gl_texture_object references from glPush/PopAttrib stack
Marek Olšák [Sat, 3 Oct 2020 04:55:57 +0000 (00:55 -0400)]
mesa: remove gl_texture_object references from glPush/PopAttrib stack

I don't see why this is needed and it's not used anywhere.
As long as apps don't call glDeleteTextures, nothing will release them.
And even if they do, we don't use the saved textures anywhere.

Also, BindTexture will fail for deleted textures anyway, so they can't be
popped. The existing code already binds the Name that was saved, not
the texture object that was saved.

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

3 years agomesa: more optimizations in glPopAttrib (colormask, drawbuffers, coord replace)
Marek Olšák [Mon, 5 Oct 2020 01:48:51 +0000 (21:48 -0400)]
mesa: more optimizations in glPopAttrib (colormask, drawbuffers, coord replace)

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

3 years agomesa: optimize out no-op calls in glPopAttrib
Marek Olšák [Mon, 5 Oct 2020 01:32:12 +0000 (21:32 -0400)]
mesa: optimize out no-op calls in glPopAttrib

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

3 years agomesa: skip _mesa_set_enable in glPopAttrib if there are no changes
Marek Olšák [Sun, 4 Oct 2020 06:26:19 +0000 (02:26 -0400)]
mesa: skip _mesa_set_enable in glPopAttrib if there are no changes

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

3 years agomesa: reduce the size of gl_texture_attrib_node::Texture by about 90%
Marek Olšák [Sun, 4 Oct 2020 05:31:30 +0000 (01:31 -0400)]
mesa: reduce the size of gl_texture_attrib_node::Texture by about 90%

Let's get rid of the big memcpy.

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

3 years agomesa: optimize saving/restoring bound textures for glPush/PopAttrib
Marek Olšák [Sat, 3 Oct 2020 04:48:30 +0000 (00:48 -0400)]
mesa: optimize saving/restoring bound textures for glPush/PopAttrib

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

3 years agomesa: reorganize gl_texture and sampler structures for glPush/PopAttrib
Marek Olšák [Mon, 5 Oct 2020 06:45:03 +0000 (02:45 -0400)]
mesa: reorganize gl_texture and sampler structures for glPush/PopAttrib

Put the fields saved by glPush/PopAttrib into the sub-structure declared
as Attrib. This will make glPush/PopAttrib much faster because it will
only save and restore that structure.

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

3 years agomesa: add a fast path for restoring light attributes in glPopAttrib
Marek Olšák [Sat, 3 Oct 2020 07:58:01 +0000 (03:58 -0400)]
mesa: add a fast path for restoring light attributes in glPopAttrib

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

3 years agomesa: add a fast path for restoring fixed-func tex state in glPopAttrib
Marek Olšák [Sat, 3 Oct 2020 07:39:28 +0000 (03:39 -0400)]
mesa: add a fast path for restoring fixed-func tex state in glPopAttrib

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

3 years agomesa: rewrite glPushAttrib/glPopAttrib to get rid of malloc
Marek Olšák [Sat, 3 Oct 2020 05:13:10 +0000 (01:13 -0400)]
mesa: rewrite glPushAttrib/glPopAttrib to get rid of malloc

This was inevitable. This gets rid of the malloc/free calls and chaining
each push group in a linked list. Now the whole attribute stack is declared
statically in gl_context.

Yes, this improves performance a lot.

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

3 years agomesa: treat glPopMatrix as a no-op state change if it doesn't change the matrix
Marek Olšák [Tue, 6 Oct 2020 00:10:31 +0000 (20:10 -0400)]
mesa: treat glPopMatrix as a no-op state change if it doesn't change the matrix

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

3 years agomesa: memset matrices at initialization to enable memcpy on it
Marek Olšák [Tue, 6 Oct 2020 01:20:47 +0000 (21:20 -0400)]
mesa: memset matrices at initialization to enable memcpy on it

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

3 years agomesa: canonicalize matrix in glPushMatrix to make glPopMatrix possibly a no-op
Marek Olšák [Tue, 6 Oct 2020 00:38:51 +0000 (20:38 -0400)]
mesa: canonicalize matrix in glPushMatrix to make glPopMatrix possibly a no-op

If there are no changes to the matrix, we can move pop the stack but not
update any state constants.

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

3 years agomesa: consider glPushMatrix a no-op change from the driver perspective
Marek Olšák [Tue, 6 Oct 2020 01:01:31 +0000 (21:01 -0400)]
mesa: consider glPushMatrix a no-op change from the driver perspective

It doesn't change any states.

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

3 years agomesa: skip glMultMatrix if the matrix is identity
Marek Olšák [Tue, 6 Oct 2020 00:02:46 +0000 (20:02 -0400)]
mesa: skip glMultMatrix if the matrix is identity

This happens a lot with viewperf and it causes unnecessary constant buffer
updates.

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

3 years agomesa: fix crashes in the no_error case of invalid glUniform calls
Marek Olšák [Mon, 5 Oct 2020 09:51:22 +0000 (05:51 -0400)]
mesa: fix crashes in the no_error case of invalid glUniform calls

I copied error conditions from validate_uniform_parameters.

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

3 years agost/mesa: replace st_context::state::constants with a mask
Marek Olšák [Fri, 2 Oct 2020 19:54:10 +0000 (15:54 -0400)]
st/mesa: replace st_context::state::constants with a mask

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

3 years agost/mesa: add a faster path for uploading state parameters into constant buffers
Marek Olšák [Mon, 28 Sep 2020 03:00:22 +0000 (23:00 -0400)]
st/mesa: add a faster path for uploading state parameters into constant buffers

The old path copies state parameters into the parameter list, and then
the driver copies them into a buffer.

The optional new path loads state parameters into a buffer directly.
This increases performance by 5% in one subtest of viewperf.

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

3 years agogallium: add PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0
Marek Olšák [Mon, 28 Sep 2020 02:57:10 +0000 (22:57 -0400)]
gallium: add PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0

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

3 years agomesa: add helpers for drivers to load state parameters into buffers
Marek Olšák [Mon, 28 Sep 2020 02:57:37 +0000 (22:57 -0400)]
mesa: add helpers for drivers to load state parameters into buffers

Drivers should upload only UniformBytes of uniforms and constants,
and then use _mesa_upload_state_parameters to upload state parameters.
This allows removing one copy of state parameters.

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

3 years agomesa: merge light state parameters for faster uploads (disabled)
Marek Olšák [Mon, 28 Sep 2020 19:15:36 +0000 (15:15 -0400)]
mesa: merge light state parameters for faster uploads (disabled)

Disabled because of CI failures.

Invoke fetch_state only once for all lights in the best case instead
of 8*8 times.

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

3 years agomesa: merge matrix state parameters for faster uploads (disabled)
Marek Olšák [Mon, 28 Sep 2020 17:31:34 +0000 (13:31 -0400)]
mesa: merge matrix state parameters for faster uploads (disabled)

Disabled because of CI failures.

Instead of separate state vars for each row and invoking fetch_state 4x:
  state.matrix.modelview.row[0]
  state.matrix.modelview.row[1]
  state.matrix.modelview.row[2]
  state.matrix.modelview.row[3]

The rows are now merged and fetch_state is invoked once:
  state.matrix.modelview.row[0..3]

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

3 years agomesa: take advantage of sorted parameters in _mesa_load_state_parameters
Marek Olšák [Mon, 28 Sep 2020 02:15:06 +0000 (22:15 -0400)]
mesa: take advantage of sorted parameters in _mesa_load_state_parameters

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

3 years agomesa: put constants before state vars for ARB programs
Marek Olšák [Mon, 28 Sep 2020 01:42:46 +0000 (21:42 -0400)]
mesa: put constants before state vars for ARB programs

This moves state vars to the end of the parameter list, so that state vars
can be loaded directly into a buffer instead of loaded into the parameter list.
Also, state vars don't need to be searched in the parameter list anymore,
because we will know their index range. (this will make gallium faster)

This commit just wraps a for loop around the existing code.

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

3 years agomesa: put constants before state vars for ffvp
Marek Olšák [Mon, 28 Sep 2020 01:42:46 +0000 (21:42 -0400)]
mesa: put constants before state vars for ffvp

This moves state vars to the end of the parameter list, so that state vars
can be loaded directly into a buffer instead of loaded into the parameter list.
Also, state vars don't need to be searched in the parameter list anymore,
because we will know their index range. (this will make gallium faster)

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

3 years agomesa: restructure gl_light vars to match the layout of gl_LightSource uniforms
Marek Olšák [Mon, 28 Sep 2020 20:11:06 +0000 (16:11 -0400)]
mesa: restructure gl_light vars to match the layout of gl_LightSource uniforms

this will make uploads faster

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

3 years agomesa: optimize setting gl_Light state parameters
Marek Olšák [Mon, 28 Sep 2020 04:22:30 +0000 (00:22 -0400)]
mesa: optimize setting gl_Light state parameters

The order of enums is a preparation for a future commit, but if you are
guessing that I just want to copy all light params into a constant buffer
with one memcpy, you are right.

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

3 years agomesa: demystify material_attrib()
Marek Olšák [Tue, 29 Sep 2020 01:54:04 +0000 (21:54 -0400)]
mesa: demystify material_attrib()

the next commit would break this magic math

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

3 years agomesa: allow multi-slot program parameters
Marek Olšák [Mon, 28 Sep 2020 17:02:59 +0000 (13:02 -0400)]
mesa: allow multi-slot program parameters

also the removed comment was incorrect.

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

3 years agomesa: fix printing state parameters
Marek Olšák [Mon, 28 Sep 2020 15:51:48 +0000 (11:51 -0400)]
mesa: fix printing state parameters

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

3 years agomesa: remove redundant _math_matrix_analyse calls in fetch_state
Marek Olšák [Mon, 28 Sep 2020 13:57:33 +0000 (09:57 -0400)]
mesa: remove redundant _math_matrix_analyse calls in fetch_state

Only program matrices needed this. Other matrices are updated in
_mesa_update_state_locked.

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

3 years agomesa: rework matrix statevar enums to remove excessive branching in fetch_state
Marek Olšák [Mon, 28 Sep 2020 13:30:51 +0000 (09:30 -0400)]
mesa: rework matrix statevar enums to remove excessive branching in fetch_state

Instead of having $matrix and $modifier as separate enums, combine them
to 1 enum $matrix_$modifier.

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

3 years agomesa: don't allocate matrices with malloc
Marek Olšák [Mon, 28 Sep 2020 12:53:42 +0000 (08:53 -0400)]
mesa: don't allocate matrices with malloc

There is no reason for it. This removes a pointer indirection.

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

3 years agoutil: add a common ALIGN16 macro for m_matrix and u_threaded_context
Marek Olšák [Mon, 12 Oct 2020 09:24:57 +0000 (05:24 -0400)]
util: add a common ALIGN16 macro for m_matrix and u_threaded_context

to prevent conflicts in the next commit

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

3 years agomesa: replace _mesa_problem with unreachable in fetch_state
Marek Olšák [Mon, 28 Sep 2020 04:24:36 +0000 (00:24 -0400)]
mesa: replace _mesa_problem with unreachable in fetch_state

let's get this out of release builds

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>

3 years agomesa: don't read from destination memory when computing state parameter values
Marek Olšák [Mon, 28 Sep 2020 03:53:41 +0000 (23:53 -0400)]
mesa: don't read from destination memory when computing state parameter values

The destination memory can be uncached, e.g. a buffer object.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>

3 years agomesa: skip redundant uniform updates for glUniformHandle
Marek Olšák [Sun, 27 Sep 2020 16:36:13 +0000 (12:36 -0400)]
mesa: skip redundant uniform updates for glUniformHandle

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

3 years agomesa: skip redundant uniform updates for glUniformMatrix
Marek Olšák [Sun, 27 Sep 2020 16:36:13 +0000 (12:36 -0400)]
mesa: skip redundant uniform updates for glUniformMatrix

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

3 years agomesa: skip redundant uniform updates for glUniform
Marek Olšák [Sun, 27 Sep 2020 16:36:13 +0000 (12:36 -0400)]
mesa: skip redundant uniform updates for glUniform

Viewperf does a lot of redundant uniform updates - 60-80% in some tests.
Those are sometimes the only state changes between draw calls.
This improves performance by 33% in one viewperf subtest.

If you are worried about CPU overhead in the non-redundant case,
glthread is the solution.

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

3 years agomesa: move sampler condition for flushing into mesa_flush_vertices_for_uniforms
Marek Olšák [Sun, 27 Sep 2020 15:28:59 +0000 (11:28 -0400)]
mesa: move sampler condition for flushing into mesa_flush_vertices_for_uniforms

This is just a code consolidation. It might fix something, not sure.

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

3 years agomesa: call FLUSH_VERTICES before changing sampler uniforms
Marek Olšák [Sun, 27 Sep 2020 15:19:46 +0000 (11:19 -0400)]
mesa: call FLUSH_VERTICES before changing sampler uniforms

Fixes: 9545139ce5f "mesa: skip FLUSH_VERTICES() if no samplers were changed"

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

3 years agomesa: don't print GL errors in release builds if MESA_DEBUG=silent
Marek Olšák [Sun, 27 Sep 2020 20:56:40 +0000 (16:56 -0400)]
mesa: don't print GL errors in release builds if MESA_DEBUG=silent

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>

3 years agomesa: properly disallow param list reallocation
Marek Olšák [Sat, 21 Nov 2020 00:49:24 +0000 (19:49 -0500)]
mesa: properly disallow param list reallocation

This can more easily detect shader variants adding too many state
parameters and causing a reallocation.

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

3 years agomesa: track ParameterValues size separately
Marek Olšák [Fri, 20 Nov 2020 23:12:17 +0000 (18:12 -0500)]
mesa: track ParameterValues size separately

This is needed for multi-slot parameters.

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

3 years agomesa: don't duplicate allocation code in _mesa_new_parameter_list_sized
Marek Olšák [Fri, 20 Nov 2020 22:58:16 +0000 (17:58 -0500)]
mesa: don't duplicate allocation code in _mesa_new_parameter_list_sized

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

3 years agoradeonsi/gfx10: fix overflow and primitive queries
Indrajit Kumar Das [Fri, 16 Oct 2020 04:39:02 +0000 (10:09 +0530)]
radeonsi/gfx10: fix overflow and primitive queries

This aligns the offsets to match the memory layout of the query buffer
defined by gfx10_sh_query_buffer_mem and calls si_launch_grid_internal
to flush caches and wait for completion of shaders prior to retrieving
results.

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

3 years agov3dv: ignore filter in TFU blit path
Iago Toral Quiroga [Tue, 1 Dec 2020 09:49:27 +0000 (10:49 +0100)]
v3dv: ignore filter in TFU blit path

The filter is only relevant to handle blits that invole scaling, but
our TFU path doesn't handle any kind of scaling so we can safely
ignore it.

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

3 years agov3dv: add a helper to choose a compatible TFU format
Iago Toral Quiroga [Tue, 1 Dec 2020 09:12:54 +0000 (10:12 +0100)]
v3dv: add a helper to choose a compatible TFU format

We are now doing this in 3 different places so it makes sense.

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

3 years agov3dv: handle Z mirroring in the TFU blit path
Iago Toral Quiroga [Tue, 1 Dec 2020 09:13:42 +0000 (10:13 +0100)]
v3dv: handle Z mirroring in the TFU blit path

The TFU path only activates for blits that are really copies
(no linear filtering, no scaling, same pixel format, etc.), and
we do it slice by slice, so we can easily handle mirroring of the
Z coordinate for 3D images by reversing the order of the layers
as we copy them.

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

3 years agov3dv: expand the formats that can be handled in the TFU blit path
Iago Toral Quiroga [Tue, 1 Dec 2020 07:50:46 +0000 (08:50 +0100)]
v3dv: expand the formats that can be handled in the TFU blit path

Same as with other TFU paths, we only handle exact copies without
conversion, so we can rewrite the format to use a compatible TFU format
based on its texel size, which allows us to use this path with more
formats.

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

3 years agoaco: Avoid extra bitfield padding
James Park [Fri, 27 Nov 2020 06:10:03 +0000 (22:10 -0800)]
aco: Avoid extra bitfield padding

MSVC may insert padding for data type switches.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785>

3 years agoaco: Stub sections that don't have _WIN32 support
James Park [Fri, 27 Nov 2020 06:09:15 +0000 (22:09 -0800)]
aco: Stub sections that don't have _WIN32 support

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785>

3 years agoaco: Fix warnings for bools in bitwise logic
James Park [Fri, 27 Nov 2020 06:08:42 +0000 (22:08 -0800)]
aco: Fix warnings for bools in bitwise logic

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785>