Commit Graph

194 Commits

Author SHA1 Message Date
Mike Blumenkrantz 0960938d86 zink: GLSL 460
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>
2021-02-16 01:16:30 +00:00
Mike Blumenkrantz efc219f1c4 zink: PIPE_CAP_GL_SPIRV
still needs a bunch of fixing, but 75% of tests pass

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>
2021-02-16 01:16:29 +00:00
Mike Blumenkrantz cb5957e13d zink: enable pipeline statistics cap
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>
2021-02-16 01:16:29 +00:00
Mike Blumenkrantz 5a4f5d1bb5 zink: enable PIPE_CAP_QUERY_SO_OVERFLOW
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>
2021-02-16 01:16:29 +00:00
Mike Blumenkrantz 3d7d55c2cf zink: enable PIPE_CAP_POLYGON_OFFSET_CLAMP
this is already handled

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>
2021-02-16 01:16:29 +00:00
Mike Blumenkrantz 670b79ffd5 zink: enable PIPE_CAP_DRAW_PARAMETERS
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>
2021-02-16 01:16:29 +00:00
Mike Blumenkrantz 75baabf9fb zink: enable PIPE_CAP_TGSI_VOTE
ARB_shader_group_vote

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9072>
2021-02-16 01:16:29 +00:00
Hoe Hao Cheng 93ff47eb19 zink: enable KHR_shader_draw_parameters on Vulkan <1.2
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021>
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng 04df0cb4ae zink: VK_KHR_draw_indirect_count is a device extension
this fixes some testcases on CI.

Fixes: 1c01ad1b80 ("zink: add KHR_draw_indirect_count detection")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8991>
2021-02-12 18:27:25 +00:00
Erik Faye-Lund 5159f406d8 zink: use gallium api to copy to display-target
This allows us to avoid us to avoid forcing linear and host-visible
display-targets.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>
2021-02-12 11:24:50 +00:00
Mike Blumenkrantz 989731bbe2 zink: GLSL 450
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8989>
2021-02-11 11:50:41 -05:00
Mike Blumenkrantz c2e67f679c zink: enable PIPE_CAP_TEXTURE_BARRIER
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8989>
2021-02-11 11:19:07 -05:00
Mike Blumenkrantz c94819286e zink: enable PIPE_CAP_TGSI_TXQS
aka ARB_shader_texture_image_samples

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8989>
2021-02-11 11:19:04 -05:00
Mike Blumenkrantz faa7393a6a zink: enable PIPE_CAP_CLIP_HALFZ
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8989>
2021-02-11 11:19:01 -05:00
Mike Blumenkrantz 8d9d7f15b9 zink: enable PIPE_CAP_CONDITIONAL_RENDER_INVERTED
this was already handled

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8989>
2021-02-11 11:18:58 -05:00
Mike Blumenkrantz e88a6d1c7b zink: GLSL 440
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8989>
2021-02-11 11:18:53 -05:00
Mike Blumenkrantz 6f7430dd50 zink: enable PIPE_CAP_QUERY_BUFFER_OBJECT
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8989>
2021-02-11 11:18:49 -05:00
Mike Blumenkrantz 90e8543da0 zink: enable PIPE_CAP_TGSI_ARRAY_COMPONENTS
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8989>
2021-02-11 11:18:46 -05:00
Adam Jackson f2573760b4 zink: Factor out instance setup a bit more
The VkInstance is really display state not screen state, as is the
loader version. Factor this out a bit further so that
zink_create_instance fills in a zink_instance_info. The latter struct
still lives in the zink_screen for now but that'll move soon.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8968>
2021-02-10 20:31:42 +00:00
Mike Blumenkrantz f88d9c9d7c zink: use better mapping for PIPE_FORMAT_X24S8_UINT
this needs to be unconditionally supported in some way, and it also
needs to use a more compatible fallback format if the base format is unavailable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8959>
2021-02-10 20:20:38 +00:00
Michel Zou aea36ee05e zink: Fix win32 build
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8957>
2021-02-10 18:19:43 +00:00
Mike Blumenkrantz b20e08fadd zink: enable PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>
2021-02-10 13:28:10 +00:00
Mike Blumenkrantz cb80609bb0 zink: GLSL 430
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8941>
2021-02-09 19:25:53 -05:00
Mike Blumenkrantz 7909c642b1 zink: enable compute
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz c5cf5ad6f0 zink: export compute-specific shader/compute caps
this doesn't enable the compute cap itself, it just handles all the other
caps

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz 84821964eb zink: force 4 component formats for samplerview/render textures
this fixes a bunch of issues with 3-component formats, which aren't supported
for various operations on certain drivers

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8697>
2021-02-07 23:16:27 +00:00
Erik Faye-Lund 3824c06aff zink: support using lavapipe
This is really nasty, and shouldn't really be needed, but we have a
problem where both Zink and Lavapipe checks $GALLIUM_DRIVER, meaning that
Zink tries to use Lavapipe, and Lavapipe tries to use Zink.

