Commit Graph

138994 Commits

Author SHA1 Message Date
Mike Blumenkrantz 7ed8e5db3a mesa/st: rename DrawGalliumComplex -> DrawGalliumMultiMode
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
2021-04-30 03:59:19 +00:00
Mike Blumenkrantz 4566383ae4 gallium: move pipe_draw_info::index_bias to pipe_draw_start_count_bias
this moves index_bias into the multidraw struct, enabling draws where the value
changes to be merged; the draw_info struct member is renamed and moved to the end
of the struct for tc use

u_vbuf still has some checks to split draws if index_bias changes, maybe
this can be removed at some point?

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
2021-04-30 03:59:19 +00:00
Mike Blumenkrantz 4fe6c85526 gallium: rename pipe_draw_start_count -> pipe_draw_start_count_bias
and add an index_bias member

no functional changes yet, just the rename and unused struct member

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
2021-04-30 03:59:19 +00:00
Timothy Arceri 60fa555e61 mesa: fix glShaderSource() error handling
Section 7.1 (SHADER OBJECTS) of the OpenGL 4.6 spec says:

   "An INVALID_VALUE error is generated if count is negative."

However a count of 0 is not an error. Previously it would cause a
GL_OUT_OF_MEMORY error.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10477>
2021-04-30 01:18:47 +00:00
Michael Tang 58f843a193 microsoft/compiler: Maintain sorting of resource type in the context
This change moves the SRVs associated with read-only SSBOs to be emitted
before any other UAV. We do this because the validator expects resources
to be emitted in a specific order, as noted by `emit_module`.

Previously, we emitted SSBOs as SRVs (read-only) or UAVs (read-write)
after other UAVs.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10514>
2021-04-29 23:55:02 +00:00
Jose Maria Casanova Crespo 5a503727f2 v3d: DRM_FORMAT_MOD_BROADCOM_SAND128 only available for NV12 format.
We were exposing as available DRM_FORMAT_MOD_BROADCOM_SAND128 for
any format.

Fixes: 95c4f0f910 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128 support"
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
2021-04-30 01:03:12 +02:00
Jose Maria Casanova Crespo 9094ad7c6a v3d: YUV formats at query_dmabuf_modifiers are external_only
This fixes Issue https://github.com/Igalia/meta-webkit/issues/185
"Issue Raspberry 4-64 + Mesa VC4 driver + Gstreamer = red Label on video"

Fixes: 95c4f0f910 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128 support"
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
2021-04-30 01:03:12 +02:00
Jose Maria Casanova Crespo 3d7b378980 v3d: YUV formats at is_dmabuf_modifier_supported are external_only
This fixes Issue https://github.com/Igalia/meta-webkit/issues/185
"Issue Raspberry 4-64 + Mesa VC4 driver + Gstreamer = red Label on video"

Fixes: 6ee10ab3de "gallium: Add pipe_screen::is_dmabuf_modifier_supported"
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
2021-04-30 01:03:12 +02:00
Pierre-Eric Pelloux-Prayer af00c92586 glx: init __GLXvendorInfo to NULL
Since 01ba8a8d02 the dd variable isn't necessarly initialized,
so the compiler complains:

   warning: ‘dd’ may be used uninitialized in this function

Initialize dd to NULL to fix this.

Fixes: 01ba8a8d02 ("glx: Implement GLX_EXT_no_config_context")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson 53e6ff4d64 glx: Remove some dead declarations from glxclient.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson b02b26b87c glx: s/Display */struct glx_display */ over internal API
We'd like to avoid __glXInitialize as much as possible since it involves
taking a global lock. This means converting internal APIs to operate as
much as possible in terms of something other than a Display *, since if
that's all you have then you're forced to call __glXInitialize to get to
the glx_display.

