};
GetPhysicalDeviceProperties2(pdevice, &pdp2);
+ wsi->maxImageDimension2D = pdp2.properties.limits.maxImageDimension2D;
+
GetPhysicalDeviceMemoryProperties(pdevice, &wsi->memory_props);
GetPhysicalDeviceQueueFamilyProperties(pdevice, &wsi->queue_family_count, NULL);
.sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR,
};
- VkResult result = iface->get_capabilities2(surface, NULL, &caps2);
+ VkResult result = iface->get_capabilities2(surface, wsi_device, NULL, &caps2);
if (result == VK_SUCCESS)
*pSurfaceCapabilities = caps2.surfaceCapabilities;
ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, pSurfaceInfo->surface);
struct wsi_interface *iface = wsi_device->wsi[surface->platform];
- return iface->get_capabilities2(surface, pSurfaceInfo->pNext,
+ return iface->get_capabilities2(surface, wsi_device, pSurfaceInfo->pNext,
pSurfaceCapabilities);
}
.pNext = &counters,
};
- VkResult result = iface->get_capabilities2(surface, NULL, &caps2);
+ VkResult result = iface->get_capabilities2(surface, wsi_device, NULL, &caps2);
if (result == VK_SUCCESS) {
VkSurfaceCapabilities2EXT *ext_caps = pSurfaceCapabilities;
VkPhysicalDevicePCIBusInfoPropertiesEXT pci_bus_info;
bool supports_modifiers;
+ uint32_t maxImageDimension2D;
+
uint64_t (*image_get_modifier)(VkImage image);
#define WSI_CB(cb) PFN_vk##cb cb
static VkResult
wsi_display_surface_get_capabilities(VkIcdSurfaceBase *surface_base,
+ struct wsi_device *wsi_device,
VkSurfaceCapabilitiesKHR* caps)
{
VkIcdSurfaceDisplay *surface = (VkIcdSurfaceDisplay *) surface_base;
caps->currentExtent.width = mode->hdisplay;
caps->currentExtent.height = mode->vdisplay;
- /* XXX Figure out extents based on driver capabilities */
- caps->maxImageExtent = caps->minImageExtent = caps->currentExtent;
+ caps->minImageExtent = (VkExtent2D) { 1, 1 };
+ caps->maxImageExtent = (VkExtent2D) {
+ wsi_device->maxImageDimension2D,
+ wsi_device->maxImageDimension2D,
+ };
caps->supportedCompositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
static VkResult
wsi_display_surface_get_capabilities2(VkIcdSurfaceBase *icd_surface,
+ struct wsi_device *wsi_device,
const void *info_next,
VkSurfaceCapabilities2KHR *caps)
{
assert(caps->sType == VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR);
VkResult result;
- result = wsi_display_surface_get_capabilities(icd_surface,
+ result = wsi_display_surface_get_capabilities(icd_surface, wsi_device,
&caps->surfaceCapabilities);
if (result != VK_SUCCESS)
return result;
uint32_t queueFamilyIndex,
VkBool32* pSupported);
VkResult (*get_capabilities2)(VkIcdSurfaceBase *surface,
+ struct wsi_device *wsi_device,
const void *info_next,
VkSurfaceCapabilities2KHR* pSurfaceCapabilities);
VkResult (*get_formats)(VkIcdSurfaceBase *surface,
static VkResult
wsi_wl_surface_get_capabilities(VkIcdSurfaceBase *surface,
+ struct wsi_device *wsi_device,
VkSurfaceCapabilitiesKHR* caps)
{
/* For true mailbox mode, we need at least 4 images:
caps->currentExtent = (VkExtent2D) { -1, -1 };
caps->minImageExtent = (VkExtent2D) { 1, 1 };
- /* This is the maximum supported size on Intel */
- caps->maxImageExtent = (VkExtent2D) { 1 << 14, 1 << 14 };
+ caps->maxImageExtent = (VkExtent2D) {
+ wsi_device->maxImageDimension2D,
+ wsi_device->maxImageDimension2D,
+ };
+
caps->supportedTransforms = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
caps->currentTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
caps->maxImageArrayLayers = 1;
static VkResult
wsi_wl_surface_get_capabilities2(VkIcdSurfaceBase *surface,
+ struct wsi_device *wsi_device,
const void *info_next,
VkSurfaceCapabilities2KHR* caps)
{
assert(caps->sType == VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR);
- return wsi_wl_surface_get_capabilities(surface, &caps->surfaceCapabilities);
+ return wsi_wl_surface_get_capabilities(surface, wsi_device,
+ &caps->surfaceCapabilities);
}
static VkResult
static VkResult
x11_surface_get_capabilities(VkIcdSurfaceBase *icd_surface,
+ struct wsi_device *wsi_device,
VkSurfaceCapabilitiesKHR *caps)
{
xcb_connection_t *conn = x11_surface_get_connection(icd_surface);
*/
caps->currentExtent = (VkExtent2D) { -1, -1 };
caps->minImageExtent = (VkExtent2D) { 1, 1 };
- /* This is the maximum supported size on Intel */
- caps->maxImageExtent = (VkExtent2D) { 1 << 14, 1 << 14 };
+ caps->maxImageExtent = (VkExtent2D) {
+ wsi_device->maxImageDimension2D,
+ wsi_device->maxImageDimension2D,
+ };
}
free(err);
free(geom);
static VkResult
x11_surface_get_capabilities2(VkIcdSurfaceBase *icd_surface,
+ struct wsi_device *wsi_device,
const void *info_next,
VkSurfaceCapabilities2KHR *caps)
{
assert(caps->sType == VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR);
- return x11_surface_get_capabilities(icd_surface, &caps->surfaceCapabilities);
+ return x11_surface_get_capabilities(icd_surface, wsi_device, &caps->surfaceCapabilities);
}
static VkResult