Open jcortell68 opened 2 months ago
Thank you for bringing this to our attention, and the thorough analysis! We follow the Google C++ Style Guide (https://google.github.io/styleguide/cppguide.html) which recommends lower case file names, but I think our code generation tools should be robust enough to handle upper case names as well. Certainly, reporting an error as you've suggested is a minimal requirement.
The failure is easy to reproduce. Add an empty file
then run the Public Counter Compiler with API=VK and GPU Family=gfxWhatever. You'll end up with this error:
That message is a bit long. Notice the simple filename that it says doesn't exist:
You can see it's malformed. The reason is that the logic in
PublicCounterCompiler::CounterCompiler::CompileCounters()
assumes that the files insource\public_counter_compiler_input_files
have only lowercase characters in their names. That unchecked assumption, if false, results in a -1 value forasicIndex
here. The code then proceeds to use the -1, resulting in the malformed filename in the error message.At a minimum, it would be nice if the compiler failed with a comprehensible and actionable message if someone introduces a file with an uppercase character. The following addition produces a nice error message for me:
Of course, the alternative is to make the code work even if the file has an uppercase character in it. I'm not sure, though, if that would require adjustments in a bunch of places. I think it's perfectly fine to require the files to be all lowercase; the compiler just needs to tell the user when that requirement isn't met. I.e., the above would be a sufficient and safe fix in my book. The nonsensical message it is producing today isn't helpful and took some time to debug to discover what was really wrong.