Commit Graph

151514 Commits

Author SHA1 Message Date
Mike Blumenkrantz 1ba1ee9e7c lavapipe: implement EXT_inline_uniform_block
this is a lot of machinery to propagate the block sizes down from the
descriptor layout to the pipeline layout to the rendering_state

block data is appended to ubo0 immediately following push constant
data (if it exists), which requires that a new buffer be created and
filled any time either type of data changes

shader handling is done by propagating the offset of each block relative
to the start of its descriptor set, then accumulating the sizes of
every uniform block in each preceding descriptor set into the offset,
then adding on the push constant size, and finally adding that on to
the existing load_ubo deref offset

update-after-bind is no longer an issue since each instance of pc+block
data is its own immutable buffer that can never be modified

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz 249fe9673a lavapipe: remove unused struct member
this was used at some point I think?

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz 5bbb39a652 lavapipe: use stream uploader for push constant upload
now instead of having static per-stage buffer regions and letting llvmpipe
do the upload, lavapipe creates a new pipe_resource and chucks it away
with take_ownership=true to allow it to be destroyed once it's no longer
in use

this also alters ubo0 mechanics such that the buffer is now sized exactly to
the size of the push constants in the pipeline and push constants are only
updated when the appropriate shader stage is flagged

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz c264b1b6ab lavapipe: save pipeline stages that push constants are active on
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz 526e898dfc lavapipe: add a stream uploader to rendering_state and queue objects
not currently used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz de01a47b1c lavapipe: zalloc pipeline layout structs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz 08732eca5d lavapipe: don't emit compute states during draw
there's a separate function for this

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz 40607f5088 lavapipe: KHR_shader_terminate_invocation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz 68fd0668eb lavapipe: extend demote->discard pass to handle terminate
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz 82d3e7515e lavapipe: EXT_shader_demote_to_helper_invocation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz 3e28ce374e lavapipe: run some shader passes for demote handling
pipe internals already support discard, so as long as everything is
rewritten to use discard, we don't need any further changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz cdcfcb7916 nir/lower_is_helper_invocation: create load_helper_invocation instr with bitsize=1
the specification stipulates that this is a bool value, so don't load it as an int
or else nir_validate explodes

Fixes: f17b41ab4f ("nir: add lowering pass for helperInvocationEXT()")

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz fe33835091 zink: handle conversion for vertices statistics query with LINE_LOOP draws
the converted number of vertices is 2x that of the "real" number of vertices,
so divide the results by 2

this works nicely since zink performs cpu readback for all queries, and shader
aggregation should be simple in the future as well

fixes:
KHR-GL46.pipeline_statistics_query_tests_ARB.functional_primitives_vertices_submitted_and_clipping_input_output_primitives

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15401>
2022-03-21 02:55:37 +00:00
Mike Blumenkrantz d25437d54f zink: store vertices statistics query to context
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15401>
2022-03-21 02:55:37 +00:00
M Henning c36f3f2db8 nouveau: Fix out-of-bounds access in AlgebraicOpt
for cases where we calculate the absolute value of the result
of a unary operation

We can remove this problematic check since it's redundant with
the one several lines down.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15476>
2022-03-20 05:35:06 +00:00
M Henning d12e16fc3b nouveau: Handle unaligned tlsBase during spills
Without this, 128-bit or 64-bit register spills can generate unaligned
loads and stores if tlsBase is unaligned.

Fixes glsl-1.50/execution/variable-indexing/gs-input-array-vec3-index-rd
with NV50_PROG_USE_NIR=1 on kepler

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13693>
2022-03-20 05:24:51 +00:00
Kenneth Graunke 4de13d53fe iris: Fix MOCS for copy regions
These were, unfortunately, backwards.  The source is the texture.
The destination is the render target.

Fixes: d8cb76211c ("iris: Fix MOCS for buffer copies")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15473>
2022-03-19 01:56:35 -07:00
Andrey Konovalov ed2f496ce4 ir3: set local_size for shaders of MESA_SHADER_KERNEL type
ir3_compile_shader_nir() should set local_size[] and local_size_variable
fields not only for compute shaders, but for the OpenCL kernels too.

v2: use gl_shader_stage_is_compute() instead of explicit comparison with
    MESA_SHADER_[COMPUTE,KERNEL].

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14863>
2022-03-18 23:20:25 +00:00
Emma Anholt 44c52e94e9 ci/traces: Make sure we have no pre-existing traces-db before starting.
bare-metal can reboot boards into an existing rootfs on intermittent
device failure, but traces-db doesn't do any sanity-checking of the local
downloads of traces and would proceed to just trying to replay them.

Nuke any existing trace db so that it re-downloads every time, same as
LAVA or docker container tests do.

