platform/upstream/mesa.git
3 years agoradv: Switch to the common VK_EXT_debug_report
Jason Ekstrand [Thu, 28 Jan 2021 22:29:37 +0000 (16:29 -0600)]
radv: Switch to the common VK_EXT_debug_report

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoradv: Use common entrypoints for VK_EXT_private_data
Jason Ekstrand [Thu, 28 Jan 2021 22:22:41 +0000 (16:22 -0600)]
radv: Use common entrypoints for VK_EXT_private_data

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoradv: port to using common dispatch code.
Dave Airlie [Mon, 25 Jan 2021 01:11:57 +0000 (11:11 +1000)]
radv: port to using common dispatch code.

I think this has the SQTT layer hooked in correctly, would
be good if somebody could confirm this.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoradv: move to subclassed instance/physical_device structs
Dave Airlie [Mon, 25 Jan 2021 00:35:32 +0000 (10:35 +1000)]
radv: move to subclassed instance/physical_device structs

This moves to using the common base structs for these
two objects, this is prep work for the using the common
dispatch layer code.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoradv: remove all entrypoint enabled debug option
Dave Airlie [Mon, 25 Jan 2021 01:32:22 +0000 (11:32 +1000)]
radv: remove all entrypoint enabled debug option

This was useful back at the dawn of time when apps weren't as
well developed and layers mostly sucked. I don't think it's been
used in a quite a while so remove it, as the new dispatch
layer doesn't support it.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoradv: move queue object to a common base object
Dave Airlie [Mon, 25 Jan 2021 01:23:58 +0000 (11:23 +1000)]
radv: move queue object to a common base object

This is needed to use the new dispatch layer code.  While we're here, we
clean up the context on the error path.

Fixes: 9b1138e3f0e96 "radv: implement VK_EXT_private_data"
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agov3dv: Switch to the common VK_EXT_debug_report
Jason Ekstrand [Thu, 28 Jan 2021 21:26:53 +0000 (15:26 -0600)]
v3dv: Switch to the common VK_EXT_debug_report

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agov3dv: Use common entrypoints for VK_EXT_private_data
Jason Ekstrand [Thu, 28 Jan 2021 21:25:30 +0000 (15:25 -0600)]
v3dv: Use common entrypoints for VK_EXT_private_data

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agov3dv: port to using common dispatch code.
Alejandro Piñeiro [Wed, 27 Jan 2021 23:21:38 +0000 (00:21 +0100)]
v3dv: port to using common dispatch code.

This moves v3dv over to using the new common dispatch layer code.

v2 (Jason Ekstrand):
 - Remove some now dead function declarations

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agov3dv: remove reference to v3dv_instance on v3dv_physical_device
Alejandro Piñeiro [Wed, 27 Jan 2021 22:45:28 +0000 (23:45 +0100)]
v3dv: remove reference to v3dv_instance on v3dv_physical_device

As we already have a reference to vk_instance at vk_physical_device,
that we are setting when calling vk_physical_device_init.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agov3dv: Drop v3dv_instance::app_info
Jason Ekstrand [Fri, 29 Jan 2021 18:01:34 +0000 (12:01 -0600)]
v3dv: Drop v3dv_instance::app_info

There's an equivalent data structure in vk_instance.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agov3dv: move to subclassing instance/physical device
Alejandro Piñeiro [Wed, 27 Jan 2021 12:46:58 +0000 (13:46 +0100)]
v3dv: move to subclassing instance/physical device

This moves to using the common base structs for these two objects, but
doesn't use any of the new features yet.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agolavapipe: Drop some wrappers in favor of common code
Jason Ekstrand [Thu, 28 Jan 2021 21:03:04 +0000 (15:03 -0600)]
lavapipe: Drop some wrappers in favor of common code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoturnip: Switch to the common VK_EXT_debug_report
Jason Ekstrand [Thu, 28 Jan 2021 20:56:34 +0000 (14:56 -0600)]
turnip: Switch to the common VK_EXT_debug_report

Acked-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoturnip: Drop some legacy wrappers in favor of common code
Jason Ekstrand [Thu, 28 Jan 2021 20:24:32 +0000 (14:24 -0600)]
turnip: Drop some legacy wrappers in favor of common code

