Commit Graph

999 Commits

Author SHA1 Message Date
Mike Blumenkrantz f7e9500dc2 lavapipe: simplify some attachment derefs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz d914df72ab lavapipe: store subpass directly to rendering_state
this is fewer array derefs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz a0c81efcf4 lavapipe: remove last VK_ATTACHMENT_UNUSED check
these are all just null checks now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz 58e18a2be9 lavapipe: remove lvp_subpass_attachment and use lvp_render_pass_attachment refs
this is one fewer indirect reference that allows removing a bunch of stuff from
renderpass creation

now also unused subpass attachments are just NULL pointers, making detection simpler

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz 5e3bc8b18d lavapipe: remove lvp_subpass::max_sample_count
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz 5e3d84e30a lavapipe: add attachment index to lvp_render_pass_attachment
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz 5cf568ce09 lavapipe: remove lvp_subpass_attachment::layout
unused

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz eaa82252f9 lavapipe: remove lvp_subpass_attachment::in_render_loop
this isn't used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz afd8820d66 lavapipe: use framebuffer attachment_count member instead of renderpass
according to spec, these must be equal

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz dd70ff3b8c lavapipe: remove some unused struct members
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Mike Blumenkrantz d103d5bb5d lavapipe: stop reading renderpass during pipeline creation
this is unnecessary and is going to be annoying in the future

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
2021-10-19 01:18:24 +00:00
Dave Airlie cae1ef0a11 clover: use max shader sampler view/images queries for clover.
This is probably sane than my last answer to this question

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13398>
2021-10-19 01:03:58 +00:00
Karol Herbst 753f595e3d clover/api: fix clGetMemObjectInfo for images
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13424>
2021-10-19 06:55:38 +10:00
Karol Herbst b4f9b15dd0 clover/formats: pass in cl_mem_flags for better format checking
This allows us to advertise more formats depending on how the image is
getting used inside a kernel.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13424>
2021-10-19 06:55:34 +10:00
Karol Herbst f09e6c1c5f clover/format: Full rework on how we declare supported images.
While at it also remove CL_LUMINANCE and CL_INTENSITY, which are optional
but also quite broken.

Also advertize all formats we can already support and make the list easier
to read. Also adds support for newer formats.

v2: fixup packing for non-8 bits (airlied)

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13424>
2021-10-19 06:55:22 +10:00
Pierre-Eric Pelloux-Prayer 7a2e40df5e Revert "gallium: add a is_dri_blit_image bool to pipe_blit_info"
This reverts commit 22a1b7c5b3.

The only use was radeonsi and it switched to PIPE_BIND_DRI_PRIME
instead.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
2021-10-18 17:16:53 +02:00
Pierre-Eric Pelloux-Prayer e9c3dbd046 gallium/dri: let the driver know if the imported image is DRI_PRIME buffer
Use createImageFromFds2 together with __DRI_IMAGE_PRIME_LINEAR_BUFFER, so
the driver's resource_from_handle hook will be aware that this specific
image is the linear buffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
2021-10-18 16:24:00 +02:00
Pierre-Eric Pelloux-Prayer 7a5de84249 gallium/dri: add createImageFromFds2
Same as createImageFromFds but with added flags so the caller can give
the driver more context.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
2021-10-18 16:23:58 +02:00
Pierre-Eric Pelloux-Prayer 48551a1807 gallium/dri: replace bool with flag parameter
This will allow to pass more information.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
2021-10-18 16:23:56 +02:00
Aaron Watry 91ff83b6c8 clover/image: add dimension property
With that we can fix CL_IMAGE_HEIGHT and CL_IMAGE_DEPTH.

v2 (Karol Herbst): split up commit
   (Serge Martin): convert to virtual method

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
2021-10-18 12:28:20 +10:00
Edward O'Callaghan 786987c447 clover: Implement CL_MEM_OBJECT_IMAGE1D_ARRAY
v2: Consider surface height as valid when unused by using 1.
     Fixup width boundary checking.
