Mark Lobodzinski | 288e4f7 | 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 | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 4 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | * of this software and/or associated documentation files (the "Materials"), to |
| 7 | * deal in the Materials without restriction, including without limitation the |
| 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 9 | * sell copies of the Materials, and to permit persons to whom the Materials |
| 10 | * are furnished to do so, subject to the following conditions: |
Tobin Ehlis | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 11 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 12 | * The above copyright notice(s) and this permission notice shall be included |
| 13 | * in all copies or substantial portions of the Materials. |
Tobin Ehlis | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 14 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 15 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Tobin Ehlis | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 18 | * |
| 19 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 20 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 21 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 22 | * USE OR OTHER DEALINGS IN THE MATERIALS |
Courtney Goeltzenleuchter | 96cd795 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 23 | * |
| 24 | * Author: Mark Lobodzinski <mark@lunarg.com> |
| 25 | * Author: Mike Stroyan <mike@LunarG.com> |
| 26 | * Author: Tobin Ehlis <tobin@lunarg.com> |
Tobin Ehlis | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 27 | */ |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 28 | |
Tobin Ehlis | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 29 | #ifndef IMAGE_H |
| 30 | #define IMAGE_H |
David Pinedo | 329ca9e | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 31 | #include "vulkan/vulkan.h" |
Tobin Ehlis | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 32 | #include "vk_layer_config.h" |
| 33 | #include "vk_layer_logging.h" |
| 34 | |
Mike Stroyan | 43909d8 | 2015-09-25 13:39:21 -0600 | [diff] [blame] | 35 | // Image ERROR codes |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 36 | typedef enum _IMAGE_ERROR { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 37 | IMAGE_NONE, // Used for INFO & other non-error messages |
| 38 | IMAGE_FORMAT_UNSUPPORTED, // Request to create Image or RenderPass with a format that is not supported |
| 39 | IMAGE_RENDERPASS_INVALID_ATTACHMENT, // Invalid image layouts and/or load/storeOps for an attachment when creating RenderPass |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 40 | IMAGE_RENDERPASS_INVALID_DS_ATTACHMENT, // If no depth attachment for a RenderPass, verify that subpass DS attachment is set to |
| 41 | // UNUSED |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 42 | IMAGE_INVALID_IMAGE_ASPECT, // Image aspect mask bits are invalid for this API call |
| 43 | IMAGE_MISMATCHED_IMAGE_ASPECT, // Image aspect masks for source and dest images do not match |
| 44 | IMAGE_VIEW_CREATE_ERROR, // Error occurred trying to create Image View |
| 45 | IMAGE_MISMATCHED_IMAGE_TYPE, // Image types for source and dest images do not match |
| 46 | IMAGE_MISMATCHED_IMAGE_FORMAT, // Image formats for source and dest images do not match |
| 47 | IMAGE_INVALID_RESOLVE_SAMPLES, // Image resolve source samples less than two or dest samples greater than one |
| 48 | IMAGE_INVALID_FORMAT, // Operation specifies an invalid format, or there is a format mismatch |
| 49 | IMAGE_INVALID_FILTER, // Operation specifies an invalid filter setting |
| 50 | IMAGE_INVALID_IMAGE_RESOURCE, // Image resource/subresource called with invalid setting |
| 51 | IMAGE_INVALID_FORMAT_LIMITS_VIOLATION, // Device limits for this format have been exceeded |
Mark Lobodzinski | 2f9b987 | 2016-03-29 17:10:14 -0600 | [diff] [blame] | 52 | IMAGE_INVALID_LAYOUT, // Operation specifies an invalid layout |
| 53 | IMAGE_INVALID_EXTENTS, // Operation specifies invalid image extents |
Tobin Ehlis | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 54 | } IMAGE_ERROR; |
| 55 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 56 | typedef struct _IMAGE_STATE { |
| 57 | uint32_t mipLevels; |
| 58 | uint32_t arraySize; |
| 59 | VkFormat format; |
Chia-I Wu | 3138d6a | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 60 | VkSampleCountFlagBits samples; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 61 | VkImageType imageType; |
| 62 | VkExtent3D extent; |
| 63 | VkImageCreateFlags flags; |
| 64 | _IMAGE_STATE() |
| 65 | : mipLevels(0), arraySize(0), format(VK_FORMAT_UNDEFINED), samples(VK_SAMPLE_COUNT_1_BIT), |
| 66 | imageType(VK_IMAGE_TYPE_RANGE_SIZE), extent{}, flags(0){}; |
| 67 | _IMAGE_STATE(const VkImageCreateInfo *pCreateInfo) |
| 68 | : mipLevels(pCreateInfo->mipLevels), arraySize(pCreateInfo->arrayLayers), format(pCreateInfo->format), |
| 69 | samples(pCreateInfo->samples), imageType(pCreateInfo->imageType), extent(pCreateInfo->extent), |
| 70 | flags(pCreateInfo->flags){}; |
Tobin Ehlis | 342b9bf | 2015-09-22 10:11:37 -0600 | [diff] [blame] | 71 | } IMAGE_STATE; |
| 72 | |
Tobin Ehlis | 6538053 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 73 | #endif // IMAGE_H |