blob: 66a967cae0504879b971b20bb6130317b1b73dc4 [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 Ehlisad8c4462015-09-21 15:20:28 -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 Ehlisad8c4462015-09-21 15:20:28 -06008 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Tobin Ehlisad8c4462015-09-21 15:20:28 -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: Mark Lobodzinski <mark@lunarg.com>
18 * Author: Mike Stroyan <mike@LunarG.com>
19 * Author: Tobin Ehlis <tobin@lunarg.com>
Tobin Ehlisad8c4462015-09-21 15:20:28 -060020 */
Mark Lobodzinski6eda00a2016-02-02 15:55:36 -070021
Tobin Ehlisad8c4462015-09-21 15:20:28 -060022#ifndef IMAGE_H
23#define IMAGE_H
David Pinedo9316d3b2015-11-06 12:54:48 -070024#include "vulkan/vulkan.h"
Tobin Ehlisad8c4462015-09-21 15:20:28 -060025#include "vk_layer_config.h"
26#include "vk_layer_logging.h"
27
Mike Stroyana3082432015-09-25 13:39:21 -060028// Image ERROR codes
Jon Ashburn5484e0c2016-03-08 17:48:44 -070029typedef enum _IMAGE_ERROR {
Mark Lobodzinski1ed594e2016-02-03 09:57:14 -070030 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
Jon Ashburn5484e0c2016-03-08 17:48:44 -070033 IMAGE_RENDERPASS_INVALID_DS_ATTACHMENT, // If no depth attachment for a RenderPass, verify that subpass DS attachment is set to
34 // UNUSED
Mark Lobodzinski1ed594e2016-02-03 09:57:14 -070035 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 Lobodzinskib2ad7022016-03-29 17:10:14 -060045 IMAGE_INVALID_LAYOUT, // Operation specifies an invalid layout
46 IMAGE_INVALID_EXTENTS, // Operation specifies invalid image extents
Tobin Ehlisad8c4462015-09-21 15:20:28 -060047} IMAGE_ERROR;
48
Jon Ashburn5484e0c2016-03-08 17:48:44 -070049typedef struct _IMAGE_STATE {
50 uint32_t mipLevels;
51 uint32_t arraySize;
52 VkFormat format;
Chia-I Wu5c17c962015-10-31 00:31:16 +080053 VkSampleCountFlagBits samples;
Jon Ashburn5484e0c2016-03-08 17:48:44 -070054 VkImageType imageType;
55 VkExtent3D extent;
56 VkImageCreateFlags flags;
57 _IMAGE_STATE()
58 : mipLevels(0), arraySize(0), format(VK_FORMAT_UNDEFINED), samples(VK_SAMPLE_COUNT_1_BIT),
59 imageType(VK_IMAGE_TYPE_RANGE_SIZE), extent{}, flags(0){};
60 _IMAGE_STATE(const VkImageCreateInfo *pCreateInfo)
61 : mipLevels(pCreateInfo->mipLevels), arraySize(pCreateInfo->arrayLayers), format(pCreateInfo->format),
62 samples(pCreateInfo->samples), imageType(pCreateInfo->imageType), extent(pCreateInfo->extent),
63 flags(pCreateInfo->flags){};
Tobin Ehliscde08892015-09-22 10:11:37 -060064} IMAGE_STATE;
65
Tobin Ehlisad8c4462015-09-21 15:20:28 -060066#endif // IMAGE_H