This patch side-steps that by temporarily setting $GALLIUM_DRIVER to
"llvmpipe", giving Lavapipe a chance to succeed.

This is not great at all. The most obvious problem is that this is super
thread-unsafe, effectively modifying global state without any care. In
reality, we'd only want the pipe-loader in the *same thread* to ignore
Zink, but it's not so obvious how to do that without introducing lots of
ugly zink-specific cruft.

People shouldn't be using Zink if they don't have a GPU, it's going to
be much better to use LLVMpipe in that case. So let's not worry too much
about this case, and instead guard this dangerous logic with an
ZINK_USE_LAVAPIPE environment variable. This means this behavior only
happens if people opt in to it.

With this in place, we can start using Zink + Lavapipe on CI.

In the longer run, it might be better to use Adam Jackson's copper
loader instead, and drop exposing Zink as a software rasterizer
entirely. But that's something for the great future where we have flying
cars and all.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7881>
2021-02-05 16:45:43 +00:00
Erik Faye-Lund 3adf6da4c1 zink: explicitly check for VK_NULL_HANDLE
This seems a bit less like magic to me.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7881>
2021-02-05 16:45:43 +00:00
Erik Faye-Lund 6b38b1ccaf zink: check for error when calling vkEnumeratePhysicalDevices
It seems it's possible for Lavapipe to fail to enumerate the physical
devices, so let's handle that and fail all the way up here.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7881>
2021-02-05 16:45:43 +00:00
Mike Blumenkrantz 50bac9f3fb zink: move maintenance2 extension to right file
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8862>
2021-02-04 19:23:20 +00:00
Dave Airlie e41b0202c9 zink: don't pick a cpu device ever.
This goes down the list and picks the first non-cpu device, when
we merge the CI patch we should add a forcing env var in here.

Fixes: 8d46e35d1 ("zink: introduce opengl over vulkan")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8845>
2021-02-03 23:11:19 +00:00
Erik Faye-Lund 36a4b423fe zink: correct return-type for function
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8832>
2021-02-02 16:00:37 +00:00
Erik Faye-Lund 9fbacf5bcf zink: be more careful about limits when unsupported
These limits are dependent on feature caps, so let's try to thread
a bit more carefully when the cap is unsupported.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8832>
2021-02-02 16:00:37 +00:00
Mike Blumenkrantz 514b17235f zink: export ssbo caps
PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT is needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8628>
2021-01-28 14:34:28 +00:00
Mike Blumenkrantz 86ff78e8fe zink: don't export PIPE_CAP_MAX_COMBINED_SHADER_BUFFERS value
gallium automatically sums up the per-stage buffers if this isn't set,
and some drivers (e.g., amdvlk) export UINT_MAX here which breaks the universe

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8742>
2021-01-27 10:44:50 -05:00
Erik Faye-Lund 9052819ebb zink: request texcoord replace lowering
We don't actually support point-sprites by texcoord replacement, so let's
remove that cap. This allows gallium to automatically lower this to the
PNTC varying instead, which we do support.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6473>
2021-01-25 17:32:33 +00:00
Mike Blumenkrantz b59d98ae5f zink: enable PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE
this was already handled internally

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8688>
2021-01-25 16:59:36 +00:00
Mike Blumenkrantz cacb3e1826 zink: enable PIPE_CAP_SAMPLER_VIEW_TARGET
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8629>
2021-01-22 22:37:46 +00:00
Mike Blumenkrantz 5282210c0b zink: check correct caps for PIPE_CAP_IMAGE_LOAD_FORMATTED
we actually need more features here than just the one which was checked to
enabled this

