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 | * |
Mark Lobodzinski | 6eda00a | 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 | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 11 | * |
Mark Lobodzinski | 6eda00a | 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 | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 14 | * |
Mark Lobodzinski | 6eda00a | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 15 | * The Materials are Confidential Information as defined by the Khronos |
| 16 | * Membership Agreement until designated non-confidential by Khronos, at which |
| 17 | * point this condition clause shall be removed. |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 18 | * |
Mark Lobodzinski | 6eda00a | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 19 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Mark Lobodzinski | 6eda00a | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 22 | * |
| 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 24 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 25 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 26 | * USE OR OTHER DEALINGS IN THE MATERIALS |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 27 | * |
| 28 | * Author: Mark Lobodzinski <mark@lunarg.com> |
| 29 | * Author: Mike Stroyan <mike@LunarG.com> |
| 30 | * Author: Tobin Ehlis <tobin@lunarg.com> |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 31 | */ |
Mark Lobodzinski | 6eda00a | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 32 | |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 33 | #ifndef IMAGE_H |
| 34 | #define IMAGE_H |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 35 | #include "vulkan/vulkan.h" |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 36 | #include "vk_layer_config.h" |
| 37 | #include "vk_layer_logging.h" |
| 38 | |
Mike Stroyan | a308243 | 2015-09-25 13:39:21 -0600 | [diff] [blame] | 39 | // Image ERROR codes |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame^] | 40 | typedef enum _IMAGE_ERROR |
| 41 | { |
| 42 | IMAGE_NONE, // Used for INFO & other non-error messages |
| 43 | IMAGE_FORMAT_UNSUPPORTED, // Request to create Image or RenderPass with a format that is not supported |
| 44 | IMAGE_RENDERPASS_INVALID_ATTACHMENT, // Invalid image layouts and/or load/storeOps for an attachment when creating RenderPass |
| 45 | IMAGE_RENDERPASS_INVALID_DS_ATTACHMENT, // If no depth attachment for a RenderPass, verify that subpass DS attachment is set to UNUSED |
| 46 | IMAGE_INVALID_IMAGE_ASPECT, // Image aspect mask bits are invalid for this API call |
| 47 | IMAGE_MISMATCHED_IMAGE_ASPECT, // Image aspect masks for source and dest images do not match |
| 48 | IMAGE_VIEW_CREATE_ERROR, // Error occurred trying to create Image View |
| 49 | IMAGE_MISMATCHED_IMAGE_TYPE, // Image types for source and dest images do not match |
| 50 | IMAGE_MISMATCHED_IMAGE_FORMAT, // Image formats for source and dest images do not match |
| 51 | IMAGE_INVALID_RESOLVE_SAMPLES, // Image resolve source samples less than two or dest samples greater than one |
| 52 | IMAGE_INVALID_FORMAT, // Operation specifies an invalid format, or there is a format mismatch |
| 53 | IMAGE_INVALID_FILTER, // Operation specifies an invalid filter setting |
| 54 | IMAGE_INVALID_IMAGE_RESOURCE, // Image resource/subresource called with invalid setting |
| 55 | IMAGE_INVALID_FORMAT_LIMITS_VIOLATION, // Device limits for this format have been exceeded |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 56 | } IMAGE_ERROR; |
| 57 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame^] | 58 | typedef struct _IMAGE_STATE |
| 59 | { |
| 60 | uint32_t mipLevels; |
| 61 | uint32_t arraySize; |
| 62 | VkFormat format; |
Chia-I Wu | 5c17c96 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 63 | VkSampleCountFlagBits samples; |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame^] | 64 | VkImageType imageType; |
| 65 | VkExtent3D extent; |
| 66 | VkImageCreateFlags flags; |
| 67 | _IMAGE_STATE():mipLevels(0), arraySize(0), format(VK_FORMAT_UNDEFINED), samples(VK_SAMPLE_COUNT_1_BIT), imageType(VK_IMAGE_TYPE_RANGE_SIZE), extent{}, flags(0) {}; |
| 68 | _IMAGE_STATE(const VkImageCreateInfo* pCreateInfo): |
| 69 | mipLevels(pCreateInfo->mipLevels), |
| 70 | arraySize(pCreateInfo->arrayLayers), |
| 71 | format(pCreateInfo->format), |
| 72 | samples(pCreateInfo->samples), |
| 73 | imageType(pCreateInfo->imageType), |
| 74 | extent(pCreateInfo->extent), |
| 75 | flags(pCreateInfo->flags) |
| 76 | {}; |
Tobin Ehlis | cde0889 | 2015-09-22 10:11:37 -0600 | [diff] [blame] | 77 | } IMAGE_STATE; |
| 78 | |
Tobin Ehlis | ad8c446 | 2015-09-21 15:20:28 -0600 | [diff] [blame] | 79 | #endif // IMAGE_H |