platform/upstream/mesa.git
3 years agoci: Uprev piglit to 9d87cc3d79e ("framework/replay: send backend's subprocess stderr...
Andres Gomez [Tue, 18 May 2021 09:31:01 +0000 (12:31 +0300)]
ci: Uprev piglit to 9d87cc3d79e ("framework/replay: send backend's subprocess stderr to sys.stderr")

This pulls in a fix for replayer to make the backends send their
stderr to sys.stderr always.

v2:
  - Updated piglit results for llvmpipe, softpipe, zink and
    radeonsi-stoney.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> [v1]
Reviewed-by: Martin Peres <martin.peres@mupuf.org> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10854>

3 years agod3d12: Sets all SRV descriptors as data-static
BillKristiansen [Tue, 18 May 2021 17:58:35 +0000 (10:58 -0700)]
d3d12: Sets all SRV descriptors as data-static

As Mesa d3d12 is currently implemented, all resource data is static
at the time a SRV or CBV is created.  Therefore, it makes sense for all
descriptors to use the DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS
flag.  Use of this flag broadens debug validation and allows some
optimizations in the underlying driver.

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

3 years agod3d12: Fixes stale context bindings after copy, resolve, and clear
BillKristiansen [Tue, 18 May 2021 17:56:31 +0000 (10:56 -0700)]
d3d12: Fixes stale context bindings after copy, resolve, and clear

Some GL applications, including Blender, are producing rendering
artifacts due to missing resource state barriers.

The d3d12_context keeps track of all resources bound as shader resource
or constant buffers.  If any of these resources are used for Copy,
Resolve, or Clear source/target, the context tracking must be updated
so the correct state can be restored before the next draw call.

This change is something of a big hammer.  Essentially, if a resource
currently bound as an SRV or CBV gets used for a non-shader access, a
flag is set in the context that invalidates all bindings of the same
type on the same shader stage.  Thus the next Draw execution refreshes
the shader views and state transitions state before invoking Draw on the
command list.

A more elegant (and complex) fix would limit the invalidation to
resource state only, rather than also forcing a recreation of resource
views.  It is unclear right now whether it is worth the time to
implement a more elegant fix.

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

3 years agoci/freedreno: Mark two more recent intermittent a530 flakes.
Emma Anholt [Wed, 19 May 2021 15:51:05 +0000 (08:51 -0700)]
ci/freedreno: Mark two more recent intermittent a530 flakes.

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

3 years agoiris: Prefer more GPU-based uploads for compression
Nanley Chery [Fri, 14 May 2021 14:47:31 +0000 (07:47 -0700)]
iris: Prefer more GPU-based uploads for compression

Where possible, start compressing depth and stencil resources on upload.
This makes a couple of benchmarks (CS:GO, GFXBench5's gl_alu2_off) start
sampling HiZ buffers in a compressed state instead of the pass-through
state.

Improves the FPS of GFXBench5's gl_alu2_off by 3.14% ±0.52% on TGL.
Testing was done with the performance CI.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2617
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10872>

3 years agoisl: Add isl_aux_usage_has_compression
Nanley Chery [Fri, 14 May 2021 14:47:17 +0000 (07:47 -0700)]
isl: Add isl_aux_usage_has_compression

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10872>

3 years agodocs/release-calendar: add the schedule for the 21.1 branch
Eric Engestrom [Wed, 19 May 2021 20:34:56 +0000 (22:34 +0200)]
docs/release-calendar: add the schedule for the 21.1 branch

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

3 years agodocs: update calendar and link releases notes for 21.1.1
Eric Engestrom [Wed, 19 May 2021 20:30:04 +0000 (22:30 +0200)]
docs: update calendar and link releases notes for 21.1.1

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

3 years agodocs: update calendar and link releases notes for 21.1.0
Eric Engestrom [Wed, 19 May 2021 20:30:00 +0000 (22:30 +0200)]
docs: update calendar and link releases notes for 21.1.0

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

3 years agodocs: add release notes for 21.1.1
Eric Engestrom [Wed, 19 May 2021 18:16:06 +0000 (20:16 +0200)]
docs: add release notes for 21.1.1

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

3 years agodocs: add release notes for 21.1.0
Eric Engestrom [Wed, 5 May 2021 17:04:04 +0000 (19:04 +0200)]
docs: add release notes for 21.1.0

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

3 years agoir3/cf: Rewrite pass
Connor Abbott [Mon, 17 May 2021 16:57:58 +0000 (18:57 +0200)]
ir3/cf: Rewrite pass

The old pass had a few bugs:
- It tried to avoid folding f2f32 into f2f16, but didn't consider
  conversions that were already folded in.
- It didn't prevent folding an f2f16 or f2f32 into a non-floating-point
  op.

In addition it wasn't written in a manner which made handling integer
conversions practical. This rewrites the pass to instead calculate the
"type" of the conversion source and then check whether folding the
conversion is allowed. This allows us to cleanly separate the
declarative part where we describe how the HW works from the policy part
where we decide whether the transform is allowed, and makes it simple to
add support for folding integer conversions.

Closes: #3208
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10859>

3 years agoradeonsi: enable glsl_correct_derivatives_after_discard by default
Pierre-Eric Pelloux-Prayer [Mon, 17 May 2021 13:52:49 +0000 (15:52 +0200)]
radeonsi: enable glsl_correct_derivatives_after_discard by default

Enabling this option by default allows the nir_opt_move_discards_to_top
to be used more often.

This is only done for LLVM13+ since doing this on LLVM11 hurts a lot of
shaders.

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

3 years agoradeonsi/nir: enable nir_opt_move_discards_to_top pass
Pierre-Eric Pelloux-Prayer [Thu, 29 Apr 2021 09:26:49 +0000 (11:26 +0200)]
radeonsi/nir: enable nir_opt_move_discards_to_top pass

Since it affects discards and demotes, this commit also moves the
usage of nir_lower_discard_or_demote ealier.

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

3 years agonir: Add a discard optimization pass
Jason Ekstrand [Wed, 4 Jul 2018 00:39:15 +0000 (17:39 -0700)]
nir: Add a discard optimization pass

Many fragment shaders do a discard using relatively little information
but still put the discard fairly far down in the shader for no good
reason.  If the discard is moved higher up, we can possibly avoid doing
some or almost all of the work in the shader.  When this lets us skip
texturing operations, it's an especially high win.

One of the biggest offenders here is DXVK.  The D3D APIs have different
rules for discards than OpenGL and Vulkan.  One effective way (which is
what DXVK uses) to implement DX behavior on top of GL or Vulkan is to
wait until the very end of the shader to discard.  This ends up in the
pessimal case where we always do all of the work before discarding.
This pass helps some DXVK shaders significantly.

v2 (Jason Ekstrand):
 - Fix a couple of typos (Grazvydas, Ian)
 - Use the new nir_instr_move helper
 - Find all movable discards before moving anything so we don't
   accidentally re-order anything and break dependencies

v3 (Pierre-Eric): remove the call to nir_opt_conditional_discard based
on Daniel Schürmann comment.

v4 (Pierre-Eric):
 - handle demote intrinsics and drop derivatives_safe_after_discard
 - add early return if discards/demotes aren't used

v5 (Pierre-Eric):
 - use pass_flags instead of instr set (Daniel Schürmann)

v6 (Daniel Schürmann):
 - cleanup and fix pass_flags handling

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10522>

3 years agonir/gather_info: Expose a nir_intrinsic_writes_external_memory helper
Jason Ekstrand [Fri, 13 Nov 2020 06:14:04 +0000 (00:14 -0600)]
nir/gather_info: Expose a nir_intrinsic_writes_external_memory helper

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10522>

3 years agonir: Add a nir_instr_move helper
Jason Ekstrand [Wed, 4 Jul 2018 16:10:28 +0000 (09:10 -0700)]
nir: Add a nir_instr_move helper

Removes an instruction from one place and inserts it at another while
working around a weird cursor corner-case.

v2: change return value to bool (Daniel Schürmann)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> (v1)
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10522>

3 years agogallium/dri: copy image use in dup_image
Lucas Stach [Fri, 13 Nov 2020 13:26:23 +0000 (14:26 +0100)]
gallium/dri: copy image use in dup_image

Don't lose the use flags when dup'ing an image.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>

3 years agoloader/dri: hook up createImageWithModifiers2
Lucas Stach [Tue, 15 Dec 2020 13:59:21 +0000 (14:59 +0100)]
loader/dri: hook up createImageWithModifiers2

Call into the new modifiers with usage createImage variant when available
to provide the DRI implementation with more context about the allocation.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>

3 years agoi965: implement createImageWithModifiers2
Simon Ser [Sun, 22 Dec 2019 20:49:10 +0000 (21:49 +0100)]
i965: implement createImageWithModifiers2

This implements __DRIimageExtension version 19.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>

3 years agogallium/dri: implement createImageWithModifiers2
Simon Ser [Sun, 22 Dec 2019 20:47:42 +0000 (21:47 +0100)]
gallium/dri: implement createImageWithModifiers2

This implements __DRIimageExtension version 19.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>

3 years agodri: add createImageWithModifiers2 interface
Simon Ser [Mon, 14 Dec 2020 17:32:47 +0000 (18:32 +0100)]
dri: add createImageWithModifiers2 interface

With the addition of createImageWithModifiers usage flags were
dropped, as it was believed at the time that modifers will be a
full replacement for the usage flags. This has turned out to be
untrue, as modifiers are not able to describe buffer placement.

Add a new version of the interface, that allows to specifiy
use flags in addition to the modifier.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>

3 years agoloader/dri3: convert to loader_dri_create_image
Lucas Stach [Tue, 15 Dec 2020 13:52:28 +0000 (14:52 +0100)]
loader/dri3: convert to loader_dri_create_image

Get rid of the code duplication and makes it easier to hook in a
new createImageWithModifiers2, but obscures the code flow a bit.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>

3 years agodri: add loader_dri_create_image helper
Lucas Stach [Tue, 15 Dec 2020 13:39:32 +0000 (14:39 +0100)]
dri: add loader_dri_create_image helper

The DRI image extension already has two different ways to allocate an
image (with and without a modifier) and will soon grow a third one.
Add a helper, which handles calling the appropriate implementation to
get rid of code duplication in the winsys.

This convert the two obvious call sites (GBM dri and EGL wayland)
that profit from the code dedup.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>

3 years agolima: add reload command to the command dump
Erico Nunes [Thu, 13 May 2021 19:02:44 +0000 (21:02 +0200)]
lima: add reload command to the command dump

This was not being included in the command stream and may be
useful to debug further issues.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10791>

3 years agolima: enable z16 format
Erico Nunes [Wed, 12 May 2021 23:40:46 +0000 (01:40 +0200)]
lima: enable z16 format

Other than listing the format as supported, an extra detail is to unset
one bit in the render state depth_test when a z16 texture needs to be
reloaded before rendering, following the mali blob behavior.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10791>

3 years agointel/vec4: Add support for UBO pushing
Jason Ekstrand [Sun, 2 May 2021 22:19:02 +0000 (17:19 -0500)]
intel/vec4: Add support for UBO pushing

Shader-db results on Haswell (vec4 only):

    total instructions in shared programs: 2853928 -> 2726576 (-4.46%)
    instructions in affected programs: 855840 -> 728488 (-14.88%)
    helped: 9500
    HURT: 18
    helped stats (abs) min: 1 max: 359 x̄: 13.54 x̃: 11
    helped stats (rel) min: 0.44% max: 53.33% x̄: 19.13% x̃: 17.44%
    HURT stats (abs)   min: 4 max: 124 x̄: 71.00 x̃: 92
    HURT stats (rel)   min: 3.64% max: 77.86% x̄: 46.43% x̃: 52.12%
    95% mean confidence interval for instructions value: -13.78 -12.98
    95% mean confidence interval for instructions %-change: -19.21% -18.81%
    Instructions are helped.

    total cycles in shared programs: 101822616 -> 60245580 (-40.83%)
    cycles in affected programs: 93312382 -> 51735346 (-44.56%)
    helped: 13292
    HURT: 4506
    helped stats (abs) min: 2 max: 1229260 x̄: 3370.82 x̃: 776
    helped stats (rel) min: 0.04% max: 96.70% x̄: 47.56% x̃: 43.76%
    HURT stats (abs)   min: 2 max: 17644 x̄: 716.37 x̃: 82
    HURT stats (rel)   min: 0.02% max: 491.80% x̄: 41.00% x̃: 11.11%
    95% mean confidence interval for cycles value: -3037.07 -1635.03
    95% mean confidence interval for cycles %-change: -26.03% -24.25%
    Cycles are helped.

    total spills in shared programs: 1080 -> 1314 (21.67%)
    spills in affected programs: 74 -> 308 (316.22%)
    helped: 0
    HURT: 47

    total fills in shared programs: 310 -> 497 (60.32%)
    fills in affected programs: 71 -> 258 (263.38%)
    helped: 0
    HURT: 47

    total sends in shared programs: 239884 -> 151799 (-36.72%)
    sends in affected programs: 129302 -> 41217 (-68.12%)
    helped: 9547
    HURT: 0
    helped stats (abs) min: 1 max: 226 x̄: 9.23 x̃: 8
    helped stats (rel) min: 3.12% max: 98.15% x̄: 72.38% x̃: 80.00%
    95% mean confidence interval for sends value: -9.48 -8.98
    95% mean confidence interval for sends %-change: -72.80% -71.97%
    Sends are helped.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agointel/vec4: Add support for masking pushed data
Jason Ekstrand [Sun, 2 May 2021 18:54:01 +0000 (13:54 -0500)]
intel/vec4: Add support for masking pushed data

This is the vec4 equivalent of d0d039a4d3f4, required for proper UBO
pushing in vertex stages for Vulkan on HSW.  Sadly, the implementation
requires us to do everything in ALIGN1 mode and the vec4 instruction
scheduler doesn't understand HW_GRF <-> UNIFORM interference so it's
easier to do the whole thing in the generator.  We add an instruction
to the top of the program which just means "emit the blob" and all the
magic happens in codegen.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agointel/vec4: Set up push ranges before we emit any code
Jason Ekstrand [Tue, 4 May 2021 15:40:17 +0000 (10:40 -0500)]
intel/vec4: Set up push ranges before we emit any code

In order to avoid switching pull constants to push constants and then
having to back to pull, compute the push ranges up-front.  This way we
know by the time we emit code exactly what ranges are pushable.  This is
a bit inefficient in the case where the "normal" push constants get
compacted.  However, most apps don't use giant piles of dead uniforms
combined with substantial UBO use so this should be ok.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agointel/vec4: Update nr_params in pack_uniform_registers
Jason Ekstrand [Tue, 4 May 2021 14:38:55 +0000 (09:38 -0500)]
intel/vec4: Update nr_params in pack_uniform_registers

This is where we re-arrange and re-pack the params.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agointel/vec4: Add some asserts to move_push_to_pull
Jason Ekstrand [Mon, 3 May 2021 20:34:41 +0000 (15:34 -0500)]
intel/vec4: Add some asserts to move_push_to_pull

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agointel/vec4: Don't spill fp64 registers more than once
Jason Ekstrand [Tue, 4 May 2021 20:30:27 +0000 (15:30 -0500)]
intel/vec4: Don't spill fp64 registers more than once

The way we handle spilling for fp64 in vec4 is to emit a series of MOVs
which swizzles the data around and then a pair of 32-bit spills.  This
works great except that the next time we go to pick a spill reg, the
compiler isn't smart enough to figure out that the register has already
been spilled.  Normally we do this by looking at the sources of spill
instructions (or destinations of fills) but, because it's separated from
the actual value by a MOV, we can't see it.  This commit adds a new
opcode VEC4_OPCODE_MOV_FOR_SCRATCH which is identical to MOV in
semantics except that it lets RA know not to spill again.

Fixes: 82c69426a5a3 "i965/vec4: support basic spilling of 64-bit registers"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agoanv: Push at most 32 regs for vec4 shaders
Jason Ekstrand [Tue, 4 May 2021 04:08:42 +0000 (23:08 -0500)]
anv: Push at most 32 regs for vec4 shaders

The vec4 back-end can't push UBOs just yet but it soon will be able.
When it starts pushing UBOs, it will have a lower limit than scalar due
to a crummy register allocator.  Mirror that limit in ANV so we don't
run into asserts due to ANV and the back-end making different choices.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agoanv: Support pushing shader constants
Jason Ekstrand [Sun, 2 May 2021 22:55:15 +0000 (17:55 -0500)]
anv: Support pushing shader constants

Usually, nir_opt_constant_folding will get rid of any load_constant
intrinsics which might possibly be pushed but there are rare cases where
we can still end up with them.  Better to handle them.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agoanv: Plumb the shader into push constant helpers
Jason Ekstrand [Sun, 2 May 2021 22:54:57 +0000 (17:54 -0500)]
anv: Plumb the shader into push constant helpers

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>

3 years agoaco: disallow SGPRs on DPP instructions
Rhys Perry [Mon, 17 May 2021 13:37:54 +0000 (14:37 +0100)]
aco: disallow SGPRs on DPP instructions

They can't be encoded.

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

3 years agod3d10umd: Avoid duplication in CreateDevice.
Jose Fonseca [Thu, 13 May 2021 11:48:30 +0000 (12:48 +0100)]
d3d10umd: Avoid duplication in CreateDevice.

As suggested by Jesse Natalie.

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

3 years agod3d10sw: Add a sanity test.
Jose Fonseca [Wed, 5 May 2021 13:51:34 +0000 (14:51 +0100)]
d3d10sw: Add a sanity test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10687>

3 years agod3d10umd,d3d10sw: Initial import.
Jose Fonseca [Wed, 5 May 2021 10:57:43 +0000 (11:57 +0100)]
d3d10umd,d3d10sw: Initial import.

This change adds a gallium D3D10 state tracker that works as a WDDM UMD
software driver, similar to Microsoft WARP, but using llvmpipe/softpipe.

The final deliverable is a d3d10sw.dll, which is similar to WARP's
d3d10warp.dll.

This has been used to run Microsoft Windows HCK wgf11* tests with
llvmpipe, and they were at one point passing 100%.

Known limitations:
- TGSI (no NIR)
- D3D10 only (no D3D11 support yet)
- no WINE integration (WINE doesn't implement WDDM DDI.)

For further details see:
- src/gallium/frontends/d3d10umd/README.md
- src/gallium/targets/d3d10sw/README.md

v2: Drop the DXBC-based disassembly.  Add missing break statements.
v3: Incorporate Jesse's feedback.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10687>

3 years agodraw: Plug leak when combining tessellation with primitive assembly.
Jose Fonseca [Mon, 17 May 2021 06:50:28 +0000 (07:50 +0100)]
draw: Plug leak when combining tessellation with primitive assembly.

Another lavapipe leak found with LeakSanitizer.

This happens when using tessellation without geometry shader but with a
fragment shader that consumes primitive ID, therefore requiring
primitive assembler stage.

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

3 years agoanv: fixup physical device properties of fragment shading rate
Lionel Landwerlin [Tue, 4 May 2021 06:46:08 +0000 (09:46 +0300)]
anv: fixup physical device properties of fragment shading rate

We've only enabled the extension on Gfx11+ so no need to care about
prior values.

Also fixup values of (min|max)FragmentShadingRateAttachmentTexelSize.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 231651fd89fb00 ("anv: implement VK_KHR_fragment_shading_rate")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10607>

3 years agoradv: enable DCC stores on RDNA2
Samuel Pitoiset [Mon, 26 Apr 2021 11:46:58 +0000 (13:46 +0200)]
radv: enable DCC stores on RDNA2

It seems this gives 2-3% improvements most of the time. This also
enables DCC for concurrent images.

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/10454>

3 years agopanfrost/ci: Test Panfrost on the Mali G72 GPU
Tomeu Vizoso [Tue, 11 May 2021 08:07:30 +0000 (10:07 +0200)]
panfrost/ci: Test Panfrost on the Mali G72 GPU

Make use of some Chromebooks recently added to the Collabora LAVA lab to
test Panfrost on the G72 (Bifrost) GPU.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10785>

3 years agoci: Update kernel to v5.13-rc2
Tomeu Vizoso [Tue, 11 May 2021 08:06:00 +0000 (10:06 +0200)]
ci: Update kernel to v5.13-rc2

This version adds support for some Chromebooks with the MT8183 SoC that
we want to use to test Panfrost.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10785>

3 years agodraw: Allocate extra padding for extra shader outputs.
Jose Fonseca [Fri, 14 May 2021 15:25:32 +0000 (16:25 +0100)]
draw: Allocate extra padding for extra shader outputs.

This prevents read buffer overflows in dup_vertex(), when draw stages
allocate extra shader outputs after the vertex buffers are allocated.

The original issue can be exercised with upcoming
piglit/tests/general/vertex-fallbacks.c test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: 21.0 21.1 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10836>

3 years agoutil/primconvert: add C++ guards to header
Mike Blumenkrantz [Tue, 11 May 2021 18:47:29 +0000 (14:47 -0400)]
util/primconvert: add C++ guards to header

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

3 years agopanfrost: Express viewport in terms of the batch
Alyssa Rosenzweig [Tue, 18 May 2021 19:55:12 +0000 (15:55 -0400)]
panfrost: Express viewport in terms of the batch

Easier to say the state dependencies.

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

3 years agopanfrost: Simplify panfrost_bind_sampler_states
Alyssa Rosenzweig [Fri, 12 Mar 2021 01:20:52 +0000 (01:20 +0000)]
panfrost: Simplify panfrost_bind_sampler_states

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

3 years agopanfrost: Mark job_index > 10000 as unlikely
Alyssa Rosenzweig [Tue, 18 May 2021 14:29:00 +0000 (10:29 -0400)]
panfrost: Mark job_index > 10000 as unlikely

By definition this is happening <= 0.02% of the time.

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

3 years agopanfrost: Remove silly assertion
Alyssa Rosenzweig [Tue, 18 May 2021 14:28:08 +0000 (10:28 -0400)]
panfrost: Remove silly assertion

We don't assert the rest of the Gallium contract here either.

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

3 years agopanfrost: Pass batch to panfrost_get_index_buffer_bounded
Alyssa Rosenzweig [Tue, 18 May 2021 14:26:27 +0000 (10:26 -0400)]
panfrost: Pass batch to panfrost_get_index_buffer_bounded

Calling batch_for_fbo outside of Gallium entrypoints is an antipattern.

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

3 years agopanfrost: Deduplicate some code from indirect/direct draws
Alyssa Rosenzweig [Tue, 18 May 2021 14:07:51 +0000 (10:07 -0400)]
panfrost: Deduplicate some code from indirect/direct draws

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

3 years agopanfrost: Move batch_set_requirements to the CSO
Alyssa Rosenzweig [Tue, 18 May 2021 14:00:25 +0000 (10:00 -0400)]
panfrost: Move batch_set_requirements to the CSO

Much of the per-draw work can be precomputed.

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

3 years agopanfrost: Pack draw-time RSD all-at-once
Alyssa Rosenzweig [Fri, 14 May 2021 23:41:33 +0000 (19:41 -0400)]
panfrost: Pack draw-time RSD all-at-once

Manually inline the functions, delete the duplicates, and use GenXML the
way it's meant to be used. Template structs should **never** cross
function boundaries.

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

3 years agopanfrost: Hoist part of shader_reads_tilebuffer
Alyssa Rosenzweig [Fri, 14 May 2021 23:31:27 +0000 (19:31 -0400)]
panfrost: Hoist part of shader_reads_tilebuffer

The other part is |'d together. Do the happy path at compile time, and
reserve the draw time fixup for a v5 silicon issue.

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

3 years agopanfrost: Pull erratum workaround into own function
Alyssa Rosenzweig [Fri, 14 May 2021 23:29:38 +0000 (19:29 -0400)]
panfrost: Pull erratum workaround into own function

This _does_ need to be draw-time, but it doesn't need to be in the
monster routine.

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

3 years agopanfrost: Distribute masks for FPK selection
Alyssa Rosenzweig [Fri, 14 May 2021 23:26:21 +0000 (19:26 -0400)]
panfrost: Distribute masks for FPK selection

We can calculate these at much lower frequencies and just & together at
draw time.

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

3 years agopanfrost: Partially determine FPK state
Alyssa Rosenzweig [Fri, 14 May 2021 23:17:23 +0000 (19:17 -0400)]
panfrost: Partially determine FPK state

This might be disabled at draw-time, but we can merge part of the state
check to compile-time.

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

3 years agopanfrost: Hoist allow_forward_pixel_to_be_killed
Alyssa Rosenzweig [Fri, 14 May 2021 23:17:11 +0000 (19:17 -0400)]
panfrost: Hoist allow_forward_pixel_to_be_killed

Only a function of the shader code.

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

3 years agopanfrost: Streamline the !fs_required case
Alyssa Rosenzweig [Fri, 14 May 2021 23:12:00 +0000 (19:12 -0400)]
panfrost: Streamline the !fs_required case

Takes some complexity out of the per-draw path.

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

3 years agopanfrost: Move early-z decision earlier
Alyssa Rosenzweig [Fri, 14 May 2021 22:50:23 +0000 (18:50 -0400)]
panfrost: Move early-z decision earlier

These were already grouped nicely, just never got used. I also added
coverage writes to the list of reasons not to use early-z for
completeness. At the moment this doesn't do anything since this is a
Midgard flag and we haven't hooked up coverage writes on Midgard.

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

3 years agopanfrost: Fill out the rasterizer CSO
Alyssa Rosenzweig [Fri, 14 May 2021 22:42:22 +0000 (18:42 -0400)]
panfrost: Fill out the rasterizer CSO

The RSD state is all over the place but let's try to collect what we
can.

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

3 years agopanfrost: Correct the type of sample_mask
Alyssa Rosenzweig [Fri, 14 May 2021 22:28:10 +0000 (18:28 -0400)]
panfrost: Correct the type of sample_mask

Let's not encode impossible masks.

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

3 years agopanfrost: Preset evaluate_per_sample
Alyssa Rosenzweig [Fri, 14 May 2021 22:27:02 +0000 (18:27 -0400)]
panfrost: Preset evaluate_per_sample

Even though this isn't totally known at compile-time, at least one case
is, so let's handle that one ahead-of-time.

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

3 years agopanfrost: Move depth/stencil/alpha to CSO create
Alyssa Rosenzweig [Fri, 14 May 2021 22:23:23 +0000 (18:23 -0400)]
panfrost: Move depth/stencil/alpha to CSO create

Now that we can merge RSD state, there's no reason to pack this at
draw-time. This is fun!

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

3 years agopanfrost: Prepack partial RSD at compile time
Alyssa Rosenzweig [Fri, 14 May 2021 22:00:45 +0000 (18:00 -0400)]
panfrost: Prepack partial RSD at compile time

Even for fragment shaders! Just need to merge the partial descriptors.

Fixes: c21c6d134bc ("panfrost: Use the pan_shader_prepare_rsd() helper")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

3 years agopanfrost: Add draw-time merge helper
Alyssa Rosenzweig [Fri, 14 May 2021 22:00:10 +0000 (18:00 -0400)]
panfrost: Add draw-time merge helper

The famous GenXML "OR" trick. Will be *essential* to packing RSDs.

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

3 years agopanfrost: Precompute bifrost_blend_type_from_nir
Alyssa Rosenzweig [Fri, 14 May 2021 21:43:35 +0000 (17:43 -0400)]
panfrost: Precompute bifrost_blend_type_from_nir

Needed in the draw call hot path. Do it at compile time.

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

3 years agopanfrost: Split Bifrost BLEND emit by word
Alyssa Rosenzweig [Fri, 14 May 2021 21:19:30 +0000 (17:19 -0400)]
panfrost: Split Bifrost BLEND emit by word

This allows the GenXML packs to be effectively inlined and folded,
skipping over the Midgard pieces.

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

3 years agopanfrost: Remove unused dither flag
Alyssa Rosenzweig [Fri, 14 May 2021 20:00:40 +0000 (16:00 -0400)]
panfrost: Remove unused dither flag

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

3 years agopanfrost: Streamline fixed-function get_blend path
Alyssa Rosenzweig [Fri, 14 May 2021 19:53:52 +0000 (15:53 -0400)]
panfrost: Streamline fixed-function get_blend path

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

3 years agopanfrost: Pass batch to panfrost_get_blend
Alyssa Rosenzweig [Fri, 14 May 2021 19:40:05 +0000 (15:40 -0400)]
panfrost: Pass batch to panfrost_get_blend

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

3 years agopanfrost: Simplify blend_final
Alyssa Rosenzweig [Fri, 14 May 2021 19:37:01 +0000 (15:37 -0400)]
panfrost: Simplify blend_final

Now that we've moved everything but the blend shader up to the CSO, we
can just return a blend shader pointer (or zero to indicate the absence
thereof), and remove a source of name conflicts.

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

3 years agopanfrost: Distribute out constant colour code
Alyssa Rosenzweig [Fri, 14 May 2021 19:23:44 +0000 (15:23 -0400)]
panfrost: Distribute out constant colour code

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

3 years agopanfrost: Pack blend equations at CSO create time
Alyssa Rosenzweig [Fri, 14 May 2021 19:05:31 +0000 (15:05 -0400)]
panfrost: Pack blend equations at CSO create time

These are large. Get them out of the per-draw path.

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

3 years agopanfrost: Garbage collect Gallium blend includes
Alyssa Rosenzweig [Fri, 14 May 2021 18:48:09 +0000 (14:48 -0400)]
panfrost: Garbage collect Gallium blend includes

Got moved to common blend handling.

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

3 years agopanfrost: Translate fixed-function blend at CSO create
Alyssa Rosenzweig [Fri, 14 May 2021 17:22:47 +0000 (13:22 -0400)]
panfrost: Translate fixed-function blend at CSO create

Fixes: 93824b6451a ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

3 years agopanfrost: Move blend properties to CSO create
Alyssa Rosenzweig [Fri, 14 May 2021 16:55:49 +0000 (12:55 -0400)]
panfrost: Move blend properties to CSO create

Fixes: 93824b6451a ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

3 years agopanfrost: Fix pan_blend_to_fixed_function_equation prototype
Alyssa Rosenzweig [Fri, 14 May 2021 14:36:27 +0000 (10:36 -0400)]
panfrost: Fix pan_blend_to_fixed_function_equation prototype

Doesn't need the whole state, just the equation itself.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Fixes: 93824b6451a ("panfrost: Move the blend logic out of the gallium driver")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

3 years agopanfrost: Fix blend fixed-function prototype
Alyssa Rosenzweig [Fri, 14 May 2021 14:24:23 +0000 (10:24 -0400)]
panfrost: Fix blend fixed-function prototype

Needs to be broken up into different functions for disjoint state.
Simpler prototypes and allows matching to CSOs.

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

3 years agopanfrost: Fix blend constant fetch prototype
Alyssa Rosenzweig [Fri, 14 May 2021 14:01:50 +0000 (10:01 -0400)]
panfrost: Fix blend constant fetch prototype

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Fixes: 93824b6451a ("panfrost: Move the blend logic out of the gallium driver")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

3 years agopanfrost: Fix is_opaque prototype
Alyssa Rosenzweig [Fri, 14 May 2021 13:50:14 +0000 (09:50 -0400)]
panfrost: Fix is_opaque prototype

Fixes: 93824b6451a ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

3 years agopanfrost: Fix the reads_dest prototype
Alyssa Rosenzweig [Fri, 14 May 2021 13:47:37 +0000 (09:47 -0400)]
panfrost: Fix the reads_dest prototype

Takes too much state, only pass what we need.

Fixes: 93824b6451a ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

3 years agopanfrost: Fix blending for unbacked MRT
Alyssa Rosenzweig [Tue, 18 May 2021 21:57:27 +0000 (17:57 -0400)]
panfrost: Fix blending for unbacked MRT

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

3 years agoaco: Implement bvh64_intersect_ray_amd intrinsic.
Bas Nieuwenhuizen [Tue, 6 Apr 2021 09:33:38 +0000 (11:33 +0200)]
aco: Implement bvh64_intersect_ray_amd intrinsic.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10818>

3 years agonir: Add bvh64_intersect_ray_amd intrinsic.
Bas Nieuwenhuizen [Tue, 6 Apr 2021 09:30:34 +0000 (11:30 +0200)]
nir: Add bvh64_intersect_ray_amd intrinsic.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10818>

3 years agor600: Enable NIR debug flags also for Cayman
Gert Wollny [Fri, 30 Apr 2021 18:14:09 +0000 (20:14 +0200)]
r600: Enable NIR debug flags also for Cayman

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

3 years agor600/sfn: legalize image access on Cayman
Gert Wollny [Sun, 9 May 2021 17:14:16 +0000 (19:14 +0200)]
r600/sfn: legalize image access on Cayman

This,  seems to avoid hardware resets with the
  ARB_shader_image_load_store-invalid
piglit.

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

3 years agor600/sfn: Add lowering pass to legalize image access
Gert Wollny [Mon, 10 May 2021 05:57:43 +0000 (07:57 +0200)]
r600/sfn: Add lowering pass to legalize image access

Make sure only existing images are accessed and that the accessed
coordinates are within the image.
The generated code is quite exponsive, because it encapsulates each
access to an image with two if statements, one to check whether the
image index actually exists (this will get optimized away if the
image selection is direct), and one if statement to check whether
the coordinates are in range. For that reason it will only be enabled
for Cayman were invalid access seems to raise more issues.

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

3 years agor600/sfn: Fix cube query layer number for indirect access
Gert Wollny [Mon, 10 May 2021 05:56:43 +0000 (07:56 +0200)]
r600/sfn: Fix cube query layer number for indirect access

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

3 years agor600/sfn: read number of images from shader info
Gert Wollny [Sun, 2 May 2021 18:23:11 +0000 (20:23 +0200)]
r600/sfn: read number of images from shader info

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

3 years agor600/sfn: Fix Geometry shader for Cayman
Gert Wollny [Fri, 30 Apr 2021 21:54:40 +0000 (23:54 +0200)]
r600/sfn: Fix Geometry shader for Cayman

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

3 years agor600/sfn: Fix Cayman SSBO write with more than one value
Gert Wollny [Fri, 30 Apr 2021 21:26:37 +0000 (23:26 +0200)]
r600/sfn: Fix Cayman SSBO write with more than one value

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

3 years agor600/sfn: Fix ssbo/image atomic swap for Cayman
Gert Wollny [Fri, 30 Apr 2021 20:18:16 +0000 (22:18 +0200)]
r600/sfn: Fix ssbo/image atomic swap for Cayman

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

3 years agor600/sfn: Fix texture gather for Cayman
Gert Wollny [Fri, 30 Apr 2021 20:09:27 +0000 (22:09 +0200)]
r600/sfn: Fix texture gather for Cayman

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

3 years agor600/sfn: Use unified code path for index register load
Gert Wollny [Fri, 30 Apr 2021 20:08:56 +0000 (22:08 +0200)]
r600/sfn: Use unified code path for index register load

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

3 years agor600/sfn: Use unified index register code for samplers
Gert Wollny [Fri, 30 Apr 2021 19:11:36 +0000 (21:11 +0200)]
r600/sfn: Use unified index register code for samplers

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

3 years agor600/sfn: Fix Cayman trans ops
Gert Wollny [Fri, 30 Apr 2021 18:13:48 +0000 (20:13 +0200)]
r600/sfn: Fix Cayman trans ops

v2: return from emit_sin_r600 on > Cayman (Kenn Glennard)

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

3 years agor600/sfn: count only distinct literals per instruction group
Gert Wollny [Fri, 30 Apr 2021 18:13:10 +0000 (20:13 +0200)]
r600/sfn: count only distinct literals per instruction group

This is to avoid useless instruction group splits.

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

3 years agor600/sfn: Don't check the faction when searching for the input slot
Gert Wollny [Fri, 14 May 2021 16:47:50 +0000 (18:47 +0200)]
r600/sfn: Don't check the faction when searching for the input slot

All loads from the same driver location are merged into one variable,
so there is no need to check the frachtion.

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