Mark Lobodzinski | 6eda00a | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2015-2016 The Khronos Group Inc. |
| 2 | * Copyright (c) 2015-2016 Valve Corporation |
| 3 | * Copyright (c) 2015-2016 LunarG, Inc. |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 4 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 5 | * 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 Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 8 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 10 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 11 | * 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 Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 16 | * |
| 17 | * Author: Mark Lobodzinski <mark@lunarg.com> |
| 18 | * Author: Mike Stroyan <mike@LunarG.com> |
| 19 | * Author: Tobin Ehlis <tobin@lunarg.com> |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 20 | */ |
Mark Lobodzinski | 6eda00a | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 21 | |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 22 | #ifndef IMAGE_H |
| 23 | #define IMAGE_H |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 24 | #include "vulkan/vulkan.h" |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 25 | #include "vk_layer_config.h" |
| 26 | #include "vk_layer_logging.h" |
| 27 | |
Mike Stroyan | a308243 | 2015-09-25 13:39:21 -0600 | [diff] [blame] | 28 | // Image ERROR codes |
Mark Lobodzinski | d27a107 | 2016-05-19 17:10:01 -0600 | [diff] [blame] | 29 | enum IMAGE_ERROR { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 30 | IMAGE_NONE, // Used for INFO & other non-error messages |
| 31 | IMAGE_FORMAT_UNSUPPORTED, // Request to create Image or RenderPass with a format that is not supported |
| 32 | IMAGE_RENDERPASS_INVALID_ATTACHMENT, // Invalid image layouts and/or load/storeOps for an attachment when creating RenderPass |
Mike Weiblen | cce7ec7 | 2016-10-17 19:33:05 -0600 | [diff] [blame] | 33 | IMAGE_RENDERPASS_INVALID_DS_ATTACHMENT, // If no depth/stencil attachment for a RenderPass, verify that subpass DS attachment |
| 34 | // is set to UNUSED |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 35 | IMAGE_INVALID_IMAGE_ASPECT, // Image aspect mask bits are invalid for this API call |
| 36 | IMAGE_MISMATCHED_IMAGE_ASPECT, // Image aspect masks for source and dest images do not match |
| 37 | IMAGE_VIEW_CREATE_ERROR, // Error occurred trying to create Image View |
| 38 | IMAGE_MISMATCHED_IMAGE_TYPE, // Image types for source and dest images do not match |
| 39 | IMAGE_MISMATCHED_IMAGE_FORMAT, // Image formats for source and dest images do not match |
| 40 | IMAGE_INVALID_RESOLVE_SAMPLES, // Image resolve source samples less than two or dest samples greater than one |
| 41 | IMAGE_INVALID_FORMAT, // Operation specifies an invalid format, or there is a format mismatch |
| 42 | IMAGE_INVALID_FILTER, // Operation specifies an invalid filter setting |
| 43 | IMAGE_INVALID_IMAGE_RESOURCE, // Image resource/subresource called with invalid setting |
| 44 | IMAGE_INVALID_FORMAT_LIMITS_VIOLATION, // Device limits for this format have been exceeded |
Mark Lobodzinski | b2ad702 | 2016-03-29 17:10:14 -0600 | [diff] [blame] | 45 | IMAGE_INVALID_LAYOUT, // Operation specifies an invalid layout |
| 46 | IMAGE_INVALID_EXTENTS, // Operation specifies invalid image extents |
Tony Barbour | 26434b9 | 2016-06-02 09:43:50 -0600 | [diff] [blame] | 47 | IMAGE_INVALID_USAGE, // Image was created without necessary usage for operation |
Mark Lobodzinski | d27a107 | 2016-05-19 17:10:01 -0600 | [diff] [blame] | 48 | }; |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 49 | |
Mark Lobodzinski | d27a107 | 2016-05-19 17:10:01 -0600 | [diff] [blame] | 50 | struct IMAGE_STATE { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 51 | uint32_t mipLevels; |
| 52 | uint32_t arraySize; |
| 53 | VkFormat format; |
Chia-I Wu | 5c17c96 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 54 | VkSampleCountFlagBits samples; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 55 | VkImageType imageType; |
| 56 | VkExtent3D extent; |
| 57 | VkImageCreateFlags flags; |
Tony Barbour | 26434b9 | 2016-06-02 09:43:50 -0600 | [diff] [blame] | 58 | VkImageUsageFlags usage; |
Mark Lobodzinski | d27a107 | 2016-05-19 17:10:01 -0600 | [diff] [blame] | 59 | IMAGE_STATE() |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 60 | : mipLevels(0), arraySize(0), format(VK_FORMAT_UNDEFINED), samples(VK_SAMPLE_COUNT_1_BIT), |
Tony Barbour | 26434b9 | 2016-06-02 09:43:50 -0600 | [diff] [blame] | 61 | imageType(VK_IMAGE_TYPE_RANGE_SIZE), extent{}, flags(0), usage(0){}; |
Mark Lobodzinski | d27a107 | 2016-05-19 17:10:01 -0600 | [diff] [blame] | 62 | IMAGE_STATE(const VkImageCreateInfo *pCreateInfo) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 63 | : mipLevels(pCreateInfo->mipLevels), arraySize(pCreateInfo->arrayLayers), format(pCreateInfo->format), |
Tony Barbour | 26434b9 | 2016-06-02 09:43:50 -0600 | [diff] [blame] | 64 | samples(pCreateInfo->samples), imageType(pCreateInfo->imageType), extent(pCreateInfo->extent), flags(pCreateInfo->flags), |
| 65 | usage(pCreateInfo->usage){}; |
Mark Lobodzinski | d27a107 | 2016-05-19 17:10:01 -0600 | [diff] [blame] | 66 | }; |
Tobin Ehlis | cde0889 | 2015-09-22 10:11:37 -0600 | [diff] [blame] | 67 | |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 68 | #endif // IMAGE_H |