Acked-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoturnip: Use common entrypoints for VK_EXT_private_data
Jason Ekstrand [Thu, 28 Jan 2021 20:23:34 +0000 (14:23 -0600)]
turnip: Use common entrypoints for VK_EXT_private_data

Acked-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoturnip: Use the common dispatch framework
Jason Ekstrand [Thu, 28 Jan 2021 19:53:02 +0000 (13:53 -0600)]
turnip: Use the common dispatch framework

Acked-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agolavapipe: use common dispatch layer.
Dave Airlie [Sun, 24 Jan 2021 23:50:29 +0000 (09:50 +1000)]
lavapipe: use common dispatch layer.

This moves lavapipe over to using the new common dispatch layer code.

v2 (Jason Ekstrand):
 - Less pointless messing around with python and meson

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agolavapipe: sort extensions in proper order.
Dave Airlie [Sun, 24 Jan 2021 23:49:28 +0000 (09:49 +1000)]
lavapipe: sort extensions in proper order.

Subsequent patch enforces this, so just do it in advance.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agolavapipe: add missing wsi entrypoint.
Dave Airlie [Sun, 24 Jan 2021 23:40:58 +0000 (09:40 +1000)]
lavapipe: add missing wsi entrypoint.

Add support for GetPhysicalDeviceSurfaceFormats2KHR which is helpful
to make the new dispatch code work.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agolavapipe: move to subclassing instance/physical device.
Dave Airlie [Sun, 24 Jan 2021 22:57:46 +0000 (08:57 +1000)]
lavapipe: move to subclassing instance/physical device.

This doesn't use any of the features yet, just moves to subclassing.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoanv: Switch to the common VK_EXT_debug_report
Jason Ekstrand [Wed, 27 Jan 2021 17:37:00 +0000 (11:37 -0600)]
anv: Switch to the common VK_EXT_debug_report

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add a truly common VK_EXT_debug_report implementation
Jason Ekstrand [Wed, 27 Jan 2021 17:32:15 +0000 (11:32 -0600)]
vulkan: Add a truly common VK_EXT_debug_report implementation

Now that we've got a common vk_instance, we can put the debug_report
stuff there and make it truly common.  For drivers to use this
implementation, they need to delete their own vk_debug_report_instance
and make sure everything references the common one.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan,anv: Move VK_KHR_copy_commands2 wrappers to common code
Jason Ekstrand [Mon, 25 Jan 2021 09:08:27 +0000 (03:08 -0600)]
vulkan,anv: Move VK_KHR_copy_commands2 wrappers to common code

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan,anv: Move a bunch of trivial wrappers to common code
Jason Ekstrand [Sun, 24 Jan 2021 20:49:57 +0000 (14:49 -0600)]
vulkan,anv: Move a bunch of trivial wrappers to common code

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoanv: Make Get*MemoryRequirements a wrapper
Jason Ekstrand [Thu, 28 Jan 2021 20:33:19 +0000 (14:33 -0600)]
anv: Make Get*MemoryRequirements a wrapper

Instead of making Get*MemoryRequirements2 call the legacy version to
fill out the base struct, put everything in Get*MemoryRequirements2 and
make the old one a trivial wrapper.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan,anv: Add common entrypoints for VK_EXT_private_data
Jason Ekstrand [Sun, 24 Jan 2021 04:43:56 +0000 (22:43 -0600)]
vulkan,anv: Add common entrypoints for VK_EXT_private_data

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan,anv: Move GetDeviceProcAddr to common code
Jason Ekstrand [Sun, 24 Jan 2021 20:29:28 +0000 (14:29 -0600)]
vulkan,anv: Move GetDeviceProcAddr to common code

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add framework for common entrypoints
Jason Ekstrand [Sun, 24 Jan 2021 20:26:23 +0000 (14:26 -0600)]
vulkan: Add framework for common entrypoints

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoanv: Use the common dispatch framework
Jason Ekstrand [Sat, 23 Jan 2021 10:57:21 +0000 (04:57 -0600)]
anv: Use the common dispatch framework

