1 // Copyright (c) 2016 The vulkano developers
2 // Licensed under the Apache License, Version 2.0
3 // <LICENSE-APACHE or
4 // https://www.apache.org/licenses/LICENSE-2.0> or the MIT
5 // license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
6 // at your option. All files in the project carrying such
7 // notice may not be copied, modified, or distributed except
8 // according to those terms.
9 
10 use crate::macros::vulkan_bitflags;
11 
12 vulkan_bitflags! {
13     #[non_exhaustive]
14 
15     /// Describes how an image is going to be used. This is **not** just an optimization.
16     ///
17     /// If you try to use an image in a way that you didn't declare, an error will occur.
18     ImageUsage = ImageUsageFlags(u32);
19 
20     /// The image can be used as a source for transfer, blit, resolve and clear commands.
21     TRANSFER_SRC = TRANSFER_SRC,
22 
23     /// The image can be used as a destination for transfer, blit, resolve and clear commands.
24     TRANSFER_DST = TRANSFER_DST,
25 
26     /// The image can be used as a sampled image in a shader.
27     SAMPLED = SAMPLED,
28 
29     /// The image can be used as a storage image in a shader.
30     STORAGE = STORAGE,
31 
32     /// The image can be used as a color attachment in a render pass/framebuffer.
33     COLOR_ATTACHMENT = COLOR_ATTACHMENT,
34 
35     /// The image can be used as a depth/stencil attachment in a render pass/framebuffer.
36     DEPTH_STENCIL_ATTACHMENT = DEPTH_STENCIL_ATTACHMENT,
37 
38     /// The image will be used as an attachment, and will only ever be used temporarily.
39     /// As soon as you leave a render pass, the content of transient images becomes undefined.
40     ///
41     /// This is a hint to the Vulkan implementation that it may not need allocate any memory for
42     /// this image if the image can live entirely in some cache.
43     ///
44     /// If `transient_attachment` is true, then only `color_attachment`, `depth_stencil_attachment`
45     /// and `input_attachment` can be true as well. The rest must be false or an error will be
46     /// returned when creating the image.
47     TRANSIENT_ATTACHMENT = TRANSIENT_ATTACHMENT,
48 
49     /// The image can be used as an input attachment in a render pass/framebuffer.
50     INPUT_ATTACHMENT = INPUT_ATTACHMENT,
51 
52     /* TODO: enable
53     // TODO: document
54     VIDEO_DECODE_DST = VIDEO_DECODE_DST_KHR {
55         device_extensions: [khr_video_decode_queue],
56     },*/
57 
58     /* TODO: enable
59     // TODO: document
60     VIDEO_DECODE_SRC = VIDEO_DECODE_SRC_KHR {
61         device_extensions: [khr_video_decode_queue],
62     },*/
63 
64     /* TODO: enable
65     // TODO: document
66     VIDEO_DECODE_DPB = VIDEO_DECODE_DPB_KHR {
67         device_extensions: [khr_video_decode_queue],
68     },*/
69 
70     /* TODO: enable
71     // TODO: document
72     FRAGMENT_DENSITY_MAP = FRAGMENT_DENSITY_MAP_EXT {
73         device_extensions: [ext_fragment_density_map],
74     },*/
75 
76     /* TODO: enable
77     // TODO: document
78     FRAGMENT_SHADING_RATE_ATTACHMENT = FRAGMENT_SHADING_RATE_ATTACHMENT_KHR {
79         device_extensions: [khr_fragment_shading_rate],
80     },*/
81 
82     /* TODO: enable
83     // TODO: document
84     VIDEO_ENCODE_DST = VIDEO_ENCODE_DST_KHR {
85         device_extensions: [khr_video_encode_queue],
86     },*/
87 
88     /* TODO: enable
89     // TODO: document
90     VIDEO_ENCODE_SRC = VIDEO_ENCODE_SRC_KHR {
91         device_extensions: [khr_video_encode_queue],
92     },*/
93 
94     /* TODO: enable
95     // TODO: document
96     VIDEO_ENCODE_DPB = VIDEO_ENCODE_DPB_KHR {
97         device_extensions: [khr_video_encode_queue],
98     },*/
99 
100     /* TODO: enable
101     // TODO: document
102     ATTACHMENT_FEEDBACK_LOOP = ATTACHMENT_FEEDBACK_LOOP_EXT {
103         device_extensions: [ext_attachment_feedback_loop_layout],
104     },*/
105 
106     /* TODO: enable
107     // TODO: document
108     INVOCATION_MASK = INVOCATION_MASK_HUAWEI {
109         device_extensions: [huawei_invocation_mask],
110     },*/
111 
112     /* TODO: enable
113     // TODO: document
114     SAMPLE_WEIGHT = SAMPLE_WEIGHT_QCOM {
115         device_extensions: [qcom_image_processing],
116     },*/
117 
118     /* TODO: enable
119     // TODO: document
120     SAMPLE_BLOCK_MATCH = SAMPLE_BLOCK_MATCH_QCOM {
121         device_extensions: [qcom_image_processing],
122     },*/
123 }
124