Alyssa Rosenzweig
7ef205dabd
panfrost: Use MALI_ATTRIBUTE_LENGTH
...
Removes an unwanted reference to mali_attr_meta.
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
59fa26902d
panfrost: Use pack for general varying
...
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
6c850637f5
panfrost: Use pack for XFB varying
...
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
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
4fc90f7c3c
panfrost: Use better packs for blits
...
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
3e7fd2a034
panfrost: Add XML for attribute buffers
...
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
2c8a722b85
panfrost: XMLify attributes
...
To keep review manageable, this only ports over pandecode and blitting.
The main uses for vertex data and varying linkage will come next, as
they touch considerably more code.
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
cdc3276317
panfrost: XMLify mali_channel
...
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
c5f18ce144
panfrost: Drop NXR format
...
It's not clear this was ever exposed under any GL/DX/CL/VK/... extension
whatsoever...
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
Louis-Francis Ratté-Boulianne
350dd2a36d
pipebuffer: Remove unused buffer event in slab bufmgr
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6225 >
2020-08-17 11:24:49 +00:00
Marek Olšák
8a012f429d
nir: handle load_input_vertex in nir_get_io_offset_src
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6328 >
2020-08-17 11:06:49 +00:00
Marek Olšák
83953f9d4d
nir: remove nir_strip stub declaration
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6328 >
2020-08-17 11:06:49 +00:00
Marek Olšák
f3a9781ee1
compiler: add glsl_print_type
...
Move it from the glsl compiler. For debugging.
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6328 >
2020-08-17 11:06:49 +00:00
Pierre-Eric Pelloux-Prayer
b7c04b1790
ac/llvm: handle static/shared llvm init separately
...
Having a single init function works as expected for shared llvm, but
when using a static llvm only one llvm will get initialized.
This commit introduces 2 separate init function:
- shared llvm = single public init function
- static llvm = one init function for each module using llvm
Fixes: 50d20dc055
("ac/llvm: export ac_init_llvm_once in targets")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3376
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6253 >
2020-08-17 10:47:41 +00:00
Louis-Francis Ratté-Boulianne
916110e17f
st/mesa: Enable clip planes lowering for geometry shaders
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6218 >
2020-08-17 10:10:07 +00:00
Louis-Francis Ratté-Boulianne
584f27326c
st/mesa: factor ucp-lowering logic into helper
...
This makes the next step easier to follow.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6218 >
2020-08-17 10:10:07 +00:00
BillKristiansen
ff4c991fd1
compiler/glsl: Initialize local variable to zero to fix MSVC RTC error
...
Without this, we get a run-time error about using an uninitialized
variable.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6221 >
2020-08-17 09:31:37 +00:00
Dave Airlie
b38879f8c5
vallium: initial import of the vulkan frontend
...
This is the initial import of the vallium frontend for gallium.
This is only good enough to run the triangle and the gears demo
(wrongly) from Sascha demos.
Improvements are mostly on the llvmpipe side after this.
It contains an implementation of the Vulkan API which is mapped
onto the gallium API, and is suitable only for SOFTWARE drivers.
Command buffers are recordred into malloced memory, then later
they are played back against the gallium API. The command buffers
are mostly just Vulkan API marshalling but in some places the information is
processed before being put into the command buffer (renderpass stuff).
Execution happens on a separate "graphics" thread, againt the gallium API.
There is only a single queue which wraps a single gallium context.
Resources are allocated via the new resource/memory APIs.
Shaders are created via the context and bound/unbound in the
second thread.
(No HW for reasons - memory management, sw paths for lots of paths,
pointless CPU side queue)
v2: drop mesa_icd, drop cpp_args, drop extra flags, change meson config (Eric)
v2.1: use meson-gallium job
meson pieces:
Reviewed-by: Eric Engestrom <eric@engestrom.ch >
overall:
Acked-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082 >
2020-08-17 14:31:47 +10:00
Dave Airlie
8004fa9c95
vulkan/wsi: add sw support. (v2)
...
This adds an option to the WSI support for a software path to be
used with the vulkan sw drivers. There is probably some changes
that could be made to improve this and use present, for now
just use put image.
v2: roll out flag across all drivers (Eric)
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082 >
2020-08-17 14:30:50 +10:00
Dave Airlie
5a9eba4acd
util/format: add some ZS helpers for vallium
...
The vallium layer has a requirement to insert and extra the 24-bit
unorm value as a unorm value (not as a float etc). Add helpers
to facilitate that.
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082 >
2020-08-17 14:30:50 +10:00
Dave Airlie
3abf548270
gallivm/nir: add load push constant support
...
This convets the push constant load to a ubo load against the 0 constant buffer,
which is where the vallium layer will bind things.
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
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
Dave Airlie
ecb617a6a7
gallium: add a resource flag to say no over allocation.
...
llvmpipe overallocates buffers for buffers used as render targets,
however this breaks some vulkan apps (UE4), so add a workaround
flag to force llvmpipe to not overallocate certain buffers.
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082 >
2020-08-17 14:30:49 +10:00
Dave Airlie
e6c7ca218d
gallium: add an interface for memory allocations.
...
In order to support vulkan over gallium for the sw renderers,
there needs to be a vulkan-like memory allocation API.
It doesn't need to be overly complicated for the needs of the sw
renderers.
The vallium layer will allocate resources and memory separately
and bind them via this API.
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082 >
2020-08-17 14:30:49 +10:00
Bas Nieuwenhuizen
50b039590e
radv: Use getter instead of setter to extract value.
...
Oops ...
Fixes: 64768111c3
"radv: Handle slightly different image dimensions."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3417
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6337 >
2020-08-16 23:40:03 +00:00
Eric Anholt
09196355b2
gallium: Use unpack_rgba() instead of fetch_rgba in translate_generic
...
This is the only user of fetch_rgba outside of llvmpipe, and it's in the
fallback path of this fallback path. Looking at an example of these two
functions, b8g8r8a8's unpack_rgba is 2.7x as long as fetch_rgba. It feels
reasonable to sacrifice some perf in this already slow (VBO readback, and
a function pointer call per attribute per vertex) path to reduce our
binary size. And, if I ever finish getting unpack codegen to switch to
rows instead of rects, that factor will go back down.
Saves 40kb of binary on non-llvmpipe 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
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
9cc84369b7
util: Mark the format description getter functions as const.
...
This lets the compiler CSE calls to them on the same format. This is
particularly relevant for the description table lookup calls, which other
inlines might do internally.
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
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
Eric Anholt
80babbbf7e
uitl: Add R1_UNORM to the list of noaccess (no pack/unpack) formats.
...
The functions were just stubs, if you called them you would be terribly
disappointed.
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
Eric Engestrom
6668d7a5f3
egl: drop unused egldriver.h header
...
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241 >
2020-08-16 13:49:18 +00:00
Eric Engestrom
1f01fa11d7
egl: drop now empty egldriver.c
...
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241 >
2020-08-16 13:49:18 +00:00
Eric Engestrom
890d0334c1
egl: inline _eglInitializeDisplay() into eglInitialize()
...
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241 >
2020-08-16 13:49:18 +00:00
Eric Engestrom
0e7ae395e7
egl: inline _eglGetDriverProc() into eglGetProcAddress()
...
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241 >
2020-08-16 13:49:18 +00:00
Eric Engestrom
735b35e34a
egl: drop unused ${drv}_driver()
...
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241 >
2020-08-16 13:49:18 +00:00
Eric Engestrom
c74628fd1e
egl: replace &_eglDriver
/NULL
tested against NULL
with simple true
/false
...
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241 >
2020-08-16 13:49:18 +00:00
Eric Engestrom
37be01bff7
egl: drop unused _EGLDriver from MesaGLInteropEGL{QueryDeviceInfo,ExportObject}()
...
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241 >
2020-08-16 13:49:18 +00:00