aboutsummaryrefslogtreecommitdiff
path: root/layers/draw_state.cpp
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-06-15 12:21:02 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-18 10:22:57 -0600
commit1c8dfd9a2a5cd5a81f8e4b758d699c19ff390cff (patch)
tree483ecaff0dd066da093bc24cb7f5da768ca11fa6 /layers/draw_state.cpp
parent688dd2e21c8c69f2d6b16226e92eac096d9c7fd8 (diff)
downloadusermoji-1c8dfd9a2a5cd5a81f8e4b758d699c19ff390cff.tar.xz
layers: Add GetPhysicalDeviceExtInfo to DrawState
Allows DrawState to be enabled in layers_validation_test
Diffstat (limited to 'layers/draw_state.cpp')
-rw-r--r--layers/draw_state.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 42dd96fb..282c2385 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -1581,6 +1581,45 @@ static const VkExtensionProperties dsExts[DRAW_STATE_LAYER_EXT_ARRAY_SIZE] = {
};
//TODO add DEBUG_MARKER to device extension list
+VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceExtensionInfo(
+ VkPhysicalDevice physical_device,
+ VkExtensionInfoType infoType,
+ uint32_t extensionIndex,
+ size_t *pDataSize,
+ void *pData)
+{
+ uint32_t *count;
+
+ if (pDataSize == NULL) {
+ return VK_ERROR_INVALID_POINTER;
+ }
+
+ switch (infoType) {
+ case VK_EXTENSION_INFO_TYPE_COUNT:
+ *pDataSize = sizeof(uint32_t);
+ if (pData == NULL) {
+ return VK_SUCCESS;
+ }
+ count = (uint32_t *) pData;
+ *count = DRAW_STATE_LAYER_EXT_ARRAY_SIZE;
+ break;
+ case VK_EXTENSION_INFO_TYPE_PROPERTIES:
+ *pDataSize = sizeof(VkExtensionProperties);
+ if (pData == NULL) {
+ return VK_SUCCESS;
+ }
+ if (extensionIndex >= DRAW_STATE_LAYER_EXT_ARRAY_SIZE) {
+ return VK_ERROR_INVALID_VALUE;
+ }
+ memcpy((VkExtensionProperties *) pData, &dsExts[extensionIndex], sizeof(VkExtensionProperties));
+ break;
+ default:
+ return VK_ERROR_INVALID_VALUE;
+ }
+
+ return VK_SUCCESS;
+}
+
VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
VkExtensionInfoType infoType,
uint32_t extensionIndex,