Commit Graph

144935 Commits

Author SHA1 Message Date
Mike Blumenkrantz 0418b98569 zink: cap max shader variants with inlined uniforms
avoid making a new shader for every frame forever

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz 1aa0b2777d zink: simplify shader variant update loop
a single continue makes this much easier to read

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz fb9e9401c9 zink: split out inlined uniform shader variants into separate cache
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz ad32e41efe zink: remove default_variants storage in program struct
these should naturally be the first entry in the list when it matters

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz 334576569e zink: replace shader module hash table with a list
this should be significantly more performant for the majority of cases
since it's rare that shaders have multiple variants outside of unit tests,
so now there can just be a list of shaders being iterated instead where the
first entry is the last used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz c995d7bad8 zink: move shader cache to gfx program struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz 834cc07e5b zink: stop using hash table for compute programs
this is pointless since there's no variants yet

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz 19e99e46db zink: store shader key to shader module
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz 8e78a6f67d zink: move uniform size calc for shader keys into keybox
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz 19fbdb9064 zink: move shader keys to be persistent on pipeline state
save a cycle or two zeroing and populating this on every recalc

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz 80604fee4a zink: move xfb updates to just before draw
it's illegal to bind the pipeline after xfb has begun

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz ff5991e86a zink: simplify flagging last vertex stage for updating
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz e515d9791e zink: only update gfx pipeline cache after creating a real pipeline
async pipelines may not require updates here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz 7438d670dd zink: remove some ctx references from shader/pipeline compile
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:32 -04:00
Mike Blumenkrantz c587152eba zink: remove ctx references from shader compile path
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:31 -04:00
Mike Blumenkrantz ab4d8ed1e9 zink: make tcs shader generation take screen param
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:31 -04:00
Mike Blumenkrantz da10f13de9 zink: move pending prim type to gfx pipeline struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>
2021-09-15 23:52:31 -04:00
Dave Airlie 259e26e5e3 llvmpipe/cs: rework coroutine context handling (v2)
Get comfy.

llvmpipe coroutines have a stack frame. This is created by hooking
in malloc and coro.alloc and coro.size intrinsics.

LLVM has an CoroElide pass that is meant to allow that stack frame
to be done as an alloca in the caller instead of using the malloc path.

The CoroElide pass relies on the coroutine being inlined (fixed that).

The CoroElide pass relies on there being a direct connect between
coro.destroy(i8 *arg) and arg = coro.begin(id). However due to the
way the compute shaders are launched, there is no way to ensure that
link. Fixing the CoroElide pass seems quite difficult, I considered
having a force CoroElide always flag to make it dtrt, however I'm not
sure how ugly that would end up.

My first attempt tried to preallocate the stacks at a fixed size,
this turned out to be naive as the stack frame size was not sized
like I expected. Instead the first coro to run allocs enough for
everyone, so avoid the massive amounts of small allocations.

This remove coro malloc from a lot of profiles and shaves another 30s
or so from OpenCL ./conversions/test_conversions uchar_uin
(from 4.40m to just under 4m on my ryzen 7 1800x)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12432>
2021-09-16 13:21:34 +10:00
Dave Airlie 8d3e97344c llvmpipe: shorten hold time on the screen mutex
There is no requirement to hold this mutex over the wait. I doubt
it matters much in practice.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12432>
2021-09-16 13:21:29 +10:00
Dave Airlie 4ccee031e9 gallivm/coro: use a phi instead of alloca
this just matches what the docs recommend

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12432>
2021-09-16 13:21:27 +10:00
Dave Airlie 69109e0b19 llvmpipe/cs: rework thread pool for avoid mtx locking
This helps reduced the mtx lock/unlock overheads for the threadpool
if the work evenly distributes across the number of threads.

The CL CTS conversions tests really hit this, and this takes maybe 10-20s
off a 5min test run.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12432>
2021-09-16 13:21:06 +10:00
Mike Blumenkrantz 53aade0ef0 zink: fix enabled vertex buffer mask calculation
the mask can't entirely be calculated based on the integer parameters,
as it's possible for some of the "bind" slots to actually be unbinds,
so remove bits as necessary to fix this