Fixes: #5585
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15440>
2022-03-18 22:54:41 +00:00
Michel Zou 49e2d39c66 lavapipe: fix i686 mingw build
Fixes: 987e8a5a
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15464>
2022-03-18 22:42:51 +00:00
Mike Blumenkrantz 47209e80db lavapipe: zalloc lvp_image_view structs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>
2022-03-18 22:27:25 +00:00
Mike Blumenkrantz 4a13b11f4a lavapipe: break out resolves into separate functions
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>
2022-03-18 22:27:25 +00:00
Mike Blumenkrantz 441c553ef7 lavapipe: store number of immutable samplers to pipeline layout
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>
2022-03-18 22:27:25 +00:00
Jason Ekstrand 7030d14e0d spirv: Properly mangle generic pointers
Fixes: a8e53a772f ("spirv: Add generic pointer support")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15470>
2022-03-18 21:52:05 +00:00
Eric Engestrom 9ba636cdc7 docs: update calendar and link releases notes for 21.3.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15466>
2022-03-18 21:07:14 +00:00
Eric Engestrom daf6ee08d6 docs: add release notes for 21.3.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15466>
2022-03-18 21:07:14 +00:00
Emma Anholt f831ba238f ci/turnip: Increase the hangcheck timer to 2 seconds.
We get a lot of useful coverage from running graphicsfuzz with spilling
enabled, but it's also pretty slow and can cause intermittent hangcheck
failures.  I thought I'd categorized them when merging !14839 (device loss
on reset), but it looks like not all of them and we're now more likely to
have flakes take out the whole test run when a single flake makes the rest
of the caselist a flake.

This is a little unfortunate in that it means our test environment is not
the same as a stock system you would want to run deqp on to submit
conformance, but I think it's an improvement in the test maintenance work
vs needing to fix things up later.

We have some other tests besides turnip that can trigger hangchecks which
we might also like this increase for (some disabled traces, for example).
However, freedreno GL has a 5-second timeout waiting for idle when
mapping, and a couple of 2-second timeouts in a row can result in spurious
failures in other tests!

Fixes: #6163
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15435>
2022-03-18 19:07:24 +00:00
Alyssa Rosenzweig 0cbe4dd4c4 pan/bi: Use bi_dontcare for ZS_EMIT
This is more portable and avoids special casing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig 1b934d5962 pan/bi: Emit arch-specific code for bi_dontcare
We use bi_dontcare() to specify any encoding where we don't care about
the value, with a preference for power-efficient encodings. On Bifrost,
a (possibly nonexistant) FAU read is the best encoding. On Valhall, that
encoding doesn't exist so just use a zero. That should be good enough in
practice.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig 222d17fc67 pan/bi: Model Valhall action on bi_instr
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig 38625af010 pan/bi: Add Valhall-specific zero builder
When emitting code during or after register allocation, we need to be able to
emit constants without running the constant->{LUT, move, uniform} pass running
after. In particular, we need to access the constant 0 to implement spill code.
Add a Valhall-specific zero for this purpose.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig 666b714a37 pan/bi: Don't analyze helper reqs in !frag shaders
Waste of time, and possibly invalid too.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig a16163a9fd pan/bi: Print Valhall-specific FAU indices
We'll emit these shortly, prepare the printer.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig 32ca920023 pan/bi: Use vertex/instance ID helpers
Enables portability to Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 1e37113ede pan/bi: Add helpers to get vertex/instance ID
These are preloaded in different places across Bifrost and Valhall. Abstract
that away so code using the builder isn't littered with "is Valhall?" checks.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 76a09b8cd3 pan/va: Fix ST_CVT definitions
They are basicallly just STORE with an extra source and the memory access
modifier in a different place.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 9b7a45e3dc pan/va: Align error messages in disassembler tests
Makes it easier to spot the difference, less eye scanning.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 3a4b864197 pan/va: Add missing .auto32 register format
Clipped to .auto for consistency with Bifrost (and the existing IR).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 263c5ef194 pan/va: Add LEA_ATTR_IMM instruction
Encoded like LEA_TEX_IMM.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 459c6ac23f pan/va: Model LEA_TEX_IMM more accurately
The unknown field is a descriptor type, which we model as an opcode2 since it's
a fixed constant. This allows us to disambiguate LEA_TEX_IMM from LEA_ATTR_IMM.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 17caccd15d pan/va: Correct definition of ZS_EMIT
It's a message instruction, not an ALU one... duh.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 508335c927 panfrost: Add Tiler Job to v9 XML
Legacy tiling job, semantics are the same as on Midgard. Useful for blits and
transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig e635dc9ea5 panfrost: Refactor XML to permit non-IDVS jobs
Tiler jobs look similar, but don't have the Allocations fields. Refactor to make
this possible to express.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 53f1fa9219 panfrost: Fix definition of DCD on v9
The position and varying shader environment descriptors are additional sections
of the job, rather than part of the (fragment only) DCD. This distinction
matters for non-IDVS jobs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 6d51c1b898 panfrost: Fix primitive restart with 32-bit indices
There's an overflow here if index_size = 4. Caught when bringing up Valhall, not
sure why this was never caught before. Yikes.

Fixes: 7a6a5f3fe1 ("panfrost: Handle explicit primitive restart")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig 02f519601a panfrost: Correct ASTC decode mode XML
The narrow/wide bit was backwards.

Fixes: bfba7533c7 ("panfrost: Add Valhall Plane Descriptor XML")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig fd87135852 pan/decode: Unify tiler job handling
Instead of adding a third Valhall path, let's use GenXML to unify our paths.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig a9ca751a8f pan/decode: Handle blend arrays on Valhall
Required for MRT.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Connor Abbott fc381fa1e3 tu: Actually expose VK_EXT_texel_buffer_alignment
Oops...

Fixes: 3d04c435 ("tu: Trivially implement VK_EXT_texel_buffer_alignment")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15451>
2022-03-18 18:30:20 +00:00
Omar Akkila f18429340e lavapipe: Lift fence check into dedicated function
Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15443>
2022-03-18 18:15:39 +00:00