v3 (Karol): Pull in changes from later commits
            Fix validation

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
2021-10-18 12:24:15 +10:00
Edward O'Callaghan 3200669c2b clover: Implement CL_MEM_OBJECT_IMAGE1D_BUFFER
v2: Consider surface height as valid when unused by using 1.
     Fixup width boundary checking.
v3 (Karol): Pull in changes from later commits
v4:(airlied): use max_buffer_size as the limit (Fixes CTS test)

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
2021-10-18 12:23:41 +10:00
Edward O'Callaghan 0ec5e50d8a clover: Implement CL_MEM_OBJECT_IMAGE2D_ARRAY
v2: Ensure we pass in row_pitch state as well.
v3 (Karol): Pull in changes from later commits

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
2021-10-18 12:23:00 +10:00
Aaron Watry 0abfbb76ff clover: implement CL_IMAGE_BUFFER
We will also need it to implement image1Dbuffer_t

v2 (Karol Herbst): extracted from other commit

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
2021-10-18 12:22:41 +10:00
Edward O'Callaghan 3298ee546e clover/images: Add array_size to implement CL_IMAGE_ARRAY_SIZE
This will be needed to implement array immages.

v2 (Karol Herbst): Extracted from other commit
                   Fix clEnqueueMapImage for arrays
                   Add some basic support for image arrays

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
2021-10-18 12:22:21 +10:00
Karol Herbst 029f22e430 clover/image: add templated basic_image class to simplify image subclassing
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>
2021-10-18 12:22:01 +10:00
Jason Ekstrand 99cda38c81 clover/nir: Don't remove texture variables
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
2021-10-16 05:49:34 +00:00
Jason Ekstrand 3c398139e1 lavapipe: Allow for texture types
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
2021-10-16 05:49:34 +00:00
Jason Ekstrand 956199e870 nir: s/nir_var_mem_image/nir_var_image/g
We typically use nir_var_mem_* for stuff that has an explicit byte-based
memory layout.  Images are opaque.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386>
2021-10-16 03:47:10 +00:00
Jason Ekstrand d68bedbb45 clover: Use nir_foreach_image_variable for images
This splits image and sampler handling into two separate loops.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
2021-10-15 14:58:56 +00:00
Jason Ekstrand aefa22ddb5 clover: Insert dummy uniform variables for images
Instead of making images have a well-defined size, insert a dummy
variable of the appropriate type which we can use for the parameter
block layout.  This will work much better when we switch over to
nir_var_mem_image.

Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
2021-10-15 14:58:56 +00:00
Jason Ekstrand 225caf537a llvmpipe: Support image variables living in nir_var_mem_image
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
2021-10-15 14:58:56 +00:00
Emma Anholt 3eadb03db7 ci/lvp: Skip some slow tests under ASan.
depending on the runner's load, we might see timeouts.  The
subgroupbroadcast one has hit us a couple times this week.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13346>
2021-10-13 21:41:07 +00:00
Adam Jackson ea038747df dri: Remove the allow_fp16_configs option, always allow them
There's no danger of accidentally using these, the default pixel format
is integer and if you want float you need to have explicitly asked for
it in eglChooseConfig.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13182>
2021-10-13 16:36:27 +00:00
Lone_Wolf ebfbb42e0e clover: TargetRegistry.h was moved to another folder
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13290>
2021-10-13 15:41:49 +00:00
Jason Ekstrand 8c4d78c764 lavapipe: Use the common WSI wrappers
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
2021-10-13 00:06:15 +00:00
Jason Ekstrand 916c9335b4 meson: Add and use an idep for Vulkan WSI
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
2021-10-13 00:06:15 +00:00
Jason Ekstrand 47adb11143 lavapipe: Switch to the new vk_error helpers
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>
2021-10-07 20:51:36 +00:00
Boris Brezillon b47090c5b3 spirv: Always declare FragCoord as a sysval
Now that all spirv_to_nir() users take care of converting sysvals to
varyings, we can unconditionally declare FragCoord as a sysval.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>
2021-10-07 19:45:35 +00:00
Boris Brezillon 4b62e90e71 spirv: Let spirv_to_nir() users turn sysvals into input varyings
This is an attempt at simplifying the spirv_to_nir() backend when it
comes to choosing between system values and input varyings. Let's patch
drivers to do the sysval to input varying conversion on their own so we
can get rid of the frag_coord_is_varying field in spirv_to_nir_options
and unconditionally create create sysvals for FragCoord, FrontFacing and
PointCoord inputs instead of adding new xxx_is_{sysval,varying} flags.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>
2021-10-07 19:45:35 +00:00
Pierre-Eric Pelloux-Prayer 22a1b7c5b3 gallium: add a is_dri_blit_image bool to pipe_blit_info
This indicates driver that a given blit is coming from the DRI
frontend.
This information can then be used to pick an appropriate blitting
method.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12763>
2021-10-07 09:21:05 +00:00
Dave Airlie f389f963ee lavapipe: fix fence handling around wsi submission
My previous fix was incorrect, properly fix things so that
fences in acquire get a proper timeline set.

