Yiwei Zhang
0fc36b11ab
venus: add VN_PERF option no_async_buffer_create
...
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16110 >
2022-04-26 23:49:59 +00:00
Yiwei Zhang
f0bfd8afe2
venus: add env perf options and introduce no_async_set_alloc
...
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16110 >
2022-04-26 23:49:59 +00:00
Yiwei Zhang
4ab640852b
venus: refactor to add struct vn_env
...
This is to prepare for adding perf options.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16110 >
2022-04-26 23:49:59 +00:00
Jason Ekstrand
e24d8760e9
nir: Constant fold sampler/texture offsets
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16171 >
2022-04-26 22:34:39 +00:00
Jason Ekstrand
9332598b26
nir/constant_folding: Break TXB folding into a helper function
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16171 >
2022-04-26 22:34:39 +00:00
Yiwei Zhang
4f7de83110
venus: fix view format for ahb image
...
There's below AHB VU on the image view:
VUID-VkImageViewCreateInfo-image-02399
If image has an external format, format must be VK_FORMAT_UNDEFINED
This is well hidden and completely missed from the original venus ahb
implementation.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16159 >
2022-04-26 22:21:53 +00:00
Mike Blumenkrantz
054bd2d38f
kopper: copy a bunch of code for texture_from_pixmap
...
seems to work?
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16152 >
2022-04-26 21:44:30 +00:00
Mike Blumenkrantz
89602c3970
kopper: store whether screen has dmabuf support
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16152 >
2022-04-26 21:44:30 +00:00
Mike Blumenkrantz
476f8ad350
kopper: move drawable geometry updating up in function
...
no functional changes
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16152 >
2022-04-26 21:44:30 +00:00
Mike Blumenkrantz
c38a2ad2ff
kopper: always fetch and store drawable info
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16152 >
2022-04-26 21:44:30 +00:00
Mike Blumenkrantz
6a9def8c9f
drisw: remove dead code
...
this was from a very early version of kopper, but it can no longer
be reached
Fixes: d760a9151b ("gallium: Learn about kopper")
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16152 >
2022-04-26 21:44:30 +00:00
Icecream95
1a4dca989c
panfrost: Enable NIR lowering of half float packing
...
The GLSL lowering of half float packing involves software conversion
to half-float; instead, use the lowering in NIR.
Both Midgard and Bifrost are already set to lower the instructions to
bit operations, but change mdg_should_scalarize so that the lowerable
split variants of the pack/unpack instructions are generated.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16175 >
2022-04-27 08:23:35 +12:00
Mike Blumenkrantz
2d7b5bd3b9
zink: fix up swapchain depth buffer geometry during fb update
...
due to desync between the frontend and the driver, the size that the
depth buffer was created with may not match the size of the swapchain if
the window is being resized very quickly, so just go ahead and clobber
the existing depth buffer with a series of very illegal internal object
replacements to make everything match up
do not try at home.
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16151 >
2022-04-26 18:58:26 +00:00
Mike Blumenkrantz
305fe87d98
zink: fix/improve swapchain surface info updating
...
if the swapchain is updated, the base surface info needs to be updated
so that the surface info used for the framebuffer is updated
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16151 >
2022-04-26 18:58:26 +00:00
Mike Blumenkrantz
25840a31eb
kopper: add DISPLAY_TARGET bind for depth buffer
...
this doesn't affect functionality and is only used for validation
in the driver
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16151 >
2022-04-26 18:58:26 +00:00
Konstantin Seurer
aeeb0b4deb
radv: Copy shader modules to avoid use after free
...
The vkd3d-proton ray tracing tests delete shader modules after creating
pipeline libraries from them. This resulted in a use after free when
creating ray tracing pipelines.
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16027 >
2022-04-26 18:20:11 +00:00
Konstantin Seurer
1873880b50
vulkan: Add a shader module clone helper
...
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16027 >
2022-04-26 18:20:11 +00:00
Alyssa Rosenzweig
7998f242a8
panfrost: Add a test for pan_image_layout_init
...
Would have caught a significant issue with ETC2 handling. Luckily Midgard dEQP
failed on this, even though Bifrost didn't (due to explicit strides?)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
52f8f7d6c9
panfrost: Simplify how image_layout_init is called
...
Rather than using it as a catch-all initialize, use it to fill in derived from
fields from a partially initialized image_layout. This is easier to understand
and, more importantly, easier to unit test.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
c45ed7e576
panfrost: Unit test block size queries
...
Simple interface, make sure we don't screw it up.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
11d0a5292b
panfrost: Remove unused dev argument
...
This function has enough arguments as it is... Motivated by wanting to unit test
this monster.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
321e1b37b9
panfrost: Unify paths through image_layout_init
...
We can always align the width/height, now that block_size is defined (as 1x1)
for linear textures. We can also remove the useless effective_depth assignment.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
724f835d2f
panfrost: Unify panfrost_block_size paths
...
Handle linear, interleaved, and AFBC formats. This requires taking a format, as
block compressed u-interleaved textures have a different tile size than other
u-interleaved textures.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
ef5e66b1fd
panfrost: Use pan_block_size in layout calculation
...
This gets rid of the weird "call block_dim twice with a mystery argument"
pattern, and will allow us to further unify code.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
e4ee2c213a
panfrost: Extract panfrost_afbc_is_wide helper
...
Rather than open-code the > 16 check in multiple places and have to justify it
in each. This is easier to understand at the call sites.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
e6f3abd5ec
panfrost: Don't pretend to support multiplane AFBC
...
This requires tons of driver changes we're not ready for. In the mean time, this
will just get in the way of refactoring AFBC support.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
d25bb73bb6
panfrost: Use panfrost_afbc_superblock_width
...
..instead of panfrost_block_dim. This is clearer, and gets rid of block dim
users.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
36449bdcdc
panfrost: Add afbc_superblock_{size, width, height} helpers
...
...and use them to implement block_dim transitionally.
These should be clearer than the general block_dim.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
43202320ee
panfrost: Always use 64-bit SD with strides
...
Midgard has multiple Surface Descriptor formats selectable in the texture
descriptor. Previously, we have used both the "64-bit surface descriptor" and
the "64-bit surface descriptor with 32-bit line stride and 32-bit layer stride".
A delicate routine tried to guess what stride the hardware will use if we don't
specify it explicitly, and omit the stride if it matches. Unfortunately, that
routine is broken in at least two ways:
* Textures with ASTC must always specify an explicit stride. Failing to do so
(like we were doing) is invalid.
* It applies even for interleaved textures. The comment above the function
saying otherwise is incorrect. (TODO: double check this)
Bifrost onwards always specify the strides explicitly. Let's just do that and
unify the gens. What is lost from doing this? A ludicrously trivial amount of
memory and texture descriptor cache space. 8 bytes per layer*level per texture,
in fact. Compared to the size of the textures being addressed, the memory usage
is trivial. The texture descriptor cache size maybe matters more. But given
Arm's hardware people went this direction for Bifrost and stuck to it, I doubt
it matters much.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
644611010e
panfrost: Split pan_layout.c from pan_texture.c
...
Before we used GenXML, pan_texture mixed layout code with texture descriptor
packing code. For the most part, the layout code is generation-independent; the
pack code is not. We introduced an anti-pattern where the file was compiled N+1
times: N times for each PAN_ARCH value, and an extra time with no PAN_ARCH
value. And then the contents of the file changed completely depending on
PAN_ARCH. This is a pretty weird construction.
Let's instead split off the layout file from the descriptor file, compile the
layout file once, and compile the descriptor file per-gen.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig
9ccba4943d
panfrost: Advertise all textures in drm-shim
...
I was rather confused when I couldn't reproduce an ASTC bug under drm-shim...
Fix that.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991 >
2022-04-26 17:47:49 +00:00
Yevhenii Kolesnikov
65caf46b3b
nir: Remove single-source phis before opt_if_loop_last_continue
...
We might have some single-source phis leftover after prior optimizations. We
want to get rid of them before merging the blocks.
Fixes: 5921a19d4b ("nir: add if opt opt_if_loop_last_continue()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6312
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com >
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16095 >
2022-04-26 17:06:07 +00:00
Lucas Stach
90ea4283b4
etnaviv: set VIVS_GL_VERTEX_ELEMENT_CONFIG depending on prim type
...
New blob versions always emit this state on GPUs that don't have the
NEW_GPIPE feature bit before drawing a primitive, as it needs to be
set according to the primitive type.
Closes : #2933
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16094 >
2022-04-26 16:59:13 +00:00
Lucas Stach
9696355802
etnaviv: update headers from rnndb
...
Update to etna_viv commit 100009142dc2.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16094 >
2022-04-26 16:59:13 +00:00
Jason Ekstrand
37d4b72ff3
vulkan/log: Allow but warn for client-invisible objects
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16107 >
2022-04-26 16:22:23 +00:00
Jason Ekstrand
62a44d1bda
vulkan/log: Allow but warn if called with a NULL object
...
Most of the time when the logging code is invoked, it means we're
already in an edge case. It should be as robust as possible, otherwise
we risk making hard to debug things even harder. To that end, instead
of blowing up if passed a NULL object on the list, handle it as
gracefully as we can.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16107 >
2022-04-26 16:22:23 +00:00
Jason Ekstrand
ef9d97ec1f
spirv: Handle Op*MulExtended for non-32-bit types
...
Fixes: 58bcebd987 ("spirv: Allow [i/u]mulExtended to use new nir opcode")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6306
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16060 >
2022-04-26 15:16:11 +00:00
Alyssa Rosenzweig
f329f67243
panfrost: Kick off v9 support in the driver
...
Call panfrost_cmdstream_screen_init_v9.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
1a1546ca7e
panfrost: Compile for v9
...
Now that everything is ported!
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
26d339ef8a
panfrost: Generate Valhall Malloc IDVS jobs
...
These look similar to Bifrost IDVS but with a twist: memory allocation is
handled by the hardware, and the descriptors are split up. Add the handling for
these.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
e626c9f6f8
panfrost: Use dirty flags to emit v9 descriptors
...
These new descriptors take the place of removed descriptors like the RSD, and
need corresponding dirty tracking.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
351403fe75
panfrost: Specialize shader descriptors for Valhall
...
Instead of being globbed into the RSD, Valhall uses minimal shader program
descriptors. For IDVS, we need separate descriptors for position and varying
shaders. It's actually worse -- we need separate descriptors for drawing points
and drawing lines/triangles in order to skip over the gl_PointSize write. Adapt
prepare_shader to upload all these descriptors.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
b15f53ffaa
panfrost: Specialize ZSA state for Valhall
...
Now we have a much nicer Z/Stencil Descriptor.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
68e7bcab3d
panfrost: Specialize vertex elements for Valhall
...
The split between attribute descriptors and buffer descriptors parallels that of
Bifrost's attribute descriptors and attribute buffer descriptors, with some
shuffling and simplication.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
2a027abfcf
panfrost: Simplify attribute format expression
...
Chew through a layer of indirection for clarity.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
603c06d00f
panfrost: Specialize rasterizer state for Valhall
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
818bbcecb2
panfrost: Adapt compute job emit for Valhall
...
Similar data structure, simpler packing.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
cb14c639eb
panfrost: Use common state emit for compute jobs
...
This reduces the "specialness" of the Bifrost compute job emit path. It's not
useful in its own right since we currently put compute jobs in their own batch.
This could be optimized.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
7ad159aab2
panfrost: Don't fix up alpha test on Bifrost
...
Since 7d1d7cdf57 ("panfrost: Don't check alpha test in fs_required on
Bifrost+"), we don't use the alpha testing state on Bifrost. So the fixup isn't
needed either.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig
cf02a1a555
panfrost: Port uniform/UBO logic to Valhall
...
Use Valhall descriptors, and report sizes so we can accurately inform the
hardware of sizes.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035 >
2022-04-26 14:56:23 +00:00