Esempio n. 1
0
 public bool CompileRootSignature(IDXILCompiler compiler)
 {
     if (compiler != null)
     {
         IDXBlob blob;
         string  msg;
         RootSigHasError    = !compiler.CompileRootSignature(this.Code, this.CompileOptions, this.SourceFilePath, out blob, out msg);
         RootSigMessages    = msg;
         CompiledRootSig    = blob;
         RootSigWasCompiled = true;
         return(!RootSigHasError);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
        public bool Compile(ID3DCompiler compiler, IDXILCompiler dxil)
        {
            if (CompileOptions.Target.ToString()[3] == '6')
            {
                if (dxil == null)
                {
                    return(false);
                }

                IDXILShaderBlob blob;
                string          msg;
                HasError     = !dxil.Compile(this.Code, this.CompileOptions, this.SourceFilePath, out blob, out msg);
                WasCompiled  = true;
                Messages     = msg;
                CompiledBlob = blob;
            }
            else
            {
                if (compiler == null)
                {
                    return(false);
                }

                IDXBCShaderBlob blob;
                string          msg;
                HasError     = !compiler.Compile(this.Code, this.CompileOptions, this.SourceFilePath, out blob, out msg);
                WasCompiled  = true;
                Messages     = msg;
                CompiledBlob = blob;
            }

            // check for embedded root signature and pull it out if there is one
            if (CompiledBlob != null)
            {
                IDXBlob rs = CompiledBlob.ExtractRootSignature();
                if (rs != null)
                {
                    RootSigWasCompiled = true;
                    RootSigHasError    = false;
                    CompiledRootSig    = rs;
                }
            }

            return(!HasError);
        }
Esempio n. 3
0
        private void CreateBackends(Options opts)
        {
            List <IBackend> backends = new List <IBackend>();
            IIncludeHandler handler  = new IncludeHandler(opts.IncludePaths);

            try
            {
                ID3DCompiler  fxc  = m_Wrapper.CreateD3DCompiler(opts.D3DCompilerPath, handler);
                IDXILCompiler dxil = m_Wrapper.CreateDXILCompiler(opts.DXILCompilerPath, handler);

                backends.Add(new D3DCompilerBackend(fxc, dxil));
                try
                {
                    IAMDDriver driver = m_Wrapper.CreateAMDDriver(opts.DXXDriverPath);
                    backends.Add(new AMDDriverBackend(driver, fxc));
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            backends.Add(new CodeXLBackend(opts.CodeXLPath, opts.D3DCompilerPath, opts.TempPath));
            backends.Add(new GLSlangBackend(m_Wrapper, handler));
            backends.Add(new GLSLOptimizerBackend(m_Wrapper));
            backends.Add(new PowerVRBackend(opts.PowerVRCompilerPath, opts.TempPath));
            backends.Add(new MaliSCBackend(opts.MaliSCRoot, opts.TempPath));
            backends.Add(new RGABackend(opts.RGAPath, opts.TempPath, m_Wrapper, handler));

            if (File.Exists(opts.IntelShaderAnalyzerPath))
            {
                backends.Add(new IntelShaderAnalyzerBackend(opts));
            }

            m_Backends = backends;
        }
Esempio n. 4
0
 public D3DCompilerBackend(ID3DCompiler comp, IDXILCompiler dxil)
 {
     m_Compiler = comp;
     m_DXIL     = dxil;
 }