This commit switches ANV to using the new common physical device and
instance base structs as well as the new dispatch framework.  This
should make code sharing between Vulkan drivers much easier.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoanv: Add a single anv_genX switch macro
Jason Ekstrand [Sun, 24 Jan 2021 03:09:18 +0000 (21:09 -0600)]
anv: Add a single anv_genX switch macro

This should make future platform enabling a good bit easier and more
reliable than having 3 of them.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add a common entrypoint table generator
Jason Ekstrand [Sun, 24 Jan 2021 20:03:52 +0000 (14:03 -0600)]
vulkan: Add a common entrypoint table generator

This is based on the one in ANV but it's a bit different because it uses
vk_entrypoint_table instead of vk_dispatch_table.  This is because,
without knowing what extensions are implemented by a driver, we have to
generate a table with everything and sort it all out later.  We use the
same trick as ANV with weak function declarations to provide NULL values
for any entrypoints NOT implemented by the driver.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add common Get*ProcAddr implementations
Jason Ekstrand [Sat, 23 Jan 2021 19:48:04 +0000 (13:48 -0600)]
vulkan: Add common Get*ProcAddr implementations

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add entrypoint tables and related helpers
Jason Ekstrand [Sun, 24 Jan 2021 17:07:24 +0000 (11:07 -0600)]
vulkan: Add entrypoint tables and related helpers

Entrypoint tables are distinct from dispatch tables because they are not
de-duplicated.  These are needed to make codegen easier.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add generators for instance trampoline functions
Jason Ekstrand [Sat, 23 Jan 2021 19:28:21 +0000 (13:28 -0600)]
vulkan: Add generators for instance trampoline functions

ANV needs these because we have a different dispatch table for each
hardware generation and Vulkan requires that the device entrypoints
returned from vkGetInstanceProcAddr work regardless of which device
they're used with.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add common instance and physical device structs
Jason Ekstrand [Sat, 23 Jan 2021 19:06:02 +0000 (13:06 -0600)]
vulkan: Add common instance and physical device structs

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add dispatch table lookup helpers
Jason Ekstrand [Sat, 23 Jan 2021 18:46:02 +0000 (12:46 -0600)]
vulkan: Add dispatch table lookup helpers

These both look up a name by string and check to see if it's actually
supported given instance and possibly device extension tables.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan-overlay-layer: Use the new dispatch tables
Jason Ekstrand [Sat, 23 Jan 2021 17:47:35 +0000 (11:47 -0600)]
vulkan-overlay-layer: Use the new dispatch tables

This lets us drop the dispatch tables in enum_to_str and replace them
with the new, better versions.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add dispatch table loading helpers
Jason Ekstrand [Sat, 23 Jan 2021 17:36:18 +0000 (11:36 -0600)]
vulkan: Add dispatch table loading helpers

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add common dispatch table generation
Jason Ekstrand [Sat, 23 Jan 2021 11:00:08 +0000 (05:00 -0600)]
vulkan: Add common dispatch table generation

This is based off the dispatch table generation in ANV with the notable
exception that these tables de-duplicate aliased entrypoints by wrapping
all aliased entrypoints in a union which contains all the aliases.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoanv: Use the common extension table struct
Jason Ekstrand [Sat, 23 Jan 2021 20:45:32 +0000 (14:45 -0600)]
anv: Use the common extension table struct

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add common extension tables
Jason Ekstrand [Sat, 23 Jan 2021 11:12:43 +0000 (05:12 -0600)]
vulkan: Add common extension tables

Unlike the per-driver tables, these contain every extension ever and
assume the maximum extension version.  This later assumption is ok
because Vulkan extension versions have only been used for something
interesting once in the history of the API.  If it happens again, we can
afford a special case.

This requires us to rework the extension table generation scripts
somewhat because we want to use the same script for both common and
per-driver codegen right now.  To do this we add a "prefix" variable to
go alongside "driver".

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Add a return code to vk_device_init
Jason Ekstrand [Sun, 24 Jan 2021 15:26:24 +0000 (09:26 -0600)]
vulkan: Add a return code to vk_device_init

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan: Move vk_device to its own file
Jason Ekstrand [Sun, 24 Jan 2021 15:06:09 +0000 (09:06 -0600)]
vulkan: Move vk_device to its own file

