Commit Graph

154351 Commits

Author SHA1 Message Date
Connor Abbott 69f5be8bad ir3: Add ir3_shader_variant::compiler
And replace uses of ->shader->compiler.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 4509b49fb8 ir3: Allocate disasm_info under variant
This shouldn't matter much because it gets stolen later, but the shader
is going away.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 21e3dd57d3 ir3: Use ir3_shader_variant::type more often
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott f45c86dfb7 ir3, fd, tu: Copy misc. info from ir3_shader to ir3_shader_variant
The shader won't be available for deserialized variants, so we need to
include all the info we need for compiling variants to be in the
variant. Most of the things we dug out of the shader were various bits
from nir_shader_info which we move into ir3_shader_variant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 3e30608ceb ir3, freedreno, tu: Make ir3_shader_variant store stream_output
This reduces the number of uses of ir3_shader which will be gone when we
deserialize the variant directly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 3cad11d84a tu: Delete unused tu_clear_blit GS handling
This has been unused for a while since we switched to writing the
array index in the VS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Erik Faye-Lund 693c723211 zink: use run-time linking to loader
This makes Zink no longer have the vulkan-loader in the import-table,
which can prevent opengl32.dll on Windows from loading on systems
without the loader installed.

Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11550>
2022-05-13 16:23:41 +00:00
Erik Faye-Lund 56e9ccce7b zink: dynamically load a few functions
These functions are used in a bit of a limbo-situation; we haven't yet
loaded the dispatch-table yet, because we have no instance yet. So let's
instead load them directly from the loader when we need them.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11550>
2022-05-13 16:23:41 +00:00
Erik Faye-Lund d91cb5cbcc zink: pass screen to zink_create_instance
This allows us to pass in some more details, like handles to the
loader-library to avoid a hard dependency.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11550>
2022-05-13 16:23:41 +00:00
Erik Faye-Lund 4654a57bb5 zink: call vk-functions through dispatch-table
This is going to make it possible to avoid linking directly to the
vulkan-loader.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11550>
2022-05-13 16:23:41 +00:00
Erik Faye-Lund 1b6ed06527 zink: initialize dispatch-table before queue-init
This matters in the next patch, where we call vk-functions through the
dispatch-table instead.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11550>
2022-05-13 16:23:41 +00:00
Erik Faye-Lund 9e9ead2c15 zink: pass screen to extension getter macro
This is just prep-work to reduce the size of the final commit; this
allows us to store the extension-getter function in the screen object.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11550>
2022-05-13 16:23:41 +00:00
Juan A. Suarez Romero 57293dee2b v3dv: check BO mapping result
Addresses error handling issue detected by Coverity.

Fixes: 89eb0ac23d ("v3dv: implement vkGetPipelineExecutableInternalRepresentationsKHR")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16495>
2022-05-13 15:56:34 +00:00
Juan A. Suarez Romero 7edb26966e v3d: add builtin support for white/black clamp-to-border
Besides transparent border color, the hardware has special support for
white and black borders when clamping to border is enabled, which should
be more efficient.

v2:
 - Rename enumerations (Iago)
 - Add comment to border_color_variant field (Iago)
 - Refactor the sampler variant code selection (Iago)

v3:
 - Add comment for case of not clamping to border (Iago).
 - Generate only required sampler states (Iago).

v4:
 - Use one array element for standard border color set (Iago).

v5:
 - Fix variant setting for transparent black borders (Iago).

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16422>
2022-05-13 15:37:05 +00:00
Victor Hermann Chiletto 580046e49f radv: always check entry count in descriptor pool when allocating
Previously this check was skipped for pools with
VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT unset, but after
96a240e1 we need to check this otherwise we risk overflowing
radv_descriptor_pool::entries into the host memory base

This fixes a crash to desktop when launching Dota 2, which overallocates
descriptor sets and expects an error to allocate another descriptor pool

Fixes: 96a240e176 ("radv: fix memory leak of descriptor set layout")

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16490>
2022-05-13 15:17:59 +00:00
Timothy Arceri 622e2ae08a svga: remove duplicate nir compile options
In a later merge request to remove the old GLSL IR loop unrolling
code we will add two additional compiler options stucts here. This
commit helps to avoid duplication getting out of hand.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16489>
2022-05-13 15:09:42 +00:00
Pierre-Eric Pelloux-Prayer d4e4aa997a radeonsi: store shader variants in an array
Instead of storing them in a linked list, put them in an array
in si_shader_selector. The keys are also stored separatly, to
avoid pointer chasing when searching a variant in si_shader_select_with_key.

