From df0da96c38fb198869ad71ba15dd5e5af24661d2 Mon Sep 17 00:00:00 2001 From: Bram Date: Mon, 16 Mar 2026 12:58:09 +0100 Subject: [PATCH] Add compute shader support --- ShaderCompiler.h | 3 ++- main.cpp | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/ShaderCompiler.h b/ShaderCompiler.h index e242120..f0d3321 100644 --- a/ShaderCompiler.h +++ b/ShaderCompiler.h @@ -58,7 +58,7 @@ public: static bool IsEntryShader(const fs::path& p) { const auto ext = ToLower(p.extension().string()); - return ext == ".vert" || ext == ".frag"; + return ext == ".vert" || ext == ".frag" || ext == ".comp"; } static bool IsIncludeOnlyShader(const fs::path& p) @@ -114,6 +114,7 @@ private: const auto ext = ToLower(p.extension().string()); if (ext == ".vert") return EShLangVertex; if (ext == ".frag") return EShLangFragment; + if (ext == ".comp") return EShLangCompute; throw std::runtime_error("Unknown entry shader stage extension: " + p.string()); } diff --git a/main.cpp b/main.cpp index 1e9c57c..db462a4 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,3 @@ -// main.cpp (updated) - -// Standard #include #include #include @@ -8,16 +5,12 @@ #include #include #include -#include -// Manifest #include -// Logging #include #include -// Your shader compiler header #include "ShaderCompiler.h" namespace fs = std::filesystem; @@ -122,6 +115,7 @@ int main(int argc, char** argv) { if (args.clean && fs::exists(args.output)) { spdlog::info("Cleaning output dir: {}", args.output.string()); fs::remove_all(args.output); + return 0; } fs::create_directories(args.output);