The contortions in DRI2 displease me, but DRI2 displeases me, so.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson 21411368a3 glx: Move server GLX vendor and version strings to glx_screen
These can in fact vary between screens.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson b91e58ad79 glx: Simplify some overuse of GetGLXScreenConfigs
If you call this on your current display and screen you're just going to
look up the same value we already stored in your context when we created
it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson 2c8a85b712 glx: Stash a copy of the XExtCodes in the glx_display
Instead of a pointer into xlib's state for it. Mostly because it lets us
remove our copy of majorOpcode from the display without taking another
pointer indirection.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson 1f096b51c6 glx: Remove unused opcode argument to __glX{Get,QueryServer}String
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson 8f853135e6 glx: Remove warn-once-ery around GLX 1.3 functions
Like, yes, this is an app bug, but we kinda emulate 1.3 anyway already
and are moving further in that direction, and at this point the app is
not going to get fixed. Just hush.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson 8edbe8761f glx: Simplify glXIsDirect
This answer is cached for us at context creation, we never really need
to generate protocol here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson 416e6b174c glx: Stop force-enabling extensions "implied" by GLX 1.3
1.3 has been ubiquitous since xserver 1.2 in early 2007, and has always
been supported with DRI2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Adam Jackson e716088c24 glx: Stop pretending the GLX major number isn't 1
Clarify the comments and logic accordingly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
2021-04-29 20:34:25 +00:00
Yiwei Zhang 96ec6b3d8f venus: handle wsi image queue ownership transfer for Android
1. pre-allocate command pools at device creation if anb enabled
2. force VK_SHARING_MODE_CONCURRENT for wsi image if necessary
3. pre-allocate and record command buffers at android wsi image creation
4. transfer in the ownership at vkAcquireImageANDROID
5. transfer out the ownership at vkQueueSignalReleaseImageANDROID

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10335>
2021-04-29 17:33:52 +00:00
Yiwei Zhang 174fca5498 venus: handle VK_IMAGE_LAYOUT_PRESENT_SRC_KHR transfer
Whenver VK_IMAGE_LAYOUT_PRESENT_SRC_KHR is used, replace it with
VK_IMAGE_LAYOUT_GENERAL as required for proper layout and ownership
transfer for external memory backed swapchain images.

This will be Android only until common WSI is fixed.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10335>
2021-04-29 17:33:52 +00:00
Yiwei Zhang 293255889c venus: enable VK_EXT_queue_family_foreign
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10335>
2021-04-29 17:33:52 +00:00
Yiwei Zhang 1846f0cead venus: update venus-protocol headers
Advertise VK_EXT_queue_family_foreign

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10335>
2021-04-29 17:33:52 +00:00
Mike Blumenkrantz ede0b3c643 docs: mark off GL_ARB_shader_clock for zink
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10521>
2021-04-29 15:52:10 +00:00
Rhys Perry 5ec25d54cf radv: fix possible use-after-free when inserting GS copy shader from cache
If we give radv_pipeline_cache_insert_shaders() a variant which was
retrived from the cache, it will free it.

I haven't encountered this issue, but it seems possible.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10433>
2021-04-29 14:06:49 +00:00
Rhys Perry d6894b643b radv: fix use-after-free upon GS copy shader cache hits
If radv_pipeline_cache_insert_shaders() finds a GS copy shader in the
cache, it will free the variant in gs_variants and replace it with the one
in the cache.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10433>
2021-04-29 14:06:49 +00:00
Rhys Perry 32ebbd8c23 vulkan: fix use-after-free in vk_common_DestroyDebugReportCallbackEXT
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: bd1705a480 ("vulkan: Make vk_debug_report_callback derive from vk_object_base")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10433>
2021-04-29 14:06:49 +00:00
Samuel Pitoiset c425b67c76 radv: fix computation of the number of user SGPRS for NGG GS state
The NGG GS state uses one user SGPR.

Cc: 21.1 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10485>
2021-04-29 13:45:39 +00:00
Mike Blumenkrantz 4b52a7f245 zink: hook up EXT_image_drm_format_modifier
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10520>
2021-04-29 12:32:59 +00:00
Mike Blumenkrantz 4df25407e9 zink: hook up VK_EXT_shader_subgroup_ballot
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10520>
2021-04-29 12:32:59 +00:00
Mike Blumenkrantz b1aef8ccc6 zink: hook up VK_EXT_conservative_rasterization
just the ext bits

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10520>
2021-04-29 12:32:59 +00:00
Mike Blumenkrantz 817a8fa22f zink: hook up VK_EXT_sample_locations
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10520>
2021-04-29 12:32:59 +00:00
Pierre-Eric Pelloux-Prayer 0477fbc655 driconf: add workaround for Golf With Friends
The game has a shader that uses texture functions that rely on implicit
derivatives after a discard.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4547

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10278>
2021-04-29 12:10:55 +00:00
Juan A. Suarez Romero e532a47f76 util/hash_table: do not leak u64 struct key
For non 64bit devices the key stored in hash_table_u64 is wrapped in
hash_key_u64 structure, which is never free.

