blob: 44ae17c36460b0be38a0e43aed840d05b8fb70d2 [file] [log] [blame]
Mark Lobodzinski6eda00a2016-02-02 15:55:36 -07001/* Copyright (c) 2015-2016 The Khronos Group Inc.
2 * Copyright (c) 2015-2016 Valve Corporation
3 * Copyright (c) 2015-2016 LunarG, Inc.
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -06004 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -06005 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -06008 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060010 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -060011 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
Courtney Goeltzenleuchter05559522015-10-30 11:14:30 -060016 *
17 * Author: Tobin Ehlis <tobin@lunarg.com>
Mark Lobodzinski6eda00a2016-02-02 15:55:36 -070018 * Author: Mark Lobodzinski <mark@lunarg.com>
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060019 */
Mark Lobodzinski6eda00a2016-02-02 15:55:36 -070020
David Pinedo9316d3b2015-11-06 12:54:48 -070021#include "vulkan/vk_layer.h"
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060022#include <vector>
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060023
24using namespace std;
25
26// Device Limits ERROR codes
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060027enum DEV_LIMITS_ERROR {
Jon Ashburn5484e0c2016-03-08 17:48:44 -070028 DEVLIMITS_NONE, // Used for INFO & other non-error messages
29 DEVLIMITS_INVALID_INSTANCE, // Invalid instance used
30 DEVLIMITS_INVALID_PHYSICAL_DEVICE, // Invalid physical device used
31 DEVLIMITS_INVALID_INHERITED_QUERY, // Invalid use of inherited query
Michael Lentine20e4c192016-04-06 17:40:22 -050032 DEVLIMITS_INVALID_ATTACHMENT_COUNT, // Invalid value for the number of attachments
Jan-Harald Fredriksen4f57fd12016-06-08 18:51:52 +020033 DEVLIMITS_MISSING_QUERY_COUNT, // Did not make initial call to an API to query the count
Jon Ashburn5484e0c2016-03-08 17:48:44 -070034 DEVLIMITS_MUST_QUERY_COUNT, // Failed to make initial call to an API to query the count
Jon Ashburn5484e0c2016-03-08 17:48:44 -070035 DEVLIMITS_INVALID_CALL_SEQUENCE, // Flag generic case of an invalid call sequence by the app
36 DEVLIMITS_INVALID_FEATURE_REQUESTED, // App requested a feature not supported by physical device
37 DEVLIMITS_COUNT_MISMATCH, // App requesting a count value different than actual value
38 DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, // Invalid queue requested based on queue family properties
Jon Ashburn5484e0c2016-03-08 17:48:44 -070039 DEVLIMITS_INVALID_UNIFORM_BUFFER_OFFSET, // Uniform buffer offset violates device limit granularity
40 DEVLIMITS_INVALID_STORAGE_BUFFER_OFFSET, // Storage buffer offset violates device limit granularity
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060041};
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060042
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060043enum CALL_STATE{
Jon Ashburn5484e0c2016-03-08 17:48:44 -070044 UNCALLED, // Function has not been called
45 QUERY_COUNT, // Function called once to query a count
46 QUERY_DETAILS, // Function called w/ a count to query details
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060047};
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060048
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060049struct INSTANCE_STATE {
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060050 // Track the call state and array size for physical devices
51 CALL_STATE vkEnumeratePhysicalDevicesState;
52 uint32_t physicalDevicesCount;
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060053 INSTANCE_STATE() : vkEnumeratePhysicalDevicesState(UNCALLED), physicalDevicesCount(0){};
54};
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060055
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060056struct PHYSICAL_DEVICE_STATE {
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -060057 // Track the call state and array sizes for various query functions
58 CALL_STATE vkGetPhysicalDeviceQueueFamilyPropertiesState;
59 uint32_t queueFamilyPropertiesCount;
Tobin Ehlis9da65002015-09-24 15:25:16 -060060 CALL_STATE vkGetPhysicalDeviceLayerPropertiesState;
61 uint32_t deviceLayerCount;
62 CALL_STATE vkGetPhysicalDeviceExtensionPropertiesState;
63 uint32_t deviceExtensionCount;
64 CALL_STATE vkGetPhysicalDeviceFeaturesState;
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060065 PHYSICAL_DEVICE_STATE()
Jon Ashburn5484e0c2016-03-08 17:48:44 -070066 : vkGetPhysicalDeviceQueueFamilyPropertiesState(UNCALLED), queueFamilyPropertiesCount(0),
67 vkGetPhysicalDeviceLayerPropertiesState(UNCALLED), deviceLayerCount(0),
68 vkGetPhysicalDeviceExtensionPropertiesState(UNCALLED), deviceExtensionCount(0),
69 vkGetPhysicalDeviceFeaturesState(UNCALLED){};
Mark Lobodzinski48eee0d2016-05-19 17:10:58 -060070};