Commit Graph

136803 Commits

Author SHA1 Message Date
Lionel Landwerlin 8e36f7da85 anv: move L3 initialization to device init on Gen11+
On Gen11+ we tend to only use a single configuration, so just get rid
of the stalls in the command buffers by moving the config to device
initialization.

v2: drop NULL config check

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9534>
2021-03-12 20:49:01 +00:00
Lionel Landwerlin 581e68bc99 anv: move L3 config emission to genX_state.c
We're about to reuse this at device initialization.

v2: Handle NULL configs on Gen12+

v3: Handle NULL config in emission helper (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9534>
2021-03-12 20:49:01 +00:00
Danylo Piliaiev 914e7a7f73 turnip: set zmode to A6XX_EARLY_Z if FS forces early fragment test
Specifying "early_fragment_tests" in fragment shader takes precedence
over our internal conditions.

Fixes test:
 dEQP-VK.fragment_operations.early_fragment.early_fragment_tests_stencil

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9569>
2021-03-12 20:11:28 +00:00
Lionel Landwerlin 1d658c8598 intel/dev: switch over to mesa log infrastructure
v2: Deal with line wrapping (Jordan)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9052>
2021-03-12 18:54:07 +00:00
Lionel Landwerlin cef063826e anv: stop using get_param for things queried by gen_device_info
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9052>
2021-03-12 18:54:07 +00:00
Lionel Landwerlin 5f057f6e91 i965: stop using get_param for things queried by gen_device_info
All this code exists in gen_device_info. It will print out the same
warning.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9052>
2021-03-12 18:54:07 +00:00
Lionel Landwerlin f08f8eaa48 iris: use gen_device_info helper to get subslice total
gen_device_info will try to use the most recent uAPI to get this
number and will fallback to this get_param. So just use what was
queries by gen_device_info_from_fd().

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9052>
2021-03-12 18:54:07 +00:00
Lionel Landwerlin fa17bbe00c intel/dev: add warning on missing kernel uAPI for Gen8+
We carry those warnings in i965/anv. Let's have them here. Next commit
we remove some code from the drivers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9052>
2021-03-12 18:54:07 +00:00
Lionel Landwerlin 196d0aa110 intel/dev: add helpers to compute subslice/eu total
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9052>
2021-03-12 18:54:07 +00:00
Mike Blumenkrantz 45e6fcef4b zink: remove debug printf
accidentally left this in while bisecting

Fixes: 929a748401 ("zink: avoid hashing states without descriptors")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9564>
2021-03-12 17:45:44 +00:00
Michel Zou 862671369d vulkan: fix CreateRenderPass prototype
Fixes compilation on win32

Fixes: 2523c477 " turnip: Move the CreateRenderPass wrapper..."
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9530>
2021-03-12 17:37:38 +00:00
Mike Blumenkrantz bf0c5988b2 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9540>
2021-03-12 17:21:40 +00:00
Mike Blumenkrantz 980a8b3fc0 zink: implement an extremely dumb resource memory cache
this stores a number (currently 5) of backing allocations for resources
for later reuse when creating matching resources

because this is on the screen object it requires locking, but this is still
far faster than allocating new memory each time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9540>
2021-03-12 17:21:40 +00:00
Axel Davy 6205400612 st/nine: Fix compilation issue in nine_debug
Some compilers complain of the implicit conversion.
Make it explicit.

Reported by:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6121
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9250

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9563>
2021-03-12 17:12:58 +00:00
Mike Blumenkrantz 378bb07110 zink: optimize pipeline hashing
we can reorder the pipeline state and avoid hashing the big arrays based
on context states that we already have available to us

also we can do incremental hashes for the shader modules to further reduce
hashing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9539>
2021-03-12 17:02:20 +00:00
Mike Blumenkrantz da08d67364 zink: move vertex_buffers_enabled_mask to non-hashed part of pipeline state
we can use this to optimize pipeline hashing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9539>
2021-03-12 17:02:20 +00:00
Samuel Pitoiset 1aabfc77d3 radv: fix initialization of disable_compression when clearing color image
Just make sure it's initialized properly.

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/9473>
2021-03-12 16:39:21 +00:00
Mike Blumenkrantz 0f7d32073d zink: ci updates
some flakes here that will be resolved in the very near future

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz a5984bdf78 zink: fix arrays of texel buffer descriptors
these need to pass a constructed array of buffers, not a single buffer per
descriptor

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 929a748401 zink: avoid hashing states without descriptors
this is unnecessary hashing which decreases the accuracy of the states

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 72a06746bf zink: remove image layouts from descriptor states
these are always the same value, so there's no need to track them

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 5700cbfa1a zink: always use VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL for sampler bindings
if a resource is used multiple times with different samplers then this can result
in conflicting layouts, so it's better to just use the general case here

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz e4421c4b82 zink: don't create descriptor barrier hash tables for cached descriptor set
this won't be used, so there's no point in allocating it

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 38e6e44262 zink: remove struct zink_descriptor_resource from descriptor updating
this can be inferred from a resource's barrier usage, and then by merging
the batch-tracking for resources into the barrier loop, this deduplicates
calls for resources which are bound for multiple stages as well as removing
another iteration during descriptor updating

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 4a3b344b23 zink: directly use resource count from pool instead of accumulating every time
this is a surprisingly impactful speedup

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 201cd1a8c0 zink: track resource count on descriptor pool object
we can do this once here instead of accumulating the count all over later

also remove the debug value on the set which duplicated this

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz d9793a8a60 zink: reuse descriptor barriers across draws
if we aren't invalidating the descriptor set then we can safely reuse its
barriers to avoid doing any sort of hashing during descriptor updating

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz c55e2fb59c zink: move descriptor binding out of the update codepath
we won't always need to update sets that we bind

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz dc020db723 zink: pre-size descriptor transition hash table
this avoids costly rehashing

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 80d9f3aa34 zink: simplify check for knowing whether descriptor updating is needed
if a program has at least one pool object set then it will have descriptors

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz fe31566fbb zink: remove intermediate func for descriptor set getting
we can simplify this a bit by just getting the objects in the function

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 141ff0e091 zink: allow reuse of zink_descriptor_pools between programs
now that we've split these into their own objects, we can reuse them across
programs with matching binding layouts for a given type, giving even more value to
the descriptor set cache by increasing reuse

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz ee40550b87 zink: move descriptor type to pool object from set
this is a little less memory usage

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 58500979a8 zink: track number of sets currently allocated per descriptor pool
if we're going to be sharing pools across programs, it's no longer sufficient
to check the hash populations, so we need a separate counter to know when we have
to flush

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 871022dc84 zink: change program pointer on struct zink_descriptor_set to pool pointer
the program using the set isn't very relevant now that there's the intermediate
pool struct which stores the sets

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 817de3c776 zink: break out all the descriptor pool/layout stuff into a new struct
by pushing these into a separate struct, we can eventually reuse them between
programs to make the descriptor set caches even more valuable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 3d4e6c641b zink: break out descriptor stuff into new files
this is getting to be enough code that it's getting to be a hassle to
keep with the program stuff

also rename a couple of the moved functions

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz eee488abad zink: deduplicate VkWriteDescriptorSet setup
no functional changes

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz ce0524f009 zink: break out image descriptor updating
all the descriptor updates are now broken out, so update_descriptors is now just
a dispatch for calling the other update functions

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz eb375dc939 zink: break out sampler descriptor updating
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz e94c2d84b3 zink: break out ssbo descriptor updating
by the power of grayskull, this is now readable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz e4076d557f zink: split out ubo descriptor updating
now that we're doing incremental updates, we can refactor this to be much
more readable by having separate functions for each type of descriptor update

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 2c83ea13d2 zink: add VkPipelineLayout to zink_program meta struct
this lets us simplify a little more code

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 0248e6b969 zink: don't double iterate all the per-batch sets on reset
we're already iterating once here, so we can definitely skip iterating again
and just do the removals inlined

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 74a0badb91 zink: add flag for recycled descriptor sets
this lets us skip a hash lookup in the last_set fastpath

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 3f561bbc83 zink: improve descriptor cache invalidation
we can pass the offset of the 'invalid' flag directly to the resources
to let them run through and invalidate their sets in time for us to detect
it when we recycle the set during batch reset and throw it onto our allocation array

additionally, by adding refs for the actual objects used in a descriptor set, we can
ensure that our cache is as accurate as possible

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 1a9f3ba2d7 zink: only batch-reference the program in use once per descriptor update
now that we're guaranteed to know what our batch is earlier, we can move this
referencing around to reduce the number of hash lookups we'll perform here

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 9df3147264 zink: move descriptor set allocation near the top of update_descriptors
no functional changes, but it moves the only point in the function where a
flush can occur out of the way which lets us get the batch we'll be using
immediately

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz 514b5ced97 zink: add program pointer to desc set struct
we generally want to avoid this, but it lets us skip a lot of hash lookups,
which is a performance hit

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00
Mike Blumenkrantz b4105e8ac0 zink: actually flag all used resources as used during update_descriptors
num descriptors != num bound resources, so this needs to be a separate count/index

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
2021-03-12 16:32:53 +00:00