This commit fixes this issue by just removing the user-defined
`delete_function` parameter in hash_table_u64_{destroy,clear} (which
nobody is using) and using instead a delete function to free this
structure.

Fixes: 608257cf82 ("i965: Fix INTEL_DEBUG=bat")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10480>
2021-04-29 12:58:23 +02:00
Juan A. Suarez Romero 33f9b06b0e v3dv: check dest bitsize in color blit
Otherwise, if src_bit_size > 0 and dst_bit_size == 0, we end up doing a
bad shift in `1 << (dst_bit_size - 1)`, as `dst_bit_size - 1` is a
negative value (in this case would be MAX_UINT32).

Fixes CID#1468134 "Bad bit shift operation (BAD_SHIFT)":
   "large_shift: In expression 1 << dst_bit_size - 1U, left shifting by
    more than 31 bits has undefined behavior. The shift amount,
    dst_bit_size - 1U, is 4294967295."

v2:
 - Use an assertion instead (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10251>
2021-04-29 10:31:11 +00:00
Juan A. Suarez Romero fd8d71ce41 v3dv: rename VC5 to V3D
As we are not using anymore references to the old VC5, let's rename
definitions from VC5 to V3D in the Vulkan driver.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
2021-04-29 11:22:12 +02:00
Juan A. Suarez Romero 26618dfb87 broadcom/simulator: change references to VC5
We are referring the driver as V3D instead old VC5; so let's update the
references.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
2021-04-29 11:22:12 +02:00
Juan A. Suarez Romero a77002584d broadcom/qpu: rename from VC5 to V3D
Get rid of old references to VC5.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
2021-04-29 11:22:12 +02:00
Juan A. Suarez Romero 14b66e27dc v3d: rename VC5 enums and definitions
As the driver was renamed in the past from VC5 to V3D, let's rename also
the definitions and enumerations to keep it consistent across the code.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
2021-04-29 11:22:12 +02:00
Juan A. Suarez Romero 3c318e6335 v3d: rename header include guards
Long time ago VC5 was renamed to V3D, but the include guards `VC5_FOO_H`
were not.

In order to keep consistency, let's rename these guards from `VC5_FOO_H`
to `V3D_FOO_H`.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
2021-04-29 11:22:12 +02:00
Caio Marcelo de Oliveira Filho e763db4a47 spirv: Don't replicate patch bool in vtn_variable
When we originally added patch variable handling to spirv_to_nir, we
were splitting I/O block variables in spirv_to_nir, so we weren't
guaranteed to have a nir_variable early enough in processing.

Since b0c643d8f5 ("spirv: Use NIR per-member splitting"), we've been
using NIR per-member splitting where we have a nir_variable which has
a separate nir_variable_data per member.  With this, we can drop
vtn_variable::patch and use the patch boolean on the nir_variable
instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10469>
2021-04-29 06:55:29 +00:00
Vinson Lee 3cd5e1b40f clover: Add constructor for constant_argument.
Fix defects reported by Coverity Scan.

member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize buf.
member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize st.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10399>
2021-04-28 22:30:07 -07:00
Jason Ekstrand 656c30ac59 intel/isl: There are seven aux states
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10515>
2021-04-28 23:16:03 -05:00
Mike Blumenkrantz 8243115836 zink: use first-created shader variant as the default
it's not really expected that most apps are going to be switching variants
all the time, so having the "default" one be more dynamic allows skipping
shader lookups more frequently

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 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 1ff40cedf0 zink: create entrypoints for descriptor variables with spirv 1.5
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10512>
2021-04-29 03:33:22 +00:00
Mike Blumenkrantz 3bf52471cc zink: generate spirv 1.5 from ntv when using vk >= 1.2
this has an ntv option so further tuning here should be easy enough

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10512>
2021-04-29 03:33:22 +00:00
Mike Blumenkrantz 6398605f28 zink: export PIPE_CAP_TGSI_CLOCK
ARB_shader_clock

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
2021-04-28 20:04:20 -04:00
Mike Blumenkrantz ff5e0cb1bb zink: support nir_intrinsic_shader_clock
simple const unop

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
2021-04-28 20:04:14 -04:00
Mike Blumenkrantz 0fba3bc236 zink: add spirv builder for unops with a const operand
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
2021-04-28 20:04:11 -04:00