Alyssa Rosenzweig
40b4ee9426
panfrost: Factor out general varying case
...
To avoid hard-to-follow control flow now that we return void.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
b805cf9b1f
panfrost: Pass varying descriptors by reference
...
Instead of returning by value, as a stepping stone to packing directly.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
d5a264facf
panfrost: Reword comment
...
Avoid referencing data structures that no longer exist.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
44397c580c
panfrost: Use packs for vertex built-ins
...
These probably need a bigger cleanup at some point but let's handle one
thing at a time.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
e646c861fc
panfrost: Use packs for vertex attribute buffers
...
Eliminates messy staging, I think.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
c9bb5dc911
panfrost: Inline panfrost_vertex_instanced
...
We'd like to have attribute code in one place together so we can
refactor effectively; this routine as-is wouldn't fit perfectly outside
Gallium anyway so let's do the simple thing.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
e9dc225122
panfrost: Hoist instance_shift/instance_odd fetch
...
We'll want to pass it as an argument shortly.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
27f8b879cc
panfrost: Use packs for attributes
...
Now that state is grouped, this is natural.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
6caf789c07
panfrost: Move attr_meta emission to the draw routine
...
It's unfortunate that we can't do more at CSO time, but actually all we
really need is the format after all, and this lets us group the state.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
8236fa3ff1
panfrost: Make attribute-buffer map explicit
...
This helps decouple the attribute and attribute buffer emission.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
9cc81ea0c2
panfrost: Simplify offset fixup proof
...
No need to put strides and such into it at all.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
76de3e691c
panfrost: Merge attribute packing routines
...
In preparation for streamlining the packing, we need related code in one
place.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
668ec24bfd
panfrost: Squash 22-bit format field in attr_meta
...
This is an intermediate step to support v7 style formats. Now we don't
see the mali_format alone, instead together with the swizzle (and sRGB
flag, unused for attributes of course).
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig
e03622e50f
panfrost: Set STRIDE_4BYTE_ALIGNED_ONLY
...
It isn't clear to me why, but this breaks in some cases (such as some
dEQP cases where the blob does a translate too).
This reverts commit 9f2997dad0 .
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Cc: mesa-stable
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326 >
2020-08-17 11:43:52 +00:00
Dave Airlie
94e4a17f29
llvmpipe: add support for memory allocation APIs
...
This adds llvmpipe driver support for the vulkan split memory/resource API
and the the don't overallocate flag.
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082 >
2020-08-17 14:30:49 +10:00
Eric Anholt
5b8d67cb64
util: Move fetch_rgba to a separate function table.
...
Only llvmpipe and translate_generic use it, and only in fallbacks, so if
you're not building that then let's not bloat our binaries with it.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305 >
2020-08-16 21:25:14 +00:00
Eric Anholt
35b22b5da0
util: Make all 3 fetch_rgba functions occupy the same function slot.
...
A single format either had the float, the sint, or the uint version.
Making the dst be void * lets us store them in the same slot and not have
logic in the callers to call the right one.
-6kb on gallium drivers
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305 >
2020-08-16 21:25:14 +00:00
Karol Herbst
dc667b1f19
nv50/ir/nir: fix smem size
...
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6325 >
2020-08-15 10:59:39 +00:00
Mike Blumenkrantz
f024bc8314
zink: invalidate pipeline hash on more changes
...
some cases were missed here, causing an assert to trigger
Fixes: 1185b3f32d "zink: pre-hash gfx-pipeline-state"
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6262 >
2020-08-14 04:30:11 +00:00
Nanley Chery
493298528a
iris: Make iris_bo_import_dmabuf take a modifier
...
Replace the tiling parameter with a modifier parameter. I find it more
straightforward to have this function figure out the tiling from the
modifier than to have its caller do it.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6296 >
2020-08-13 22:03:48 +00:00
Nanley Chery
c111e9099c
iris: Don't call SET_TILING for dmabuf imports
...
Calling SET_TILING on a DMA buffer with the gen12 CCS modifier can fail
unnecessarily. The main surface in the BO is Y-tiled, but the CCS portion is
linear and can have a stride that's not a multiple of 128B. Because SET_TILING
is called on the CCS plane with I915_TILING_Y, the ioctl will sometimes reject
the stride.
SET_TILING was originally used in b6d45e7f74 to
fix an assertion failure in iris_resource_from_handle. Assigning the BO's
tiling_mode field is sufficient to avoid the failure.
Fixes: c19492bcdb ("iris: Handle importing aux-enabled surfaces on TGL")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6296 >
2020-08-13 22:03:48 +00:00
Jonathan Marek
0c97e601a4
turnip: implement VK_EXT_custom_border_color
...
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6093 >
2020-08-13 16:54:06 +00:00
Jonathan Marek
a322924d9c
panfrost: add missing dependency on midgard_pack.h
...
Fixes build failing when libpanfrost is built before midgard_pack.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6093 >
2020-08-13 16:54:06 +00:00
Icecream95
8557b1a8eb
panfrost: Fix border colour
...
The border colour was being set to the red colour for all channels.
Fixes tex-border-1 from piglit.
Fixes: f74186baa5 ("panfrost: XMLify Midgard samplers")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6298 >
2020-08-13 13:45:00 +00:00
Alyssa Rosenzweig
c9bdba26b0
panfrost: XMLify Block Format
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig
ad0b32cdbd
panfrost: XMLify Bifrost textures
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
f008a6314c
panfrost: XMLify Midgard textures
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
b10c3c869d
panfrost: XMLify Bifrost samplers
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
f74186baa5
panfrost: XMLify Midgard samplers
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
c4c8c8e8fb
panfrost: Don't mask coverage mask to 4-bits
...
While it is correct for MSAA 4x, it will break for MSAA 8x and 16x, and
it is only dubiously correct for no-MSAA. Drop the mask.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
6afd4addef
panfrost: Simplify depth/stencil/alpha
...
The alpha test is lowered by the frontend so we can drop that unused
code path, and stencil state can be computed at CSO create time to
reduce draw-time complexity.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
1675d92d66
panfrost: Simplify zsa == NULL case
...
Stencil fields are only used if stenciling is enabled.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
931e7b4c7a
panfrost: XMLify stencil test
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
fa949678c1
panfrost: XMLify UBOs
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig
7f487e087f
panfrost: XMLify viewport
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig
ef20691e3d
panfrost: XMLify wrap modes
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig
e9ca320461
panfrost: XMLify stencil op
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig
d182a6057f
panfrost: XMLify mali_func
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig
32dbc80979
panfrost: XMLify draw_mode
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig
4b7056b8c8
panfrost: XMLify job_type
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig
88dc4c21e6
panfrost: Redirect cmdstream includes through GenXML
...
This will provide a way to incrementally upgrade.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195 >
2020-08-13 08:55:15 +02:00
Eric Anholt
9fd0f455af
util: Change a codegenned switch statement to a nice little table.
...
This saves us 13 to 35kb on release drivers in my builds.
Acked-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5826 >
2020-08-12 14:22:24 -07:00
Eric Anholt
4064a6cd20
util: Split the pack/unpack functions out of the format desc.
...
This gives the compiler a chance to GC pack/unpack functions separate from
the format descriptions. For drivers that use everything, this is
+10-20kb, while for libvulkan_intel it's -1.3MB.
Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1048434
Acked-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5826 >
2020-08-12 13:13:39 -07:00
Marek Olšák
4c84600afa
radeonsi: fix compute-based culling with VERTEX_COUNTER_GDS_MODE == 1
...
Discovered when testing Sienna Cichlid.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6282 >
2020-08-12 17:39:09 +00:00
Marek Olšák
2b78cb2e00
radeonsi: disable NGG culling on gfx10.3 because of hangs
...
Fixes: a23802bcb9 - ac,radeonsi: start adding support for gfx10.3
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6282 >
2020-08-12 17:39:09 +00:00
Mike Blumenkrantz
61042b1bdb
zink: handle more draw modes
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6269 >
2020-08-12 14:52:26 +00:00
Mike Blumenkrantz
ced9e6e3e5
zink: change pipeline hashes to index based on vk primitive type
...
this is a bit more convenient since we always support vk types but not
necessarily gallium types
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6269 >
2020-08-12 14:52:26 +00:00
Alyssa Rosenzweig
2a1217513e
panfrost: Implement panfrost_query_dmabuf_modifiers
...
v2: Only advertise AFBC if PAN_MESA_DEBUG=afbc is set. This is to avoid
sharing AFBC buffers as SCANOUT until corresponding kernel bugfixes are
landed. Technically a kernel issue but let's prevent a regression.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Tested-by: Icecream95 <ixn@keemail.me > [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159 >
2020-08-12 09:59:21 -04:00
Alyssa Rosenzweig
24c921b1b5
panfrost: Ensure AFBC slices are aligned
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Tested-by: Icecream95 <ixn@keemail.me >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159 >
2020-08-12 09:59:21 -04:00
Alyssa Rosenzweig
4d0241dfed
panfrost: Allocate enough space for tiled formats
...
We need to align and possible reserve space for a header.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Tested-by: Icecream95 <ixn@keemail.me >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159 >
2020-08-12 09:59:20 -04:00