Commit Graph

53696 Commits

Author SHA1 Message Date
Marek Olšák 350bdda83d radeonsi: code style fix
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Marek Olšák 8890cb2a99 radeonsi: simplify setting COMPUTE_PGM_RSRC2.SCRATCH_EN
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Marek Olšák 3d773c7303 radeonsi: remove unused si_cs_shader_state::uses_scratch
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Marek Olšák 77e1fc67bc radeonsi: align the tessellation ring address to 2MB
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Marek Olšák 121cde7cb9 radeonsi: cleanup local includes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Marek Olšák 0cb42c57c5 radeonsi: always print the lower-case GPU name for radeonsi-run-tests.py
This fixes the GPU name detection in radeonsi-run-tests.py when
the marketing name is unknown.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Marek Olšák 88f22f188e ac,radeonsi: report SCALED formats as unsupported by samplers and color buffers
This was never exercised and it doesn't work.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Alyssa Rosenzweig 61100e7011 lima,panfrost: Use row stride for tiling routines
This makes more sense.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig c4241a831f panfrost: Use row_stride even for linear resources
In that case, they match up.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig c11df56cff panfrost: Adapt get_param for row strides
Let's preserve the old behaviour -- this is UABI, we need to be bug for bug
compatible.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig 81a686a714 panfrost: Use row stride for explicit layouts
Line strides don't make sense for linear images, so use row strides instead in
the API. Then update the layout code accordingly.

Note: we need to preserve the old UABI (bug for bug compatibility), so we still
use legacy strides externally. But now we use row strides internally, which is
better than using both everywhere.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Mike Blumenkrantz 4a4adb65ce llvmpipe: disable compute statistics queries if queries are disabled
cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
2022-05-03 13:00:50 +00:00
Mike Blumenkrantz e4884c35d6 llvmpipe: remove misleading query comment
u_blitter already handles this

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
2022-05-03 13:00:50 +00:00
Mike Blumenkrantz a36c3f6f6a llvmpipe: disable statistic queries during draw if queries are disabled
cc: mesa-stable

fixes (zink):
spec@ext_transform_feedback@generatemipmap prims_generated

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
2022-05-03 13:00:50 +00:00
Pierre-Eric Pelloux-Prayer 6ee9e6ce87 radeonsi: generate unique shader name in si_get_nir_shader
This function modifies the NIR shader, so when using NIR_DEBUG=print and
nir_viewer all the variants are displayed using the original name.

With this change, we get the original shader (eg: GLSL3), and then each
variant gets its own name (GLSL3-xxxxxxxx) - and is displayed in its
own tab in nir_viewer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16247>
2022-05-03 10:39:51 +00:00
Pierre-Eric Pelloux-Prayer f1f2d407e7 radeonsi: don't always strip NIR debug infos
When using NIR_DEBUG=print, always having shader names help debugging.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16247>
2022-05-03 10:39:51 +00:00
Lionel Landwerlin acf6bf88c0 iris: use new kernel uAPI to compute video memory
v2: Use os_get_available_system_memory() when kernel memory region
    uAPI is not available (Lionel)

Cc: 22.1 <mesa-stable>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16210>
2022-05-02 22:57:06 +00:00
Mike Blumenkrantz 562fd98998 llvmpipe: add a ci flake
not able to repro locally

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16280>
2022-05-02 17:46:08 +00:00
Jesse Natalie 2505afc430 d3d12: Destroy empty residency bo set during early-return
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
2022-05-02 16:58:20 +00:00
Jesse Natalie 1e940f2ccf d3d12: Fix a couple over-releases from incorrect take-ownership flag
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
2022-05-02 16:58:20 +00:00
Jesse Natalie 32c1b5fd05 d3d12: Fix leaks in map with do-not-wait
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
2022-05-02 16:58:20 +00:00
Jesse Natalie 5b46ef9857 d3d12: Use a pipe_reference in d3d12_bo
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
2022-05-02 16:58:20 +00:00
Jesse Natalie 9f37579e1b d3d12: Correctly key off of polygon stipple enable cap
Apparently we were only keying off the presence of a real stipple pattern
being set, and completely ignoring when the app does glDisable().

Add in the actual enable bit as an additional discriminator to determine
if we should be doing polygon stippling.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16254>
2022-05-02 15:56:05 +00:00
Alyssa Rosenzweig 3641dfe436 panfrost: Flip point coords in hardware
On Bifrost, this is very easy: there's an RSD bit to Y-flip gl_PointCoord. It
should map perfectly to the Gallium bit. With this change, we no longer use
lower_pntc_ytransform on Bifrost, saving a bit of ALU when reading point
coordinates.

