Commit Graph

127362 Commits

Author SHA1 Message Date
Mike Blumenkrantz 6196f2aa93 zink: always compile shaders in pipeline order
in order to accurately perform slot/location mapping that's consistent across
stages, we need to go through the stages in order so that we can pass each successive
slot map allocation along to the next compiled stage

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5970>
2020-08-07 12:36:59 +00:00
Mike Blumenkrantz c312299316 zink: start using per-stage flags for new shaders, refcount shader modules
we don't want to recompile shaders if we don't have to, so we can set bitflags
upon receiving new shader states and then compile only the stages that have
changed while refcounting the unchanged stages

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5970>
2020-08-07 12:36:59 +00:00
Mike Blumenkrantz 76d3645dd2 zink: use ZINK_SHADER_COUNT instead of PIPE_SHADER_TYPES - 1 everywhere
this is just for convenience and consistency

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5970>
2020-08-07 12:36:59 +00:00
Mike Blumenkrantz 0f059d550b zink: split up creating zink_shader objects and VkShaderModule objects
the actual VkShaderModule is only needed when we're creating a program to
draw with, so this can be split off for "uncompiled" and "compiled" shader
objects which will facilitate implementing shader keys

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5970>
2020-08-07 12:36:59 +00:00
Mike Blumenkrantz a03d17ede7 zink: refcount zink_gfx_program objects
now that we're tracking these by shader, we want to ensure that they live through
each render pass successfully if there's no flush regardless of the timing when the
shader objects are destroyed. this becomes useful when we split up shader create and compile
functionality in future patches, at which point program refcounts can be changed
during successive draw calls, potentially resulting in a program being destroyed at that
point when it shouldn't be

with this patch, each shader used by the program gets a reference, with the renderpass
batch itself becoming the owner of the program such that it will be deleted
when the draw state gets invalidated and a new program is created

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5970>
2020-08-07 12:36:58 +00:00
Mike Blumenkrantz 8772c693c5 zink: adjust zink_shader struct to contain full streamout info
move remapped register_index -> slot into a separate value on the struct
in order to preserve the register_index value

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5970>
2020-08-07 12:36:58 +00:00
Mike Blumenkrantz e481d3e2ed zink: move shader state methods for pipe_context into zink_program.c
just moving these so all the shader code can be in one place

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5970>
2020-08-07 12:36:58 +00:00
Lionel Landwerlin d83be29a53 intel/dump_gpu: add an option to capture a single frame
We use the driver identifier buffer to get the information about the
current frame.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
2020-08-07 11:27:54 +00:00
Lionel Landwerlin a6a5b0e52e intel/dump_gpu: fix --platform option
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
2020-08-07 11:27:54 +00:00
Lionel Landwerlin 9f0db069d3 anv: track the current frame and write it into the driver identifier BO
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
2020-08-07 11:27:54 +00:00
Lionel Landwerlin 42cb068d9f intel/dump_gpu: only map in GTT buffers not previously mapped
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
2020-08-07 11:27:54 +00:00
Lionel Landwerlin 22b512ea5b intel/dump_gpu: add an only-capture option
This option allows for smaller aub files to be generated by only
storing the BOs flagged with EXEC_OBJECT_CAPTURE.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
2020-08-07 11:27:54 +00:00
Lionel Landwerlin f0e13827aa intel/dump_gpu: set default device_override
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
2020-08-07 11:27:54 +00:00
Lionel Landwerlin c4bfa6dfbb intel/dump_gpu: further track mapping of BOs
We can go further in tracking what BOs are written to by the driver by
tracking when a buffer in unmapped. A BO could be mmap, written, unmap
and never be written to again. In such case we can just write the BO's
content on the first exec buf after unmap and never write it again.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
2020-08-07 11:27:54 +00:00
Lionel Landwerlin 63c90acc9e intel/dump_gpu: only write BOs mapped by the driver
Track what BOs are mapped by the driver and only write those. We can
safely assume that when not mapped there is no data to save.

v2: Don't forget to return the ret (Rafael)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
2020-08-07 11:27:54 +00:00
Mike Blumenkrantz 54c68498d4 zink: set primitive restart cap
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5912>
2020-08-07 11:17:04 +00:00
Mike Blumenkrantz 5959178381 zink: use util_draw_vbo_without_prim_restart for unsupported prim modes
this fixes up primitive restart functionality for the primitive types that
vulkan doesn't support using primitive restart with

fixes #2873

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5912>
2020-08-07 11:17:04 +00:00
Mike Blumenkrantz f4583b4086 zink: move 8bit index handling out of u_primconvert path
putting this through util_translate_prim_restart_ib reduces our reliance on
u_primconvert, which ideally we don't want to be using

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5912>
2020-08-07 11:17:04 +00:00
Mike Blumenkrantz 5edaf081cd zink: basic primitive restart support for strip/fan topologies
this conditionally handles rewriting the index buffer to use vk-compatible
restart indexes and then enables it in the pipeline for supported draw
modes

fixes #3174

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5912>
2020-08-07 11:17:04 +00:00
Bas Nieuwenhuizen 8531830038 radv: Add ETC2 support on RAVEN2.
I did a whole bunch of validation and it essentially works.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6215>
2020-08-07 10:54:58 +00:00
Samuel Pitoiset bea8930468 radv: allow to force-enable LLVM internally for a specific shader stage
For ACO debugging purposes, developers only.

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/6208>
2020-08-07 07:45:06 +00:00
Christian Gmeiner e63a7882a0 etnaviv: call nir_lower_bool_to_bitsize
Starting with commit 6f394343b1 ("nir/algebraic: i2f(f2i()) -> trunc()")
dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_vertex
ends with an unsuppored flt instruction. Use nir_lower_bool_to_bitsize to
convert this flt to a flt32 which is supported. This fixes the introduced
regression.

