[Vulkan] Log down strings when an invalid usage flag is specified.
This commit is contained in:
parent
b5d647d540
commit
d98344f99b
|
@ -271,10 +271,13 @@ TextureCache::Texture* TextureCache::AllocateTexture(
|
||||||
if ((props.optimalTilingFeatures & required_flags) != required_flags) {
|
if ((props.optimalTilingFeatures & required_flags) != required_flags) {
|
||||||
// Texture needs conversion on upload to a native format.
|
// Texture needs conversion on upload to a native format.
|
||||||
XELOGE(
|
XELOGE(
|
||||||
"Texture Cache: Invalid usage flag specified on format %s (vk %d) "
|
"Texture Cache: Invalid usage flag specified on format %s (%s)\n\t"
|
||||||
"(0x%.8X != 0x%.8X)",
|
"(requested: %s)",
|
||||||
texture_info.format_info()->name, format,
|
texture_info.format_info()->name, ui::vulkan::to_string(format),
|
||||||
(props.optimalTilingFeatures & required_flags), required_flags);
|
ui::vulkan::to_flags_string(
|
||||||
|
static_cast<VkFormatFeatureFlagBits>(required_flags &
|
||||||
|
~props.optimalTilingFeatures))
|
||||||
|
.c_str());
|
||||||
assert_always();
|
assert_always();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,8 @@ bool VulkanSwapChain::Initialize(VkSurfaceKHR surface) {
|
||||||
XELOGVK(" presentMode = %s", to_string(create_info.presentMode));
|
XELOGVK(" presentMode = %s", to_string(create_info.presentMode));
|
||||||
XELOGVK(" clipped = %s", create_info.clipped ? "true" : "false");
|
XELOGVK(" clipped = %s", create_info.clipped ? "true" : "false");
|
||||||
XELOGVK(" imageColorSpace = %s", to_string(create_info.imageColorSpace));
|
XELOGVK(" imageColorSpace = %s", to_string(create_info.imageColorSpace));
|
||||||
auto image_usage_flags_str = to_flags_string(create_info.imageUsage);
|
auto image_usage_flags_str = to_flags_string(
|
||||||
|
static_cast<VkImageUsageFlagBits>(create_info.imageUsage));
|
||||||
XELOGVK(" imageUsageFlags = %s", image_usage_flags_str.c_str());
|
XELOGVK(" imageUsageFlags = %s", image_usage_flags_str.c_str());
|
||||||
XELOGVK(" imageSharingMode = %s", to_string(create_info.imageSharingMode));
|
XELOGVK(" imageSharingMode = %s", to_string(create_info.imageSharingMode));
|
||||||
XELOGVK(" queueFamilyCount = %u", create_info.queueFamilyIndexCount);
|
XELOGVK(" queueFamilyCount = %u", create_info.queueFamilyIndexCount);
|
||||||
|
|
|
@ -296,7 +296,7 @@ const char* to_string(VkResult result) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string to_flags_string(VkImageUsageFlags flags) {
|
std::string to_flags_string(VkImageUsageFlagBits flags) {
|
||||||
std::string result;
|
std::string result;
|
||||||
#define OR_FLAG(f) \
|
#define OR_FLAG(f) \
|
||||||
if (flags & f) { \
|
if (flags & f) { \
|
||||||
|
@ -317,6 +317,36 @@ std::string to_flags_string(VkImageUsageFlags flags) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string to_flags_string(VkFormatFeatureFlagBits flags) {
|
||||||
|
std::string result;
|
||||||
|
#define OR_FLAG(f) \
|
||||||
|
if (flags & f) { \
|
||||||
|
if (!result.empty()) { \
|
||||||
|
result += " | "; \
|
||||||
|
} \
|
||||||
|
result += #f; \
|
||||||
|
}
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_BLIT_SRC_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_BLIT_DST_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR);
|
||||||
|
OR_FLAG(VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT);
|
||||||
|
#undef OR_FLAG
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
std::string to_flags_string(VkSurfaceTransformFlagBitsKHR flags) {
|
std::string to_flags_string(VkSurfaceTransformFlagBitsKHR flags) {
|
||||||
std::string result;
|
std::string result;
|
||||||
#define OR_FLAG(f) \
|
#define OR_FLAG(f) \
|
||||||
|
|
|
@ -65,7 +65,8 @@ const char* to_string(VkPhysicalDeviceType type);
|
||||||
const char* to_string(VkSharingMode sharing_mode);
|
const char* to_string(VkSharingMode sharing_mode);
|
||||||
const char* to_string(VkResult result);
|
const char* to_string(VkResult result);
|
||||||
|
|
||||||
std::string to_flags_string(VkImageUsageFlags flags);
|
std::string to_flags_string(VkImageUsageFlagBits flags);
|
||||||
|
std::string to_flags_string(VkFormatFeatureFlagBits flags);
|
||||||
std::string to_flags_string(VkSurfaceTransformFlagBitsKHR flags);
|
std::string to_flags_string(VkSurfaceTransformFlagBitsKHR flags);
|
||||||
|
|
||||||
const char* to_string(VkColorSpaceKHR color_space);
|
const char* to_string(VkColorSpaceKHR color_space);
|
||||||
|
|
Loading…
Reference in New Issue