Fixes: 028591954a ("lvp/fence: quick fix to previous commit.")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13218>
2021-10-06 20:52:09 +00:00
Dave Airlie b1f15b4f4d Revert "lvp/fence: quick fix to previous commit."
This reverts commit 028591954a.

This wasn't the correct fix, that is coming up.

Fixes: 028591954a ("lvp/fence: quick fix to previous commit.")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13218>
2021-10-06 20:52:09 +00:00
Mike Blumenkrantz 7cc85dba71 build: unify vulkan cpp platform args
these were duplicated all over the place, and it's annoying to have to keep
duplicating them any time a new component includes the vulkan header

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13141>
2021-10-06 14:19:35 +00:00
Mike Blumenkrantz 1d574d4860 lavapipe: remove display extension support
lavapipe doesn't actually support these

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13141>
2021-10-06 14:19:35 +00:00
Thomas Wagner fe1a091bd0 lavapipe: enable KHR_external_memory_fd
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Heinrich Fink <hfink@snap.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12345>
2021-10-06 13:49:08 +00:00
Thomas Wagner 895d3399f7 lavapipe: add support for KHR_external_memory_fd
Support creating exportable memory. Use memfd file
descriptors and import/export them as opaque fd handles.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Heinrich Fink <hfink@snap.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12345>
2021-10-06 13:49:08 +00:00
Dave Airlie 028591954a lvp/fence: quick fix to previous commit.
This fixes last of xcb cts issues.

Fixes: 8a294b6f975e1 ("lavapipe: Fix vkWaitForFences for initially-signalled fences")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13212>
2021-10-06 15:27:33 +10:00
Pavel Asyutchenko b9617bc621 lavapipe: Fix vkWaitForFences for initially-signalled fences
Fences with VK_FENCE_CREATE_SIGNALED_BIT are created with
signalled=true and timeline=0, waiting on them without
submitting first returned VK_TIMEOUT instead of VK_SUCCESS.

Signed-off-by: Pavel Asyutchenko <sventeam@yandex.ru>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13128>
2021-10-06 15:11:04 +10:00
Mike Blumenkrantz 96ea718b7e lavapipe: EXT_4444_formats support
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12001>
2021-10-06 04:35:25 +00:00
Mike Blumenkrantz 2f6debfd6d lavapipe: inherit from vk_image
simple and easy since we don't use much of this anyway

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13146>
2021-10-06 03:10:06 +00:00
Tapani Pälli 54325dd138 lavapipe: remove feature checks from device creation
This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Emma Anholt c530510514 gallium/dri: Make YUV formats we're going to emulate external-only.
If we're going to have to bind them as separate planes with colorspace
conversion for sampling on the frontend, then we need to report that
they're only for external-image samplers, otherwise the lowering won't be
applied.

Fixes: 4e3a7dcf ("gallium: enable EGL_EXT_image_dma_buf_import_modifiers unconditionally")
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038>
2021-09-30 19:22:48 +00:00
Veerabadhran Gopalakrishnan 2c2b5fc65f gallium/va: Remove VP9 header parsing for secure playback
Latest VCN FW is capable of parsing the VP9 uncompressed header.
Removing the parsing from gallium.

