Mesa (main): anv: Implement VK_EXT_non_seamless_cube_map.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 10 18:52:26 UTC 2022


Module: Mesa
Branch: main
Commit: 9ccc68397365b4d38257715184bb446eb94fa6d7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9ccc68397365b4d38257715184bb446eb94fa6d7

Author: Georg Lehmann <dadschoorse at gmail.com>
Date:   Sun Aug 29 19:58:36 2021 +0200

anv: Implement VK_EXT_non_seamless_cube_map.

Signed-off-by: Georg Lehmann <dadschoorse at gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12730>

---

 docs/features.txt              | 2 +-
 docs/relnotes/new_features.txt | 2 +-
 src/intel/vulkan/anv_device.c  | 8 ++++++++
 src/intel/vulkan/genX_state.c  | 5 ++++-
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/docs/features.txt b/docs/features.txt
index cb05729c09f..2f16babda8f 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -556,7 +556,7 @@ Khronos extensions that are not part of any Vulkan version:
   VK_EXT_memory_budget                                  DONE (anv, radv, tu)
   VK_EXT_memory_priority                                DONE (radv)
   VK_EXT_multi_draw                                     DONE (anv, lvp, radv)
-  VK_EXT_non_seamless_cube_map                          DONE (radv)
+  VK_EXT_non_seamless_cube_map                          DONE (anv, radv)
   VK_EXT_pci_bus_info                                   DONE (anv, radv)
   VK_EXT_physical_device_drm                            DONE (anv, radv, tu, v3dv)
   VK_EXT_post_depth_coverage                            DONE (anv/gfx10+, lvp, radv/gfx10+)
diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt
index 80c9287a9b9..8443b90ecde 100644
--- a/docs/relnotes/new_features.txt
+++ b/docs/relnotes/new_features.txt
@@ -6,4 +6,4 @@ zink GL_EXT_memory_object_win32 and GL_EXT_semaphore_win32 support
 vertexAttributeInstanceRateZeroDivisor support for lavapipe
 panfrost Valhall support (conformant OpenGL ES 3.1 on Mali-G57)
 VK_EXT_primitives_generated_query on RADV
-VK_EXT_non_seamless_cube_map on RADV
+VK_EXT_non_seamless_cube_map on RADV, ANV
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 224fd655155..aedd385e424 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -285,6 +285,7 @@ get_device_extensions(const struct anv_physical_device *device,
       .EXT_inline_uniform_block              = true,
       .EXT_line_rasterization                = true,
       .EXT_memory_budget                     = device->sys.available,
+      .EXT_non_seamless_cube_map             = true,
       .EXT_pci_bus_info                      = true,
       .EXT_physical_device_drm               = true,
       .EXT_pipeline_creation_cache_control   = true,
@@ -1820,6 +1821,13 @@ void anv_GetPhysicalDeviceFeatures2(
          break;
       }
 
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT : {
+         VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *features =
+            (VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *)ext;
+         features->nonSeamlessCubeMap = true;
+         break;
+      }
+
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
          VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *features =
             (VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *)ext;
diff --git a/src/intel/vulkan/genX_state.c b/src/intel/vulkan/genX_state.c
index ab9d5f19798..b81b604206d 100644
--- a/src/intel/vulkan/genX_state.c
+++ b/src/intel/vulkan/genX_state.c
@@ -953,6 +953,9 @@ VkResult genX(CreateSampler)(
                               sampler->n_planes * 32, 32);
    }
 
+   const bool seamless_cube =
+      !(pCreateInfo->flags & VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT);
+
    for (unsigned p = 0; p < sampler->n_planes; p++) {
       const bool plane_has_chroma =
          sampler->conversion && sampler->conversion->format->planes[p].has_chroma;
@@ -1004,7 +1007,7 @@ VkResult genX(CreateSampler)(
          .ShadowFunction =
             vk_to_intel_shadow_compare_op[pCreateInfo->compareEnable ?
                                         pCreateInfo->compareOp : VK_COMPARE_OP_NEVER],
-         .CubeSurfaceControlMode = OVERRIDE,
+         .CubeSurfaceControlMode = seamless_cube ? OVERRIDE : PROGRAMMED,
 
          .BorderColorPointer = border_color_offset,
 



More information about the mesa-commit mailing list