mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-18 09:25:32 +00:00
Update fmtlib
This commit is contained in:
@@ -158,22 +158,22 @@ public:
|
||||
|
||||
static void ThrowIfFailed(VkResult res) {
|
||||
if (res != VK_SUCCESS)
|
||||
Log.report(logvisor::Fatal, fmt("{}\n"), res);
|
||||
Log.report(logvisor::Fatal, FMT_STRING("{}\n"), res);
|
||||
}
|
||||
|
||||
static VKAPI_ATTR VkBool32 VKAPI_CALL dbgFunc(VkDebugReportFlagsEXT msgFlags, VkDebugReportObjectTypeEXT objType,
|
||||
uint64_t srcObject, size_t location, int32_t msgCode,
|
||||
const char* pLayerPrefix, const char* pMsg, void* pUserData) {
|
||||
if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
|
||||
Log.report(logvisor::Error, fmt("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
Log.report(logvisor::Error, FMT_STRING("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
} else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT) {
|
||||
Log.report(logvisor::Warning, fmt("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
Log.report(logvisor::Warning, FMT_STRING("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
} else if (msgFlags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) {
|
||||
Log.report(logvisor::Warning, fmt("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
Log.report(logvisor::Warning, FMT_STRING("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
} else if (msgFlags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) {
|
||||
Log.report(logvisor::Info, fmt("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
Log.report(logvisor::Info, FMT_STRING("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
} else if (msgFlags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) {
|
||||
Log.report(logvisor::Info, fmt("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
Log.report(logvisor::Info, FMT_STRING("[{}] Code {} : {}"), pLayerPrefix, msgCode, pMsg);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -308,7 +308,7 @@ static void demo_check_layers(const std::vector<VulkanContext::LayerProperties>&
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
Log.report(logvisor::Fatal, fmt("Cannot find layer: {}"), layerNames[i]);
|
||||
Log.report(logvisor::Fatal, FMT_STRING("Cannot find layer: {}"), layerNames[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ bool VulkanContext::initVulkan(std::string_view appName, PFN_vkGetInstanceProcAd
|
||||
vk::init_dispatch_table_top(getVkProc);
|
||||
|
||||
if (!glslang::InitializeProcess()) {
|
||||
Log.report(logvisor::Error, fmt("unable to initialize glslang"));
|
||||
Log.report(logvisor::Error, FMT_STRING("unable to initialize glslang"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ bool VulkanContext::initVulkan(std::string_view appName, PFN_vkGetInstanceProcAd
|
||||
VkResult instRes = vk::CreateInstance(&instInfo, nullptr, &m_instance);
|
||||
if (instRes != VK_SUCCESS) {
|
||||
Log.report(logvisor::Error,
|
||||
fmt("The Vulkan runtime is installed, but there are no supported "
|
||||
FMT_STRING("The Vulkan runtime is installed, but there are no supported "
|
||||
"hardware vendor interfaces present"));
|
||||
return false;
|
||||
}
|
||||
@@ -427,12 +427,12 @@ bool VulkanContext::initVulkan(std::string_view appName, PFN_vkGetInstanceProcAd
|
||||
PFN_vkCreateDebugReportCallbackEXT createDebugReportCallback =
|
||||
(PFN_vkCreateDebugReportCallbackEXT)vk::GetInstanceProcAddr(m_instance, "vkCreateDebugReportCallbackEXT");
|
||||
if (!createDebugReportCallback)
|
||||
Log.report(logvisor::Fatal, fmt("GetInstanceProcAddr: Unable to find vkCreateDebugReportCallbackEXT function."));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("GetInstanceProcAddr: Unable to find vkCreateDebugReportCallbackEXT function."));
|
||||
|
||||
m_destroyDebugReportCallback =
|
||||
(PFN_vkDestroyDebugReportCallbackEXT)vk::GetInstanceProcAddr(m_instance, "vkDestroyDebugReportCallbackEXT");
|
||||
if (!m_destroyDebugReportCallback)
|
||||
Log.report(logvisor::Fatal, fmt("GetInstanceProcAddr: Unable to find vkDestroyDebugReportCallbackEXT function."));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("GetInstanceProcAddr: Unable to find vkDestroyDebugReportCallbackEXT function."));
|
||||
|
||||
VkDebugReportCallbackCreateInfoEXT debugCreateInfo = {};
|
||||
debugCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
|
||||
@@ -477,7 +477,7 @@ bool VulkanContext::enumerateDevices() {
|
||||
|
||||
void VulkanContext::initDevice() {
|
||||
if (m_graphicsQueueFamilyIndex == UINT32_MAX)
|
||||
Log.report(logvisor::Fatal, fmt("VulkanContext::m_graphicsQueueFamilyIndex hasn't been initialized"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("VulkanContext::m_graphicsQueueFamilyIndex hasn't been initialized"));
|
||||
|
||||
/* create the device and queues */
|
||||
VkDeviceQueueCreateInfo queueInfo = {};
|
||||
@@ -493,7 +493,7 @@ void VulkanContext::initDevice() {
|
||||
if (m_features.samplerAnisotropy)
|
||||
features.samplerAnisotropy = VK_TRUE;
|
||||
if (!m_features.textureCompressionBC)
|
||||
Log.report(logvisor::Fatal, fmt("Vulkan device does not support DXT-format textures"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("Vulkan device does not support DXT-format textures"));
|
||||
features.textureCompressionBC = VK_TRUE;
|
||||
VkShaderStageFlagBits tessellationDescriptorBit = VkShaderStageFlagBits(0);
|
||||
if (m_features.tessellationShader) {
|
||||
@@ -501,7 +501,7 @@ void VulkanContext::initDevice() {
|
||||
features.tessellationShader = VK_TRUE;
|
||||
}
|
||||
if (!m_features.dualSrcBlend)
|
||||
Log.report(logvisor::Fatal, fmt("Vulkan device does not support dual-source blending"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("Vulkan device does not support dual-source blending"));
|
||||
features.dualSrcBlend = VK_TRUE;
|
||||
|
||||
uint32_t extCount = 0;
|
||||
@@ -524,7 +524,7 @@ void VulkanContext::initDevice() {
|
||||
}
|
||||
|
||||
if (!hasSwapchain)
|
||||
Log.report(logvisor::Fatal, fmt("Vulkan device does not support swapchains"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("Vulkan device does not support swapchains"));
|
||||
|
||||
/* need swapchain device extension */
|
||||
m_deviceExtensionNames.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
|
||||
@@ -654,10 +654,10 @@ void VulkanContext::initDevice() {
|
||||
ThrowIfFailed(vk::CreatePipelineLayout(m_dev, &pipelineLayout, nullptr, &m_pipelinelayout));
|
||||
|
||||
std::string gpuName = m_gpuProps.deviceName;
|
||||
Log.report(logvisor::Info, fmt("Initialized {}"), gpuName);
|
||||
Log.report(logvisor::Info, fmt("Vulkan version {}.{}.{}"), m_gpuProps.apiVersion >> 22,
|
||||
Log.report(logvisor::Info, FMT_STRING("Initialized {}"), gpuName);
|
||||
Log.report(logvisor::Info, FMT_STRING("Vulkan version {}.{}.{}"), m_gpuProps.apiVersion >> 22,
|
||||
(m_gpuProps.apiVersion >> 12) & 0b1111111111, m_gpuProps.apiVersion & 0b111111111111);
|
||||
Log.report(logvisor::Info, fmt("Driver version {}.{}.{}"), m_gpuProps.driverVersion >> 22,
|
||||
Log.report(logvisor::Info, FMT_STRING("Driver version {}.{}.{}"), m_gpuProps.driverVersion >> 22,
|
||||
(m_gpuProps.driverVersion >> 12) & 0b1111111111, m_gpuProps.driverVersion & 0b111111111111);
|
||||
}
|
||||
|
||||
@@ -1394,7 +1394,7 @@ class VulkanTextureS : public GraphicsDataNode<ITextureS> {
|
||||
m_pixelPitchDenom = 1;
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, fmt("unsupported tex format"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("unsupported tex format"));
|
||||
}
|
||||
m_vkFmt = pfmt;
|
||||
|
||||
@@ -1553,7 +1553,7 @@ class VulkanTextureSA : public GraphicsDataNode<ITextureSA> {
|
||||
m_pixelPitchNum = 2;
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, fmt("unsupported tex format"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("unsupported tex format"));
|
||||
}
|
||||
m_vkFmt = pfmt;
|
||||
|
||||
@@ -1707,7 +1707,7 @@ class VulkanTextureD : public GraphicsDataNode<ITextureD> {
|
||||
m_cpuSz = width * height * 2;
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, fmt("unsupported tex format"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("unsupported tex format"));
|
||||
}
|
||||
m_vkFmt = pfmt;
|
||||
m_stagingBuf.reset(new uint8_t[m_cpuSz]);
|
||||
@@ -2679,7 +2679,7 @@ struct VulkanShaderDataBinding : GraphicsDataNode<IShaderDataBinding> {
|
||||
for (size_t i = 0; i < ubufCount; ++i) {
|
||||
#ifndef NDEBUG
|
||||
if (ubufOffs[i] % 256) {
|
||||
Log.report(logvisor::Fatal, fmt("non-256-byte-aligned uniform-offset {} provided to newShaderDataBinding"),
|
||||
Log.report(logvisor::Fatal, FMT_STRING("non-256-byte-aligned uniform-offset {} provided to newShaderDataBinding"),
|
||||
i);
|
||||
}
|
||||
#endif
|
||||
@@ -2692,7 +2692,7 @@ struct VulkanShaderDataBinding : GraphicsDataNode<IShaderDataBinding> {
|
||||
for (size_t i = 0; i < ubufCount; ++i) {
|
||||
#ifndef NDEBUG
|
||||
if (!ubufs[i]) {
|
||||
Log.report(logvisor::Fatal, fmt("null uniform-buffer {} provided to newShaderDataBinding"), i);
|
||||
Log.report(logvisor::Fatal, FMT_STRING("null uniform-buffer {} provided to newShaderDataBinding"), i);
|
||||
}
|
||||
#endif
|
||||
m_ubufs.push_back(ubufs[i]);
|
||||
@@ -2794,7 +2794,7 @@ struct VulkanShaderDataBinding : GraphicsDataNode<IShaderDataBinding> {
|
||||
void bind(VkCommandBuffer cmdBuf, int b, VkRenderPass rPass = 0) {
|
||||
#ifndef NDEBUG
|
||||
if (!m_committed)
|
||||
Log.report(logvisor::Fatal, fmt("attempted to use uncommitted VulkanShaderDataBinding"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to use uncommitted VulkanShaderDataBinding"));
|
||||
#endif
|
||||
|
||||
/* Ensure resized texture bindings are re-bound */
|
||||
@@ -3178,7 +3178,7 @@ struct VulkanCommandQueue final : IGraphicsCommandQueue {
|
||||
VulkanTextureR* csource = m_resolveDispSource.cast<VulkanTextureR>();
|
||||
#ifndef NDEBUG
|
||||
if (!csource->m_colorBindCount)
|
||||
Log.report(logvisor::Fatal, fmt("texture provided to resolveDisplay() must have at least 1 color binding"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("texture provided to resolveDisplay() must have at least 1 color binding"));
|
||||
#endif
|
||||
|
||||
ThrowIfFailed(
|
||||
@@ -3493,9 +3493,9 @@ VulkanTextureR::VulkanTextureR(const boo::ObjToken<BaseGraphicsData>& parent, Vu
|
||||
, m_colorBindCount(colorBindCount)
|
||||
, m_depthBindCount(depthBindCount) {
|
||||
if (colorBindCount > MAX_BIND_TEXS)
|
||||
Log.report(logvisor::Fatal, fmt("too many color bindings for render texture"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("too many color bindings for render texture"));
|
||||
if (depthBindCount > MAX_BIND_TEXS)
|
||||
Log.report(logvisor::Fatal, fmt("too many depth bindings for render texture"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("too many depth bindings for render texture"));
|
||||
|
||||
if (m_samplesColor == 0)
|
||||
m_samplesColor = 1;
|
||||
@@ -3724,7 +3724,7 @@ ObjToken<IShaderStage> VulkanDataFactory::Context::newShaderStage(const uint8_t*
|
||||
|
||||
if (stage == PipelineStage::Control || stage == PipelineStage::Evaluation) {
|
||||
if (!factory.m_ctx->m_features.tessellationShader)
|
||||
Log.report(logvisor::Fatal, fmt("Device does not support tessellation shaders"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("Device does not support tessellation shaders"));
|
||||
}
|
||||
|
||||
return {new VulkanShaderStage(m_data, factory.m_ctx, data, size, stage)};
|
||||
@@ -3738,9 +3738,9 @@ ObjToken<IShaderPipeline> VulkanDataFactory::Context::newShaderPipeline(
|
||||
|
||||
if (control || evaluation) {
|
||||
if (!factory.m_ctx->m_features.tessellationShader)
|
||||
Log.report(logvisor::Fatal, fmt("Device does not support tessellation shaders"));
|
||||
Log.report(logvisor::Fatal, FMT_STRING("Device does not support tessellation shaders"));
|
||||
if (additionalInfo.patchSize > factory.m_ctx->m_gpuProps.limits.maxTessellationPatchSize)
|
||||
Log.report(logvisor::Fatal, fmt("Device supports {} patch vertices, {} requested"),
|
||||
Log.report(logvisor::Fatal, FMT_STRING("Device supports {} patch vertices, {} requested"),
|
||||
int(factory.m_ctx->m_gpuProps.limits.maxTessellationPatchSize), int(additionalInfo.patchSize));
|
||||
}
|
||||
|
||||
@@ -4104,14 +4104,14 @@ std::vector<uint8_t> VulkanDataFactory::CompileGLSL(const char* source, Pipeline
|
||||
glslang::TShader shader(lang);
|
||||
shader.setStrings(&source, 1);
|
||||
if (!shader.parse(&glslang::DefaultTBuiltInResource, 110, false, messages)) {
|
||||
fmt::print(fmt("{}\n"), source);
|
||||
Log.report(logvisor::Fatal, fmt("unable to compile shader\n{}"), shader.getInfoLog());
|
||||
fmt::print(FMT_STRING("{}\n"), source);
|
||||
Log.report(logvisor::Fatal, FMT_STRING("unable to compile shader\n{}"), shader.getInfoLog());
|
||||
}
|
||||
|
||||
glslang::TProgram prog;
|
||||
prog.addShader(&shader);
|
||||
if (!prog.link(messages)) {
|
||||
Log.report(logvisor::Fatal, fmt("unable to link shader program\n{}"), prog.getInfoLog());
|
||||
Log.report(logvisor::Fatal, FMT_STRING("unable to link shader program\n{}"), prog.getInfoLog());
|
||||
}
|
||||
|
||||
std::vector<unsigned int> out;
|
||||
|
||||
Reference in New Issue
Block a user