Commit Graph

24 Commits

Author SHA1 Message Date
Mike Blumenkrantz 538472e279 zink: handle multisampled fbfetch
this uses a shader key to flag the fbfetch as per-sample

it doesn't work, but at least it doesn't error anymore?

Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15823>
2022-04-08 18:24:30 +00:00
Mike Blumenkrantz 5b2d0cca17 zink: handle shader key variants that have nonseamless cubemaps
this is just the program-based handling, which means finding the right
variant and/or creating new ones based on matching a 32bit mask indicating
which textures must be rewritten

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz 63236f9ea9 zink: add a tcs shader key
only applies for generated tcs

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz 63fa2ab978 zink: add Sample decorations to fragment shader inputs with sample shading
PIPE_CAP_FORCE_PERSAMPLE_INTERP is broken for the no-attachment case, so
this is the only option

fixes (lavapipe):
KHR-GL46.sample_shading.render*
dEQP-GLES31.functional.sample_shading.min_sample_shading*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14852>
2022-02-09 09:13:37 -05: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 727e10d290 zink: use smallest int type possible for decompose shader key
this reduces the component key size for decomposition by up to 75%, down
to as low as 2 bytes, which is more optimal for both hashing and memcmp of
the key

it will become more useful as further changes are added to improve vertex format
support, enabling the keysize to remain relatively small

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12771>
2021-09-14 01:55:56 +00:00
Mike Blumenkrantz 1542f3eb47 zink: decompose vertex attribs into single components when not supported
this avoids vbuf in a lot more cases on radv where 3component attribs aren't supported

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12771>
2021-09-14 01:55:56 +00:00
Mike Blumenkrantz 43cfd97ade zink: remove tcs shader keys
these never did anything and need a rework to become useful, assuming
I even find a case where such a thing would be needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12660>
2021-09-07 13:03:08 +00:00
Erik Faye-Lund 3fde1c4242 zink: do not try to dereference null-key
We can't do any of this logic if key is NULL, because that means we'll
dereference memory close to a NULL-pointer.

While we're at it, add some asserts to the zink_fs_key and zink_vs_key
functions who would otherwise be responsible for giving us invalid
non-null pointers out of null-pointers.

CID: 1475973, 1475983

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12559>
2021-08-27 18:32:03 +00:00
Mike Blumenkrantz 0cf643db5d zink: remove shader_id
now that shaders are per-program, shader_id is no longer useful

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11691>
2021-07-06 18:05:15 +00:00
Mike Blumenkrantz 6dab5898db zink: add fastpath for getting default shader variants
no need for hashing or lookups if this is the default variant

also have an alt variant for vertex stages to account for streamout and
halfz lowering

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10513>
2021-04-29 03:43:08 +00:00
Mike Blumenkrantz 41a42955d5 zink: remove leftover references to flatshading in shader keys
this is handled by st already

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10495>
2021-04-28 10:30:11 +00:00
Mike Blumenkrantz 7f28775edc zink: implement uniform inlining
this lets us inline away our problems

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9888>
2021-04-08 03:00:48 +00:00
Mike Blumenkrantz cf8ca77be1 zink: handle point sprite
this needs custom yinvert handling and also prim mode detection, which
gallium can't do on its own

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9115>
2021-02-24 23:25:01 +00:00
Mike Blumenkrantz 575756274a zink: handle dual blending override from driconf
when this is enabled, we need to push gl_FragData[1] to location 0 and
index 1 so that it gets blended like the application expects

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9095>
2021-02-18 00:02:17 +00:00
Mike Blumenkrantz a0911f825d zink: add a vs shader key for rewriting gl_DrawID
if we get a direct draw, we have to rewrite the drawid for it to work as expected

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8971>
2021-02-16 00:52:32 +00:00
Mike Blumenkrantz 26b009b054 zink: move tess/geom shader info to vs shader key
now that there exists a shader key for vertex stages, we can stop modifying
the zink_shader values and instead use this as a more reliable method of detecting
the state

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8682>
2021-01-29 15:38:06 +00:00
Mike Blumenkrantz 03971d8ddc zink: add shader key for vs shaders
we're reusing these for tes/gs for now too

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8682>
2021-01-29 15:38:06 +00:00
Mike Blumenkrantz 334759d850 zink: implement passthrough tcs shader injection
GL allows the pipeline to "infer" a tcs shader if a tes shader is bound using
API-specified default values for gl_TessLevelOuter and gl_TessLevelInner,
but VK requires that both shaders be explicitly present

to handle this, create a generic tcs which translates all vs outputs to
invocation-based arrays and copy the appropriate value to the expected tes
input array location. also emit the default inner/outer values as push constants
so we don't have to recompile the shaders whenever the api calls occur

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>
2020-12-22 13:46:38 +00:00
Mike Blumenkrantz b47407269d zink: initial shader key implementation
this is a squashed version of a previously-reviewed series
ref https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7193

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7801>
2020-12-08 17:35:48 +00:00
Erik Faye-Lund 01f04c7760 Revert "zink: move shader key structs into their own header"
This reverts commit ed7a5a5568.

Fixes: ed7a5a5568 ("zink: move shader key structs into their own header")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7754>
2020-11-24 21:51:34 +00:00
Erik Faye-Lund a4d03aa2b1 Revert "zink: fill in params for fs shader keys and flag shader for rebuild"
This reverts commit 9aa08221fa.

Fixes: 9aa08221fa ("zink: fill in params for fs shader keys and flag shader for rebuild")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7754>
2020-11-24 21:51:34 +00:00
Mike Blumenkrantz 9aa08221fa zink: fill in params for fs shader keys and flag shader for rebuild
we need to check for rebuild any time fb samples becomes 0 in order to remove
any writes to gl_SampleMask

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7193>
2020-11-13 14:40:33 +00:00
Mike Blumenkrantz ed7a5a5568 zink: move shader key structs into their own header
this is going to get messy as we fill them out, so at least we can
keep things split up a bit for organizational sake

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7193>
2020-11-13 14:40:33 +00:00