This main point here is to simplify the code by storing everything
in the selector instead of splitting the list storage between the selector
and the shaders; this shouldn't affect performance in a meaningful way.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16273>
2022-05-13 14:40:56 +00:00
Pierre-Eric Pelloux-Prayer e549b6fe42 radeonsi: scale the number of shader compiler threads
Instead of spawning all the threads on startup.

This speeds up short lived programs (eg: piglit runs duration is reduced by ±25%),
avoid wasting resources and still make use of multi-threaded capabilities.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16273>
2022-05-13 14:40:56 +00:00
Pierre-Eric Pelloux-Prayer b75b9d5cb4 radeonsi: remove unused params from si_shader_select_with_key
thread_index is always -1, optimized_or_none is always false.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16273>
2022-05-13 14:40:56 +00:00
Pierre-Eric Pelloux-Prayer 7357ce19a2 util/u_queue: rework UTIL_QUEUE_INIT_SCALE_THREADS to scale faster
The original code waiting for the queue to be full before adding more
threads. This makes the thread count grow slowly, especially if the
queue also uses UTIL_QUEUE_INIT_RESIZE_IF_FULL.

This commit changes this behavior: now a new thread is spawned if we're
adding a job to a non-empty queue because this means that the existing
threads fail to process jobs faster than they're queued.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16273>
2022-05-13 14:40:56 +00:00
Samuel Pitoiset 76356ed208 aco: remove unreachable code about viewport index/layer and mesh shaders
If the mesh shaders exports the viewport index or the layer, the value
can't be NULL, and it should be implicitly zero.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16438>
2022-05-13 14:01:54 +00:00
Samuel Pitoiset 27f1da8215 radv,aco: do not implicitly export the primitive ID for mesh shaders
From the Vulkan spec:

    "VUID-VkGraphicsPipelineCreateInfo-PrimitiveId-06264
     If the pipeline is being created with pre-rasterization shader
     state, it includes a mesh shader and the fragment shader code
     reads from an input variable that is decorated with PrimitiveId,
     then the mesh shader code must write to a matching output variable,
     decorated with PrimitiveId, in all execution paths"

So, if PS uses PrimitiveID, MS must export it (like GS).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16438>
2022-05-13 14:01:54 +00:00
Martin Roukala (né Peres) b043cbc72b radv/ci: reduce the execution timeout
We currently default to 4h of execution time, but this is unnecessary
on all our platforms. Tighten it to 45 minutes per run, and overall of
1.5h to allow for restarts.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16472>
2022-05-13 13:30:48 +00:00
Martin Roukala (né Peres) 815d192c7b radv/ci: reboot the DUTs when hitting a ring timeout
I am not super happy about doing this, as this means we will
potentially be introducing regressions because CI would have papered
over a rare race condition... But the situation is that this is already
happening, and improving the reliability will likely come from tracking
the occurence rate of hangs in an external system.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16472>
2022-05-13 13:30:48 +00:00
Marcin Ślusarz 1542ab70eb anv: handle primitive shading rate for mesh
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16030>
2022-05-13 13:05:51 +00:00
Marcin Ślusarz 9acb30c8c4 intel/compiler: implement primitive shading rate for mesh
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16030>
2022-05-13 13:05:51 +00:00
Juan A. Suarez Romero f575b0d7b5 v3d: add hook to get on-disk shader cache
This allows to support at least one binary format in
GL_ARB_get_program_binary extension.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16433>
2022-05-13 12:46:45 +00:00
Marek Olšák 29965f356b ac: replace 5 ac_shader_abi::load_* callbacks with 1 intrinsic_load callback
This merges them into si_llvm_load_intrinsic and reuses load_tess_varyings.