Things are going to start getting more complicated so let's avoid the
single mega-file approach.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agolavapipe: Properly clean up vk_device
Jason Ekstrand [Sat, 23 Jan 2021 10:31:08 +0000 (04:31 -0600)]
lavapipe: Properly clean up vk_device

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agov3dv: Properly clean up vk_device
Jason Ekstrand [Sat, 23 Jan 2021 10:29:04 +0000 (04:29 -0600)]
v3dv: Properly clean up vk_device

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoturnip: Properly clean up vk_device
Jason Ekstrand [Sat, 23 Jan 2021 10:24:09 +0000 (04:24 -0600)]
turnip: Properly clean up vk_device

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoradv: Properly clean up vk_device
Jason Ekstrand [Sat, 23 Jan 2021 10:23:51 +0000 (04:23 -0600)]
radv: Properly clean up vk_device

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoanv: Clean up the vk_device on the CreateDevice error path
Jason Ekstrand [Sat, 23 Jan 2021 10:33:02 +0000 (04:33 -0600)]
anv: Clean up the vk_device on the CreateDevice error path

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agovulkan/meson: Add missing dependencise on vk_extensions_gen.py
Jason Ekstrand [Thu, 28 Jan 2021 19:51:57 +0000 (13:51 -0600)]
vulkan/meson: Add missing dependencise on vk_extensions_gen.py

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>

3 years agoci/freedreno: Add Valve games and other traces now that we have GLX.
Eric Anholt [Thu, 21 Jan 2021 20:42:11 +0000 (12:42 -0800)]
ci/freedreno: Add Valve games and other traces now that we have GLX.

Two games are skipped until we fix up their runtimes (or maybe make
scheduled overnight pipelines for longer traces?)

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8727>

3 years agoci/freedreno: Do our piglit runs against Xorg.
Eric Anholt [Fri, 22 Jan 2021 00:19:43 +0000 (16:19 -0800)]
ci/freedreno: Do our piglit runs against Xorg.

We were using surfaceless, which misses out on some useful coverage we'd
like to have in the GLX/EGL piglit tests, but more importantly prevented
many traces from running.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8727>

3 years agoci/lava+baremetal: Add an xserver to the root fs.
Eric Anholt [Thu, 21 Jan 2021 23:59:47 +0000 (15:59 -0800)]
ci/lava+baremetal: Add an xserver to the root fs.

We want to be able to test GLX and EGL on real hardware, and we can't do
that with just the surfaceless backend.  Bringing up the xserver is pretty
easy.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8727>

3 years agodocs/ci: Document setting up the http cache for traces.
Eric Anholt [Thu, 21 Jan 2021 21:55:02 +0000 (13:55 -0800)]
docs/ci: Document setting up the http cache for traces.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8727>

3 years agoci/docs: Update CI farm requirements suggestions.
Eric Anholt [Thu, 21 Jan 2021 21:40:47 +0000 (13:40 -0800)]
ci/docs: Update CI farm requirements suggestions.

We have a handy printout for slow tests now, and DEQP_FRACTION is now
compatible with parallel.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8727>

3 years agoci/freedreno: Use the http cache for artifacts downloads, too.
Eric Anholt [Thu, 21 Jan 2021 23:41:18 +0000 (15:41 -0800)]
ci/freedreno: Use the http cache for artifacts downloads, too.

The gitlab artifacts handling has been slow in the past as we hit
gitlab.fdo from multiple runners, and it costs fd.o egress bandwidth.  Use
the local http cache against the packet.net minio to cut that downloads
cost.

Closes: #3249
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8727>

3 years agoci/freedreno: Use the new nginx cache for trace downloads.
Eric Anholt [Thu, 21 Jan 2021 20:36:01 +0000 (12:36 -0800)]
ci/freedreno: Use the new nginx cache for trace downloads.

As we introduce bigger traces to the replay, pulling all of that down all
the way from packet is going to get unreasonable.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8727>

