Check for argument count & add UNLEASHED_RECOMP define when compiling shaders.

This commit is contained in:
Skyth 2025-02-26 23:30:17 +03:00
parent 8f81380fc3
commit 55639ba868
2 changed files with 12 additions and 0 deletions

View file

@ -54,6 +54,10 @@ IDxcBlob* DxcCompiler::compile(const std::string& shaderSource, bool compilePixe
args[argCount++] = L"-Qstrip_debug"; args[argCount++] = L"-Qstrip_debug";
#ifdef UNLEASHED_RECOMP
args[argCount++] = L"-DUNLEASHED_RECOMP";
#endif
IDxcResult* result = nullptr; IDxcResult* result = nullptr;
HRESULT hr = dxcCompiler->Compile(&source, args, argCount, nullptr, IID_PPV_ARGS(&result)); HRESULT hr = dxcCompiler->Compile(&source, args, argCount, nullptr, IID_PPV_ARGS(&result));

View file

@ -31,6 +31,14 @@ struct RecompiledShader
int main(int argc, char** argv) 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 = const char* input =
#ifdef XENOS_RECOMP_INPUT #ifdef XENOS_RECOMP_INPUT
XENOS_RECOMP_INPUT XENOS_RECOMP_INPUT