summaryrefslogtreecommitdiffstats
path: root/video/out/vulkan/ra_vk.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-27 00:24:03 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-27 00:25:18 +0200
commit5b6b77b8dceac346b4d279b8e5c0d8eebec2f0e8 (patch)
treef32ae2c32ca51b2868a78ead1ffe60a0a1c2c09f /video/out/vulkan/ra_vk.c
parent0ba6c7d73f2886b23ca2c5e7d09296140bf84f35 (diff)
downloadmpv-5b6b77b8dceac346b4d279b8e5c0d8eebec2f0e8.tar.bz2
mpv-5b6b77b8dceac346b4d279b8e5c0d8eebec2f0e8.tar.xz
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
Diffstat (limited to 'video/out/vulkan/ra_vk.c')
-rw-r--r--video/out/vulkan/ra_vk.c25
1 files changed, 12 insertions, 13 deletions
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,
};