Commit Graph

146710 Commits

Author SHA1 Message Date
Jason Ekstrand 4108fda426 vulkan: Move all the common object code to runtime/
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand 4af0c038cf vulkan: Move trampoline code-gen to its own file
This way we sepaprate the raw tables from the code that actively depends
on vk_device and friends.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand d53f20ff4d vulkan: Break entrypoint parsing into its own file
Instead of having a bunch of stuff depend on vk_dispatch_table_gen to
get the list of entrypoints, pull that into its own vk_entrypoints file.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand 8f9e0c2816 vulkan/dispatch_table: EntrypointBase doesn't need to derive from object
We use python3 now and everything derives from object automatically

Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand 3fd7cc9d42 vulkan: Drop unnecessary [en]coding comments from python generators
Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand a208b849f3 vulkan: Rework mako error handling in python generators
Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand 006633c043 lavapipe: Use vk_instance_get_proc_addr_unchecked for WSI
It exists precisely to handle this case without the driver looking up
trampolines itself.  This is nearly identical to what ANV does.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand 5ccba1576d v3dv: Use vk_instance_get_proc_addr_unchecked for WSI
It exists precisely to handle this case without the driver looking up
trampolines itself.  This is nearly identical to what ANV does.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand 837a142f2d vulkan/vk_extensions_gen: Stop including vk_object.h
All we need from it is vulkan_common.h for VkExtensionProperties.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand 741262ee01 vulkan/vk_extensions_gen: Drop support for extra includes
No one is using this anymore.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Vinson Lee 20620af1e4 clover: Add constructor for image_rd_argument.
Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize st.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13500>
2021-10-29 22:57:46 +00:00
Mike Blumenkrantz e8f18385e0 zink: inject LOD for sampler version of OpImageQuerySize
this is required by spec

cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13585>
2021-10-29 19:05:07 +00:00
Mike Blumenkrantz 87fbb0eab0 zink: be more permissive for injecting LOD into texture() instructions
there's other variants of implicit lod sampling, and none of them are valid
outside fragment stage

Fixes: 3ad06b6949 ("zink: always use explicit lod for texture() when legal in non-fragment stages")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13585>
2021-10-29 19:05:07 +00:00
Connor Abbott 8d0b508d91 ir3: Emit barriers for images again
This was accidentally broken with the nir_var_image work.

