* IN THE SOFTWARE.
*/
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#ifndef VK_FORMAT_H
+#define VK_FORMAT_H
#include <assert.h>
#include <vulkan/vulkan.h>
#include <util/macros.h>
+
enum vk_format_layout {
/**
* Formats with vk_format_block::width == vk_format_block::height == 1
return vk_format_has_depth(desc);
}
+static inline bool
+vk_format_is_stencil(VkFormat format)
+{
+ const struct vk_format_description *desc = vk_format_description(format);
+
+ assert(desc);
+ if (!desc) {
+ return false;
+ }
+
+ return vk_format_has_stencil(desc);
+}
+
static inline bool
vk_format_is_color(VkFormat format)
{
return channel >= 0 && desc->channel[channel].pure_integer;
}
+static inline bool
+vk_format_is_srgb(VkFormat format)
+{
+ const struct vk_format_description *desc = vk_format_description(format);
+ return desc->colorspace == VK_FORMAT_COLORSPACE_SRGB;
+}
+
static inline VkFormat
vk_format_stencil_only(VkFormat format)
{
return 0;
}
}
-#ifdef __cplusplus
-} // extern "C" {
-#endif
+
+#endif /* VK_FORMAT_H */