From 44431f8ee5f79a60539b8d7f7854129c9672010d Mon Sep 17 00:00:00 2001 From: Rebecca Mckeever Date: Wed, 4 Jan 2023 15:17:24 -0800 Subject: [PATCH] nvk: Implement VK_EXT_non_seamless_cube_map Add new bit to VkSamplerCreateFlags and then advertise VK_EXT_non_seamless_cube_map. Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/42 Signed-off-by: Rebecca Mckeever Part-of: --- src/nouveau/vulkan/nvk_physical_device.c | 6 ++++++ src/nouveau/vulkan/nvk_sampler.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index 84227f904ed..21929bf2912 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -203,6 +203,11 @@ nvk_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, f->indexTypeUint8 = true; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: { + VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *f = (void *)ext; + f->nonSeamlessCubeMap = true; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: { VkPhysicalDeviceProvokingVertexFeaturesEXT *f = (void *)ext; f->provokingVertexLast = true; @@ -476,6 +481,7 @@ nvk_get_device_extensions(const struct nvk_physical_device *pdev, .EXT_image_2d_view_of_3d = true, .EXT_index_type_uint8 = true, .EXT_inline_uniform_block = true, + .EXT_non_seamless_cube_map = true, .EXT_pci_bus_info = true, .EXT_private_data = true, .EXT_provoking_vertex = true, diff --git a/src/nouveau/vulkan/nvk_sampler.c b/src/nouveau/vulkan/nvk_sampler.c index c6f726385c2..a0b80029dcc 100644 --- a/src/nouveau/vulkan/nvk_sampler.c +++ b/src/nouveau/vulkan/nvk_sampler.c @@ -224,7 +224,11 @@ nvk_CreateSampler(VkDevice _device, } assert(device->ctx->eng3d.cls >= KEPLER_A); - SAMP_SET_E(samp, NVA097, 1, CUBEMAP_INTERFACE_FILTERING, AUTO_SPAN_SEAM); + if (pCreateInfo->flags & VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT) { + SAMP_SET_E(samp, NVA097, 1, CUBEMAP_INTERFACE_FILTERING, USE_WRAP); + } else { + SAMP_SET_E(samp, NVA097, 1, CUBEMAP_INTERFACE_FILTERING, AUTO_SPAN_SEAM); + } if (device->ctx->eng3d.cls >= MAXWELL_B) { switch (vk_sampler_create_reduction_mode(pCreateInfo)) {