3 years agoci/freedreno: Drop pointless GIT_STRATEGY setting for a630.
Eric Anholt [Thu, 28 Jan 2021 19:56:30 +0000 (11:56 -0800)]
ci/freedreno: Drop pointless GIT_STRATEGY setting for a630.

It's already in place due to extending from .test.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8727>

3 years agoradv: Do not hash vk_object_base in descriptor set layout.
Bas Nieuwenhuizen [Mon, 1 Feb 2021 12:19:26 +0000 (13:19 +0100)]
radv: Do not hash vk_object_base in descriptor set layout.

It contains potentially pointer-y stuff.

Fixes: 178adfa6a8e ("radv: use the base object struct types")
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8809>

3 years agoradv: prefer CP DMA for GTT buffer copies/clears on dGPUs due to slow PCIe
Samuel Pitoiset [Thu, 28 Jan 2021 15:26:47 +0000 (16:26 +0100)]
radv: prefer CP DMA for GTT buffer copies/clears on dGPUs due to slow PCIe

The CP DMA bandwidth is always better than PCIe, so I think wasting
compute resources is not a good idea. This is only enabled on GFX10+
because untested on older gens and also because RadeonSI does that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8763>

3 years agoradv/winsys: move the initial BO domain to radeon_winsys_bo
Samuel Pitoiset [Thu, 28 Jan 2021 15:19:26 +0000 (16:19 +0100)]
radv/winsys: move the initial BO domain to radeon_winsys_bo

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8763>

3 years agoci: Use GNU time as meson test wrapper
Michel Dänzer [Fri, 29 Jan 2021 10:03:19 +0000 (11:03 +0100)]
ci: Use GNU time as meson test wrapper

This will hopefully give us more information about why some tests are
intermittently timing out.

Only in build jobs using the x86_build docker image for now, since
those are where we're currently seeing most such timeouts. But may
expand this later if it provides the expected benefits.

v2:
* Add comment about why we test for and use /usr/bin/time explicitly.

Acked-by: Eric Engestrom <eric@engestrom.ch> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8776>

3 years agor600/sfn: Use the constant buffer ID when given
Gert Wollny [Sun, 31 Jan 2021 17:54:29 +0000 (18:54 +0100)]
r600/sfn: Use the constant buffer ID when given

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8800>

3 years agor600/sfn: Fix dual source blend lowered to FRAG_DATA
Gert Wollny [Sun, 31 Jan 2021 12:39:47 +0000 (13:39 +0100)]
r600/sfn: Fix dual source blend lowered to FRAG_DATA

This fixes the Unigine benchmarks.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8800>

3 years agor600/sfn: Fix FS inputs when reading from the same position
Gert Wollny [Sat, 30 Jan 2021 20:47:26 +0000 (21:47 +0100)]
r600/sfn: Fix FS inputs when reading from the same position

Don't add another varying in this case.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8800>

3 years agor600/sfn: Add the position input as varying
Gert Wollny [Sat, 30 Jan 2021 18:09:42 +0000 (19:09 +0100)]
r600/sfn: Add the position input as varying

Like this it will be handled correctly in the shader IO structure

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8800>

3 years agor600/sfn: Set unnormalized flag for z-coordinate when fetching from array
Gert Wollny [Sat, 30 Jan 2021 18:08:55 +0000 (19:08 +0100)]
r600/sfn: Set unnormalized flag for z-coordinate when fetching from array

It shouldn't be relewant for fetch, but the TGSI code path does it, so
let's do it here as well.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8800>

3 years agor600/sfn: Fix use of cnde_int for bcsel
Gert Wollny [Sat, 30 Jan 2021 18:07:38 +0000 (19:07 +0100)]
r600/sfn: Fix use of cnde_int for bcsel

The boolean is an int, so use the int version of the opcode.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8800>

3 years agodocs/features: mark ssbos as done for zink
Erik Faye-Lund [Fri, 29 Jan 2021 11:34:18 +0000 (12:34 +0100)]
docs/features: mark ssbos as done for zink

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8778>

3 years agov3dv: Only lower local arrays of size up to 2 to if-chains
Arcady Goldmints-Orlov [Fri, 20 Nov 2020 07:12:51 +0000 (01:12 -0600)]
v3dv: Only lower local arrays of size up to 2 to if-chains

