From 5b6b77b8dceac346b4d279b8e5c0d8eebec2f0e8 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 27 Sep 2017 00:24:03 +0200 Subject: vo_gpu: vulkan: normalize use of *Flags and *FlagBits FlagBits is just the name of the enum. The actual data type representing a combination of these flags follows the *Flags convention. (The relevant difference is that the latter is defined to be uint32_t instead of left implicit) For consistency, use *Flags everywhere instead of randomly switching between *Flags and *FlagBits. Also fix a wrong type name on `stageFlags`, pointed out by @atomnuker --- video/out/vulkan/ra_vk.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'video/out/vulkan/ra_vk.c') diff --git a/video/out/vulkan/ra_vk.c b/video/out/vulkan/ra_vk.c index a9970b76db..9f5581d5c1 100644 --- a/video/out/vulkan/ra_vk.c +++ b/video/out/vulkan/ra_vk.c @@ -290,16 +290,15 @@ struct ra_tex_vk { struct ra_buf_pool pbo; // "current" metadata, can change during the course of execution VkImageLayout current_layout; - VkPipelineStageFlagBits current_stage; - VkAccessFlagBits current_access; + VkPipelineStageFlags current_stage; + VkAccessFlags current_access; }; // Small helper to ease image barrier creation. if `discard` is set, the contents // of the image will be undefined after the barrier static void tex_barrier(struct vk_cmd *cmd, struct ra_tex_vk *tex_vk, - VkPipelineStageFlagBits newStage, - VkAccessFlagBits newAccess, VkImageLayout newLayout, - bool discard) + VkPipelineStageFlags newStage, VkAccessFlags newAccess, + VkImageLayout newLayout, bool discard) { VkImageMemoryBarrier imgBarrier = { .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, @@ -511,7 +510,7 @@ static struct ra_tex *vk_tex_create(struct ra *ra, VK(vkCreateImage(vk->dev, &iinfo, MPVK_ALLOCATOR, &tex_vk->img)); - VkMemoryPropertyFlagBits memFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + VkMemoryPropertyFlags memFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; VkMemoryRequirements reqs; vkGetImageMemoryRequirements(vk->dev, tex_vk->img, &reqs); @@ -598,8 +597,8 @@ struct ra_buf_vk { int refcount; // 1 = object allocated but not in use, > 1 = in use bool needsflush; // "current" metadata, can change during course of execution - VkPipelineStageFlagBits current_stage; - VkAccessFlagBits current_access; + VkPipelineStageFlags current_stage; + VkAccessFlags current_access; }; static void vk_buf_deref(struct ra *ra, struct ra_buf *buf) @@ -617,8 +616,8 @@ static void vk_buf_deref(struct ra *ra, struct ra_buf *buf) } static void buf_barrier(struct ra *ra, struct vk_cmd *cmd, struct ra_buf *buf, - VkPipelineStageFlagBits newStage, - VkAccessFlagBits newAccess, int offset, size_t size) + VkPipelineStageFlags newStage, + VkAccessFlags newAccess, int offset, size_t size) { struct ra_buf_vk *buf_vk = buf->priv; @@ -693,8 +692,8 @@ static struct ra_buf *vk_buf_create(struct ra *ra, buf_vk->current_access = 0; buf_vk->refcount = 1; - VkBufferUsageFlagBits bufFlags = 0; - VkMemoryPropertyFlagBits memFlags = 0; + VkBufferUsageFlags bufFlags = 0; + VkMemoryPropertyFlags memFlags = 0; VkDeviceSize align = 4; // alignment 4 is needed for buf_update switch (params->type) { @@ -977,7 +976,7 @@ static VkResult vk_compile_glsl(struct ra *ra, void *tactx, return ret; } -static const VkPipelineStageFlagBits stageFlags[] = { +static const VkShaderStageFlags stageFlags[] = { [RA_RENDERPASS_TYPE_RASTER] = VK_SHADER_STAGE_FRAGMENT_BIT, [RA_RENDERPASS_TYPE_COMPUTE] = VK_SHADER_STAGE_COMPUTE_BIT, }; -- cgit v1.2.3