mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
v3dv: disallow image stores on VK_KHR_DISPLAY surfaces
Display surfaces must be linear and V3D can only do linear TMU access for 1D images. This would also restrict sampling usages, however, we can currently work around those in the driver at a performance penalty. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10268 Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26647>
This commit is contained in:
parent
f6437f4388
commit
205938cd39
1 changed files with 46 additions and 0 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include "vk_util.h"
|
||||
#include "wsi_common.h"
|
||||
#include "wsi_common_drm.h"
|
||||
#include "wsi_common_entrypoints.h"
|
||||
|
||||
static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
|
||||
v3dv_wsi_proc_addr(VkPhysicalDevice physicalDevice, const char *pName)
|
||||
|
|
@ -43,6 +44,51 @@ v3dv_wsi_can_present_on_device(VkPhysicalDevice _pdevice, int fd)
|
|||
return wsi_common_drm_devices_equal(fd, pdevice->display_fd);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
filter_surface_capabilities(VkSurfaceKHR _surface,
|
||||
VkSurfaceCapabilitiesKHR *caps)
|
||||
{
|
||||
ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, _surface);
|
||||
|
||||
/* Display images must be linear so they are restricted. This would
|
||||
* affect sampling usages too, but we don't restrict those since we
|
||||
* support on-the-fly conversion to UIF when sampling for simple 2D
|
||||
* images at a performance penalty.
|
||||
*/
|
||||
if (surface->platform == VK_ICD_WSI_PLATFORM_DISPLAY)
|
||||
caps->supportedUsageFlags &= ~VK_IMAGE_USAGE_STORAGE_BIT;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
v3dv_GetPhysicalDeviceSurfaceCapabilitiesKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkSurfaceKHR surface,
|
||||
VkSurfaceCapabilitiesKHR* pSurfaceCapabilities)
|
||||
{
|
||||
VkResult result;
|
||||
result = wsi_GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice,
|
||||
surface,
|
||||
pSurfaceCapabilities);
|
||||
filter_surface_capabilities(surface, pSurfaceCapabilities);
|
||||
return result;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
v3dv_GetPhysicalDeviceSurfaceCapabilities2KHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
||||
VkSurfaceCapabilities2KHR* pSurfaceCapabilities)
|
||||
{
|
||||
VkResult result;
|
||||
result = wsi_GetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice,
|
||||
pSurfaceInfo,
|
||||
pSurfaceCapabilities);
|
||||
filter_surface_capabilities(pSurfaceInfo->surface,
|
||||
&pSurfaceCapabilities->surfaceCapabilities);
|
||||
return result;
|
||||
}
|
||||
|
||||
VkResult
|
||||
v3dv_wsi_init(struct v3dv_physical_device *physical_device)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue