From b578ce434be7452ffdafc6e5f38de603bbe05dfa Mon Sep 17 00:00:00 2001 From: BearOso Date: Thu, 2 Feb 2023 16:12:02 -0600 Subject: [PATCH] Remove fmt from shader files. --- vulkan/slang_preset_ini.cpp | 2 +- vulkan/vulkan_shader_chain.cpp | 11 +++++------ vulkan/vulkan_slang_pipeline.cpp | 8 +------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/vulkan/slang_preset_ini.cpp b/vulkan/slang_preset_ini.cpp index 204ae226..11d0fd88 100644 --- a/vulkan/slang_preset_ini.cpp +++ b/vulkan/slang_preset_ini.cpp @@ -129,7 +129,7 @@ bool IniFile::get_bool(std::string key, bool default_value = false) for (auto &c : lower) c = tolower(c); - const char *true_strings[] = { "true", "1", "yes", "on"}; + const char *true_strings[] = { "true", "1", "yes", "on", "y"}; for (auto &s : true_strings) if (lower == s) return true; diff --git a/vulkan/vulkan_shader_chain.cpp b/vulkan/vulkan_shader_chain.cpp index 02b90dbb..7ea08a02 100644 --- a/vulkan/vulkan_shader_chain.cpp +++ b/vulkan/vulkan_shader_chain.cpp @@ -1,6 +1,5 @@ #include "vulkan_shader_chain.hpp" #include "slang_helpers.hpp" -#include "fmt/format.h" #include "stb_image.h" #include "vulkan/vulkan_enums.hpp" @@ -191,19 +190,19 @@ void ShaderChain::update_and_propagate_sizes(int original_width_new, int origina bool ShaderChain::load_shader_preset(std::string filename) { if (!ends_with(filename, ".slangp")) - fmt::print("Warning: loading preset without .slangp extension\n"); + printf("Warning: loading preset without .slangp extension\n"); preset = std::make_unique(); if (!preset->load_preset_file(filename)) { - fmt::print("Couldn't load preset file: {}\n", filename); + printf("Couldn't load preset file: %s\n", filename.c_str()); return false; } if (!preset->introspect()) { - fmt::print("Failed introspection process in preset: {}\n", filename); + printf("Failed introspection process in preset: %s\n", filename.c_str()); return false; } @@ -221,7 +220,7 @@ bool ShaderChain::load_shader_preset(std::string filename) bool lastpass = (i == preset->passes.size() - 1); if (!pipelines[i]->generate_pipeline(lastpass)) { - fmt::print("Couldn't create pipeline for shader: {}\n", p.filename); + printf("Couldn't create pipeline for shader: %s\n", p.filename.c_str()); return false; } @@ -573,7 +572,7 @@ bool ShaderChain::load_lookup_textures() if (!bytes) { - fmt::print("Couldn't load look-up texture: {}\n", l.filename); + printf("Couldn't load look-up texture: %s\n", l.filename.c_str()); return false; } diff --git a/vulkan/vulkan_slang_pipeline.cpp b/vulkan/vulkan_slang_pipeline.cpp index b1d4293d..742a0265 100644 --- a/vulkan/vulkan_slang_pipeline.cpp +++ b/vulkan/vulkan_slang_pipeline.cpp @@ -1,6 +1,5 @@ #include "vulkan_slang_pipeline.hpp" #include "slang_helpers.hpp" -#include "fmt/format.h" #include namespace Vulkan @@ -243,11 +242,6 @@ bool SlangPipeline::generate_pipeline(bool lastpass) vk::ColorComponentFlagBits::eA) .setBlendEnable(false) .setColorBlendOp(vk::BlendOp::eAdd); - // .setSrcColorBlendFactor(vk::BlendFactor::eSrcAlpha) - // .setDstColorBlendFactor(vk::BlendFactor::eOneMinusSrcAlpha) - // .setAlphaBlendOp(vk::BlendOp::eAdd) - // .setSrcAlphaBlendFactor(vk::BlendFactor::eOne) - // .setSrcAlphaBlendFactor(vk::BlendFactor::eZero); auto blend_state_info = vk::PipelineColorBlendStateCreateInfo{} .setLogicOpEnable(false) @@ -319,7 +313,7 @@ bool SlangPipeline::generate_pipeline(bool lastpass) if (result != vk::Result::eSuccess) { - fmt::print("Failed to create pipeline for shader: {}\n", shader->filename); + printf("Failed to create pipeline for shader: %s\n", shader->filename.c_str()); return false; }