On Valhall, this is quite hard: the bit is in the framebuffer descriptor now!
That means it can't be changed in a batch. This is expected to be ok: on GLES
and VK, the origin is controlled only by the framebuffer orientation. It's a
bigger problem on big GL, where GL_POINT_SPRITE_COORD_ORIGIN can be set freely.
To cope, a tri-state data structure is used for the state tracking. This has a
failure case on Valhall: every draw toggling the coord origin. However, the
intention of the ORIGIN state bit is smoothing over coordinate system
differences; it should never /actually/ change once set. Until we see an app
doing something so stupid, I don't think we should worry about.

We need all the Valhall tri-state infrastructure for handling provoking vertices
on big GL anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:56:25 -04:00
Alyssa Rosenzweig 5bab8e6cbe panfrost: Lower user clip planes
Since we don't export the relevant CAP, the state tracker calls
nir_lower_clip_vs for us. However, for some reason we're still responsible for
calling nir_lower_clip_fs. Now that we have sane shader key infrastructure,
let's do so.

Fixes the floor rendering wrong in the title screen of Neverball.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig 013bb50168 panfrost: Lower point sprites on Bifrost
Use the common pass. This only should trigger when drawing points, so we need
some extra tracking to ensure this.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig b6909ebb36 panfrost: Refactor variant rebind code
For point sprite lowering on Bifrost and Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig 39788ac703 panfrost: Refactor variant selection code
Extract the "compile a new variant" routine from the "select and bind a variant"
routine. This allows us to simplify the control flow, eliminating the `compiled`
boolean on the shader structure.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig 755f30fb18 panfrost: Simplify shader key architecture
Rather than clever key compare/initialize code, let's make the shader keys plain
old data. This makes it easier both to extend and to optimize the shader keys.

Keys are compared with a simple memcmp(). I considered a hash table but I don't
think we have enough variants (or large enough keys) to justify the overhead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig 2c3ed7af53 panfrost: Use s->info.stage instead of tgsi stage
Now that we have the NIR handy.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig 1c5adbb3df panfrost: Don't subclass pipe_compute_state
Just copy the bit we need so the NIR doesn't hang around. This is simpler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig b834dea889 panfrost: Call tgsi_to_nir earlier
This ensures we always have NIR available in the shader state. It also saves a
(trivial) amount of recomputation if multiple TGSI variants are needed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig 3f505a8bc1 panfrost: Remove ancient unused code
Leftover scraps.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
2022-05-02 09:55:49 -04:00
Alyssa Rosenzweig db7d8519f9 panfrost: Only flip point sprites for GL
Fixes dEQP-VK.glsl.builtin_var.simple.pointcoord

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16204>
2022-05-02 13:12:31 +00:00
Gert Wollny 4a2ff9eb86 r600: Allow eight bit, three channel formats for vertex buffers
While using three component texture formats results in CTs failures,
three component vertex attributes are fine, and not allowing them
results in significant performance regressisons.

Fixes: e41958e344
   r600: Disable eight bit three channel formats

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