also add some debug asserts to ensure I don't break this again for the
tenth time

Fixes: 6dd02a5139 ("zink: stop using util_set_vertex_buffers_mask()")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12871>
2021-09-16 01:43:40 +00:00
Icecream95 09bb8602f3 pan/bi: Don't set dependencies for +BLEND in blend shaders
The dependency wait should already have been done in the fragment
shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12461>
2021-09-15 22:42:03 +00:00
Dave Airlie d9a784520a lavapipe: enable dynamic index ubo/ssbo
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12689>
2021-09-16 08:05:59 +10:00
Dave Airlie fc0bf57632 gallivm/ssbo: cast ssbo index to int type.
Since these can be loaded from ubos or other places now.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12689>
2021-09-16 08:05:56 +10:00
Dave Airlie 1ccac4abff gallivm/ssbo: fix up dynamic indexed ssbo load/stores/atomics
Although the index has to be dynamically uniform, if we don't ever
execute a few lanes then we'll have 0, so it important to read the
ssbo index from the first active lane.

Just loop over them all.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12689>
2021-09-16 08:05:51 +10:00
Eric Engestrom 2585d2d6fb docs: shorten "last release" note to fit on the website without horizontal scrolling
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12798>
2021-09-15 22:24:26 +01:00
Eric Engestrom 810184e27e docs: add plan for 21.3.x release cycle
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12397>
2021-09-15 20:47:26 +00:00
Jesse Natalie 3415bf0268 egl: Add a basic Windows driver
This is enough to run wglgears ported to EGL (desktop GL)

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 06e95693fb egl: Detect Windows platform using GDI
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 58389dd55f egl: Don't try to dereference native displays unless there's a detectable platform
Not all native displays are pointers to dereferenceable memory, e.g.
DCs on Windows. Don't bother dereferencing if no platforms are available
that can be detected that way.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie eb7d150743 egl: Use the .def file for Windows
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie e775b07c17 egl: Add wgl/gallium dependencies for Windows platform
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie e76db0f165 meson, egl: Support building for the Windows platform
Add a stub EGL driver for Windows
Fix compiler issues in egl/main
Ensure Windows build produces libEGL.dll
Default EGL to enabled for Windows when building a Gallium driver

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie b8a23fa893 meson: Include EGL after gallium
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 9716209761 wgl: Add stw_* DLL exports for EGL support
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 0574265256 wgl: Swap buffers via pointer instead of HDC
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 90d2b93731 wgl: Add a stw_dev getter
Data imports need to be marked __declspec(dllimport), so
just export a function instead of data.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie bb706ca93a wgl: Use HWND instead of HDC as primary framebuffer handle
EGL's native window is an HWND, so this removes the need to
GetDC from the creation path there.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie ddedf59625 wgl: Add an explicit iPixelFormat for context creation
If it's 0, then it's looked up from the framebuffer for the specified HDC

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 9c875b040c wgl: Un-inline helpers which use stw_own_mutex
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 7d96e19b92 wgl: Add iPixelFormat to stw_pixelformat_info
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 49d83de072 wgl: Split DrvReleaseContext to support unbind via pointer
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie c4806ae03c wgl: Make contexts current with framebuffers instead of HDCs
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie be9f9886fe wgl: Allow creating framebuffers that aren't in the global window list
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 8b9b5cdbf4 wgl: Make contexts current with pointer instead of DHGLRC
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie 0d3a215819 wgl: Pass share context as pointer instead of DHGLRC
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie ca1cceeed5 wgl: Create contexts and DHGLRCs separately
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Mike Blumenkrantz 6a240a1c95 zink: stop setting nr_samples for null surfaces
this is a special value that shouldn't be set

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12875>
2021-09-15 19:41:51 +00:00
Mike Blumenkrantz 8e9ec440af zink: don't copy inner surface refcount
this leaks surfaces. lots of surfaces.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12875>
2021-09-15 19:41:51 +00:00