Signed-off-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13106>
2021-09-30 18:52:12 +00:00
Ed Baker e99278fcf8 frontends/va: Fix test_va_api VAAPIDisplayAttribs tests
Set max_display_attribs to 0 instead of 1 to match
va[Query,Get,Set]DisplayAttributes implementations [1].

If max_display_attribs is greater than 0 libva-utils tests check
vaQueryDisplayAttributes() accordingly [2].

[1] https://gitlab.freedesktop.org/mesa/mesa/-/blob/2de348cdb01e45/src/gallium/frontends/va/display.c#L32
[2] https://github.com/intel/libva-utils/blob/master/test/test_va_api_display_attribs.cpp#L90

Signed-off-by: Ed Baker <edward.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12941>
2021-09-30 17:28:44 +00:00
Dave Airlie b9aee98912 gallivm: use pmulhrsw to make aos sampling more accurate.
This uses pmulhrsw avx2 and ssse3 variants. It fixes the
precision of texture filtering calculations.

However it does leave these paths inaccurate on platforms
that don't support it.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
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/13075>
2021-09-29 21:55:23 +00:00
Pierre-Eric Pelloux-Prayer e67083caf4 gallium: add PIPE_CAP_PREFER_BACK_BUFFER_REUSE
This will be used in the next commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12788>
2021-09-29 08:14:57 +00:00
Dave Airlie 6db1434480 lavapipe: fixup image binding flags.
This removes a bunch of warnings in the debug logs on CI

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13091>
2021-09-29 07:57:22 +10:00
Dave Airlie 3010c86094 lavapipe: cleanup image create function.
drop the wrapper as it's unused and make things static.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13091>
2021-09-29 07:57:07 +10:00
Jason Ekstrand 06ac3b1bea lavapipe: Switch to common GetDeviceQueue and DeviceWaitIdle
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13003>
2021-09-28 21:08:26 +00:00
Jason Ekstrand f3040c6e05 lavapipe: Simplify DeviceWaitIdle
No reason to duplicate the guts of QueueWaitIdle inside DeviceWaitIdle.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13003>
2021-09-28 21:08:26 +00:00
Jason Ekstrand 6c8b0b35a6 lavapipe: Drop lvp_queue::flags
It's now part of vk_queue

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13003>
2021-09-28 21:08:25 +00:00
Jason Ekstrand b2313b6884 vulkan: Add the pCreateInfo to vk_queue_init()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13003>
2021-09-28 21:08:25 +00:00
Roland Scheidegger f2d76a576d lavapipe: Fix crashes with transform feedback when using VK_WHOLE_SIZE
llvmpipe expects valid size parameter, and when just VK_WHOLE_SIZE is
passed very bad things can happen.
This was handled specially before, but got dropped when lavapipe was
converted to use the generated command queue.

Fixes: eb7eccc76f ("lavapipe: Use generated command queue code")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13036>
2021-09-27 23:04:20 +00:00
Jesse Natalie 1f880a2ea8 clover: Rename module -> binary, because C++20 makes module a keyword
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12273>
2021-09-27 18:50:09 +00:00
Jesse Natalie 6fb29e1de0 clover: Delete unused 'e' exception reference vars
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12273>
2021-09-27 18:50:09 +00:00
Jesse Natalie 38e36df7cb clover: std::result_of is deprecated in c++17 and removed in c++20
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12273>
2021-09-27 18:50:09 +00:00
Dave Airlie 03097f30fb lavapipe: move to new shared features/properties
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12953>
2021-09-27 16:35:54 +10:00
Dave Airlie 08b54ebe98 lavapipe: enable vulkan 1.2 support.
The remaining extensions are optional features, just turn on vk 1.2
with them reporting as off.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12953>
2021-09-27 16:35:49 +10:00
Dave Airlie 6f6f7d2680 gallivm/nir: fix subgroup invocation read.
Again if you get passed an invoc but the exec mask has the
active lane somewhere other than at 0, then if we have an
invoc we should find the active lane and extract the value
from invoc rather than using the idx.

