mesa/src
Ian Romanick 2024d47048 iris: Add the variant to the list as early as possible
I tried to find a way to break this into some smaller commits, but
everything is very intertwined. :(

When searching the variants list in the iris_uncompiled_shader, add the
new variant if it is not found.  This will be necessary for threaded
shader compilation.  This conceptually simple change had a bunch of
fallout.

Much of this was at least conceptually borrowed from radeonsi.

- Other threads might find a variant in the list before the variant has
  been compiled.  To accomdate this, add a fence.  Each thread will wait
  on the fence in the variant when searching the list.

- A variant in the list may fail compilation.  To accomodate this, add a
  flag.  All paths will examine iris_compiled_shader::compilation_failed
  before trying to use the variant.

- The race condition between multiple threads trying to create the same
  variant at the same time is handled *before* both thread spend the
  effort to compile the shader.  The means that iris_upload_shader
  cannot change shaders on the caller, so it does not need to return
  anything.

v2: Change "found" parameter of find_or_add_variant to "added."  This
inverts the values returned, and it probably makes uses of the returned
value more easily understood.  Always set the value in the called
function.  Suggested by Ken.

v3: Move shader->compilation_failed check to avoid shader != NULL test.
Rearrange some logic and add a comment in iris_update_compiled_tcs.
Suggested by Ken.  Don't call find_or_add_variant in
iris_create_shader_state.  See
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11229#note_1000843
for more details.  Noticed by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11229>
2021-07-28 17:32:44 +00:00
..
amd radv: implement VK_EXT_shader_atomic_float2 2021-07-27 08:44:36 +02:00
android_stub egl/android: refactor to use the legit vndk/window.h header 2021-06-09 21:07:54 +00:00
asahi asahi: Add integers to agx_vertex_formats 2021-07-24 18:00:07 -04:00
broadcom ci/v3dv: update vulkan expected results 2021-07-27 12:44:50 +00:00
compiler mesa: move gl_program::is_arb_asm to shader_info 2021-07-28 08:49:30 +00:00
drm-shim drm-shim: fix compile with glibc >= 2.33 2021-04-20 05:49:29 +00:00
egl egl/dri2: Stop disabling pbuffer support on msaa configs 2021-07-23 19:22:44 +00:00
etnaviv android: Drop the Android.mk build system 2021-07-08 14:44:02 -05:00
freedreno ir3: Preserve gl_ViewportIndex in the binning shader 2021-07-28 16:49:46 +00:00
gallium iris: Add the variant to the list as early as possible 2021-07-28 17:32:44 +00:00
gbm gbm/dri: Fix leaking bo memory on failure path 2021-07-13 11:15:44 +00:00
getopt scons: Remove. 2021-03-20 10:38:55 +00:00
glx glx/drisw: Nerf PutImage when loaderPrivate == NULL 2021-07-15 15:10:17 +00:00
gtest
hgl
imgui
intel anv/android: Rework our handling of AHardwareBuffer imports 2021-07-27 14:45:28 +00:00
loader loader/dri3: create linear buffer with scanout support 2021-07-28 15:53:36 +00:00
mapi glthread: use custom marshal/unmarshal for CallList 2021-07-09 10:05:46 +00:00
mesa st/texture: refactor get_src_format() to be more useful 2021-07-28 17:07:15 +00:00
microsoft microsoft/spirv_to_dxil: Adding continue opt pass to fix DXIL loop gen 2021-07-24 14:47:41 +00:00
nouveau
panfrost pan/va: Allow floating-point swizzles on ATEST 2021-07-28 00:26:06 +00:00
tool pps: Panfrost pps driver 2021-07-13 11:03:55 +00:00
util util/queue: Don't crash in util_queue_destroy when init failed 2021-07-28 17:32:44 +00:00
virtio venus: log more WSI messages 2021-07-27 06:21:47 +00:00
vulkan vulkan/wsi/x11: do not inherit last_present_mode 2021-07-28 01:05:50 +00:00
meson.build meson: Build panfrost with tools=panfrost 2021-07-22 17:55:49 +00:00