From 55639ba868969decb9247272da51c32e9d4d7929 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Wed, 26 Feb 2025 23:30:17 +0300 Subject: [PATCH] Check for argument count & add UNLEASHED_RECOMP define when compiling shaders. --- XenosRecomp/dxc_compiler.cpp | 4 ++++ XenosRecomp/main.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/XenosRecomp/dxc_compiler.cpp b/XenosRecomp/dxc_compiler.cpp index bde73ad..fcbc43a 100644 --- a/XenosRecomp/dxc_compiler.cpp +++ b/XenosRecomp/dxc_compiler.cpp @@ -54,6 +54,10 @@ IDxcBlob* DxcCompiler::compile(const std::string& shaderSource, bool compilePixe args[argCount++] = L"-Qstrip_debug"; +#ifdef UNLEASHED_RECOMP + args[argCount++] = L"-DUNLEASHED_RECOMP"; +#endif + IDxcResult* result = nullptr; HRESULT hr = dxcCompiler->Compile(&source, args, argCount, nullptr, IID_PPV_ARGS(&result)); diff --git a/XenosRecomp/main.cpp b/XenosRecomp/main.cpp index e35b89d..3dd0a06 100644 --- a/XenosRecomp/main.cpp +++ b/XenosRecomp/main.cpp @@ -31,6 +31,14 @@ struct RecompiledShader int main(int argc, char** argv) { +#ifndef XENOS_RECOMP_INPUT + if (argc < 4) + { + printf("Usage: XenosRecomp [input path] [output path] [shader common header file path]"); + return 0; + } +#endif + const char* input = #ifdef XENOS_RECOMP_INPUT XENOS_RECOMP_INPUT