Marek Olšák
b60dfa2c09
radeon: decrease the size of radeon_cmdbuf by switching prev fields to uint16
...
This also removes the 32-bit hole in radeon_cmdbuf.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8434 >
2021-02-02 05:42:32 +00:00
Marek Olšák
34114e1dcb
radeonsi: tune NGG shader culling vertex threshold for each chip
...
These are based on my testing and estimation.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8434 >
2021-02-02 05:42:32 +00:00
Marek Olšák
ffbf3a5f8b
radeonsi: simplify the NGG culling condition in si_draw_vbo
...
Changes:
- disallow NGG culling for GS, fast launch for tess using template args
(GS can't do NGG culling, tess can't do fast launch)
- skip checking current_rast_prim with tessellation
(bake the condition into ngg_cull_vert_threshold)
- use only 1 vertex count threshold for enabling NGG shader culling
to simplify it. I think it doesn't have a big impact. The threshold
computation depends on more parameters than just fast launch.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8434 >
2021-02-02 05:42:32 +00:00
Marek Olšák
7581743510
radeonsi: set current_rast_prim at bind time for tess and GS
...
It doesn't have to be done in draw_vbo.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8434 >
2021-02-02 05:42:32 +00:00
Mark Janes
2edfb27913
intel: combine common gather routines in INTEL_MEASURE
...
Anv and iris had separate, similar routines to gather intel_measure
timestamps. Timestamps are now managed within intel_measure, allowing
those routines to be consolidated.
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
d6fc72e286
intel: support secondary command buffers in INTEL_MEASURE
...
When a secondary command buffer is encountered, insert an event that
links to the new batch.
This commit leaves intel_measure timestamp buffer objects mmapped,
which is more efficient than mapping/unmapping several times. With
the BOs mapped at all times, timestamp buffers can be managed directly
by intel_measure, where it will iterate over timestamps of linked
secondary buffers.
With timestamp buffers managed by intel_measure, a more efficient and
accurate check for render completion can be moved into intel_measure
from anv/iris.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
9eacbfaf7b
intel: stop tracking submission state in INTEL_MEASURE
...
With secondary command buffers, it is inconvenient to track whether a
batch has been submitted and needs to be gathered. Instead, always
check for completed snapshots before destroying a command buffer.
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Kenneth Graunke
f7d4ebbf86
iris: add hooks to call INTEL_MEASURE
...
These hooks were written in the initial IRIS_MEASURE implementation.
Minor changes by Mark Janes <markjanes@swizzler.org > to adapt to the
INTEL_MEASURE reimplementation.
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
b338bb70e0
iris: add a iris_context reference to iris_batch
...
This eliminates the need to use container_of in error handling code.
INTEL_MEASURE will need to access the iris context from each batch.
suggested-by: Kenneth Graunke <kenneth@whitecape.org >
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
e67b8f504b
iris: implement iris layer of INTEL_MEASURE
...
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
cec1a9bbb9
anv: add hooks to call INTEL_MEASURE
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
0b6209b908
blorp: add hook for INTEL_MEASURE
...
Saves the snapshot type within the blorp parameters.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
4a2d9e44ff
anv: implement anv layer of INTEL_MEASURE
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
c5f3eb1961
anv: enable timestamp for INTEL_MEASURE
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Mark Janes
0f4143ec37
intel: Print GPU timing data based on INTEL_MEASURE
...
This infrastructure collects GPU timestamps over common intervals, and
generates a CSV report to show how long rendering took. The overhead
of collection is limited to the flushing that is required at the
interval boundaries for accurate timestamps.
By default, timing data is sent to stderr. To direct output to a
file:
INTEL_MEASURE=file=/tmp/measure.csv {workload}
To begin capturing timestamps at a particular frame:
INTEL_MEASURE=file=/tmp/measure.csv,start=15 {workload}
To capture only 23 frames:
INTEL_MEASURE=count=23 {workload}
To capture frames 15-37, stopping before frame 38:
INTEL_MEASURE=start=15,count=23 {workload}
Designate an asynchronous control file with:
INTEL_MEASURE=control=path/to/control.fifo {workload}
As the workload runs, enable capture for 5 frames with:
$ echo 5 > path/to/control.fifo
Enable unbounded capture:
$ echo -1 > path/to/control.fifo
and disable with:
$ echo 0 > path/to/control.fifo
Select the boundaries of each snapshot with:
INTEL_MEASURE=draw : DEFAULT - Collects timings for every render
INTEL_MEASURE=rt : Collects timings when the render target changes
INTEL_MEASURE=batch : Collects timings when batches are submitted
INTEL_MEASURE=frame : Collects timings at frame boundaries
With INTEL_MEASURE=interval=5, the duration of 5 events will be
combined into a single record in the output. When possible, a single
start and end event will be submitted to the GPU to minimize
stalling. Combined events will not span batches, except in
the case of INTEL_MEASURE=frame.
Acked-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354 >
2021-02-01 17:24:57 -08:00
Bas Nieuwenhuizen
f9960579c3
radv: Enable modifiers with the WSI.
...
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Bas Nieuwenhuizen
58e5232625
radv: Enable DRM format modifiers on GFX9+.
...
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Bas Nieuwenhuizen
7f7da82dbb
radv: Add image layout with drm format modifiers.
...
Half of it is passing the right modifier to ac_surface, the other half
is applying the offset/strides.
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Bas Nieuwenhuizen
1fbb6ff563
radv: Add drm format modifier queries.
...
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Bas Nieuwenhuizen
6c83e3ea98
radv: Add format modifier format queries.
...
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Bas Nieuwenhuizen
4dbbd59a01
radv: Don't relayout images with modifiers.
...
The modifier should have been the exact layout of the image. Hence
we should not relayout the image according to the implicit modifier
on memory import (i.e. VkMemory allocation).
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Bas Nieuwenhuizen
f543f09e2a
radv: Use the surface offset from ac_surface instead of a plane offset.
...
In preparation for doing this with modifiers in general.
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Bas Nieuwenhuizen
bd816bddf2
radv: Extract DCC format support handling.
...
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Bas Nieuwenhuizen
21f476920e
amd/common: Add modifier size helper.
...
For use in Vulkan.
Reviewed-By: Chad Versace <chad@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667 >
2021-02-02 00:43:56 +00:00
Yevhenii Kolesnikov
a678ec9b8c
nir/from_ssa: don't check for interference within the same set
...
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8246 >
2021-02-01 14:28:35 -06:00
Yevhenii Kolesnikov
fd05620e43
nir/from_ssa: consider defs in sibling blocks
...
If def a and def b are in sibling blocks, the one with higher
parent_instr's index does not necessarily come after the other.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3712
Fixes: 943ddb9458 "nir: Add a better out-of-SSA pass"
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8246 >
2021-02-01 14:27:56 -06:00
Dylan Baker
abdaf5fab8
Scons: check for timespec_get on windows as well as unices
...
windows has a timespec_get function, and if we don't check that then it
will try to fall back to using clock_gettime, which windows doesn't
have.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8592 >
2021-02-01 19:40:20 +00:00
Jason Ekstrand
f2545f22f4
vulkan: Drop the type_prefix parameter from gen_extensions
...
Now that all the drivers are converted, it's set to 'vk' by everyone so
there's no point in having the parameter.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Jason Ekstrand
bafd0c680d
vulkan: Rework vk_device_init and friends
...
Now that all drivers are converted over, we can make a few changes.
First off, vk_device_init no longer takes two separate allocators
because we can assume that the parent instance is non-null and it can
pull the instance allocator from that. Second, dispatch tables and the
instance extension table are no longer optional. We leave the device
extension table optional for now because we don't do any verification at
vk_init_physical_device time and some drivers find it more convenient to
set the extensions later in their own physical_device_init for various
reasons.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Jason Ekstrand
3a7514ea09
anv,radv: Use common entrypoints for VK_KHR_deferred_operation
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Jason Ekstrand
23ba48a0c7
vulkan: Make the debug_report implementation internal
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Jason Ekstrand
41318a5819
vulkan: Use vk_object_base::type for debug_report
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Jason Ekstrand
c41eaf0add
anv: Use vk_object_base::type for debug_report
...
This is way better than the giant macro thing we had before.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Jason Ekstrand
bd1705a480
vulkan: Make vk_debug_report_callback derive from vk_object_base
...
Fixes: 51c6bc13ce "anv,vulkan: Implement VK_EXT_private_data"
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Jason Ekstrand
19d7cf0457
radv: Switch to the common VK_EXT_debug_report
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Jason Ekstrand
3f2341767b
radv: Use common entrypoints for VK_EXT_private_data
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Dave Airlie
23f8ca0c9d
radv: port to using common dispatch code.
...
I think this has the SQTT layer hooked in correctly, would
be good if somebody could confirm this.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Dave Airlie
7d16621281
radv: move to subclassed instance/physical_device structs
...
This moves to using the common base structs for these
two objects, this is prep work for the using the common
dispatch layer code.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:25 +00:00
Dave Airlie
abbca2fa92
radv: remove all entrypoint enabled debug option
...
This was useful back at the dawn of time when apps weren't as
well developed and layers mostly sucked. I don't think it's been
used in a quite a while so remove it, as the new dispatch
layer doesn't support it.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Dave Airlie
f695957421
radv: move queue object to a common base object
...
This is needed to use the new dispatch layer code. While we're here, we
clean up the context on the error path.
Fixes: 9b1138e3f0 "radv: implement VK_EXT_private_data"
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Jason Ekstrand
7fe36c1187
v3dv: Switch to the common VK_EXT_debug_report
...
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Jason Ekstrand
9933b188d2
v3dv: Use common entrypoints for VK_EXT_private_data
...
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Alejandro Piñeiro
21f9a88673
v3dv: port to using common dispatch code.
...
This moves v3dv over to using the new common dispatch layer code.
v2 (Jason Ekstrand):
- Remove some now dead function declarations
Acked-by: Iago Toral Quiroga <itoral@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Alejandro Piñeiro
3e2bbf5d50
v3dv: remove reference to v3dv_instance on v3dv_physical_device
...
As we already have a reference to vk_instance at vk_physical_device,
that we are setting when calling vk_physical_device_init.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Jason Ekstrand
bde7e1c313
v3dv: Drop v3dv_instance::app_info
...
There's an equivalent data structure in vk_instance.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Alejandro Piñeiro
9c0079e0ee
v3dv: move to subclassing instance/physical device
...
This moves to using the common base structs for these two objects, but
doesn't use any of the new features yet.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Jason Ekstrand
249652fc1e
lavapipe: Drop some wrappers in favor of common code
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Jason Ekstrand
394708b3cb
turnip: Switch to the common VK_EXT_debug_report
...
Acked-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Jason Ekstrand
3a8060271c
turnip: Drop some legacy wrappers in favor of common code
...
Acked-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00
Jason Ekstrand
0870cf4c06
turnip: Use common entrypoints for VK_EXT_private_data
...
Acked-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676 >
2021-02-01 18:54:24 +00:00