This fixes a bunch of VK 1.2 subgroup tests once 1.2 is enabled:
dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_nonconst*

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12953>
2021-09-27 16:35:45 +10:00
Dave Airlie c7907fe1a1 lavapipe: move to 1.2 features/properties structs.
This just adds all the wrappers in the right places hopefully

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12953>
2021-09-27 16:35:03 +10:00
Mike Blumenkrantz a8e123cd1c lavapipe: add support for KHR_shader_float_controls
These pass all the CTS tests, though not sure how useful they are.

[airlied: these may need some work in the future depending on app expectations]

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12953>
2021-09-27 16:34:34 +10:00
Dave Airlie 52acefc011 lavapipe/ci: drop some fails I fixed recently
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13011>
2021-09-24 13:04:59 +10:00
Yevhenii Kolesnikov 9d40877f72 lavapipe: Use a common vk_queue structure
Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>
2021-09-23 15:57:46 +00:00
Yevhenii Kolesnikov 8bf94337eb lavapipe: Use a common vk_command_buffer structure
Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>
2021-09-23 15:57:46 +00:00
Dave Airlie b7bfba5983 lavapipe: don't access pColorBlendState when not legal
This state isn't valid unless some conditions are met.

Fixes VK-GL-CTS
dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs.graphics

Fixes: 578190c0fe ("lavapipe: implement VK_EXT_color_write_enable")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12984>
2021-09-23 07:50:21 +00:00
Dave Airlie 6413b2b6a2 lavapipe: fix vertex attributes/descriptor binding
Yo' dawg, I heard you like bindings in your bindings.

When you have VertexAttribs with a binding, it's not an index into
the VertexBindings, you have to match it to the VertexBinding
with the same binding value.

This fixes
dEQP-VK.pipeline.extended_dynamic_state.after_pipelines.vertex_input_multiple_bindings
and some others.

Fixes: 5951d2abac ("lavapipe: implement EXT_vertex_input_dynamic_state")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12983>
2021-09-23 07:10:02 +00:00
Christian Gmeiner 3d65cea6ee util/bitset: s/BITSET_SET_RANGE/BITSET_SET_RANGE_INSIDE_WORD
Prep work for the next commit.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Dave Airlie 86399c1b1f lavapipe: enable KHR_spirv_1_4
One test fails but I think it's a missing barrier in the test

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12888>
2021-09-17 05:38:29 +10:00
Dave Airlie c1de9eff01 lavapipe: enable KHR_shader_subgroup_extended_types
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11816>
2021-09-16 04:15:41 +00:00
Dave Airlie 3a27e406ed lavapipe: enable KHR_shader_float16_int8
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11816>
2021-09-16 04:15:41 +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
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
Kai Wasserbäch d4f7337d14 fix(clover/llvm): update code to build with recent versions of LLVM 14 (Git)
`hasAttribute()` in `llvm::AttributeList` is gone, use `hasParamAttr()` instead.

This fixes an FTBFS.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12826>
2021-09-13 22:10:49 +00:00
Roland Scheidegger 1a554fd610 lavapipe: implement VK_EXT_depth_clip_enable
v2: fix pipeline creation, need a deep copy for rasterization state now

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12260>
2021-09-09 18:29:26 +00:00
Roland Scheidegger 49337ec410 gallium: add rasterizer depth_clamp enable bit
This is required for d3d10+, which has depth_clamp always enabled
regardless of depth_clip (in contrast to OpenGL, where enabling
depth_clamp disables depth_clip). There doesn't seem to be a GL
extension for it, but it will be used for lavapipe to implement
VK_EXT_depth_clip_enable.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12260>
2021-09-09 18:29:26 +00:00
Qiang Yu 1fd3cf990e mesa: fix glthread deadlock when EGL multi thread shared context
This fixes dEQP EGL tests when glthread is enabled:
dEQP-EGL.functional.sharing.gles2.multithread.random.images.copyteximage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random.images.texsubimage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_server_sync.images.teximage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_server_sync.images.texsubimage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.images.copyteximage2d.*
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.images.texsubimage2d.*

