1 /*
2  * Copyright 2017 Intel Corporation
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
25 
26 #ifndef ANV_EXTENSIONS_H
27 #define ANV_EXTENSIONS_H
28 
29 #include "perf/gen_perf.h"
30 
31 #define ANV_INSTANCE_EXTENSION_COUNT 17
32 
33 extern const VkExtensionProperties anv_instance_extensions[];
34 
35 struct anv_instance_extension_table {
36    union {
37       bool extensions[ANV_INSTANCE_EXTENSION_COUNT];
38       struct {
39          bool KHR_device_group_creation;
40          bool KHR_display;
41          bool KHR_external_fence_capabilities;
42          bool KHR_external_memory_capabilities;
43          bool KHR_external_semaphore_capabilities;
44          bool KHR_get_display_properties2;
45          bool KHR_get_physical_device_properties2;
46          bool KHR_get_surface_capabilities2;
47          bool KHR_surface;
48          bool KHR_surface_protected_capabilities;
49          bool KHR_wayland_surface;
50          bool KHR_xcb_surface;
51          bool KHR_xlib_surface;
52          bool EXT_acquire_xlib_display;
53          bool EXT_debug_report;
54          bool EXT_direct_mode_display;
55          bool EXT_display_surface_counter;
56       };
57    };
58 };
59 
60 extern const struct anv_instance_extension_table anv_instance_extensions_supported;
61 
62 
63 #define ANV_DEVICE_EXTENSION_COUNT 98
64 
65 extern const VkExtensionProperties anv_device_extensions[];
66 
67 struct anv_device_extension_table {
68    union {
69       bool extensions[ANV_DEVICE_EXTENSION_COUNT];
70       struct {
71         bool KHR_8bit_storage;
72         bool KHR_16bit_storage;
73         bool KHR_bind_memory2;
74         bool KHR_buffer_device_address;
75         bool KHR_copy_commands2;
76         bool KHR_create_renderpass2;
77         bool KHR_dedicated_allocation;
78         bool KHR_depth_stencil_resolve;
79         bool KHR_descriptor_update_template;
80         bool KHR_device_group;
81         bool KHR_draw_indirect_count;
82         bool KHR_driver_properties;
83         bool KHR_external_fence;
84         bool KHR_external_fence_fd;
85         bool KHR_external_memory;
86         bool KHR_external_memory_fd;
87         bool KHR_external_semaphore;
88         bool KHR_external_semaphore_fd;
89         bool KHR_get_memory_requirements2;
90         bool KHR_image_format_list;
91         bool KHR_imageless_framebuffer;
92         bool KHR_incremental_present;
93         bool KHR_maintenance1;
94         bool KHR_maintenance2;
95         bool KHR_maintenance3;
96         bool KHR_multiview;
97         bool KHR_performance_query;
98         bool KHR_pipeline_executable_properties;
99         bool KHR_push_descriptor;
100         bool KHR_relaxed_block_layout;
101         bool KHR_sampler_mirror_clamp_to_edge;
102         bool KHR_sampler_ycbcr_conversion;
103         bool KHR_separate_depth_stencil_layouts;
104         bool KHR_shader_atomic_int64;
105         bool KHR_shader_clock;
106         bool KHR_shader_draw_parameters;
107         bool KHR_shader_float16_int8;
108         bool KHR_shader_float_controls;
109         bool KHR_shader_non_semantic_info;
110         bool KHR_shader_subgroup_extended_types;
111         bool KHR_shader_terminate_invocation;
112         bool KHR_spirv_1_4;
113         bool KHR_storage_buffer_storage_class;
114         bool KHR_swapchain;
115         bool KHR_swapchain_mutable_format;
116         bool KHR_timeline_semaphore;
117         bool KHR_uniform_buffer_standard_layout;
118         bool KHR_variable_pointers;
119         bool KHR_vulkan_memory_model;
120         bool EXT_4444_formats;
121         bool EXT_buffer_device_address;
122         bool EXT_calibrated_timestamps;
123         bool EXT_conditional_rendering;
124         bool EXT_custom_border_color;
125         bool EXT_depth_clip_enable;
126         bool EXT_descriptor_indexing;
127         bool EXT_display_control;
128         bool EXT_extended_dynamic_state;
129         bool EXT_external_memory_dma_buf;
130         bool EXT_external_memory_host;
131         bool EXT_fragment_shader_interlock;
132         bool EXT_global_priority;
133         bool EXT_host_query_reset;
134         bool EXT_image_drm_format_modifier;
135         bool EXT_image_robustness;
136         bool EXT_index_type_uint8;
137         bool EXT_inline_uniform_block;
138         bool EXT_line_rasterization;
139         bool EXT_memory_budget;
140         bool EXT_pci_bus_info;
141         bool EXT_pipeline_creation_cache_control;
142         bool EXT_pipeline_creation_feedback;
143         bool EXT_post_depth_coverage;
144         bool EXT_private_data;
145         bool EXT_queue_family_foreign;
146         bool EXT_robustness2;
147         bool EXT_sampler_filter_minmax;
148         bool EXT_scalar_block_layout;
149         bool EXT_separate_stencil_usage;
150         bool EXT_shader_atomic_float;
151         bool EXT_shader_demote_to_helper_invocation;
152         bool EXT_shader_stencil_export;
153         bool EXT_shader_subgroup_ballot;
154         bool EXT_shader_subgroup_vote;
155         bool EXT_shader_viewport_index_layer;
156         bool EXT_subgroup_size_control;
157         bool EXT_texel_buffer_alignment;
158         bool EXT_transform_feedback;
159         bool EXT_vertex_attribute_divisor;
160         bool EXT_ycbcr_image_arrays;
161         bool ANDROID_external_memory_android_hardware_buffer;
162         bool ANDROID_native_buffer;
163         bool GOOGLE_decorate_string;
164         bool GOOGLE_hlsl_functionality1;
165         bool GOOGLE_user_type;
166         bool INTEL_performance_query;
167         bool INTEL_shader_integer_functions2;
168         bool NV_compute_shader_derivatives;
169       };
170    };
171 };
172 
173 struct anv_physical_device;
174 
175 void
176 anv_physical_device_get_supported_extensions(const struct anv_physical_device *device,
177                                              struct anv_device_extension_table *extensions);
178 
179 #endif /* ANV_EXTENSIONS_H */
180