Connor Abbott
410d59943d
tu: Hash pipeline layout contents
...
Mostly adapted from anv.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147 >
2022-05-13 17:07:05 +00:00
Connor Abbott
3e3f8b1639
ir3: Add ir3_shader_create_variant()
...
This is similar to ir3_shader_get_variant(), but always compiles the
variant from scratch and returns a variant that's owned by the user
rather than the shader. We'll need this because when variants are stored
in the Vulkan pipeline cache they will outlive their shader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147 >
2022-05-13 17:07:05 +00:00
Connor Abbott
ea646ac9af
ir3: Support disabling the pipeline cache
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147 >
2022-05-13 17:07:05 +00:00
Connor Abbott
c7a6293635
ir3: Add functions to serialize variants
...
This will be used by turnip to create free-floating variant objects that
integrate into the Vulkan cache system.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147 >
2022-05-13 17:07:05 +00:00
Connor Abbott
ceae844794
ir3: Remove ir3_shader_variant::shader
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147 >
2022-05-13 17:07:05 +00:00
Connor Abbott
91160dab97
tu: Keep original blit shaders separately
...
We won't be able to access them once the ->shader link is gone.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147 >
2022-05-13 17:07:05 +00:00
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
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