};
// Return true if format is a depth or stencil format
-bool vk_format_is_depth_or_stencil(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_depth_or_stencil(VkFormat format) {
return (vk_format_is_depth_and_stencil(format) || vk_format_is_depth_only(format) || vk_format_is_stencil_only(format));
}
// Return true if format contains depth and stencil information
-bool vk_format_is_depth_and_stencil(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_depth_and_stencil(VkFormat format) {
bool is_ds = false;
switch (format) {
}
// Return true if format is a stencil-only format
-bool vk_format_is_stencil_only(VkFormat format) { return (format == VK_FORMAT_S8_UINT); }
+VK_LAYER_EXPORT bool vk_format_is_stencil_only(VkFormat format) { return (format == VK_FORMAT_S8_UINT); }
// Return true if format is a depth-only format
-bool vk_format_is_depth_only(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_depth_only(VkFormat format) {
bool is_depth = false;
switch (format) {
}
// Return true if format is of time UNORM
-bool vk_format_is_norm(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_norm(VkFormat format) {
bool is_norm = false;
switch (format) {
};
// Return true if format is an integer format
-bool vk_format_is_int(VkFormat format) { return (vk_format_is_sint(format) || vk_format_is_uint(format)); }
+VK_LAYER_EXPORT bool vk_format_is_int(VkFormat format) { return (vk_format_is_sint(format) || vk_format_is_uint(format)); }
// Return true if format is an unsigned integer format
-bool vk_format_is_uint(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_uint(VkFormat format) {
bool is_uint = false;
switch (format) {
}
// Return true if format is a signed integer format
-bool vk_format_is_sint(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_sint(VkFormat format) {
bool is_sint = false;
switch (format) {
}
// Return true if format is a floating-point format
-bool vk_format_is_float(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_float(VkFormat format) {
bool is_float = false;
switch (format) {
}
// Return true if format is in the SRGB colorspace
-bool vk_format_is_srgb(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_srgb(VkFormat format) {
bool is_srgb = false;
switch (format) {
}
// Return true if format is compressed
-bool vk_format_is_compressed(VkFormat format) {
+VK_LAYER_EXPORT bool vk_format_is_compressed(VkFormat format) {
switch (format) {
case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
case VK_FORMAT_BC1_RGB_SRGB_BLOCK:
}
// Return compressed block sizes for block compressed formats
-VkExtent2D vk_format_compressed_block_size(VkFormat format) {
+VK_LAYER_EXPORT VkExtent2D vk_format_compressed_block_size(VkFormat format) {
VkExtent2D block_size = { 1, 1 };
switch (format) {
case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
}
// Return format class of the specified format
-VkFormatCompatibilityClass vk_format_get_compatibility_class(VkFormat format) {
+VK_LAYER_EXPORT VkFormatCompatibilityClass vk_format_get_compatibility_class(VkFormat format) {
auto item = vk_format_table.find(format);
if (item != vk_format_table.end()) {
return item->second.format_class;
}
// Return size, in bytes, of a pixel of the specified format
-size_t vk_format_get_size(VkFormat format) {
+VK_LAYER_EXPORT size_t vk_format_get_size(VkFormat format) {
auto item = vk_format_table.find(format);
if (item != vk_format_table.end()) {
return item->second.size;
}
// Perform a zero-tolerant modulo operation
-VkDeviceSize vk_safe_modulo(VkDeviceSize dividend, VkDeviceSize divisor) {
+VK_LAYER_EXPORT VkDeviceSize vk_safe_modulo(VkDeviceSize dividend, VkDeviceSize divisor) {
VkDeviceSize result = 0;
if (divisor != 0) {
result = dividend % divisor;
static const uint8_t UTF8_DATA_BYTE_CODE = 0x80;
static const uint8_t UTF8_DATA_BYTE_MASK = 0xC0;
-VkStringErrorFlags vk_string_validate(const int max_length, const char *utf8) {
+VK_LAYER_EXPORT VkStringErrorFlags vk_string_validate(const int max_length, const char *utf8) {
VkStringErrorFlags result = VK_STRING_ERROR_NONE;
int num_char_bytes = 0;
int i, j;
}
// Utility function for finding a text string in another string
-bool white_list(const char *item, const char *list) {
+VK_LAYER_EXPORT bool white_list(const char *item, const char *list) {
std::string candidate(item);
std::string white_list(list);
return (white_list.find(candidate) != std::string::npos);
// If a vk_layer_settings.txt file is present and an application defines a debug callback, both callbacks
// will be active. If no vk_layer_settings.txt file is present, creating an application-defined debug
// callback will cause the default callbacks to be unregisterd and removed.
-void layer_debug_actions(debug_report_data *report_data, std::vector<VkDebugReportCallbackEXT> &logging_callback,
- const VkAllocationCallbacks *pAllocator, const char *layer_identifier) {
+VK_LAYER_EXPORT void layer_debug_actions(debug_report_data *report_data, std::vector<VkDebugReportCallbackEXT> &logging_callback,
+ const VkAllocationCallbacks *pAllocator, const char *layer_identifier) {
VkDebugReportCallbackEXT callback = VK_NULL_HANDLE;
} VkStringErrorFlagBits;
typedef VkFlags VkStringErrorFlags;
-void layer_debug_actions(debug_report_data* report_data, std::vector<VkDebugReportCallbackEXT> &logging_callback,
- const VkAllocationCallbacks *pAllocator, const char* layer_identifier);
+VK_LAYER_EXPORT void layer_debug_actions(debug_report_data *report_data, std::vector<VkDebugReportCallbackEXT> &logging_callback,
+ const VkAllocationCallbacks *pAllocator, const char *layer_identifier);
static inline bool vk_format_is_undef(VkFormat format) { return (format == VK_FORMAT_UNDEFINED); }
return !(vk_format_is_undef(format) || vk_format_is_depth_or_stencil(format));
}
-bool vk_format_is_norm(VkFormat format);
-bool vk_format_is_int(VkFormat format);
-bool vk_format_is_sint(VkFormat format);
-bool vk_format_is_uint(VkFormat format);
-bool vk_format_is_float(VkFormat format);
-bool vk_format_is_srgb(VkFormat format);
-bool vk_format_is_compressed(VkFormat format);
-VkExtent2D vk_format_compressed_block_size(VkFormat format);
-size_t vk_format_get_size(VkFormat format);
-unsigned int vk_format_get_channel_count(VkFormat format);
-VkFormatCompatibilityClass vk_format_get_compatibility_class(VkFormat format);
-VkDeviceSize vk_safe_modulo(VkDeviceSize dividend, VkDeviceSize divisor);
-VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array);
-bool white_list(const char *item, const char *whitelist);
+VK_LAYER_EXPORT bool vk_format_is_norm(VkFormat format);
+VK_LAYER_EXPORT bool vk_format_is_int(VkFormat format);
+VK_LAYER_EXPORT bool vk_format_is_sint(VkFormat format);
+VK_LAYER_EXPORT bool vk_format_is_uint(VkFormat format);
+VK_LAYER_EXPORT bool vk_format_is_float(VkFormat format);
+VK_LAYER_EXPORT bool vk_format_is_srgb(VkFormat format);
+VK_LAYER_EXPORT bool vk_format_is_compressed(VkFormat format);
+VK_LAYER_EXPORT VkExtent2D vk_format_compressed_block_size(VkFormat format);
+VK_LAYER_EXPORT size_t vk_format_get_size(VkFormat format);
+VK_LAYER_EXPORT unsigned int vk_format_get_channel_count(VkFormat format);
+VK_LAYER_EXPORT VkFormatCompatibilityClass vk_format_get_compatibility_class(VkFormat format);
+VK_LAYER_EXPORT VkDeviceSize vk_safe_modulo(VkDeviceSize dividend, VkDeviceSize divisor);
+VK_LAYER_EXPORT VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array);
+VK_LAYER_EXPORT bool white_list(const char *item, const char *whitelist);
static inline int u_ffs(int val) {
#ifdef WIN32