diff options
| author | Ian Elliott <ian@LunarG.com> | 2015-04-21 16:41:02 -0600 |
|---|---|---|
| committer | Ian Elliott <ian@LunarG.com> | 2015-05-15 17:41:11 -0600 |
| commit | e4602cd9e6cc3a806338c6a06c8ef77a4175076f (patch) | |
| tree | 7836495049c9dd7bd5d892ac47f368635278dd92 /icd | |
| parent | 4d0b66f936c27ff7592b3def08d1a6cc30db4379 (diff) | |
| download | usermoji-e4602cd9e6cc3a806338c6a06c8ef77a4175076f.tar.xz | |
wsi: Add queries for VkDisplayWSI's and VkFormat's to demos.
Show how to query which VkFormat to use for a WSI swap chain. In order to work
correctly, changes are needed to existing ICDs:
- Changed the order of VkFormats for the intel sample driver, so that the
desired value will be first (which is what the demos will use).
- Enhanced the nulldrv to support the
VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI query.
Diffstat (limited to 'icd')
| -rw-r--r-- | icd/nulldrv/nulldrv.c | 18 | ||||
| -rw-r--r-- | icd/nulldrv/nulldrv.h | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/icd/nulldrv/nulldrv.c b/icd/nulldrv/nulldrv.c index d6472c85..bc30671b 100644 --- a/icd/nulldrv/nulldrv.c +++ b/icd/nulldrv/nulldrv.c @@ -1472,6 +1472,24 @@ ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceInfo( NULLDRV_LOG_FUNC; VkResult ret = VK_SUCCESS; + if (infoType == VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI) { + // NOTE: Handle this extension value as a special case: + struct nulldrv_display *display; + VkDisplayPropertiesWSI *props = + (VkDisplayPropertiesWSI *) pData; + *pDataSize = sizeof(VkDisplayPropertiesWSI); + if (pData == NULL) { + return ret; + } + display = (struct nulldrv_display *) nulldrv_base_create(NULL, sizeof(*display), + /*VK_OBJECT_TYPE_SWAP_CHAIN_WSI*//* FIXME: DELETE THIS HACK: */VK_DBG_OBJECT_QUEUE); + props->display = (VkDisplayWSI) display; + props->physicalResolution.width = 1920; + props->physicalResolution.height = 1080; + + return ret; + } + switch (infoType) { case VK_PHYSICAL_DEVICE_INFO_TYPE_PROPERTIES: { diff --git a/icd/nulldrv/nulldrv.h b/icd/nulldrv/nulldrv.h index e40ada30..7e15d3b5 100644 --- a/icd/nulldrv/nulldrv.h +++ b/icd/nulldrv/nulldrv.h @@ -200,6 +200,11 @@ struct nulldrv_buf_view { uint32_t cmd_len; }; +struct nulldrv_display { + struct nulldrv_base base; + struct nulldrv_dev *dev; +}; + struct nulldrv_swap_chain { struct nulldrv_base base; struct nulldrv_dev *dev; |