Deadlock happens when:

  Thread A: call EGL context functions which will involve _mesa_glthread_finish(), like
  eglMakeCurrent() and eglDestroyContext(). It will hold the EGLDisplay.Mutex and wait
  on glthread job queue empty (util_queue_fence_wait(&last->fence)). glthread job thread
  executes batch holding gl_context.Shared.TexMutex (glthread_unmarshal_batch()).

  Thread B: call EGLImage import functions like EGLImageTargetTexture2DOES() which will
  hold gl_context.Shared.TexMutex (egl_image_target_texture()) then validate EGLImage
  and hold EGLDisplay.Mutex (dri2_lookup_egl_image()).

This fixes the deadlock by moving the EGLImage validation out of gl_context.Shared.TexMutex
lock area.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>
2021-09-09 01:42:39 +00:00
Qiang Yu 4145532671 gallium/api: add validate_egl_image interface
For being used by mesa state tracker.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>
2021-09-09 01:42:39 +00:00
Qiang Yu d45d749e8b gallium/dri: add dri_screen egl image validate hooks
For being used by EGLImage import in the following commits.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>
2021-09-09 01:42:39 +00:00
Jesse Natalie e2bb111e02 wgl: Make overridden entrypoints local to stw_ext_context
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:22:35 -07:00
Jesse Natalie 739fb1057d wgl: Move wgl* non-extension definitions to libgl-gdi
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:22:24 -07:00
Jesse Natalie a153c78d6e wgl: Move opengl32.def to target instead of frontend
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:22:13 -07:00
Jesse Natalie 675775b140 wgl: Don't use BUILD_GL32 for wgl frontend
The set of GL exports from OpenGL32.dll is controlled by a .def file,
there's no need to also use __declspec(dllexport) for all of them.

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

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:22:00 -07:00
Mike Blumenkrantz ff6ccbf5f0 lavapipe: fix primitive restart with indexed indirect draws
restart index needs to be set

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12761>
2021-09-07 22:45:07 -04:00
Rob Clark 6619877bdf clover: Don't remove sampler/image uniforms
Otherwise we fool nir_shader_gather_info() into telling us there are no
samplers/images.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12733>
2021-09-05 18:14:08 +00:00
mattvchandler eed660221b gallium/osmesa: fix buffer resizing
Generate a new buffer if OSMesaMakeCurrent is called with a new size
Fix a use-after-free error when the old buffer is destroyed

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5276
Fixes: 26c6f6cfbb ("gallium/osmesa: Remove the broken buffer-reuse scheme.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12685>
2021-09-03 20:30:04 +00:00
Mike Blumenkrantz fd3eaabf28 lavapipe: unbreak push descriptor templates
the stride/offset calculation on this was all wrong, so just unroll the
template before enqueuing to present a uniform stream of descriptors
without trying to copy potentially megabytes of data

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12708>
2021-09-03 13:51:42 +00:00
Tomeu Vizoso 03d586899e Revert "lavapipe: unbreak imageless framebuffer"
This reverts commit c679dbe09c.

No need to override the generated cmd enqueing function, we can use the
information in vk.xml to do the right thing with pNext arguments.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12701>
2021-09-03 07:33:21 +02:00
Mike Blumenkrantz c679dbe09c lavapipe: unbreak imageless framebuffer
vk cmd queue doesn't copy pNext pointers

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12688>
2021-09-01 21:40:00 -04:00
Mike Blumenkrantz 9be8c48058 lavapipe: support EXT_primitive_topology_list_restart
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12627>
2021-09-01 22:01:03 +00:00
Tomeu Vizoso 25720f84df lavapipe: Use c_msvc_compat_args
So local builds fail before the Windows build finds out.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12662>
2021-09-01 16:00:01 +02:00
Tomeu Vizoso eb7eccc76f lavapipe: Use generated command queue code
Most of the code that implements entry points for commands doesn't need
to be manually written. So just drop it.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12369>
2021-09-01 01:05:22 +00:00
Tomeu Vizoso 77ad17d022 lavapipe: add xfails for whole of CTS
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12369>
2021-09-01 01:05:22 +00:00
Dave Airlie 07956bbcae lavapipe: VK_KHR_depth_stencil_resolve support
This adds support for depth stencil resolves to lavapipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504>
2021-08-31 23:26:45 +00:00
Erik Faye-Lund 526f7d7790 gallium/tgsi: rip out cylindrical wrap from ureg
We always pass zero to these arguments, so this feature isn't in use.

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12505>
2021-08-25 19:37:16 +00:00
Mike Blumenkrantz e645e3c523 nine: replace unnecessary dynamic-sized array with bitfield
PIPE_MAX_VERTEX_STREAMS is 4, so this can be simplified to reduce cpu usage

Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12523>
2021-08-24 20:38:41 +00:00
Erik Faye-Lund a16f3963d3 lavapipe: fix reported subpixel precision for lines
We have no reason to report a subpixel precision of 4 for lines; in fact
LLVMpipe uses 8 subpixel bits for lines, similar to other primitives.
But let's use the pipe-cap for this instead of hard-coding it.

Fixes: 9fbf6b2abf ("lavapipe: implement VK_EXT_line_rasterization")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12277>
2021-08-24 08:45:20 +00:00
Michel Zou 8bb9e9e76f lavapipe: fix missing VKAPI_CALL attribute
Fixes build on mingw

Fixes: c198adf7

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12484>
2021-08-21 16:46:43 +02:00
Marek Olšák 8f935317e6 frontend/dri: add environment variable DRI_NO_MSAA for performance comparisons
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12491>
2021-08-21 00:30:59 +00:00
Marek Olšák 10a46226b1 gallium: remove vertices_per_patch, add pipe_context::set_patch_vertices
We would like draw-only display lists to have immutable draw info and
this is the only GL non-draw state in pipe_draw_info (not counting
view_mask).

It also allows removing some code from draw_vbo for tessellation.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12351>
2021-08-21 00:08:11 +00:00
Emma Anholt 03e457bb1a ci/lavapipe: Add a fractional run with ASan
This catches use-after-frees and buffer overflows, but not leaks (which we
disable the checking for since the library gets dlclose()d and we end up
with useless backtraces).

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8889>
2021-08-20 18:22:30 +00:00
Marek Olšák bb89cf4bf3 gallium: add take_ownership into set_sampler_views to skip reference counting
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12334>
2021-08-20 15:04:20 +00:00
Boyuan Zhang 8e5e70bb3d frontends/va: add num_temporal_layers check
Fixes: 51935d59

temporal_id check is valid only if the num_temporal_layers is set (>0).
When num_temporal_layers is 0, we shouldn't check temporal_id and return
error.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12463>
2021-08-19 14:25:09 +00:00
Ian Romanick 5f2dbd45f2 gallium: Remove "optimize" parameter from pipe_screen::finalize_nir
As part of adding support for inline uniforms in Iris, I was going to
add a finalize_nir hook.  I went looking to see how other drivers use
the "optimize" parameter, and I discovered that *nobody* uses it at all.

v2: Fix typo in commit message.  Noticed by Mike.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12317>
2021-08-13 15:45:29 -07:00
Leo Liu fa1bb47703 frontends/va: Reallocate p010 buffer for AV1 10 bits decode
Check bit depth and reallocate p010 buffer if it's 10 bits.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12307>
2021-08-13 09:24:01 -04:00
Leo Liu 2ea47f258d frontends/va: Add AV1 profile main to the config
Thus enabling the AV1 support

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12307>
2021-08-13 09:24:01 -04:00
Leo Liu 4ce6100215 frontends/va: Place AV1 picture and slice parameter buffers functions
So that can pass the parameters from application to driver.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12307>
2021-08-13 09:24:01 -04:00
Leo Liu 9cc4c1d8f8 frontends/va: Add AV1 parameter buffers functions
Includes picture parameter and slice parameter buffers.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12307>
2021-08-13 09:24:01 -04:00
Leo Liu 0a421ff9a4 frontends/va: Add AV1 picture description
Driver will get codec parameters for hardware from it.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12307>
2021-08-13 09:24:01 -04:00
Dave Airlie c198adf718 lavapipe: add host ptr support.
This actually doesn't need any backend support.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12316>
2021-08-11 09:58:17 +10:00
Dave Airlie 7fb9e78d09 clover: only return CLC version as 1.2 (even for 3.0)
Fixes CTS compiler opencl_c_versions

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12286>
2021-08-10 21:38:39 +00:00
Dave Airlie e78d5bb8e2 clover/nir: don't convert to NIR on library link
If just creating a library, just link the spir-v and store it.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12286>
2021-08-10 21:38:39 +00:00
Dave Airlie 6cc1568ff5 clover: fix compilation with clang + llvm 12.
clang in llvm 12 no longer accepts "-cl-denorms-are-zero" as a cc1
options which is how this code uses it.

For now just pick the correct cc1 equivalent.

This fixes a crash with llvm master and CL conversions tests

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12286>
2021-08-10 21:38:39 +00:00
Mike Blumenkrantz 03ddffd19f nine: init more draw info members
Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12284>
2021-08-10 19:43:50 +00:00
Mike Blumenkrantz c361658670 nine: init take_index_buffer_ownership for draws
Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12284>
2021-08-10 19:43:50 +00:00
Jesse Natalie b3f9b347f9 wgl: Add a driver name for driconf
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Jesse Natalie 35ec7e8b8e wgl: Parse driconf options
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Jesse Natalie 7939094d65 gallium/dri: Move driConf -> st option processing to aux/util
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Dave Airlie 353e632393 clover: add kernel attributes support for SPIR-V
Fixes CTS api kernel_attributes

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12225>
2021-08-09 19:16:29 +00:00
Dave Airlie 773f046103 clover: return CL_INVALID_PLATFORM properly.
If the platform isn't clover platform return an error,

Fixes CTS api negative_get_platform_info

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12225>
2021-08-09 19:16:29 +00:00
Dave Airlie 3106a340a0 clover: fix api zero sized enqueue
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12225>
2021-08-09 19:16:29 +00:00
Erik Faye-Lund 7d3ab96f39 lavapipe: lower mipmapPrecisionBits to 4
Through some exhaustive searching, I've found that our log2 approximation
is precise to around 3.5 bits. And the squaring step should increase the
result with one bit, leaving us with 4.5 bits of precision.

Reporting the right mipmap precision fixes a few CTS-tests.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12238>
2021-08-09 06:27:10 +00:00
Thong Thai 3cafe333e9 frontends/va/postproc: Keep track of deinterlacing method being used
When transcoding a video, the context used by decode/postproc process
might be different from that of the encoder, but we encoder needs to
know if deinterlacing was used.

Fixes: c5088b4972 ("gallium: Fix VAAPI postproc blit")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12251>
2021-08-08 14:06:54 +00:00
Mike Blumenkrantz 2f665e52e1 nine: enable tc
Acked-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11866>
2021-08-06 18:40:32 +00:00
Mike Blumenkrantz 740752d232 nine: track bound sampler count to optimize unbinds
Acked-by: Marek Olšák <marek.olsak@amd.com>

Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11865>
2021-08-06 17:12:54 +00:00
Mike Blumenkrantz 7a170230f1 nine: update bound sampler mask directly during texture updates
Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11865>
2021-08-06 17:12:54 +00:00
Mike Blumenkrantz 9205a45da5 nine: split enabled/dummy texture binds into separate iterators
this removes a conditional from the loops

Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11865>
2021-08-06 17:12:54 +00:00
Mike Blumenkrantz 26d1886a7c nine: optimize texture binds a bit
this can just iterate over the mask of active textures instead of always
iterating over and rebinding all textures

Acked-by: Marek Olšák <marek.olsak@amd.com>

Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11865>
2021-08-06 17:12:54 +00:00
Erik Faye-Lund 028a83d9ad lavapipe: remove duplicate xfail with typo
Seems there's a rogue "time" in here, causing it to look like a new
failure. But if we remove that and resort the list, we'll see that this
failure was already listed.

Fixes: dfccbdff98 ("ci: update to VK-GL-CTS 1.2.7.0")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12233>
2021-08-06 15:37:34 +00:00