Cc: 20.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6182>
2020-08-07 03:25:36 +00:00
Alyssa Rosenzweig c5b2319628 panfrost: Drop compiler cmdstream deps
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 1d0b3ef051 panfrost: Treat texture dimension as first-class
Instead of hiding behind a cmdstream enum. The raw values have a very
simple interpretation as dimension.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 5a3088e85f panfrost: Inline max rt into compilers
Another dep.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 54f96544ec pan/bi: Drop use of MALI_POSITIVE
Contributing to a dep on the main cmdstream. It's a fancy word for
subtract one...

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig c94013c819 panfrost: Add panloader/ to .gitignore
For out-of-tree trace infrastructure.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 52e3a67bb1 panfrost: Reduce bit dependency to disassembly only
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 14bb72c68b pan/bi: Separate disasm/compiler targets
Likewise.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig b792d613e6 pan/mdg: Separate disassembler and compiler targets
The compiler depends on the disassembler, which is okay. But the
disassembler now no longer depends on the compiler circularly, avoiding
the need to being in GLSL/NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig d62a6e7c5f panfrost: Move pandecode into lib/
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 1c62b5528a panfrost: Rename encoder/ to lib/
We'll want both encoding and decoding here, as a generic hardware
interface library based on GenXML.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 956b09653c panfrost: Don't export exception_status
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 4ddc6e543c panfrost: Remove panfrost-misc.h
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 64f3c9da87 panfrost: Inline panfrost-misc.h into panfrost-job.h
We only need a small subset of the defines here.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig ebf7e87f2c pan/decode: Remove shader replacement artefact
Did this ever work?

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig e4df95bf9f panfrost: Move format stringify to decode.c
Let's simplify pandecode before moving it around. We don't need to share
this routine right now, and we'll be generating it soon.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig b80e753940 panfrost: Remove blend prettyprinters
Unused and mostly wrong too.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Lionel Landwerlin b43bcb05a1 anv: fix incorrect realloc failure handling
We don't want to leak in case of failure.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Ivan Briano <ivan.briano@intel.com>
Fixes: 246261f0ad ("anv: prepare the driver for delayed submissions")
Fixes: 34f32a6d66 ("anv: implement VK_KHR_timeline_semaphore")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6200>
2020-08-06 23:07:56 +00:00
Rhys Perry 21b47cbd99 aco: fix C++11/C++14 compilation
static_assert without a message is only available since C++17.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: d1f992f3c2 ('aco: rework barriers and replace can_reorder')
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3374
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6216>
2020-08-06 23:51:14 +01:00
Danylo Piliaiev 782ba8d3ae st/mesa: Treat vertex outputs absent in outputMapping as zero in mesa_to_tgsi
After updating vertex outputs being written based on optimized NIR, they may
go out of sync with outputs in mesa IR. Which is translated to TGSI and used
together with NIR if draw doesn't have llvm.

It's much easier to treat such outputs as zero because there is no pass to
entirely get rid of them.

Similar to eeab9c93db but now for outputs.

Fixes: d684fb37bf
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3365
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6187>
2020-08-06 16:53:50 +00:00
Dylan Baker a92cfa66b4 Bump development version and clear new_features
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
2020-08-06 09:34:42 -07:00
Jason Ekstrand 7f06d194fd anv: Advertise shaderIntegerFunctions2
We advertised the extension string but never the feature bit.  Doh!

Fixes: c57338b924 "anv: Enable SPV_INTEL_shader_integer_functions2..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6033>
2020-08-06 16:14:16 +00:00
Icenowy Zheng 9e397956b0 panfrost: signal syncobj if nothing is going to be flushed
When nothing is going to be flushed, the kernel will get no job that
signals the syncobj.

Signal it by ourselves, otherwise it will never get signaled.

Closes: #3371

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6190>
2020-08-06 13:16:25 +00:00
Bas Nieuwenhuizen c6aadbae71 radv: Don't use both DCC and CMASK for single sample images.
Fixes: c67ef7695a "radv: Use ac_surface to allocate aux surfaces."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6194>
2020-08-06 10:50:22 +00:00
Jose Fonseca e2c614a415 appveyor: Use Python3.
This implied upgrading to the Visual Studio 2019 image, not for VS
itself, but for the newer Python 3.8.5 version it contains, to avoid
UnicodeDecodeError inside modulefinder module when attempting to decode
our UTF-8 encoded Python scripts with cp1252 encoding.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6184>
2020-08-06 09:46:48 +00:00
Jose Fonseca 0f9fb7ffaa appveyor: Upgrade pip.
To avoid all those warnings.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6184>
2020-08-06 09:46:48 +00:00
Vinson Lee 2e665458a9 util: Fix SCons build.
Fixes: 848e7b947d ("util: Move stack debug functions to src/util")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6199>
2020-08-05 22:55:06 -07:00
Eric Anholt 56ab105182 freedreno: Add more asserts for DST_OFF/NUM_UNIT in indirect const uploads.
These are just empirical alignment numbers from looking at dEQP traces of
the blob driver (a330, a418, a540, a618, a630), with one exception noted
in the comments.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5990>
2020-08-05 23:06:55 +00:00
Eric Anholt 3e970de360 freedreno: Increase the NUM_UNIT on compute's consts in indirect dispatch.
Avoids tripping the assert in the next commit -- the blob never uses
num_unit % 4 != 0 for indirect const uploads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5990>
2020-08-05 23:06:55 +00:00