Overhaul logging.

This commit is contained in:
gibbed
2020-02-28 14:30:48 -06:00
committed by Rick Gibbed
parent de3c91ab2c
commit a48bb71c2f
107 changed files with 954 additions and 854 deletions

View File

@@ -149,7 +149,7 @@ bool D3D12Context::InitializeSwapChainBuffers() {
for (uint32_t i = 0; i < kSwapChainBufferCount; ++i) {
if (FAILED(
swap_chain_->GetBuffer(i, IID_PPV_ARGS(&swap_chain_buffers_[i])))) {
XELOGE("Failed to get buffer %u of the swap chain", i);
XELOGE("Failed to get buffer {} of the swap chain", i);
return false;
}
}

View File

@@ -78,7 +78,7 @@ bool D3D12ImmediateTexture::Initialize(ID3D12Device* device) {
if (FAILED(device->CreateCommittedResource(
&util::kHeapPropertiesDefault, D3D12_HEAP_FLAG_NONE, &resource_desc,
state_, nullptr, IID_PPV_ARGS(&resource_)))) {
XELOGE("Failed to create a %ux%u texture for immediate drawing", width,
XELOGE("Failed to create a {}x{} texture for immediate drawing", width,
height);
return false;
}
@@ -358,7 +358,7 @@ void D3D12ImmediateDrawer::UpdateTexture(ImmediateTexture* texture,
&util::kHeapPropertiesUpload, D3D12_HEAP_FLAG_NONE, &buffer_desc,
D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, IID_PPV_ARGS(&buffer)))) {
XELOGE(
"Failed to create an upload buffer for a %ux%u texture for "
"Failed to create an upload buffer for a {}x{} texture for "
"immediate drawing",
width, height);
return;
@@ -369,7 +369,7 @@ void D3D12ImmediateDrawer::UpdateTexture(ImmediateTexture* texture,
void* buffer_mapping;
if (FAILED(buffer->Map(0, &buffer_read_range, &buffer_mapping))) {
XELOGE(
"Failed to map an upload buffer for a %ux%u texture for immediate "
"Failed to map an upload buffer for a {}x{} texture for immediate "
"drawing",
width, height);
buffer->Release();
@@ -506,7 +506,7 @@ void D3D12ImmediateDrawer::BeginDrawBatch(const ImmediateDrawBatch& batch) {
current_fence_value, vertex_buffer_view.SizeInBytes, nullptr, nullptr,
&vertex_buffer_view.BufferLocation);
if (vertex_buffer_mapping == nullptr) {
XELOGE("Failed to get a buffer for %u vertices in the immediate drawer",
XELOGE("Failed to get a buffer for {} vertices in the immediate drawer",
batch.vertex_count);
return;
}
@@ -525,7 +525,7 @@ void D3D12ImmediateDrawer::BeginDrawBatch(const ImmediateDrawBatch& batch) {
xe::align(index_buffer_view.SizeInBytes, UINT(sizeof(uint32_t))),
nullptr, nullptr, &index_buffer_view.BufferLocation);
if (index_buffer_mapping == nullptr) {
XELOGE("Failed to get a buffer for %u indices in the immediate drawer",
XELOGE("Failed to get a buffer for {} indices in the immediate drawer",
batch.index_count);
return;
}

View File

@@ -87,7 +87,7 @@ bool D3D12Provider::Initialize() {
library_d3dcompiler_ = LoadLibraryW(L"D3DCompiler_47.dll");
if (library_dxgi_ == nullptr || library_d3d12_ == nullptr ||
library_d3dcompiler_ == nullptr) {
XELOGE("Failed to load dxgi.dll, D3D12.dll and D3DCompiler_47.dll.");
XELOGE("Failed to load dxgi.dll, D3D12.dll or D3DCompiler_47.dll.");
return false;
}
bool libraries_loaded = true;
@@ -184,8 +184,8 @@ bool D3D12Provider::Initialize() {
if (WideCharToMultiByte(CP_UTF8, 0, adapter_desc.Description, -1,
adapter_name_mb, adapter_name_mb_size, nullptr,
nullptr) != 0) {
XELOGD3D("DXGI adapter: %s (vendor %.4X, device %.4X)", adapter_name_mb,
adapter_desc.VendorId, adapter_desc.DeviceId);
XELOGD3D("DXGI adapter: {} (vendor {:04X}, device {:04X})",
adapter_name_mb, adapter_desc.VendorId, adapter_desc.DeviceId);
}
}
@@ -253,13 +253,13 @@ bool D3D12Provider::Initialize() {
virtual_address_support.MaxGPUVirtualAddressBitsPerResource;
}
XELOGD3D("Direct3D 12 device features:");
XELOGD3D("* Max GPU virtual address bits per resource: %u",
XELOGD3D("* Max GPU virtual address bits per resource: {}",
virtual_address_bits_per_resource_);
XELOGD3D("* Programmable sample positions: tier %u",
XELOGD3D("* Programmable sample positions: tier {}",
programmable_sample_positions_tier_);
XELOGD3D("* Rasterizer-ordered views: %s",
XELOGD3D("* Rasterizer-ordered views: {}",
rasterizer_ordered_views_supported_ ? "yes" : "no");
XELOGD3D("* Tiled resources: tier %u", tiled_resources_tier_);
XELOGD3D("* Tiled resources: tier {}", tiled_resources_tier_);
// Get the graphics analysis interface, will silently fail if PIX is not
// attached.

View File

@@ -30,7 +30,7 @@ ID3D12RootSignature* CreateRootSignature(
&desc, D3D_ROOT_SIGNATURE_VERSION_1, &blob, &error_blob))) {
XELOGE("Failed to serialize a root signature");
if (error_blob != nullptr) {
XELOGE("%s",
XELOGE("{}",
reinterpret_cast<const char*>(error_blob->GetBufferPointer()));
error_blob->Release();
}

View File

@@ -105,7 +105,7 @@ uint8_t* UploadBufferPool::Request(uint64_t submission_index, uint32_t size,
&util::kHeapPropertiesUpload, D3D12_HEAP_FLAG_NONE,
&new_buffer_desc, D3D12_RESOURCE_STATE_GENERIC_READ, nullptr,
IID_PPV_ARGS(&new_buffer)))) {
XELOGE("Failed to create a D3D upload buffer with %u bytes",
XELOGE("Failed to create a D3D upload buffer with {} bytes",
page_size_);
return nullptr;
}
@@ -114,7 +114,7 @@ uint8_t* UploadBufferPool::Request(uint64_t submission_index, uint32_t size,
read_range.End = 0;
void* new_buffer_mapping;
if (FAILED(new_buffer->Map(0, &read_range, &new_buffer_mapping))) {
XELOGE("Failed to map a D3D upload buffer with %u bytes", page_size_);
XELOGE("Failed to map a D3D upload buffer with {} bytes", page_size_);
new_buffer->Release();
return nullptr;
}
@@ -263,7 +263,7 @@ uint64_t DescriptorHeapPool::Request(uint64_t submission_index,
ID3D12DescriptorHeap* new_heap;
if (FAILED(device_->CreateDescriptorHeap(&new_heap_desc,
IID_PPV_ARGS(&new_heap)))) {
XELOGE("Failed to create a heap for %u shader-visible descriptors",
XELOGE("Failed to create a heap for {} shader-visible descriptors",
page_size_);
return kHeapIndexInvalid;
}

View File

@@ -63,7 +63,7 @@ std::unique_ptr<SpirvAssembler::Result> SpirvAssembler::Assemble(
source_text_length, &binary, &diagnostic);
std::unique_ptr<Result> result(new Result(binary, diagnostic));
if (result_code) {
XELOGE("Failed to assemble spv: %d", result_code);
XELOGE("Failed to assemble spv: {}", result_code);
if (result->has_error()) {
return result;
} else {

View File

@@ -67,7 +67,7 @@ std::unique_ptr<SpirvDisassembler::Result> SpirvDisassembler::Disassemble(
SPV_BINARY_TO_TEXT_OPTION_INDENT, &text, &diagnostic);
std::unique_ptr<Result> result(new Result(text, diagnostic));
if (result_code) {
XELOGE("Failed to disassemble spv: %d", result_code);
XELOGE("Failed to disassemble spv: {}", result_code);
if (result->has_error()) {
return result;
} else {

View File

@@ -65,7 +65,7 @@ std::unique_ptr<SpirvValidator::Result> SpirvValidator::Validate(
auto result_code = spvValidate(spv_context_, &binary, &diagnostic);
std::unique_ptr<Result> result(new Result(text, diagnostic));
if (result_code) {
XELOGE("Failed to validate spv: %d", result_code);
XELOGE("Failed to validate spv: {}", result_code);
if (result->has_error()) {
return result;
} else {

View File

@@ -93,9 +93,10 @@ bool UploadBufferChain::EnsureCurrentBufferAllocated() {
if (vkCreateBuffer(device, &buffer_create_info, nullptr,
&upload_buffer.buffer) != VK_SUCCESS) {
XELOGE(
"Failed to create a Vulkan upload buffer with %ull x %u bytes and "
"0x%.8X usage",
buffer_create_info.size, VulkanContext::kQueuedFrames, usage_flags_);
"Failed to create a Vulkan upload buffer with {} x {} bytes and "
"{:#08X} usage",
buffer_create_info.size, VulkanContext::kQueuedFrames,
static_cast<uint32_t>(usage_flags_));
buffer_creation_failed_ = true;
return false;
}
@@ -110,8 +111,8 @@ bool UploadBufferChain::EnsureCurrentBufferAllocated() {
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
if (memory_type_ == UINT32_MAX) {
XELOGE(
"Failed to find a memory type for an upload buffer with %ull bytes "
"and 0x%.8X usage",
"Failed to find a memory type for an upload buffer with {} bytes "
"and {:#08X} usage",
buffer_memory_requirements.size, usage_flags_);
vkDestroyBuffer(device, upload_buffer.buffer, nullptr);
buffer_creation_failed_ = true;
@@ -132,7 +133,7 @@ bool UploadBufferChain::EnsureCurrentBufferAllocated() {
memory_allocate_info.memoryTypeIndex = memory_type_;
if (vkAllocateMemory(device, &memory_allocate_info, nullptr,
&upload_buffer.memory) != VK_SUCCESS) {
XELOGE("Failed to allocate %ull for a Vulkan upload buffer",
XELOGE("Failed to allocate {} for a Vulkan upload buffer",
memory_page_size_);
vkDestroyBuffer(device, upload_buffer.buffer, nullptr);
buffer_creation_failed_ = true;
@@ -141,7 +142,7 @@ bool UploadBufferChain::EnsureCurrentBufferAllocated() {
if (vkBindBufferMemory(device, upload_buffer.buffer, upload_buffer.memory,
0) != VK_SUCCESS) {
XELOGE("Failed to bind a %ull-byte memory object to a Vulkan upload buffer",
XELOGE("Failed to bind a {}-byte memory object to a Vulkan upload buffer",
memory_page_size_);
vkDestroyBuffer(device, upload_buffer.buffer, nullptr);
vkFreeMemory(device, upload_buffer.memory, nullptr);
@@ -151,7 +152,7 @@ bool UploadBufferChain::EnsureCurrentBufferAllocated() {
if (vkMapMemory(device, upload_buffer.memory, 0, memory_page_size_, 0,
&upload_buffer.mapping) != VK_SUCCESS) {
XELOGE("Failed to map a %ull-byte memory object of a Vulkan upload buffer",
XELOGE("Failed to map a {}-byte memory object of a Vulkan upload buffer",
memory_page_size_);
vkDestroyBuffer(device, upload_buffer.buffer, nullptr);
vkFreeMemory(device, upload_buffer.memory, nullptr);

View File

@@ -471,7 +471,7 @@ void VulkanContext::BeginSwap() {
swapchain_create_info.oldSwapchain = swapchain_;
if (vkCreateSwapchainKHR(device, &swapchain_create_info, nullptr,
&swapchain) != VK_SUCCESS) {
XELOGE("Failed to create a %ux%u Vulkan swap chain",
XELOGE("Failed to create a {}x{} Vulkan swap chain",
target_window_extent.width, target_window_extent.height);
context_lost_ = true;
return;

View File

@@ -324,7 +324,7 @@ void VulkanImmediateDrawer::BeginDrawBatch(const ImmediateDrawBatch& batch) {
vertex_buffer_size, vertex_buffer, vertex_buffer_offset);
if (!vertex_buffer_mapping) {
XELOGE(
"Failed to get a Vulkan buffer for %u vertices in the immediate drawer",
"Failed to get a Vulkan buffer for {} vertices in the immediate drawer",
batch.vertex_count);
return;
}
@@ -343,7 +343,7 @@ void VulkanImmediateDrawer::BeginDrawBatch(const ImmediateDrawBatch& batch) {
index_buffer, index_buffer_offset);
if (!index_buffer_mapping) {
XELOGE(
"Failed to get a Vulkan buffer for %u indices in the immediate "
"Failed to get a Vulkan buffer for {} indices in the immediate "
"drawer",
batch.index_count);
return;

View File

@@ -241,7 +241,7 @@ bool VulkanProvider::Initialize() {
&physical_device_memory_properties_);
// Log physical device properties.
XELOGVK("Vulkan physical device: %s (vendor %.4X, device %.4X)",
XELOGVK("Vulkan physical device: {} (vendor {:04X}, device {:04X})",
physical_device_properties_.deviceName,
physical_device_properties_.vendorID,
physical_device_properties_.deviceID);

View File

@@ -70,7 +70,7 @@ VulkanInstance::~VulkanInstance() { DestroyInstance(); }
bool VulkanInstance::Initialize() {
auto version = Version::Parse(VK_API_VERSION);
XELOGVK("Initializing Vulkan %s...", version.pretty_string.c_str());
XELOGVK("Initializing Vulkan {}...", version.pretty_string);
if (volkInitialize() != VK_SUCCESS) {
XELOGE("volkInitialize() failed!");
return false;
@@ -134,7 +134,7 @@ bool VulkanInstance::EnableRenderDoc() {
int minor;
int patch;
api->GetAPIVersion(&major, &minor, &patch);
XELOGI("RenderDoc attached; %d.%d.%d", major, minor, patch);
XELOGI("RenderDoc attached; {}.{}.{}", major, minor, patch);
is_renderdoc_attached_ = true;
@@ -173,18 +173,17 @@ bool VulkanInstance::QueryGlobals() {
} while (err == VK_INCOMPLETE);
CheckResult(err, "vkEnumerateInstanceExtensionProperties");
}
XELOGVK("Found %d global layers:", global_layers_.size());
XELOGVK("Found {} global layers:", global_layers_.size());
for (size_t i = 0; i < global_layers_.size(); ++i) {
auto& global_layer = global_layers_[i];
auto spec_version = Version::Parse(global_layer.properties.specVersion);
auto impl_version =
Version::Parse(global_layer.properties.implementationVersion);
XELOGVK("- %s (spec: %s, impl: %s)", global_layer.properties.layerName,
spec_version.pretty_string.c_str(),
impl_version.pretty_string.c_str());
XELOGVK(" %s", global_layer.properties.description);
XELOGVK("- {} (spec: {}, impl: {})", global_layer.properties.layerName,
spec_version.pretty_string, impl_version.pretty_string);
XELOGVK(" {}", global_layer.properties.description);
if (!global_layer.extensions.empty()) {
XELOGVK(" %d extensions:", global_layer.extensions.size());
XELOGVK(" {} extensions:", global_layer.extensions.size());
DumpExtensions(global_layer.extensions, " ");
}
}
@@ -198,7 +197,7 @@ bool VulkanInstance::QueryGlobals() {
global_extensions_.data());
} while (err == VK_INCOMPLETE);
CheckResult(err, "vkEnumerateInstanceExtensionProperties");
XELOGVK("Found %d global extensions:", global_extensions_.size());
XELOGVK("Found {} global extensions:", global_extensions_.size());
DumpExtensions(global_extensions_, "");
return true;
@@ -249,7 +248,7 @@ bool VulkanInstance::CreateInstance() {
auto err = vkCreateInstance(&instance_info, nullptr, &handle);
if (err != VK_SUCCESS) {
XELOGE("vkCreateInstance returned %s", to_string(err));
XELOGE("vkCreateInstance returned {}", to_string(err));
}
switch (err) {
case VK_SUCCESS:
@@ -270,7 +269,7 @@ bool VulkanInstance::CreateInstance() {
XELOGE("Instance initialization failed; requested layer not present");
return false;
default:
XELOGE("Instance initialization failed; unknown: %s", to_string(err));
XELOGE("Instance initialization failed; unknown: {}", to_string(err));
return false;
}
@@ -325,7 +324,7 @@ VkBool32 VKAPI_PTR DebugMessageCallback(VkDebugReportFlagsEXT flags,
message_type = "DEBUG";
}
XELOGVK("[%s/%s:%d] %s", pLayerPrefix, message_type, messageCode, pMessage);
XELOGVK("[{}/{}:{}] {}", pLayerPrefix, message_type, messageCode, pMessage);
return false;
}
@@ -355,7 +354,7 @@ void VulkanInstance::EnableDebugValidation() {
if (status == VK_SUCCESS) {
XELOGVK("Debug validation layer enabled");
} else {
XELOGVK("Debug validation layer failed to install; error %s",
XELOGVK("Debug validation layer failed to install; error {}",
to_string(status));
}
}
@@ -437,10 +436,10 @@ bool VulkanInstance::QueryDevices() {
available_devices_.push_back(std::move(device_info));
}
XELOGVK("Found %d physical devices:", available_devices_.size());
XELOGVK("Found {} physical devices:", available_devices_.size());
for (size_t i = 0; i < available_devices_.size(); ++i) {
auto& device_info = available_devices_[i];
XELOGVK("- Device %d:", i);
XELOGVK("- Device {}:", i);
DumpDeviceInfo(device_info);
}
@@ -453,12 +452,11 @@ void VulkanInstance::DumpLayers(const std::vector<LayerInfo>& layers,
auto& layer = layers[i];
auto spec_version = Version::Parse(layer.properties.specVersion);
auto impl_version = Version::Parse(layer.properties.implementationVersion);
XELOGVK("%s- %s (spec: %s, impl: %s)", indent, layer.properties.layerName,
spec_version.pretty_string.c_str(),
impl_version.pretty_string.c_str());
XELOGVK("%s %s", indent, layer.properties.description);
XELOGVK("{}- {} (spec: {}, impl: {})", indent, layer.properties.layerName,
spec_version.pretty_string, impl_version.pretty_string);
XELOGVK("{} {}", indent, layer.properties.description);
if (!layer.extensions.empty()) {
XELOGVK("%s %d extensions:", indent, layer.extensions.size());
XELOGVK("{} {} extensions:", indent, layer.extensions.size());
DumpExtensions(layer.extensions, std::strlen(indent) ? " " : " ");
}
}
@@ -469,8 +467,8 @@ void VulkanInstance::DumpExtensions(
for (size_t i = 0; i < extensions.size(); ++i) {
auto& extension = extensions[i];
auto version = Version::Parse(extension.specVersion);
XELOGVK("%s- %s (%s)", indent, extension.extensionName,
version.pretty_string.c_str());
XELOGVK("{}- {} ({})", indent, extension.extensionName,
version.pretty_string);
}
}
@@ -478,21 +476,20 @@ void VulkanInstance::DumpDeviceInfo(const DeviceInfo& device_info) {
auto& properties = device_info.properties;
auto api_version = Version::Parse(properties.apiVersion);
auto driver_version = Version::Parse(properties.driverVersion);
XELOGVK(" apiVersion = %s", api_version.pretty_string.c_str());
XELOGVK(" driverVersion = %s", driver_version.pretty_string.c_str());
XELOGVK(" vendorId = 0x%04x", properties.vendorID);
XELOGVK(" deviceId = 0x%04x", properties.deviceID);
XELOGVK(" deviceType = %s", to_string(properties.deviceType));
XELOGVK(" deviceName = %s", properties.deviceName);
XELOGVK(" apiVersion = {}", api_version.pretty_string);
XELOGVK(" driverVersion = {}", driver_version.pretty_string);
XELOGVK(" vendorId = {:#04x}", properties.vendorID);
XELOGVK(" deviceId = {:#04x}", properties.deviceID);
XELOGVK(" deviceType = {}", to_string(properties.deviceType));
XELOGVK(" deviceName = {}", properties.deviceName);
auto& memory_props = device_info.memory_properties;
XELOGVK(" Memory Heaps:");
for (size_t j = 0; j < memory_props.memoryHeapCount; ++j) {
XELOGVK(" - Heap %u: %" PRIu64 " bytes", j,
memory_props.memoryHeaps[j].size);
XELOGVK(" - Heap {}: {} bytes", j, memory_props.memoryHeaps[j].size);
for (size_t k = 0; k < memory_props.memoryTypeCount; ++k) {
if (memory_props.memoryTypes[k].heapIndex == j) {
XELOGVK(" - Type %u:", k);
XELOGVK(" - Type {}:", k);
auto type_flags = memory_props.memoryTypes[k].propertyFlags;
if (!type_flags) {
XELOGVK(" VK_MEMORY_PROPERTY_DEVICE_ONLY");
@@ -519,16 +516,16 @@ void VulkanInstance::DumpDeviceInfo(const DeviceInfo& device_info) {
XELOGVK(" Queue Families:");
for (size_t j = 0; j < device_info.queue_family_properties.size(); ++j) {
auto& queue_props = device_info.queue_family_properties[j];
XELOGVK(" - Queue %d:", j);
XELOGVK(" - Queue {}:", j);
XELOGVK(
" queueFlags = %s%s%s%s",
" queueFlags = {}{}{}{}",
(queue_props.queueFlags & VK_QUEUE_GRAPHICS_BIT) ? "graphics, " : "",
(queue_props.queueFlags & VK_QUEUE_COMPUTE_BIT) ? "compute, " : "",
(queue_props.queueFlags & VK_QUEUE_TRANSFER_BIT) ? "transfer, " : "",
(queue_props.queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) ? "sparse, "
: "");
XELOGVK(" queueCount = %u", queue_props.queueCount);
XELOGVK(" timestampValidBits = %u", queue_props.timestampValidBits);
XELOGVK(" queueCount = {}", queue_props.queueCount);
XELOGVK(" timestampValidBits = {}", queue_props.timestampValidBits);
}
XELOGVK(" Layers:");

View File

@@ -162,7 +162,7 @@ VkResult VulkanSwapChain::Initialize(VkSurfaceKHR surface) {
if (surface_caps.maxImageCount > 0 &&
image_count > surface_caps.maxImageCount) {
// Too many requested - use whatever we can.
XELOGI("Requested number of swapchain images (%d) exceeds maximum (%d)",
XELOGI("Requested number of swapchain images ({}) exceeds maximum ({})",
image_count, surface_caps.maxImageCount);
image_count = surface_caps.maxImageCount;
}
@@ -194,25 +194,25 @@ VkResult VulkanSwapChain::Initialize(VkSurfaceKHR surface) {
create_info.oldSwapchain = nullptr;
XELOGVK("Creating swap chain:");
XELOGVK(" minImageCount = %u", create_info.minImageCount);
XELOGVK(" imageFormat = %s", to_string(create_info.imageFormat));
XELOGVK(" imageExtent = %d x %d", create_info.imageExtent.width,
XELOGVK(" minImageCount = {}", create_info.minImageCount);
XELOGVK(" imageFormat = {}", to_string(create_info.imageFormat));
XELOGVK(" imageExtent = {} x {}", create_info.imageExtent.width,
create_info.imageExtent.height);
auto pre_transform_str = to_flags_string(create_info.preTransform);
XELOGVK(" preTransform = %s", pre_transform_str.c_str());
XELOGVK(" imageArrayLayers = %u", create_info.imageArrayLayers);
XELOGVK(" presentMode = %s", to_string(create_info.presentMode));
XELOGVK(" clipped = %s", create_info.clipped ? "true" : "false");
XELOGVK(" imageColorSpace = %s", to_string(create_info.imageColorSpace));
XELOGVK(" preTransform = {}", pre_transform_str);
XELOGVK(" imageArrayLayers = {}", create_info.imageArrayLayers);
XELOGVK(" presentMode = {}", to_string(create_info.presentMode));
XELOGVK(" clipped = {}", create_info.clipped ? "true" : "false");
XELOGVK(" imageColorSpace = {}", to_string(create_info.imageColorSpace));
auto image_usage_flags_str = to_flags_string(
static_cast<VkImageUsageFlagBits>(create_info.imageUsage));
XELOGVK(" imageUsageFlags = %s", image_usage_flags_str.c_str());
XELOGVK(" imageSharingMode = %s", to_string(create_info.imageSharingMode));
XELOGVK(" queueFamilyCount = %u", create_info.queueFamilyIndexCount);
XELOGVK(" imageUsageFlags = {}", image_usage_flags_str);
XELOGVK(" imageSharingMode = {}", to_string(create_info.imageSharingMode));
XELOGVK(" queueFamilyCount = {}", create_info.queueFamilyIndexCount);
status = vkCreateSwapchainKHR(*device_, &create_info, nullptr, &handle);
if (status != VK_SUCCESS) {
XELOGE("Failed to create swapchain: %s", to_string(status));
XELOGE("Failed to create swapchain: {}", to_string(status));
return status;
}
@@ -799,7 +799,7 @@ VkResult VulkanSwapChain::End() {
// Fatal. Device lost.
break;
default:
XELOGE("Failed to queue present: %s", to_string(status));
XELOGE("Failed to queue present: {}", to_string(status));
assert_always("Unexpected queue present failure");
}

View File

@@ -410,7 +410,7 @@ void FatalVulkanError(std::string error) {
void CheckResult(VkResult result, const char* action) {
if (result) {
XELOGE("Vulkan check: %s returned %s", action, to_string(result));
XELOGE("Vulkan check: {} returned {}", action, to_string(result));
}
assert_true(result == VK_SUCCESS, action);
}
@@ -430,26 +430,26 @@ std::pair<bool, std::vector<const char*>> CheckRequirements(
found = true;
if (requirement.min_version > layer_infos[j].properties.specVersion) {
if (requirement.is_optional) {
XELOGVK("- optional layer %s (%s) version mismatch", layer_name,
layer_version.pretty_string.c_str());
XELOGVK("- optional layer {} ({}) version mismatch", layer_name,
layer_version.pretty_string);
continue;
}
XELOGE("ERROR: required layer %s (%s) version mismatch", layer_name,
layer_version.pretty_string.c_str());
XELOGE("ERROR: required layer {} ({}) version mismatch", layer_name,
layer_version.pretty_string);
any_missing = true;
break;
}
XELOGVK("- enabling layer %s (%s)", layer_name,
layer_version.pretty_string.c_str());
XELOGVK("- enabling layer {} ({})", layer_name,
layer_version.pretty_string);
enabled_layers.push_back(layer_name);
break;
}
}
if (!found) {
if (requirement.is_optional) {
XELOGVK("- optional layer %s not found", requirement.name.c_str());
XELOGVK("- optional layer {} not found", requirement.name);
} else {
XELOGE("ERROR: required layer %s not found", requirement.name.c_str());
XELOGE("ERROR: required layer {} not found", requirement.name);
any_missing = true;
}
}
@@ -472,27 +472,26 @@ std::pair<bool, std::vector<const char*>> CheckRequirements(
found = true;
if (requirement.min_version > extension_properties[j].specVersion) {
if (requirement.is_optional) {
XELOGVK("- optional extension %s (%s) version mismatch",
extension_name, extension_version.pretty_string.c_str());
XELOGVK("- optional extension {} ({}) version mismatch",
extension_name, extension_version.pretty_string);
continue;
}
XELOGE("ERROR: required extension %s (%s) version mismatch",
extension_name, extension_version.pretty_string.c_str());
XELOGE("ERROR: required extension {} ({}) version mismatch",
extension_name, extension_version.pretty_string);
any_missing = true;
break;
}
XELOGVK("- enabling extension %s (%s)", extension_name,
extension_version.pretty_string.c_str());
XELOGVK("- enabling extension {} ({})", extension_name,
extension_version.pretty_string);
enabled_extensions.push_back(extension_name);
break;
}
}
if (!found) {
if (requirement.is_optional) {
XELOGVK("- optional extension %s not found", requirement.name.c_str());
XELOGVK("- optional extension {} not found", requirement.name);
} else {
XELOGE("ERROR: required extension %s not found",
requirement.name.c_str());
XELOGE("ERROR: required extension {} not found", requirement.name);
any_missing = true;
}
}

View File

@@ -66,7 +66,7 @@ bool Win32Window::OnCreate() {
auto spda = (decltype(&SetProcessDpiAwareness))SetProcessDpiAwareness_;
auto res = spda(PROCESS_PER_MONITOR_DPI_AWARE);
if (res != S_OK) {
XELOGW("Failed to set process DPI awareness. (code = 0x%.8X)", res);
XELOGW("Failed to set process DPI awareness. (code = {:#08X})", res);
}
}