Fixes: e87dbfd3 ("ir3: Check for nir_var_mem_image in shared_barrier handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13593>
2021-10-29 16:33:04 +00:00
Marek Olšák 8bfa146b80 radeonsi: print the border color error message only once
Cc: 21.2 21.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13590>
2021-10-29 12:33:55 +00:00
Marek Olšák a4e0b02f85 mesa: skip strlen when hashing strings for ProgramResourceHash
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:20 -04:00
Marek Olšák 7fe3cc94eb mesa: add separate hash tables for each GLSL resource type
This removes the malloc for the key, the associated string pointer
indirection, and hopefully the hash table has fewer elements than
the global one.

This decrease overhead of glGetUniformLocation.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:20 -04:00
Marek Olšák 1b1425d45c mesa: handle hash collisions in program resource lookups (e.g. uniforms)
We computed the hash of the name and used it as a key, and then the table
computed the hash of the hash.

Do it properly: Pass the name as a string into the hash table and let
the table handle everything.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:20 -04:00
Marek Olšák aad903c3f5 mesa: preparse [ and [0] in gl_resource_name and use it in shader_query.cpp
strrchr is very expensive here.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:20 -04:00
Marek Olšák 4b67055fef mesa: rename locals in _mesa_program_resource_find_name for clarity
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:20 -04:00
Marek Olšák 22d51f3c92 mesa: precompute strlen in gl_resource_name::length and use it
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:20 -04:00
Marek Olšák 81ad6a8b64 mesa: don't compute the same strlen up to 3x in _mesa_program_resource_find_name
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:20 -04:00
Marek Olšák dea558cbd2 glsl: add gl_resource_name to precompute "name" properties later
This just adds the structure with a name and its update function.
strlen and others will be added in the following commits. The idea is to
parse and analyze the name in advance to make glGetUniformLocation faster.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:18 -04:00
Marek Olšák c216f1931d mesa: use alloca in search_resource_hash
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 05:09:55 -04:00
Samuel Pitoiset 1776d741c5 zink: add CI lists and deqp-suite configuration for RADV
This is used by our local CI (ie. vk-cts-image) which is a separate
project outside of Mesa. We use it for testing RADV since a while.

The CI lists have been created against Navi2x (Sienna Cichlid).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13573>
2021-10-29 08:28:02 +00:00
Marek Olšák 76892c4e46 vbo: restructure vbo_save_vertex_list to get more cache hits
- Move more stuff into the cold structure.
- Reorder fields for better packing.
- Flatten the gallium and merged nested structures.

Since we have tens of thousands of these, decreasing the size improves
performance by 13%.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13506>
2021-10-29 07:33:50 +00:00
Marek Olšák 3835205a0e vbo: use int16_t for vbo_save_vertex_list::gallium::private_refcount
We never use more than 16 bits.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13506>
2021-10-29 07:33:50 +00:00
Marek Olšák 97caca6b47 vbo: return a GL error earlier in vbo_save_playback_vertex_list_gallium
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13506>
2021-10-29 07:33:50 +00:00
Marek Olšák fa2c39df0f mesa: remove PADDING_64BIT by adding the dlist header into vbo_save_vertex_list
Now we can put useful data where the padding was.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13506>
2021-10-29 07:33:50 +00:00
Marek Olšák 05605d7f53 mesa: remove display list OPCODE_NOP
This decreases overhead because there are fewer nodes to parse.

There are 2 changes done here:
- If the next node offset is (offset % 8) == 4, pad the last node instead
  of inserting NOP. This makes sure that the node offset is aligned.
- The vertex list node will add 4 bytes to the header to make the payload
  aligned, so the payload will be at &n[2].

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13506>
2021-10-29 07:33:50 +00:00
Marek Olšák 4a26f57103 mesa: fix locking when destroying/overwriting/adding display lists
We need to hold the lock when calling destroy_list and doing
_mesa_HashInsertLocked in EndList.

So move the locking out of destroy_list.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13506>
2021-10-29 07:33:50 +00:00
Marek Olšák c494cfb1dd radeonsi: don't invoke si_decompress_depth if textures are not dirty at binding
This eliminates the overhead of invoking si_decompress_depth.

The complication here is that we need to update needs_depth_decompress_mask
every time we update dirty_level_mask.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13492>
2021-10-29 07:14:33 +00:00
Marek Olšák 0e54ac7a3c winsys/amdgpu: optimize looping inefficiencies in add_bo_fence_dependencies
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:22 +00:00
Marek Olšák c4ba003e2f winsys/amdgpu: move BO fence array updates to the CS thread
We always wait for num_active_ioctls == 0 before we use the fence,
so we can just add fences to BOs in the CS thread.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:22 +00:00
Marek Olšák 67de09acbd winsys/amdgpu: don't use ip_instance and ring fields of fence and IB structures
They are always 0.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:22 +00:00
Marek Olšák f6d072b2f0 winsys/amdgpu: increase the BO hash list size
This decreases overhead inside amdgpu_cs_add_buffer by 40%
for viewperf2020/catia.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:22 +00:00
Marek Olšák a5118bc97d winsys/amdgpu: don't clear RADEON_USAGE_SYNCHRONIZED for last_added_bo_usage
It was breaking the early return path.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:22 +00:00
Marek Olšák 107bc76882 winsys/amdgpu: remove an amdgpu_cs dereference from amdgpu_cs_add_buffer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:21 +00:00
Marek Olšák 8bb0c09f9e winsys/amdgpu: simplify parameter passing and derefs in cs_add_buffer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:21 +00:00
Marek Olšák 61bd8ec043 gallium/radeon: merge BO read/write usage flags with priority flags
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:21 +00:00
Marek Olšák 90ff5ef5c0 gallium/radeon: remove unused RADEON_DEPENDENCY_START_FENCE
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:21 +00:00
Marek Olšák b5cf0d118c gallium/radeon: remove/merge some BO priorities and remove holes
The upper bits will be used by RADEON_USAGE_*

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:21 +00:00
Marek Olšák f815009036 gallium/radeon: change the BO priority definitions to bits
This is for the next microoptimization.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13478>
2021-10-29 06:54:21 +00:00
Marek Olšák a0f05a5b20 radeonsi: remove unused parameters in si_emit_draw_packets
This is a leftover from GS fast launch and compute-based culling.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13539>
2021-10-29 06:33:29 +00:00
Marek Olšák 98f696c972 radeonsi: enable shader culling for indirect draws
It was mistakenly disabled, decreasing performance a lot.

Only valid for Mesa 21.3.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Cc: 21.3 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13539>
2021-10-29 06:33:29 +00:00
Greg V 98dbd01a96 util: make util_get_process_exec_path work on FreeBSD w/o procfs
sysctl is the correct way of getting the current executable's path.
procfs is not mounted by default.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598>
2021-10-29 06:06:05 +00:00
Greg V 1d9eda1b57 util: __getProgramName: remove check for ancient FreeBSD versions, simplify ifdefs
FreeBSD 5.0 was released in 2003.
We really do not need to check that we're on >= 4.4.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598>
2021-10-29 06:06:05 +00:00
Boyuan Zhang ed5d7987dc radeon/vcn: combine session init func
Combine the session init function for h.264 and hevc to reduce redundancy.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13511>
2021-10-28 23:44:15 +00:00
Boyuan Zhang ced5a54c13 radeon/vcn: combine encode params func
Combine the encode params function for h.264 and hevc to reduce redundancy.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13511>
2021-10-28 23:44:15 +00:00
Boyuan Zhang 49fff27d46 radeon/vcn: remove redundancy for vcn2 enc
Remove redundancy functions for vcn2 encode. Re-using the vcn1 quality params
function as a result.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13511>
2021-10-28 23:44:15 +00:00