Boris Brezillon
cfe9bca912
panfrost: Add extra info to the pan_image_layout struct
...
This means duplicating some of the bits we already have in the
pipe_resource object embedded in panfrost_resource, but if will also
allow us to move some code out of the gallium driver without requiring
copy those fields every time we call a generic helper.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033 >
2021-04-13 18:06:37 +00:00
Boris Brezillon
efcb1e494b
panfrost: Stop passing a depth > 1 when creating 2D textures
...
The depth field is ignored if dim != 3D, but it's a bit confusing.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033 >
2021-04-13 18:06:37 +00:00
Boris Brezillon
5d7c244c07
panfrost: Add a format field to pan_image_layout
...
We will need this information at the layout level if we want to move
some of the code out of the gallium driver and share it with the
Vulkan driver. Let's get rid of panfrost_resource.internal_format which
basically encodes the same thing.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033 >
2021-04-13 18:06:37 +00:00
Boris Brezillon
3f8cebee09
panfrost: Move image states out of pan_image_layout
...
The layout is supposed to encode image miplevels/surfaces layout, not
the state data stored in the buffers. It doesn't matter for a gallium
driver, since resources are expected to hold both a layout and a state,
but Vulkan is a bit different. In Vulkan, the image state is explicitly
passed by the user when starting a render pass (vkCmdBeginRenderPass()),
and might evolve depending on the operation done in this render pass.
This state is not effective until the command buffer is queued and
executed. For these reasons, keeping the image state attached to the
VkImage object is not an option, but we'd still like to re-use the
layout and state objects, and all common helpers acting on those objects.
Let's move the state bits out of the layout to make that possible.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033 >
2021-04-13 18:06:37 +00:00
Boris Brezillon
b00b6a727c
panfrost: s/panfrost_slice/pan_image_slice_layout/
...
We are about to move slice states out of the panfrost_slice object,
but before we do that, let's rename the existing struct to reflect what
this object refers to.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033 >
2021-04-13 18:06:37 +00:00
Icecream95
c8620005d2
panfrost: Align BO size to 4096 bytes
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10158 >
2021-04-12 23:53:41 +00:00
Rhys Perry
a2619b97f5
nir/lower_idiv: add options to use fp32 for 8-bit division lowering
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10081 >
2021-04-12 16:19:46 +00:00
Alyssa Rosenzweig
e00d94f14f
panfrost: Enable AFBC buffer sharing
...
This was hidden originally to workaround a bug in the RK3399 display
driver. The patch resolving this issue has been merged in the upstream
kernel, and in fact...
1. The issue was visible on 21.0 even with this workaround under certain
configurations (sway with an external monitor).
2. Even on buggy kernels, due to other platform details this is an
obscure bug to hit (not aware of any ways to trigger it OOTB with
current userspaces other than sway with an external monitor)
So why bother? Let's just delete the hack and let AFBC be used freely.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Cc: mesa-stable
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10148 >
2021-04-12 15:55:55 +00:00
Alyssa Rosenzweig
ba8737bb86
pan/bi: Determine block successors correctly
...
Fixes GPU timeouts in Google Maps.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Reviewed-by: Icecream95 <ixn@disroot.org >
Tested-by: Icecream95 <ixn@disroot.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10145 >
2021-04-11 02:05:31 +00:00
Icecream95
51a812bb60
panfrost: Flush output after disassembling shaders
...
Fixes text printed to stderr appearing in the middle of disassembly
when piping stdout and stderr to the same place.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10088 >
2021-04-09 23:45:26 +00:00
Bas Nieuwenhuizen
580f1ac473
nir: Extract shader_info->cs.shared_size out of union.
...
It is valid for all stages, just 0 for most of them. In particular
mesh/task shaders might be using it.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10094 >
2021-04-08 14:39:28 +00:00
Boris Brezillon
2e6d94c198
panfrost: Add helpers to support indirect draws
...
Indirect draws are implemented with compute jobs patching the
vertex/tiler jobs. Provide helpers to do that.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8700 >
2021-04-07 08:27:58 +00:00
Boris Brezillon
9a08c9097f
panfrost: Stop including pan_device.h from pan_bo.h
...
We want to define structures containing pan_pool objects in pan_device.h
but it is prevented by the
pan_device.h -> pan_pool.h -> pan_bo.h
^____________________________|
loop.
Break this loop by not including pan_device.h from pan_bo.h.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8700 >
2021-04-07 08:27:58 +00:00
Alyssa Rosenzweig
d01628d24d
pan/bi: Remove conversion lowering
...
Inherited from Midgard, it's easier to just do at NIR->BIR time now that
we have a builder that doesn't suck. Impeded certain optimizations.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065 >
2021-04-06 19:35:33 +00:00
Alyssa Rosenzweig
266de379c2
pan/bi: Generalize f2i16, f2u16
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065 >
2021-04-06 19:35:33 +00:00
Alyssa Rosenzweig
be74b84e6f
pan/bi: Fill in some more conversions
...
The trick is that downcasts are just swizzling out what you don't want,
so things like U32_TO_F16 can be synthesized as V2U16_TO_V2F16 with
src.h00
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065 >
2021-04-06 19:35:33 +00:00
Alyssa Rosenzweig
435800e750
pan/bi: Lower swizzles
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065 >
2021-04-06 19:35:33 +00:00
Alyssa Rosenzweig
e3e2c5b594
pan/bi: Optimize MKVEC.v2i16 generation
...
Prefer SWZ.v2i16 in cases where that's possible, it will be easier to
optimize later.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065 >
2021-04-06 19:35:33 +00:00
Alyssa Rosenzweig
f9bc168bd3
pan/bi: Add bi_swz_16 helper
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065 >
2021-04-06 19:35:33 +00:00
Alyssa Rosenzweig
11010b932b
pan/bi: Lower large arrays to scratch
...
No shader-db changes.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10020 >
2021-04-03 19:18:55 +00:00
Alyssa Rosenzweig
f5d1a8bf6f
pan/bi: Split writemasks for memory stores
...
Will avoid a regression in the following commit, and probably fixes some
GLES3.1 stuff.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10020 >
2021-04-03 19:18:55 +00:00
Alyssa Rosenzweig
52863f2e60
pan/bi: Enable all nir_opt_move/sink optimizations
...
total instructions in shared programs: 116716 -> 116716 (0.00%)
total nops in shared programs: 86280 -> 84996 (-1.49%)
nops in affected programs: 50485 -> 49201 (-2.54%)
Nops are helped.
total clauses in shared programs: 20993 -> 20732 (-1.24%)
clauses in affected programs: 7737 -> 7476 (-3.37%)
Clauses are helped.
total quadwords in shared programs: 91697 -> 91155 (-0.59%)
quadwords in affected programs: 52123 -> 51581 (-1.04%)
Quadwords are helped.
total spills in shared programs: 0 -> 0
total fills in shared programs: 0 -> 0
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10020 >
2021-04-03 19:18:55 +00:00
Alyssa Rosenzweig
5cef39acbe
panfrost: Deduplicate Bifrost fau_count
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Alyssa Rosenzweig
3fdd3be8d6
panfrost: Deduplicate UBO count assignment
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Alyssa Rosenzweig
6a9936f5b5
pan/bi: Remove stale todo/assert
...
Was already handled, just untested.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Alyssa Rosenzweig
10b736f160
pan/bi: Remove TODO: RA warnings
...
We'll make this perfectly valid syntax for precolouring.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Alyssa Rosenzweig
93cdb072a8
pan/bi: Only run DCE once
...
No more progress loop needed. I'm skeptical we really want a dataflow
approach long-term, though, this is annoyingly expensive.
No shader-db changes.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Alyssa Rosenzweig
b7a339bc97
pan/bi: Only run copyprop once
...
We need to update `replacement` with the results of copyprop earlier
within the pass, but after that there's no point running more than once
if we're not going to materialize any new moves.
No shader-db changes.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Alyssa Rosenzweig
69666723f8
pan/bi: Handle 16-bit blend sr_count
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Alyssa Rosenzweig
d91bf7257d
pan/bi: Add bi_foreach_block_rev
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Alyssa Rosenzweig
8fde30925d
pan/bi: Document register conventions
...
Should motiviate RA decisions.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9421 >
2021-04-03 12:47:29 -04:00
Boris Brezillon
bbff09b952
panfrost: Move the blend shader cache at the device level
...
So we can re-use it in the Vulkan driver.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9831 >
2021-03-29 06:53:50 +00:00
Boris Brezillon
3fe3aebd63
panfrost: Get rid of panfrost_pool_alloc()
...
This one is no longer used.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9827 >
2021-03-26 08:46:15 +01:00
Boris Brezillon
f23a023a7e
panfrost: Use the descriptor allocators where appropriate
...
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9827 >
2021-03-26 08:46:10 +01:00
Boris Brezillon
58747cd2f5
panfrost: Emit surface descriptors with pan_pack()
...
Now that we have surface descriptors defined in midgard.xml we can use
pan_pack() to emit them.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9827 >
2021-03-26 08:46:06 +01:00
Boris Brezillon
7c08bb5ad0
panfrost: Define the Surface and Surface-with-stride descriptors
...
Right now the code manipulates mali_ptr, but having surface descriptors
properly defined will allow us to use the descriptors allocator when
allocating a midgard texture.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9827 >
2021-03-26 08:46:01 +01:00
Boris Brezillon
a1c0cc3fdd
panfrost: Provide various helpers to simplify descriptor allocation
...
Got the alignment wrong a few times, so I figured it would be good to
have helpers that take care of the alignment requirements based on
the midgard.xml definitions.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9827 >
2021-03-26 08:45:57 +01:00
Boris Brezillon
724045aff2
panfrost: Specify descriptor alignment requirements
...
Once we have that in place, we can provide macros to simplify descriptor
allocation.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9827 >
2021-03-26 08:45:51 +01:00
Boris Brezillon
65931ffa27
pan/gen_pack: Parse alignment requirements
...
This will help us simplify descriptor allocation.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9827 >
2021-03-26 08:45:32 +01:00
Icecream95
616394cf31
pan/mdg: Use appropriate sizes for global loads/stores
...
When always using 128-bit operations, an access at the end of an SSBO
could spill over to the next page and cause a GPU fault. To avoid
this, pick the smallest instruction that fits.
The if ladder might need extending for sizes of less than 32 bits, but
those currently fail in other parts of the compiler so are untested.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9747 >
2021-03-25 13:23:47 +00:00
Icecream95
2f78ed8f0a
pan/mdg: Rename load/store operations
...
Use the actual bit sizes the instructions deal with.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9747 >
2021-03-25 13:23:47 +00:00
Jesse Natalie
28bf06f350
panfrost: Add a Meson dependency on bi_opcodes.h for bifrost_compiler
...
Fixes: 2d4597de ("pan/bi: Use autogenerated modifiers")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9719 >
2021-03-19 19:22:29 +00:00
Timur Kristóf
1d571c6bc1
pan/bi: Use correct enum type for NIR intrinsics.
...
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com >
Reviewed-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9632 >
2021-03-16 21:46:52 +00:00
Boris Brezillon
442fbcdb47
panfrost: Expose panfrost_modifier_to_layout()
...
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9517 >
2021-03-11 15:10:58 +00:00
Boris Brezillon
825b1f9446
panfrost: Split the sampler and texture count
...
The texture and sampler descriptors are well separated in Vulkan,
let's add a new field to allow mixing sampler and texture descs.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9517 >
2021-03-11 15:10:58 +00:00
Boris Brezillon
b0f968cf5c
panfrost: Don't count the special vertex/instance ID attributes on Bifrost
...
On Bifrost the vertex/instance ID are preloaded in special registers,
no need to add special attribute entries.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9517 >
2021-03-11 15:10:58 +00:00
Boris Brezillon
7b9dfc502a
panfrost: Print the correct UBO size when dumping UBO information
...
There's a minus(1) modifier on the entries field. Take it into account.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9517 >
2021-03-11 15:10:58 +00:00
Boris Brezillon
3559efb9bf
panfrost: Allow passing an explicit UBO index for the sysval UBO
...
UBO index assignment is a bit special in Vulkan, it's based on the
descriptor set layout, which doesn't know about shaders' internal UBOs
(our sysval UBOs). Extend the backend compilers so we can place sysval
UBOs where we want: after all explicit UBOs.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9517 >
2021-03-11 15:10:58 +00:00
Boris Brezillon
92d9f090d9
panfrost: Add a knob to disable the UBO -> push constants optimization
...
I'm just too lazy to implement the logic to prepare push constant
buffers in the Vulkan driver. Besides, Vulkan has explicit push
constants, which AFAIK is not handled in the compiler backends yet,
and that will probably conflict with the UBO -> push constant
promotion.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9517 >
2021-03-11 15:10:57 +00:00
Alyssa Rosenzweig
5487847d8c
pan/bi: Implement u{add, sub}_sat
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9520 >
2021-03-11 14:30:19 +00:00