Icecream95
b4cc116339
panfrost: Fix GL_EXT_vertex_array_bgra
...
Previously, attributes would always use an RGBA swizzle, even if the
format was BGRA.
Fixes piglit tests bgra-sec-color-pointer and bgra-vert-attrib-pointer.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4752 >
2020-04-28 00:20:53 +00:00
Samuel Pitoiset
7a0a6a7180
radv: do not expose GTT as device local memory mostly for APUs
...
On APUs, the memory is unified (all heaps are equally fast) and
apps should count all memory heaps together. But some games like
Id Tech games (Youngblood and such) don't manage memory correctly
on APUs and they spill everything when one VRAM heap is full.
Instead of spilling buffers, they should just allocate new buffers
in the second heap but it seems like these games are confused if
two memory heaps have the DEVICE_LOCAL_BIT set.
This is probably a first step towards better memory management on
APUs but there is still some work to do if we want to run most apps
with a small dedicated VRAM (256MB or so).
This gives a huge boost for Id Tech games on APUs, and doesn't
seem to reduce Feral games performance.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4771 >
2020-04-27 22:41:41 +00:00
Jan Zielinski
4a523baa00
gallium/swr: Fix LLVM 11 compilation issues
...
Changes needed to adapt to LLVM API changes in vector
and pointer types.
Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4769 >
2020-04-27 22:29:52 +00:00
Eric Anholt
69c8dfd49f
freedreno: Fix calculation of the const buffer cmdstream size.
...
The HW packet requires padding the number of pointers you emit, and we
would assertion fail about running out of buffer space if the number of
UBOs to be uploaded was odd.
Fixes: b4df115d3f ("freedreno/a6xx: pre-calculate userconst stateobj size")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4621 >
2020-04-27 22:10:10 +00:00
Mike Blumenkrantz
acc56300dc
zink: explicitly unref old fb object when setting new one
...
this object has a ref from being created, and its lifetime is expected to
be a single frame, so remove that initial ref when we expect to stop
using it
Closes : #2648
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4768 >
2020-04-27 21:55:51 +00:00
Mike Blumenkrantz
d3f0022a43
zink: remove framebuffer cache
...
this can only match when re-rendering identical frames, which is not a
typical case. the lack of cache eviction also leads to memory ballooning.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4768 >
2020-04-27 21:55:51 +00:00
Bas Nieuwenhuizen
afd9274d48
st/dri: Set next in template instead of after creation. (v2)
...
This should prevent horrors like Iris has with the delayed calls
to iris_resource_finish_aux_import just because info is not
available at allocation time.
AFAICT all drivers just copy the template except radeonsi/r600
which reset the next pointer.
AFAICT there is also no other place we get a state tracker setting
next ptrs on a resource.
v2: Updated Gallium docs.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3792 >
2020-04-27 21:08:01 +00:00
Erik Faye-Lund
a1e453f504
mesa/st: call _mesa_initialize() early
...
This allows drivers to reliably do things like using the GLSL
type-system during initialization.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765 >
2020-04-27 20:40:01 +00:00
Erik Faye-Lund
57f4c66028
mesa/main: one_time_init() -> _mesa_initialize()
...
This exposes the logic inside one_time_init() as _mesa_initialize(), so
drivers who needs to use functionality initialized in one_time_init
earlier if they need.
This means we can reliably use the GLSL type-system when compiling
driver built-in shaders.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765 >
2020-04-27 20:40:01 +00:00
Erik Faye-Lund
6ff94735c9
mesa/main: Do not pass context to one_time_init
...
There's no longer any reason to pass the context down to one_time_init,
because we always do the same thing regardless of the context, and we
don't change the context.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765 >
2020-04-27 20:40:01 +00:00
Erik Faye-Lund
ac9d30431e
mesa/main: do not init remap-table per api
...
This hasn't really been nessecary since 8386088e3d ("dispatch: stop
using _mesa_create_exec_table_es1() for GLES1."), when we stopped
diverging the logic here based on the context-API. So let's simplify the
code a bit.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765 >
2020-04-27 20:40:01 +00:00
Erik Faye-Lund
9bc98778a4
mesa/main: do not pass context to one-time extension init
...
_mesa_problem doesn't use the ctx argument for anything, so there's no
reason to pass it. This saves us from needing a context passed down this
code-path in the first place.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765 >
2020-04-27 20:40:01 +00:00
Erik Faye-Lund
05c69752cf
mesa/main: do not store unrecognized extensions in context
...
We process extension overrides only when we initialize the first
context, which means that unrecognized extensions only appear in the
first context created.
Let's instead store them in a global array, so we can apply them to all
contexts. This has the added benefit of making the initialization of the
first context less special, which allows us to clean up code a bit more.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765 >
2020-04-27 20:40:01 +00:00
Dave Airlie
9bc5b2d169
vulkan: add initial device selection layer. (v6.1)
...
This is code Bas has out of tree but I think mesa should be shipping it, and I've improved it.
Initially-written-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
v2: add infinite recursion fix (Bas)
v3: Fix wayland/xcb barrier, whitespace
v4: use a macro for getting apis, shorten some lines, use outarray
v5: rewrite in C, use hash_table/mutex.
v6: use once_init to init the mutex, fix freeing ht
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1766 >
2020-04-27 19:57:49 +00:00
Eric Anholt
4a42a50585
freedreno/ir3: Add support for disasm of cat2 float32 immediates.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4736 >
2020-04-27 19:35:00 +00:00
Eric Anholt
292231596b
freedreno/ir3: Refactor out print_reg_src().
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4736 >
2020-04-27 19:35:00 +00:00
Eric Anholt
3bcf819b43
freedreno/ir3: Convert remaining disasm src prints to reginfo.
...
More lines of code, but they're much more intelligible.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4736 >
2020-04-27 19:35:00 +00:00
Eric Anholt
1462b00391
freedreno/ir3: Add a unit test for our disassembler.
...
Makes sure that we can maintain consistent output from our disassembly as
we refactor. I've only included stuff that matches qcom's disasm so far.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4736 >
2020-04-27 19:35:00 +00:00
Eric Anholt
90984ba853
freedreno/ir3: Print a space after nop counts, like qcom's disasm.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4736 >
2020-04-27 19:35:00 +00:00
Eric Anholt
916629f9d7
freedreno/ir3: Fix the disasm of half-float STG dests.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4736 >
2020-04-27 19:35:00 +00:00
Eric Anholt
b34ee185f4
freedreno: Fix derivatives without texturing on a3xx-a5xx.
...
The shader variant tells us if we should set the PIXLODENABLE flag.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4685 >
2020-04-27 19:06:57 +00:00
Jonathan Marek
065068c66a
freedreno/ir3: run nir_lower_pack
...
This lowers pack_32_2x16/unpack_32_2x16 into the scalar versions of those
instructions.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4738 >
2020-04-27 18:40:03 +00:00
Jonathan Marek
42093bb694
nir: add pack_32_2x16_split/unpack_32_2x16_split lowering
...
The new option replaces the two other _split lowering options, since
there's no need for separate options.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Rob Clark <robdclark@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4738 >
2020-04-27 18:40:03 +00:00
Bas Nieuwenhuizen
cbeda7f78e
radv: Add WSI buffers to BO list only if they can be used.
...
Also reverse the BO list removal loop. This way typical WSI usage
should find the entry in O(active swapchains) iterations, which
should not be a performance issues. Tested with Doom(2106) which
found the entry in 1 iteration every time.
Acked-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4306 >
2020-04-27 18:01:24 +00:00
Bas Nieuwenhuizen
9a61f2a8a9
vulkan/wsi: Add callback to set ownership of buffer.
...
For radv BO list pruning.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4306 >
2020-04-27 18:01:24 +00:00
Samuel Pitoiset
42b1696ef6
ac,radeonsi: fix compilations issues with LLVM 11
...
Latest LLVM replaced LLVMVectorTypeKind.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2826
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4755 >
2020-04-27 17:13:36 +00:00
Jan Zielinski
52aa730d07
gallium/gallivm: remove unused header include for newer LLVM
...
In the top of the trunk LLVM (11) llvm/IR/CallSite.h header
has been removed. The file compiles without this include also
for LLVM 8, but I'm not sure about 9, 10, and older versions
so I disable it only for the latest LLVM
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4748 >
2020-04-27 16:53:44 +00:00
Jan Zielinski
e2a7436dd1
gallium/gallivm: fix compilation issues with llvm 11
...
Top of the trunk LLVM removes old vector type
and introduces two new ones - one for fixed-width
and one for scalable vectors. This commit fixes
compilation issues by switching from LLVMVectorTypeKind
to LLVMFixedVectorTypeKind for new LLVM.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com >
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4748 >
2020-04-27 16:53:44 +00:00
Alyssa Rosenzweig
6943eda5c9
ir3: Use shared mediump output lowering
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Acked-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4716 >
2020-04-27 16:32:24 +00:00
Alyssa Rosenzweig
42c9bbaeed
nir: Move nir_lower_mediump_outputs from ir3
...
(Original code from ir3)
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Acked-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4716 >
2020-04-27 16:32:24 +00:00
Ian Romanick
ba8f7f3fa2
nir/algebraic: Detect some kinds of malformed variable names
...
I spent over an hour trying to debug a problem if a condition on a
variable not being applied. The problem turned out to be
"a(is_not_negative" instead of "a(is_not_negative)". This commit would
have detected that problem and failed to build.
v2: Just add $ to the end of the existing regex, and it will fail to
match a malformed string. Suggested by Jason.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com > [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4720 >
2020-04-27 09:08:34 -07:00
Alyssa Rosenzweig
fc4eb0714c
pan/bi: Implement 16-bit COMBINE lowering
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
280b65126e
pan/bi: Fix RA wrt 16-bit swizzles
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
64c33a459f
pan/bit: Add SELECT tests
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
23ffaa16c7
pan/bit: Interpret BI_SELECT
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
a5bfe59196
pan/bi: Force BI_SELECT arguments scalar
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
c12081dca1
pan/bi: Pack ADD SEL16
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
d31e4879f0
pan/bi: Pack FMA SEL8
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
7b31f04bac
pan/bi: Pack FMA SEL16
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
ee561f0e6b
pan/bi: Rename BI_SWIZZLE to BI_SELECT
...
The select version is more general.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
b2c6cf2b6d
pan/bi: Eliminate writemasks in the IR
...
Since the hardware doesn't support them, they're a burden to deal with,
so let's ensure we never get to a place where we would need to at all.
Disables COMBINE lowering for now.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
1622478fbd
pan/bi: Fix ADD.v4i8 opcode
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
de12311431
pan/bi: Add missing BI_VECTOR
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:26 +00:00
Alyssa Rosenzweig
667190d38a
pan/bi: Assign blend descriptor for BLEND op
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:25 +00:00
Alyssa Rosenzweig
1a8f1a324a
pan/bi: Passthrough blend types
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:25 +00:00
Alyssa Rosenzweig
5f953b8f50
pan/bi: Passthrough type for ATEST
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:25 +00:00
Alyssa Rosenzweig
462af10bb7
pan/bi: Pack fp16 ATEST
...
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766 >
2020-04-27 14:52:25 +00:00
Michel Dänzer
c50bbfa0ab
mesa: Skip 3-byte array formats in _mesa_array_format_flip_channels
...
Byte swapping makes no sense for 3-byte formats: Swapping the order of 2
or 4 bytes at a time would inevitably result in bytes getting mixed up
between neighbouring pixels.
Fixes crash with a debugging build on a big endian machine due hitting
the unreachable() at the end of the function.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2665
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4735 >
2020-04-27 14:14:00 +00:00
Marek Olšák
ad5da3e63e
mesa: replace GLenum target with gl_shader_stage in NewProgram
...
So that the GLSL compiler doesn't have to use the GLenum conversion
functions.
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4756 >
2020-04-27 12:49:53 +00:00
Bas Nieuwenhuizen
531728d6cb
drm-uapi,radv,radeonsi: Add amdgpu_drm.h header.
...
Use it instead of the libdrm provided amdgpu_drm.h header. I used
the kernel revision from the README to get the header so the
header versions should be consistent.
Tested by removing /usr/include/libdrm/amdgpu_drm.h from my dev-machine.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4749 >
2020-04-27 12:27:02 +00:00