2 * Copyright 2018 Collabora Ltd.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #include "pipe/p_screen.h"
28 #include "util/slab.h"
30 #include <vulkan/vulkan.h>
32 extern uint32_t zink_debug
;
34 #define ZINK_DEBUG_NIR 0x1
35 #define ZINK_DEBUG_SPIRV 0x2
36 #define ZINK_DEBUG_TGSI 0x4
39 struct pipe_screen base
;
41 struct sw_winsys
*winsys
;
43 struct slab_parent_pool transfer_pool
;
46 VkPhysicalDevice pdev
;
48 VkPhysicalDeviceProperties props
;
49 VkPhysicalDeviceFeatures feats
;
50 VkPhysicalDeviceMemoryProperties mem_props
;
51 VkPhysicalDeviceTransformFeedbackPropertiesEXT tf_props
;
52 VkPhysicalDeviceRobustness2PropertiesEXT rb2_props
;
53 VkPhysicalDeviceRobustness2FeaturesEXT rb2_feats
;
54 VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT vdiv_feats
;
55 uint32_t max_vertex_attrib_divisor
;
57 bool have_KHR_maintenance1
;
58 bool have_KHR_external_memory_fd
;
59 bool have_EXT_conditional_rendering
;
60 bool have_EXT_transform_feedback
;
61 bool have_EXT_index_type_uint8
;
62 bool have_EXT_robustness2_features
;
63 bool have_EXT_vertex_attribute_divisor
;
64 bool have_EXT_calibrated_timestamps
;
66 bool have_X8_D24_UNORM_PACK32
;
67 bool have_D24_UNORM_S8_UINT
;
70 uint32_t timestamp_valid_bits
;
73 PFN_vkGetMemoryFdKHR vk_GetMemoryFdKHR
;
74 PFN_vkCmdBeginConditionalRenderingEXT vk_CmdBeginConditionalRenderingEXT
;
75 PFN_vkCmdEndConditionalRenderingEXT vk_CmdEndConditionalRenderingEXT
;
77 PFN_vkCmdBindTransformFeedbackBuffersEXT vk_CmdBindTransformFeedbackBuffersEXT
;
78 PFN_vkCmdBeginTransformFeedbackEXT vk_CmdBeginTransformFeedbackEXT
;
79 PFN_vkCmdEndTransformFeedbackEXT vk_CmdEndTransformFeedbackEXT
;
80 PFN_vkCmdBeginQueryIndexedEXT vk_CmdBeginQueryIndexedEXT
;
81 PFN_vkCmdEndQueryIndexedEXT vk_CmdEndQueryIndexedEXT
;
82 PFN_vkCmdDrawIndirectByteCountEXT vk_CmdDrawIndirectByteCountEXT
;
84 PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT vk_GetPhysicalDeviceCalibrateableTimeDomainsEXT
;
85 PFN_vkGetCalibratedTimestampsEXT vk_GetCalibratedTimestampsEXT
;
88 static inline struct zink_screen
*
89 zink_screen(struct pipe_screen
*pipe
)
91 return (struct zink_screen
*)pipe
;
95 zink_get_format(struct zink_screen
*screen
, enum pipe_format format
);
98 zink_is_depth_format_supported(struct zink_screen
*screen
, VkFormat format
);