Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("hlslc. v0.1");
            Console.WriteLine("Author@KLDistance (https://github.com/KLDistance)\n");
            try
            {
                Semantics  semantics = new Semantics(args);
                TicksTimer timer     = new TicksTimer();
                timer.MsTickStart();
                if (semantics.IsOptionalCompilation())
                {
                    semantics.CompileWithOptions("main", "vs", "ps");
                }
                else
                {
                    semantics.CompileWithoutOptions();
                }
                double msElapsed = timer.MsTickCut();
#if GENERATE_MSG
                Console.WriteLine("Overall shader compilation done. {0:.##} ms elapsed.", msElapsed);
#endif
            }
            catch (Exception e)
            {
                Console.WriteLine("Invalid format of inputs! Error type: {0}.\n" +
                                  "Use \"hlslc -h\" command to see detailed implementation of the tool.", e.Data);
            }
        }
Example #2
0
        public TicksTimer()
        {
            long freq = 0;

            TicksTimer.QueryPerformanceFrequency(out freq);
            this.msFreq    = freq * 0.001;
            this.startTime = 0;
            this.stopTime  = 0;
        }
Example #3
0
 public double MsTickCut()
 {
     TicksTimer.QueryPerformanceCounter(out this.stopTime);
     return((this.stopTime - this.startTime) / this.msFreq);
 }
Example #4
0
 public void MsTickStart()
 {
     TicksTimer.QueryPerformanceCounter(out this.startTime);
 }