v2: rename function to is_buffer_format_supported (Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16267>
2022-05-02 12:39:31 +00:00
Pierre-Eric Pelloux-Prayer 529f316d87 radeonsi: fix VS kill_outputs handling
981bd8cbe2 moved outputs removing handling to NIR, but instead of
applying it only to the last stage before the FS this now applies
it to both the GS and the VS.

This commit fixes this by clearing the kill_outputs field for
the VS when using a ES-GS shader.

Fixes: 981bd8cbe2 ("radeonsi: apply key.ge.opt.kill_{outputs,pointsize,clipdistance} in NIR")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16249>
2022-05-02 13:41:39 +02:00
Alyssa Rosenzweig 31b3f56813 asahi: Workaround broken GLSL compiler
https://gitlab.freedesktop.org/mesa/mesa/-/issues/6075 still hasn't been
fixed (despite the bug being known for a year now..)

Workaround the brokenness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16268>
2022-05-01 21:56:21 -04:00
Emma Anholt bf02bffe15 nouveau: Enable the NIR backend by default.
The glsl-to-tgsi code generation and GLSL IR linker is is going away
(!8044), so we need to make the call on whether to use nir-to-tgsi (See
!15932 and !15541), or switch over to the NIR code generator.  The NIR
backend should reduce the compile time regression while providing more
direct control over the IR we receive than going through NTT, while still
providing the optimization that NIR-to-TGSI was bringing us.

nv92 shader-db:
total local in shared programs: 2048 -> 1988 (-2.93%)
local in affected programs: 2048 -> 1988 (-2.93%)
total gpr in shared programs: 688468 -> 724705 (5.26%)
gpr in affected programs: 437159 -> 473396 (8.29%)
total instructions in shared programs: 6115978 -> 5874401 (-3.95%)
instructions in affected programs: 5038041 -> 4796464 (-4.80%)
total loops in shared programs: 1361 -> 835 (-38.65%)
loops in affected programs: 538 -> 12 (-97.77%)
total bytes in shared programs: 42389752 -> 40480416 (-4.50%)
bytes in affected programs: 36311616 -> 34402280 (-5.26%)
LOST:   0
GAINED: 1 (pixmark-piano)

nv120 shader-db:
total local in shared programs: 4416 -> 1988 (-54.98%)
local in affected programs: 4416 -> 1988 (-54.98%)
total gpr in shared programs: 870534 -> 893490 (2.64%)
gpr in affected programs: 564210 -> 587166 (4.07%)
total instructions in shared programs: 6379402 -> 6243210 (-2.13%)
instructions in affected programs: 5430790 -> 5294598 (-2.51%)
total bytes in shared programs: 68184224 -> 66729672 (-2.13%)
bytes in affected programs: 58013544 -> 56558992 (-2.51%)

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>
2022-04-29 23:07:03 +00:00
Emma Anholt 16ead7132f nouveau/nir: Put the UBO offset indirect into the address reg.
Fixes indirect UBO addressing pre-nvc0.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>
2022-04-29 23:07:03 +00:00
Karol Herbst d1ff453a0d nv50/nir: align tlsspace to 0x10
nvc0 aligns to 0x10 in setting up its rogram header, but nv50 TLS
allocation expects the incoming value to be aligned already (like TGSI
always did).  Avoids regression in
KHR-GL33.shaders.arrays.declaration.dynamic_expression_array_access_* with
the nir backend.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>
2022-04-29 23:07:03 +00:00
Emma Anholt c228cb3889 nouveau/nir: Add support for pre-GF100 images and ssbos.
We have to allocate them slots in the global file.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>
2022-04-29 23:07:03 +00:00
Emma Anholt 75f0127d78 ci/nouveau: Add MESA_GLES_VERSION_OVERRIDE=3.1 baseline state.
imirkin requested that I test the GLES31 codepaths on nv50, and this is
the best I can do with the hardware I have.

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>
2022-04-29 23:07:03 +00:00
Emma Anholt 3ddc505400 nouveau/nir: Move FS output stores to the end of the last block.
The nir_move/sink caused instructions to sink interleaved into the output
stores at the end of the shader.  nouveau's RA doesn't track liveness of
FS outputs in registers after the export instruction, so they could end up
overwritten.  To work around it, after normal NIR move/sink, move the
output stores back to the end of the shader.

Fixes: b1fa2068b8 ("nouveau/nir: Enable nir_opt_move/sink.")

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>
2022-04-29 23:07:03 +00:00
Erik Faye-Lund 82b681db99 gallium/xlib: fix stale comment
We haven't been doing what the comment says for about a decade, it's
about time to update the comment!

Fixes: 5f60a00743 ("st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16213>
2022-04-29 19:30:03 +00:00
Jordan Justen 33456ae5a4 iris: Fix assertion meant to only target the clear-color stride
Fixes: 2bc8c61fd0 ("iris: Return a 64B stride for clear color plane")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6398
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16241>
2022-04-29 09:34:56 -07:00
Gert Wollny 89bba41d90 virgl: don't move input gl_SampleMaskIn to a temp
The input is an array so moving it to a single temporary value doesn't
seem to make much sense. I also don't see any piglit regressions when
not moving the value to a temporary.

Fixes: bc912bace1
  virgl: Add workarounds for virglrenderer input/sv signedness bugs.

v2: remove unused enum for SAMPLEMASK (Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15997>
2022-04-29 10:50:51 +02:00
Pierre-Eric Pelloux-Prayer 3de97742ca radeonsi: enable PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16139>
2022-04-29 07:52:59 +00:00
Pierre-Eric Pelloux-Prayer bd88bed855 gallium: add PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER
This way we can make allow_draw_out_of_order true by default for all
apps, iff the driver allows it.

And allow_draw_out_of_order=false can still be used in drirc, for
apps that need this optim to be turned off.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16139>
2022-04-29 07:52:59 +00:00
Pierre-Eric Pelloux-Prayer f59c8c6e1c radeonsi: drop assume_no_z_fights option
And garbage collect the code that was only used by this option.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16139>
2022-04-29 07:52:59 +00:00
Pierre-Eric Pelloux-Prayer c9a73f53e8 radeonsi: remove commutative_blend_add option
This is unused.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16139>
2022-04-29 07:52:59 +00:00