Larger arrays get lowered to scratch access later, as that turns out
to be faster, while the if-chain is actually faster for arrays of
2 elements.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>

3 years agobroadcom/compiler: Enable PER_QUAD TMU access only in uniform control flow
Arcady Goldmints-Orlov [Tue, 15 Dec 2020 19:55:23 +0000 (13:55 -0600)]
broadcom/compiler: Enable PER_QUAD TMU access only in uniform control flow

PER_QUAD TMU lookups will partially override the predication mask on TMU
writes. If some but not all lanes in a quad are predicated out, setting
PER_QUAD will force them all to be enabled. This can result in TMU
access to bogus addresses when in nonuniform control flow. Also, since
PER_QUAD is needed to make sure derivatives work with helper
invocations, and derivatives are undefined in nonuniform control flow,
there is no reason to leave it enabled in this case.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>

3 years agobroadcom/compiler: Emit uniform loops using uniform control flow
Arcady Goldmints-Orlov [Thu, 24 Dec 2020 16:24:56 +0000 (10:24 -0600)]
broadcom/compiler: Emit uniform loops using uniform control flow

Similarly to if statements, uniform loops are now emitted without
predication, using simple branches for breaks and continues. The
uniformity of the loop is determined by running the
nir_divergence_analysis pass.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>

3 years agobroadcom/compiler: Use ANYA for branches in uniform ifs
Arcady Goldmints-Orlov [Thu, 31 Dec 2020 17:04:11 +0000 (11:04 -0600)]
broadcom/compiler: Use ANYA for branches in uniform ifs

Using ANYAP instead of ALLAP makes things work correctly in cases
where all lanes are masked out.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>

3 years agonir/from_ssa: Respect and populate divergence information
Jason Ekstrand [Tue, 15 Oct 2019 21:14:39 +0000 (16:14 -0500)]
nir/from_ssa: Respect and populate divergence information

Reviewed-by: Arcady Goldmints-Orlov <agoldmints@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>

3 years agonir: store the results of divergence analysis on loops
Arcady Goldmints-Orlov [Thu, 24 Dec 2020 16:23:33 +0000 (10:23 -0600)]
nir: store the results of divergence analysis on loops

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>

3 years agonir: handle v3d intrinsics in divergence analysis
Arcady Goldmints-Orlov [Tue, 29 Dec 2020 18:43:04 +0000 (12:43 -0600)]
nir: handle v3d intrinsics in divergence analysis

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>

3 years agonir: add more intrinsics to divergence analysis
Arcady Goldmints-Orlov [Mon, 4 Jan 2021 02:55:31 +0000 (20:55 -0600)]
nir: add more intrinsics to divergence analysis

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>

3 years agomesa: Remove _mesa_destroy_context()
Rob Clark [Sun, 31 Jan 2021 16:58:09 +0000 (08:58 -0800)]
mesa: Remove _mesa_destroy_context()

There was only one caller, an error path in mesa/st.  But this is now
incorrect as we need align_free().  Just remove it.

