| 35 | } |
| 36 | |
| 37 | void PrintUsage() |
| 38 | { |
| 39 | fprintf(stderr, |
| 40 | "usage: hlslparser [-h|-g] -i shader.hlsl -o [shader.hlsl | shader.metal]\n" |
| 41 | "Translate DX9-style HLSL shader to HLSL/MSL shader.\n" |
| 42 | " -i input HLSL\n" |
| 43 | " -o output HLSL or MSL\n" |
| 44 | "optional arguments:\n" |
| 45 | " -g debug mode, preserve comments\n" |
| 46 | " -h, --help show this help message and exit\n" |
| 47 | " -line write #file/line directive\n" |
| 48 | " -nohalf turn half into float"); |
| 49 | } |
| 50 | |
| 51 | // Taken from KrmaLog.cpp |
| 52 | static bool endsWith(const string& value, const string& ending) |