Fixes: 2f6f4b613c3 ("zink: export shader image caps using features")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8656>
2021-01-22 19:54:58 +00:00
Erik Faye-Lund 855370bb62 zink: make all xfb caps depend on extension
Without this, we'll expose GL_ARB_transform_feedback2 and
GL_ARB_transform_feedback3 even without VK_EXT_transform_feedback,
because these caps are directly wired up without checking the pervious
extensions.

Fixes: e8ad52f7b0 ("zink: enable xfb extension in screen creation")
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/8640>
2021-01-22 15:39:20 +00:00
Erik Faye-Lund 8c7d971666 zink: require vulkan memory model for tesselation
We enable the KHR_vulkan_memory_model extension whenever we use
tesselation, so right now this is a defacto requirement. So let's make
this requirement explicit.

Fixes: f815b87e18 ("zink: export tess shader pipe caps")
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/8640>
2021-01-22 15:39:20 +00:00
Erik Faye-Lund f95c174927 zink: check for extension instead of function
This shouldn't change any behavior, it just seems a bit more to the
point to check for the extension that decides if these are NULL or not
than to check both of 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/8640>
2021-01-22 15:39:20 +00:00
Erik Faye-Lund c9340744a3 zink: respect feature-cap for multi-draw indirect
Even in the presence of VK_KHR_draw_indirect_count, we still technically
need to respect the feature-cap when using a Vk 1.0 core-function.

Fixes: cef876910a ("zink: enable PIPE_CAP_MULTI_DRAW_INDIRECT(_PARAMS) caps")
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/8640>
2021-01-22 15:39:20 +00:00
Erik Faye-Lund 6f6941e2dd zink: respect feature-cap for sample-shading
Vulkan has a cap to enable this, we should check that one rather than
always claiming support.

Fixes: 0c70268ff7 ("zink: mark ARB_sample_shading as supported")
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/8640>
2021-01-22 15:39:20 +00:00
Erik Faye-Lund 612169859a zink: respect feature-cap for independent blending
Vulkan has a cap to enable this, we should check that one rather than
always claiming support.

Fixes: 8d46e35d16 ("zink: introduce opengl over vulkan")
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/8640>
2021-01-22 15:39:20 +00:00
Erik Faye-Lund 831d205513 zink: respect feature-cap for robust buffer access
Vulkan has a cap to enable this, we should check that one rather than
always claiming support.

Fixes: 61720098fa ("zink: set PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR")
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/8640>
2021-01-22 15:39:20 +00:00
Erik Faye-Lund b35e11ef95 zink: always expose linear float textures
This is not an optional feature in Vulkan, so we can rely on this being
supported. This has the nice benefit of enabling OpenGL ES 3.0 support
on ANV.

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/8640>
2021-01-22 15:39:20 +00:00
Mike Blumenkrantz 96d7555770 zink: support PIPE_FORMAT_X24S8_UINT
enables ARB_texture_view

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8630>
2021-01-21 22:03:49 -05:00
Hoe Hao Cheng fa86272547 zink: expose PIPE_CAP_ANISOTROPIC_FILTER
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Fabio Pedretti <fabio.ped@libero.it>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8617>
2021-01-22 01:30:50 +00:00
Mike Blumenkrantz 61720098fa zink: set PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8631>
2021-01-21 23:14:31 +00:00