treewide: Stop putting enum in front of Vulkan enum types
The Vulkan headers add typedefs to fix aliasing issues whenever a type gets renamed. However, C doesn't allow "enum typedef" so this doesn't work if people stick the "enum" keyword in front. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32433>
This commit is contained in:
committed by
Marge Bot
parent
54aeff37ee
commit
2fae75b278
@@ -20,7 +20,7 @@
|
||||
#include "vk_format.h"
|
||||
|
||||
static inline enum pipe_format
|
||||
radv_format_to_pipe_format(enum VkFormat vkformat)
|
||||
radv_format_to_pipe_format(VkFormat vkformat)
|
||||
{
|
||||
switch (vkformat) {
|
||||
case VK_FORMAT_R10X6_UNORM_PACK16:
|
||||
|
||||
@@ -332,7 +332,7 @@ radv_translate_fill(VkPolygonMode func)
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
radv_translate_stencil_op(enum VkStencilOp op)
|
||||
radv_translate_stencil_op(VkStencilOp op)
|
||||
{
|
||||
switch (op) {
|
||||
case VK_STENCIL_OP_KEEP:
|
||||
|
||||
@@ -89,7 +89,7 @@ hk_image_base_address(const struct hk_image *image, uint8_t plane)
|
||||
}
|
||||
|
||||
static inline enum pipe_format
|
||||
hk_format_to_pipe_format(enum VkFormat vkformat)
|
||||
hk_format_to_pipe_format(VkFormat vkformat)
|
||||
{
|
||||
switch (vkformat) {
|
||||
case VK_FORMAT_R10X6_UNORM_PACK16:
|
||||
|
||||
@@ -558,7 +558,7 @@ hk_queue_submit(struct vk_queue *vk_queue, struct vk_queue_submit *submit)
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
translate_priority(enum VkQueueGlobalPriorityKHR prio)
|
||||
translate_priority(VkQueueGlobalPriorityKHR prio)
|
||||
{
|
||||
/* clang-format off */
|
||||
switch (prio) {
|
||||
@@ -584,7 +584,7 @@ hk_queue_init(struct hk_device *dev, struct hk_queue *queue,
|
||||
const VkDeviceQueueGlobalPriorityCreateInfoKHR *priority_info =
|
||||
vk_find_struct_const(pCreateInfo->pNext,
|
||||
DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR);
|
||||
const enum VkQueueGlobalPriorityKHR priority =
|
||||
const VkQueueGlobalPriorityKHR priority =
|
||||
priority_info ? priority_info->globalPriority
|
||||
: VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR;
|
||||
|
||||
|
||||
@@ -3181,7 +3181,7 @@ tu_CmdBindDescriptorBufferEmbeddedSamplers2EXT(
|
||||
}
|
||||
}
|
||||
|
||||
static enum VkResult
|
||||
static VkResult
|
||||
tu_push_descriptor_set_update_layout(struct tu_device *device,
|
||||
struct tu_descriptor_set *set,
|
||||
struct tu_descriptor_set_layout *layout)
|
||||
|
||||
@@ -1851,7 +1851,7 @@ tu_queue_init(struct tu_device *device,
|
||||
const VkDeviceQueueGlobalPriorityCreateInfoKHR *priority_info =
|
||||
vk_find_struct_const(create_info->pNext,
|
||||
DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR);
|
||||
const enum VkQueueGlobalPriorityKHR global_priority = priority_info ?
|
||||
const VkQueueGlobalPriorityKHR global_priority = priority_info ?
|
||||
priority_info->globalPriority :
|
||||
(TU_DEBUG(HIPRIO) ? VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR :
|
||||
VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR);
|
||||
|
||||
@@ -1269,7 +1269,7 @@ template <chip CHIP>
|
||||
static void
|
||||
emit_stop_primitive_ctrs(struct tu_cmd_buffer *cmdbuf,
|
||||
struct tu_cs *cs,
|
||||
enum VkQueryType query_type)
|
||||
VkQueryType query_type)
|
||||
{
|
||||
bool is_secondary = cmdbuf->vk.level == VK_COMMAND_BUFFER_LEVEL_SECONDARY;
|
||||
cmdbuf->state.prim_counters_running--;
|
||||
|
||||
@@ -91,7 +91,7 @@ static inline unsigned vk_conv_topology(VkPrimitiveTopology topology)
|
||||
}
|
||||
}
|
||||
|
||||
static inline unsigned vk_conv_wrap_mode(enum VkSamplerAddressMode addr_mode)
|
||||
static inline unsigned vk_conv_wrap_mode(VkSamplerAddressMode addr_mode)
|
||||
{
|
||||
switch (addr_mode) {
|
||||
case VK_SAMPLER_ADDRESS_MODE_REPEAT:
|
||||
|
||||
@@ -27,7 +27,7 @@ const struct nvk_va_format *
|
||||
nvk_get_va_format(const struct nvk_physical_device *pdev, VkFormat format);
|
||||
|
||||
static inline enum pipe_format
|
||||
nvk_format_to_pipe_format(enum VkFormat vkformat)
|
||||
nvk_format_to_pipe_format(VkFormat vkformat)
|
||||
{
|
||||
switch (vkformat) {
|
||||
case VK_FORMAT_R10X6_UNORM_PACK16:
|
||||
|
||||
@@ -1057,7 +1057,7 @@ get_panthor_group_priority(const VkDeviceQueueCreateInfo *create_info)
|
||||
const VkDeviceQueueGlobalPriorityCreateInfoKHR *priority_info =
|
||||
vk_find_struct_const(create_info->pNext,
|
||||
DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR);
|
||||
const enum VkQueueGlobalPriorityKHR priority =
|
||||
const VkQueueGlobalPriorityKHR priority =
|
||||
priority_info ? priority_info->globalPriority
|
||||
: VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR;
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ panvk_per_arch(queue_init)(struct panvk_device *device,
|
||||
ASSERTED const VkDeviceQueueGlobalPriorityCreateInfoKHR *priority_info =
|
||||
vk_find_struct_const(create_info->pNext,
|
||||
DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR);
|
||||
ASSERTED const enum VkQueueGlobalPriorityKHR priority =
|
||||
ASSERTED const VkQueueGlobalPriorityKHR priority =
|
||||
priority_info ? priority_info->globalPriority
|
||||
: VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR;
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ panvk_meta_cleanup(struct panvk_device *device)
|
||||
|
||||
static enum pan_kmod_group_allow_priority_flags
|
||||
global_priority_to_group_allow_priority_flag(
|
||||
enum VkQueueGlobalPriorityKHR priority)
|
||||
VkQueueGlobalPriorityKHR priority)
|
||||
{
|
||||
switch (priority) {
|
||||
case VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR:
|
||||
@@ -179,7 +179,7 @@ check_global_priority(const struct panvk_physical_device *phys_dev,
|
||||
const VkDeviceQueueGlobalPriorityCreateInfoKHR *priority_info =
|
||||
vk_find_struct_const(create_info->pNext,
|
||||
DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR);
|
||||
const enum VkQueueGlobalPriorityKHR priority =
|
||||
const VkQueueGlobalPriorityKHR priority =
|
||||
priority_info ? priority_info->globalPriority
|
||||
: VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR;
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ struct vn_physical_device {
|
||||
*/
|
||||
uint32_t wa_min_fb_align;
|
||||
|
||||
enum VkDriverId renderer_driver_id;
|
||||
VkDriverId renderer_driver_id;
|
||||
|
||||
VkQueueFamilyProperties2 *queue_family_properties;
|
||||
uint32_t queue_family_count;
|
||||
|
||||
@@ -68,7 +68,7 @@ vk_blend_op_to_pipe(VkBlendOp in)
|
||||
}
|
||||
|
||||
enum pipe_blendfactor
|
||||
vk_blend_factor_to_pipe(enum VkBlendFactor vk_factor)
|
||||
vk_blend_factor_to_pipe(VkBlendFactor vk_factor)
|
||||
{
|
||||
switch (vk_factor) {
|
||||
case VK_BLEND_FACTOR_ZERO:
|
||||
|
||||
@@ -260,7 +260,7 @@ const enum pipe_format vk_format_map[] = {
|
||||
};
|
||||
|
||||
enum pipe_format
|
||||
vk_format_to_pipe_format(enum VkFormat vkformat)
|
||||
vk_format_to_pipe_format(VkFormat vkformat)
|
||||
{
|
||||
if (vkformat >= ARRAY_SIZE(vk_format_map)) {
|
||||
switch (vkformat) {
|
||||
|
||||
@@ -36,7 +36,7 @@ extern "C" {
|
||||
extern const enum pipe_format vk_format_map[];
|
||||
|
||||
enum pipe_format
|
||||
vk_format_to_pipe_format(enum VkFormat vkformat);
|
||||
vk_format_to_pipe_format(VkFormat vkformat);
|
||||
|
||||
VkFormat
|
||||
vk_format_from_pipe_format(enum pipe_format format);
|
||||
|
||||
@@ -362,7 +362,7 @@ vk_spec_info_to_nir_spirv(const VkSpecializationInfo *spec_info,
|
||||
if (name != _stack_##name) free(name)
|
||||
|
||||
static inline uint8_t
|
||||
vk_index_type_to_bytes(enum VkIndexType type)
|
||||
vk_index_type_to_bytes(VkIndexType type)
|
||||
{
|
||||
switch (type) {
|
||||
case VK_INDEX_TYPE_NONE_KHR: return 0;
|
||||
@@ -374,7 +374,7 @@ vk_index_type_to_bytes(enum VkIndexType type)
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
vk_index_to_restart(enum VkIndexType type)
|
||||
vk_index_to_restart(VkIndexType type)
|
||||
{
|
||||
switch (type) {
|
||||
case VK_INDEX_TYPE_UINT8_KHR: return 0xff;
|
||||
|
||||
@@ -534,7 +534,7 @@ fail:
|
||||
return supported;
|
||||
}
|
||||
|
||||
enum VkPresentModeKHR
|
||||
VkPresentModeKHR
|
||||
wsi_swapchain_get_present_mode(struct wsi_device *wsi,
|
||||
const VkSwapchainCreateInfoKHR *pCreateInfo)
|
||||
{
|
||||
|
||||
@@ -244,7 +244,7 @@ wsi_swapchain_init(const struct wsi_device *wsi,
|
||||
const struct wsi_base_image_params *image_params,
|
||||
const VkAllocationCallbacks *pAllocator);
|
||||
|
||||
enum VkPresentModeKHR
|
||||
VkPresentModeKHR
|
||||
wsi_swapchain_get_present_mode(struct wsi_device *wsi,
|
||||
const VkSwapchainCreateInfoKHR *pCreateInfo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user