Fixes: 55e853d823e ("mesa/st: Allocate the gl_context with 16-byte alignment.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8801>

3 years agoandroid: pan/mdg: create nir pass to lower image coord bitsize
Mauro Rossi [Sun, 31 Jan 2021 22:16:10 +0000 (23:16 +0100)]
android: pan/mdg: create nir pass to lower image coord bitsize

Fixes the following building error:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: midgard_nir_lower_image_bitsize
>>> referenced by midgard_compile.c:321 (external/mesa/src/panfrost/midgard/midgard_compile.c:321)

Fixes: db725e1d52a6 ("pan/mdg: create nir pass to lower image coord bitsize")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8802>

3 years agov3dv: Fix assert.
Vinson Lee [Sat, 23 Jan 2021 02:49:12 +0000 (18:49 -0800)]
v3dv: Fix assert.

Fix defect reported by Coverity Scan.

Side effect in assertion (ASSERT_SIDE_EFFECT)
assignment_where_comparison_intended: Assignment job->ez_state =
VC5_EZ_DISABLED has a side effect. This code will work differently in a
non-debug build.

Fixes: cec2ed7c80f ("v3dv: fix disabling Early Z for the whole frame")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8666>

3 years agolima: Fix typos.
Vinson Lee [Fri, 22 Jan 2021 21:46:49 +0000 (13:46 -0800)]
lima: Fix typos.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8658>

3 years agomesa: don't count buffer references for the context that created them
Marek Olšák [Mon, 4 Jan 2021 20:25:18 +0000 (15:25 -0500)]
mesa: don't count buffer references for the context that created them

See mtypes.h - it gives you the top level view of how it works, and other
code contains a lot of comments.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8606>

3 years agomesa: pop all textures up to NumCurrentTexUsed, not just MaxTextureUnits
Marek Olšák [Sun, 20 Dec 2020 04:02:16 +0000 (23:02 -0500)]
mesa: pop all textures up to NumCurrentTexUsed, not just MaxTextureUnits

glPush/PopAttrib had 2 defects:
- Only MaxTextureUnits were pushed and popped (which is 8 at most).
- If some texture units had been unused, we would still push/pop them.

This fix changes how many units we push and pop to NumCurrentTexUsed,
which is the maximum texture unit + 1 that was used to by the user.

This commit:
- In glPushAttrib, save NumCurrentTexUsed texture units.
- In glPopAttrib, restore the same number of texture units, and if
  NumCurrentTexUsed has increased since glPushAttrib, bind 0 in the newly
  used units to get them to the state before glPushAttrib.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: don't push/pop default texture attributes redundantly
Marek Olšák [Sun, 20 Dec 2020 00:55:59 +0000 (19:55 -0500)]
mesa: don't push/pop default texture attributes redundantly

Since default texture objects are bound in almost all texture units and all
texture targets, we can skip saving and restoring their attributes if we
just do that for default texture objects outside the loop saving all texture
units.

This reduces CPU time spent in glPushAttrib from 2.1% to 1.35% in one
subtest of viewperf13/catia.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: don't save gl_shared_state in glPushAttrib
Marek Olšák [Sun, 20 Dec 2020 00:12:48 +0000 (19:12 -0500)]
mesa: don't save gl_shared_state in glPushAttrib

glPushAttrib only saves values and names. It doesn't save objects.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: partially skip glPush/PopAttrib for MSAA textures and texture buffers
Marek Olšák [Sat, 19 Dec 2020 08:21:25 +0000 (03:21 -0500)]
mesa: partially skip glPush/PopAttrib for MSAA textures and texture buffers

This is based on the GL 4.6 Compatibility profile spec. Some fields just
don't have to be restored. This decreases CPU overhead.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: only pop states in glPopAttrib that have been changed since glPushAttrib
Marek Olšák [Sat, 19 Dec 2020 07:46:03 +0000 (02:46 -0500)]
mesa: only pop states in glPopAttrib that have been changed since glPushAttrib

PopAttribState records all state changes. glPopAttrib uses it to skip
restoring state groups that haven't been changed.

This eliminates a lot of glPopAttrib overhead.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: optimize out _NEW_ALL in glPopAttrib(GL_ENABLE_BIT)
Marek Olšák [Sat, 19 Dec 2020 07:41:32 +0000 (02:41 -0500)]
mesa: optimize out _NEW_ALL in glPopAttrib(GL_ENABLE_BIT)

I reviewed all affected states and this if the minimum attrib mask.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: fix trivial bugs in glPopAttrib
Marek Olšák [Sat, 19 Dec 2020 07:40:15 +0000 (02:40 -0500)]
mesa: fix trivial bugs in glPopAttrib

There were quite a few. Hopefully the comments make it clear.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: for every state change, remember states we changed for glPopAttrib
Marek Olšák [Sat, 19 Dec 2020 06:37:40 +0000 (01:37 -0500)]
mesa: for every state change, remember states we changed for glPopAttrib

The idea is to restore only those states in glPopAttrib that have been
changed. This will reduce glPopAttrib overhead a lot.

This is based on the state tables in the OpenGL 4.6 Compatibility Profile
specification and many extension specifications.

This code might superfluously flag GL_TEXTURE_BIT for texture and
sampler functions that don't have effect on states popped by glPopAttrib,
but I don't wanna test my luck and make a mistake. Thus,
if _NEW_TEXTURE_OBJECT if flagged, GL_TEXTURE_BIT is usually flagged too.

This has no effect on glPopAttrib yet. glPopAttrib will use this in a later
commit. This only adds attrib masks into FLUSH_VERTICES based on specs.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: flush glBegin/End before changing GL_DEPTH_STENCIL_TEXTURE_MODE
Marek Olšák [Sat, 19 Dec 2020 06:48:40 +0000 (01:48 -0500)]
mesa: flush glBegin/End before changing GL_DEPTH_STENCIL_TEXTURE_MODE

Fixes: 23e81b93bbe3 "mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3)."

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: fix glPopAttrib for many texture fields
Marek Olšák [Sat, 19 Dec 2020 06:19:35 +0000 (01:19 -0500)]
mesa: fix glPopAttrib for many texture fields

Move the fields that should be restored by glPopAttrib into the Attrib
structure, which is the only portion of texture objects that is restored
by glPopAttrib. Also moves fields that should not be restored by glPopAttrib
out of the Attrib structure.

This is based on the GL 4.6 Compatibility spec.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: don't push/pop gl_texture_object::Target
Marek Olšák [Sun, 20 Dec 2020 00:33:40 +0000 (19:33 -0500)]
mesa: don't push/pop gl_texture_object::Target

This field is immutable because each texture unit is an array of texture
target slots and only matching targets can be bound into each slot.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: optimize glPopAttrib(GL_VIEWPORT_BIT)
Marek Olšák [Sat, 19 Dec 2020 08:14:01 +0000 (03:14 -0500)]
mesa: optimize glPopAttrib(GL_VIEWPORT_BIT)

We can just copy the variables because they are already clamped
to ctx->Const limits.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: optimize most _mesa_ActiveTexture calls in glPopAttrib
Marek Olšák [Sat, 19 Dec 2020 08:04:45 +0000 (03:04 -0500)]
mesa: optimize most _mesa_ActiveTexture calls in glPopAttrib

_mesa_ActiveTexture changes CurrentUnit and the texture matrix stack
if the matrix mode is a texture matrix. In these cases, the texture matrix
stack is not touched.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agomesa: remove/replace FLUSH_VERTICES when it doesn't do anything
Marek Olšák [Sat, 19 Dec 2020 06:41:04 +0000 (01:41 -0500)]
mesa: remove/replace FLUSH_VERTICES when it doesn't do anything

In _mesa_PopAttrib, we call FLUSH_VERTICES at the beginning, so we don't
need to do it again.

In the MultiMode functions, we call standard Draw functions
using the dispatch, which do the flushing by themselves.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

3 years agoradeonsi: precompute NGG cull flags in si_create_rs_state
Marek Olšák [Thu, 14 Jan 2021 12:43:19 +0000 (07:43 -0500)]
radeonsi: precompute NGG cull flags in si_create_rs_state

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8794>

3 years agoradeonsi: prefetch VB descriptors right after uploading
Marek Olšák [Mon, 11 Jan 2021 20:14:40 +0000 (15:14 -0500)]
radeonsi: prefetch VB descriptors right after uploading

This skips the logic that sets and checks prefetch_L2_mask.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8794>

3 years agoradeonsi: set VB user SGPRs in si_upload_vertex_buffer_descriptors
Marek Olšák [Mon, 11 Jan 2021 20:02:48 +0000 (15:02 -0500)]
radeonsi: set VB user SGPRs in si_upload_vertex_buffer_descriptors

so that we don't have to enter the state emit loop and invoke the more
complicated function si_emit_graphics_shader_pointers.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8794>

3 years agoradeonsi: reorganize si_draw_vbo for lower register pressure (part 2)
Marek Olšák [Sun, 10 Jan 2021 02:43:33 +0000 (21:43 -0500)]
radeonsi: reorganize si_draw_vbo for lower register pressure (part 2)

Move statements that use the least number of local variables as close
to the beginning as possible. Also move local variables closer to their use.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8794>