radv: Implement VK_EXT_non_seamless_cube_map.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12729>
This commit is contained in:
Georg Lehmann 2021-08-27 14:22:31 +02:00 committed by Marge Bot
parent d5d16a4f00
commit 17818800d0
3 changed files with 11 additions and 1 deletions

View File

@ -556,6 +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_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+)

View File

@ -6,3 +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

View File

@ -499,6 +499,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
.EXT_memory_budget = true,
.EXT_memory_priority = true,
.EXT_multi_draw = true,
.EXT_non_seamless_cube_map = true,
.EXT_pci_bus_info = true,
#ifndef _WIN32
.EXT_physical_device_drm = true,
@ -1763,6 +1764,12 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->primitivesGeneratedQueryWithNonZeroStreams = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT : {
VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *features =
(VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *)ext;
features->nonSeamlessCubeMap = true;
break;
}
default:
break;
}
@ -6413,6 +6420,7 @@ radv_init_sampler(struct radv_device *device, struct radv_sampler *sampler,
VkBorderColor border_color =
uses_border_color ? pCreateInfo->borderColor : VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
uint32_t border_color_ptr;
bool disable_cube_wrap = pCreateInfo->flags & VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT;
const struct VkSamplerReductionModeCreateInfo *sampler_reduction =
vk_find_struct_const(pCreateInfo->pNext, SAMPLER_REDUCTION_MODE_CREATE_INFO);
@ -6452,7 +6460,7 @@ radv_init_sampler(struct radv_device *device, struct radv_sampler *sampler,
S_008F30_MAX_ANISO_RATIO(max_aniso_ratio) | S_008F30_DEPTH_COMPARE_FUNC(depth_compare_func) |
S_008F30_FORCE_UNNORMALIZED(pCreateInfo->unnormalizedCoordinates ? 1 : 0) |
S_008F30_ANISO_THRESHOLD(max_aniso_ratio >> 1) | S_008F30_ANISO_BIAS(max_aniso_ratio) |
S_008F30_DISABLE_CUBE_WRAP(0) | S_008F30_COMPAT_MODE(compat_mode) |
S_008F30_DISABLE_CUBE_WRAP(disable_cube_wrap) | S_008F30_COMPAT_MODE(compat_mode) |
S_008F30_FILTER_MODE(filter_mode) | S_008F30_TRUNC_COORD(trunc_coord));
sampler->state[1] = (S_008F34_MIN_LOD(radv_float_to_ufixed(CLAMP(pCreateInfo->minLod, 0, 15), 8)) |
S_008F34_MAX_LOD(radv_float_to_ufixed(CLAMP(pCreateInfo->maxLod, 0, 15), 8)) |