RADV only implemented 1 callback.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16467>
2022-05-13 06:45:31 -04:00
Marek Olšák 535d954914 radeonsi: try to group stage-specific code in si_llvm_translate_nir
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16467>
2022-05-13 06:45:31 -04:00
Marek Olšák 2b7906ea74 radeonsi: get rid of the ambiguous "prologue" word
It has nothing to do with our "prolog" shader parts.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16467>
2022-05-13 06:45:31 -04:00
Marek Olšák 4118717cba radeonsi: cleanups getting rid of the ambigous "epilogue" word
It has nothing to do with our "epilog" shader parts.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16467>
2022-05-13 06:44:57 -04:00
Marek Olšák dc81f0ba46 ac/llvm: remove ac_shader_abi::emit_outputs
it's called last in ac_nir_translate, so call it in the caller.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16467>
2022-05-13 06:44:57 -04:00
Marek Olšák 9a8413aaea radeonsi: inline si_nir_build_llvm
it always returns true

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16467>
2022-05-13 06:44:57 -04:00
Marcin Ślusarz aa1c128b54 anv: disable streamout before emitting mesh shading state
Fixes tests which use secondary command buffers.

Fixes: ef04caea9b ("anv: Implement Mesh Shading pipeline")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493>
2022-05-13 09:43:02 +00:00
Marcin Ślusarz 29a778fa6b intel/compiler: print name of the unhandled intrinsic
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493>
2022-05-13 09:43:02 +00:00
Marcin Ślusarz f083df8710 anv: update task/mesh distribution with the recommended values
Fixes: ef04caea9b ("anv: Implement Mesh Shading pipeline")

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493>
2022-05-13 09:43:02 +00:00
Marcin Ślusarz 65ff6932dc intel/compiler: handle gl_Viewport and gl_Layer in FS URB setup
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493>
2022-05-13 09:43:02 +00:00
Marcin Ślusarz 040062df41 intel/compiler: handle VARYING_SLOT_CULL_PRIMITIVE in mesh
It's needed for gl_MeshPerPrimitiveNV[].gl_ViewportMask

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493>
2022-05-13 09:43:02 +00:00
Marcin Ślusarz 7446acf4b4 compiler: add VARYING_SLOT_CULL_PRIMITIVE
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493>
2022-05-13 09:43:02 +00:00
Marek Olšák 2a1c711052 ac/llvm: skip s_barrier if tess patches don't cross a wave boundary
If tess patches are wholly in one wave, "s_waitcnt lgkm(0)" is sufficient.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Marek Olšák 59673001c8 radeonsi: add si_get_tcs_epilog_key
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Marek Olšák 20bb85e2ec ac/llvm: fix the remaining s_barriers for LLVM 15
LLVM 15 doesn't insert s_waitcnt before barriers.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Marek Olšák b48d183633 ac/llvm: move the gfx6 optimization for TCS barriers into ac_build_s_barrier
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Marek Olšák e4882d6b7e ac/llvm: add gl_shader_stage parameter into ac_build_s_barrier
this will be used later

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Marek Olšák fb51a3c4b0 ac/llvm: replace LLVMBuildFence with ac_build_waitcnt(VSTORE)
No change in LLVM IR.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Marek Olšák bed91084c8 ac/llvm: inline emit_membar
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Marek Olšák 8d4c0197c3 radeonsi: wait before s_barrier in TCS epilog to fix LLVM 15
Only LGKM is needed here.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Marek Olšák 9a592608cb ac/llvm: implement memory_barrier_tcs_patch properly to fix LLVM 15
because LLVM 15 doesn't insert s_waitcnt before s_barrier.

Now, control_barrier shouldn't add any waits because memory_barrier is
responsible for it, so remove the wait.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16304>
2022-05-13 09:15:20 +00:00
Yonggang Luo 790d2bbe67 st: Improve _mesa_error about GL_OUT_OF_MEMORY in st_cb_texture.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16453>
2022-05-13 08:25:47 +00:00
Pavel Ondračka 23dfae4c81 r300: fix vertex shader control flow in loops
This fixes 7 loop piglit tests when loop unrolling is disabled.

The problem is that we were trying to be smart with breaks and
tried to save one predicate instruction for endif in some cases.
This worked for simple loops but brought problems for more complex
shaders, instead just switch to standard VE_PRED_SNEQ_PUSH
ME_PRED_SET_POP combo everywhere.

Shader-db results on RV530 show three hurt glmark tests, however
I believe the simplification should be worth it.

total instructions in shared programs: 123715 -> 123718 (<.01%)
instructions in affected programs: 54 -> 57 (5.56%)
total predicate in shared programs: 118 -> 121 (2.54%)
predicate in affected programs: 6 -> 9 (50.00%)
total temps in shared programs: 17304 -> 17307 (0.02%)
temps in affected programs: 12 -> 15 (25.00%)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6468
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16470>
2022-05-13 08:15:15 +00:00