Ejemplo n.º 1
0
        private void CacheEffectParams(GraphicsDevice device)
        {
            ShaderProfile maxPixelShaderProfile = device.GraphicsDeviceCapabilities.MaxPixelShaderProfile;

            this.hasPS20 = (((maxPixelShaderProfile == ShaderProfile.PS_2_0) || (maxPixelShaderProfile == ShaderProfile.PS_2_A)) || ((maxPixelShaderProfile == ShaderProfile.PS_2_B) || (maxPixelShaderProfile == ShaderProfile.PS_3_0))) || (maxPixelShaderProfile == ShaderProfile.XPS_3_0);
            this.basicShaderTechnique   = _effect.Techniques["BasicEffect"];
            this.basicTextureParam      = _effect.Parameters["BasicTexture"];
            this.fogEnabledParam        = _effect.Parameters["FogEnabled"];
            this.fogStartParam          = _effect.Parameters["FogStart"];
            this.fogEndParam            = _effect.Parameters["FogEnd"];
            this.fogColorParam          = _effect.Parameters["FogColor"];
            this.worldParam             = _effect.Parameters["World"];
            this.viewParam              = _effect.Parameters["View"];
            this.projectionParam        = _effect.Parameters["Projection"];
            this.diffuseColorParam      = _effect.Parameters["DiffuseColor"];
            this.specularColorParam     = _effect.Parameters["SpecularColor"];
            this.emissiveColorParam     = _effect.Parameters["EmissiveColor"];
            this.specularPowerParam     = _effect.Parameters["SpecularPower"];
            this.alphaParam             = _effect.Parameters["Alpha"];
            this.ambientLightColorParam = _effect.Parameters["AmbientLightColor"];
            this.eyePositionParam       = _effect.Parameters["EyePosition"];
            this.shaderIndexParam       = _effect.Parameters["ShaderIndex"];
            texCoordsOffsetParam        = _effect.Parameters["TexCoordsOffset"];
            texCoordsMultiplierParam    = _effect.Parameters["TexCoordsMultiplier"];
            this.light0 = new BasicDirectionalLight2(_effect.Parameters["DirLight0Direction"], _effect.Parameters["DirLight0DiffuseColor"], _effect.Parameters["DirLight0SpecularColor"]);
            this.light1 = new BasicDirectionalLight2(_effect.Parameters["DirLight1Direction"], _effect.Parameters["DirLight1DiffuseColor"], _effect.Parameters["DirLight1SpecularColor"]);
            this.light2 = new BasicDirectionalLight2(_effect.Parameters["DirLight2Direction"], _effect.Parameters["DirLight2DiffuseColor"], _effect.Parameters["DirLight2SpecularColor"]);
        }
Ejemplo n.º 2
0
        private void OnPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
        {
            GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;

            GraphicsDeviceCapabilities caps = adapter.GetCapabilities(DeviceType.Hardware);

            maxVertexShaderProfile = caps.MaxVertexShaderProfile;
            maxPixelShaderProfile  = caps.MaxPixelShaderProfile;
            supportsShadersV3      = (maxVertexShaderProfile >= ShaderProfile.VS_3_0 && maxPixelShaderProfile >= ShaderProfile.PS_3_0);

            SurfaceFormat          format        = adapter.CurrentDisplayMode.Format;
            PresentationParameters presentParams = e.GraphicsDeviceInformation.PresentationParameters;

            if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format, false, MultiSampleType.EightSamples))
            {
                presentParams.MultiSampleQuality = 0;
                presentParams.MultiSampleType    = MultiSampleType.EightSamples;
                return;
            }
            if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format, false, MultiSampleType.FourSamples))
            {
                presentParams.MultiSampleQuality = 0;
                presentParams.MultiSampleType    = MultiSampleType.FourSamples;
                return;
            }
            if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format, false, MultiSampleType.TwoSamples))
            {
                presentParams.MultiSampleQuality = 0;
                presentParams.MultiSampleType    = MultiSampleType.TwoSamples;
                return;
            }
        }
Ejemplo n.º 3
0
        static void ShaderCompiler(string inputfile, string outputfile, ShaderProfile shaderProfile, bool isAsm, string entryname)
        {
            CompilerMacro[] macroArray = null;
            macroArray         = new CompilerMacro[2];
            macroArray[0].Name = "XBOX";
            macroArray[1].Name = "XBOX360";

            CompiledShader compiledShader;

            if (isAsm)
            {
                compiledShader = Microsoft.Xna.Framework.Graphics.ShaderCompiler.AssembleFromFile(inputfile, macroArray, null, CompilerOptions.None, TargetPlatform.Xbox360);
            }
            else
            {
                compiledShader = Microsoft.Xna.Framework.Graphics.ShaderCompiler.CompileFromFile(inputfile, macroArray, null, CompilerOptions.None, entryname, shaderProfile, TargetPlatform.Xbox360);
            }

            if (compiledShader.Success)
            {
                System.IO.File.WriteAllBytes(outputfile, compiledShader.GetShaderCode());
            }
            else
            {
                Console.WriteLine("Error compiling shader:");
            }

            if (compiledShader.ErrorsAndWarnings != string.Empty)
            {
                Console.WriteLine(compiledShader.ErrorsAndWarnings);
            }
        }
Ejemplo n.º 4
0
        public static string GetShaderEntryPoint(ShaderProfile version)
        {
            switch (version.Version)
            {
            case ShaderVersion.VertexShader:
                return("MainVS");

            case ShaderVersion.PixelShader:
                return("MainPS");

            case ShaderVersion.HullShader:
                return("MainHS");

            case ShaderVersion.GeometryShader:
                return("MainGS");

            case ShaderVersion.DomainShader:
                return("MainDS");

            case ShaderVersion.ComputeShader:
                return("MainCS");

            default:
                return("Main");
            }
        }
Ejemplo n.º 5
0
        public override CompiledEffectContent Process(StitchedEffectContent input, ContentProcessorContext context)
        {
            StitchedEffectSymbol stitchedEffect = StitchedEffectBuilder.BuildStitchedEffect(input, context);

            // Find out which shader profile to attempt to compile for first.
            ShaderProfile minimumShaderProfile = GetMinimumTargetShaderProfile(stitchedEffect);

            foreach (ShaderProfile shaderProfile in Enum.GetValues(typeof(ShaderProfile)))
            {
                if (shaderProfile < minimumShaderProfile)
                {
                    continue;
                }

                CompiledEffectContent compiledEffect;
                if (AttemptEffectCompilation(context, input, stitchedEffect, shaderProfile, out compiledEffect))
                {
                    return(compiledEffect);
                }
            }

            throw new InvalidContentException(
                      "Could not find a shader profile compatible with this stitched effect.",
                      input.Identity);
        }
 private static bool IsValidShaderProfile(ShaderProfile capsShaderProfile, ShaderProfile minimumShaderProfile)
 {
     if ((capsShaderProfile == ShaderProfile.PS_2_B) && (minimumShaderProfile == ShaderProfile.PS_2_A))
     {
         return(false);
     }
     return(capsShaderProfile >= minimumShaderProfile);
 }
        public void WillReturnCorrectFeatureLevelFromProfile(int major, int minor, int profileMajor, int profileMinor, FeatureLevel expected)
        {
            var profile = new ShaderProfile(ShaderVersion.VertexShader, major, minor, profileMajor, profileMinor);

            var featureLevel = profile.GetFeatureLevel();

            Assert.AreEqual(expected, featureLevel);
        }
Ejemplo n.º 8
0
        public void CompileFromFiles(Canvas canvas, string psName, string vsName)
        {
            this.psFileName = psName;
            this.vsFileName = vsName;
            ShaderProfile psProf = ShaderProfile.PS_1_1;

            switch (PSTarget)
            {
            case 2:
                psProf = ShaderProfile.PS_2_0;
                break;

            case 3:
                psProf = ShaderProfile.PS_3_0;
                break;
            }
            ShaderProfile vsProf = ShaderProfile.VS_1_1;

            switch (VSTarget)
            {
            case 2:
                vsProf = ShaderProfile.VS_2_0;
                break;

            case 3:
                vsProf = ShaderProfile.VS_3_0;
                break;
            }
            CompiledShader psShader = ShaderCompiler.CompileFromFile(psFileName, null, null, CompilerOptions.PackMatrixRowMajor, "main", psProf, TargetPlatform.Windows);

            Log.GetInstance().WriteLine(psShader.ErrorsAndWarnings);
            CompiledShader vsShader = ShaderCompiler.CompileFromFile(vsFileName, null, null, CompilerOptions.PackMatrixRowMajor, "main", vsProf, TargetPlatform.Windows);

            Log.GetInstance().WriteLine(vsShader.ErrorsAndWarnings);
            errorMessage = null;
            if (vsShader.ErrorsAndWarnings.Length > 1)
            {
                errorMessage = "Vertex Shader: " + vsShader.ErrorsAndWarnings;
            }
            if (psShader.ErrorsAndWarnings.Length > 1)
            {
                if (errorMessage == null)
                {
                    errorMessage = "Pixel Shader: " + psShader.ErrorsAndWarnings;
                }
                else
                {
                    errorMessage = errorMessage + "\n Pixel Shader: " + psShader.ErrorsAndWarnings;
                }
            }
            if (psShader.Success && vsShader.Success)
            {
                ps       = new PixelShader(canvas.GetDevice(), psShader.GetShaderCode());
                vs       = new VertexShader(canvas.GetDevice(), vsShader.GetShaderCode());
                compiled = true;
            }
        }
Ejemplo n.º 9
0
        public CustomBuildFileHLSL(ProjConfig conf, string targetName, ShaderProfile shaderProfile, string entryPoint, string outputDir, string sourceFile)
        {
            KeyInput = sourceFile;
            string resourceName = Path.GetFileNameWithoutExtension(sourceFile);

            Output              = string.Format(@"{0}\{1}.h", outputDir, resourceName);
            Description         = "Shader (" + shaderProfile.ToString() + ") : " + sourceFile;
            Executable          = "";                         // Setting 'fxc' exe in ExeArgs instead, avoid build system adding a uneeded dependency to 'fxc'
            ExecutableArguments = string.Format("fxc /Zi /nologo /O2 /E\"{0}\" /T {1} /Fh\"{2}\" /Vn\"gpShader_{3}\" \"{4}\"", entryPoint, shaderProfile.ToString(), Output, resourceName, sourceFile);
        }
Ejemplo n.º 10
0
 public EffectPassDefinition(
     string name,
     string vertexShaderName, string pixelShaderName,
     ShaderProfile vertexShaderProfile, ShaderProfile pixelShaderProfile)
 {
     Name                = name;
     VertexShaderName    = vertexShaderName;
     PixelShaderName     = pixelShaderName;
     VertexShaderProfile = vertexShaderProfile;
     PixelShaderProfile  = pixelShaderProfile;
 }
Ejemplo n.º 11
0
 public EffectPassDefinition(
     string name,
     string vertexShaderName, string pixelShaderName,
     ShaderProfile vertexShaderProfile, ShaderProfile pixelShaderProfile)
 {
     Name = name;
     VertexShaderName = vertexShaderName;
     PixelShaderName = pixelShaderName;
     VertexShaderProfile = vertexShaderProfile;
     PixelShaderProfile = pixelShaderProfile;
 }
Ejemplo n.º 12
0
        public void ValidateShaderModels(ShaderProfile profile)
        {
            int major, minor;

            if (!string.IsNullOrEmpty(vsFilename))
            {
                switch (profile)
                {
                case ShaderProfile.DirectX_11:
                    ParseShaderModel(vsShaderXML, _hlslVertexShaderRegex, out major, out minor);
                    if (major <= 3)
                    {
                        throw new NotSupportedException(String.Format("Invalid profile '{0}'. Vertex shader '{1}' must be SM 4.0 level 9.1 or higher!", vsShaderXML, vsFilename));
                    }
                    break;

                case ShaderProfile.OpenGL:
                    ParseShaderModel(vsShaderXML, _glslVertexShaderRegex, out major, out minor);
                    if (major > 3)
                    {
                        throw new NotSupportedException(String.Format("Invalid profile '{0}'. Vertex shader '{1}' must be SM 3.0 or lower!", vsShaderXML, vsFilename));
                    }
                    break;

                case ShaderProfile.PlayStation4:
                    throw new NotSupportedException("PlayStation 4 support isn't available in this build.");
                }
            }

            if (!string.IsNullOrEmpty(psFileName))
            {
                switch (profile)
                {
                case ShaderProfile.DirectX_11:
                    ParseShaderModel(psShaderXML, _hlslPixelShaderRegex, out major, out minor);
                    if (major <= 3)
                    {
                        throw new NotSupportedException(String.Format("Invalid profile '{0}'. Pixel shader '{1}' must be SM 4.0 level 9.1 or higher!", vsShaderXML, psFileName));
                    }
                    break;

                case ShaderProfile.OpenGL:
                    ParseShaderModel(psShaderXML, _glslPixelShaderRegex, out major, out minor);
                    if (major > 3)
                    {
                        throw new NotSupportedException(String.Format("Invalid profile '{0}'. Pixel shader '{1}' must be SM 3.0 or lower!", vsShaderXML, psFileName));
                    }
                    break;

                case ShaderProfile.PlayStation4:
                    throw new NotSupportedException("PlayStation 4 support isn't available in this build.");
                }
            }
        }
Ejemplo n.º 13
0
        public void CanGetDescription()
        {
            // Arrange.
            const ShaderProfile shaderProfile = ShaderProfile.Version2_0;

            // Act.
            string description = shaderProfile.GetDescription();

            // Assert.
            Assert.AreEqual("2_0", description);
        }
Ejemplo n.º 14
0
		public EffectCodeGenerator(
			StitchedEffectSymbol stitchedEffect, ShaderProfile targetShaderProfile,
			TextWriter writer)
		{
			_stitchedEffect = stitchedEffect;
			_targetShaderProfile = targetShaderProfile;
			_output = new ScriptTextWriter(writer);
			_context = new GeneratorContext
			{
				TargetShaderProfile = _targetShaderProfile
			};
		}
Ejemplo n.º 15
0
 public EffectCodeGenerator(
     StitchedEffectSymbol stitchedEffect, ShaderProfile targetShaderProfile,
     TextWriter writer)
 {
     _stitchedEffect      = stitchedEffect;
     _targetShaderProfile = targetShaderProfile;
     _output  = new ScriptTextWriter(writer);
     _context = new GeneratorContext
     {
         TargetShaderProfile = _targetShaderProfile
     };
 }
Ejemplo n.º 16
0
            internal CompileUnit(ShaderBuildReport owner, int programIndex, int multicompileIndex, string[] defines, LogItem[] warnings, LogItem[] errors, ShaderProfile profile, string entry)
            {
                m_GPUProgramIndex   = programIndex;
                m_MultiCompileIndex = multicompileIndex;
                m_Defines           = defines;
                m_Warnings          = warnings;
                m_Errors            = errors;
                m_Profile           = profile;
                m_Entry             = entry;

                this.owner = owner;
            }
Ejemplo n.º 17
0
        private static bool AttemptEffectCompilation(
            ContentProcessorContext context, StitchedEffectContent input,
            StitchedEffectSymbol stitchedEffect, ShaderProfile shaderProfile,
            out CompiledEffectContent compiledEffect)
        {
            // Generate effect code.
            StringWriter        writer        = new StringWriter();
            EffectCodeGenerator codeGenerator = new EffectCodeGenerator(stitchedEffect, shaderProfile, writer);

            codeGenerator.GenerateCode();
            string effectCode = writer.ToString();

            // Save effect code so that if there are errors, we'll be able to view the generated .fx file.
            string tempEffectFile = GetTempEffectFileName(input);

            File.WriteAllText(tempEffectFile, effectCode, Encoding.GetEncoding(1252));

            // Process effect code.
            EffectProcessor effectProcessor = new EffectProcessor
            {
                DebugMode = EffectProcessorDebugMode.Auto,
                Defines   = null
            };

            EffectContent effectContent = new EffectContent
            {
                EffectCode = effectCode,
                Identity   = new ContentIdentity(tempEffectFile),
                Name       = input.Name
            };

            try
            {
                compiledEffect = effectProcessor.Process(effectContent, context);

                // This is only needed if the compilation was successful - if it failed,
                // a more specific error message (with link to the generated file)
                // will be shown to the user.
                context.Logger.LogImportantMessage(string.Format("{0} : Stitched effect generated (double-click this message to view).", tempEffectFile));

                return(true);
            }
            catch (InvalidContentException ex)
            {
                if (ErrorIndicatesNeedForShaderModel3(ex.Message))
                {
                    compiledEffect = null;
                    return(false);
                }
                throw;
            }
        }
        public ShaderCodeBlockNode GetCodeBlock(ShaderProfile targetShaderProfile)
        {
            // First attempt to get a shader matching this specific profile.
            ShaderCodeBlockNode result = this.FirstOrDefault(n => n.ShaderProfile != null && n.ShaderProfile.Value <= targetShaderProfile);

            if (result != null)
            {
                return(result);
            }

            // Otherwise get the first shader with an unspecified profile.
            return(this.FirstOrDefault(n => n.ShaderProfile == null));
        }
Ejemplo n.º 19
0
		public bool CanBeCompiledForShaderProfile(ShaderProfile shaderProfile)
		{
			foreach (StitchedFragmentSymbol stitchedFragment in StitchedFragments)
			{
				// There might not be any vertex or pixel shaders, and that's OK, since we'll create them as needed.
				// But if there IS a vertex or pixel shader, we should not automatically create one.
				if (stitchedFragment.FragmentNode.VertexShaders.Any()
				    && stitchedFragment.FragmentNode.VertexShaders.GetCodeBlock(shaderProfile) == null)
					return false;
				if (stitchedFragment.FragmentNode.PixelShaders.Any()
				    && stitchedFragment.FragmentNode.PixelShaders.GetCodeBlock(shaderProfile) == null)
					return false;
			}
			return true;
		}
Ejemplo n.º 20
0
 /// <summary>Start a compile operation.</summary>
 /// <param name="sourceFile">Path of the file to compile.</param>
 /// <param name="genDir">Path to the generated directory.</param>
 /// <param name="targetFile">Path to the generated binary.</param>
 /// <param name="options">Options to use during compilation.</param>
 /// <param name="profile">Profile to compile.</param>
 /// <param name="shaderTarget">Target to compile.</param>
 /// <returns>The compile operation.</returns>
 public virtual CompileOperation Compile(
     FileInfo sourceFile,
     DirectoryInfo genDir,
     FileInfo targetFile,
     ShaderCompilerOptions options,
     ShaderProfile profile,
     ShaderTarget shaderTarget
     )
 => new CompileOperation(
     new ProcessStartInfo(),
     sourceFile,
     sourceFile,
     targetFile,
     options
     );
Ejemplo n.º 21
0
        private static string GetShaderProfileName(ShaderProfile shaderProfile)
        {
            switch (shaderProfile)
            {
            case ShaderProfile.PS_1_1:
                return("1.1");

            case ShaderProfile.PS_1_2:
                return("1.2");

            case ShaderProfile.PS_1_3:
                return("1.3");

            case ShaderProfile.PS_1_4:
                return("1.4");

            case ShaderProfile.PS_2_0:
                return("2.0");

            case ShaderProfile.PS_2_A:
                return("2.0a");

            case ShaderProfile.PS_2_B:
                return("2.0b");

            case ShaderProfile.PS_2_SW:
                return("2.0sw");

            case ShaderProfile.PS_3_0:
                return("3.0");

            case ShaderProfile.VS_1_1:
                return("1.1");

            case ShaderProfile.VS_2_0:
                return("2.0");

            case ShaderProfile.VS_2_A:
                return("2.0a");

            case ShaderProfile.VS_2_SW:
                return("2.0sw");

            case ShaderProfile.VS_3_0:
                return("3.0");
            }
            return(shaderProfile.ToString());
        }
Ejemplo n.º 22
0
 public bool CanBeCompiledForShaderProfile(ShaderProfile shaderProfile)
 {
     foreach (StitchedFragmentSymbol stitchedFragment in StitchedFragments)
     {
         // There might not be any vertex or pixel shaders, and that's OK, since we'll create them as needed.
         // But if there IS a vertex or pixel shader, we should not automatically create one.
         if (stitchedFragment.FragmentNode.VertexShaders.Any() &&
             stitchedFragment.FragmentNode.VertexShaders.GetCodeBlock(shaderProfile) == null)
         {
             return(false);
         }
         if (stitchedFragment.FragmentNode.PixelShaders.Any() &&
             stitchedFragment.FragmentNode.PixelShaders.GetCodeBlock(shaderProfile) == null)
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 23
0
        public void ValidateShaderModels(ShaderProfile profile)
        {
            int major, minor;

            if (!string.IsNullOrEmpty(vsFunction))
            {
                switch (profile)
                {
                    case ShaderProfile.DirectX_11:
                        ParseShaderModel(vsModel, _hlslVertexShaderRegex, out major, out minor);
                        if (major <= 3)
                            throw new Exception(String.Format("Invalid profile '{0}'. Vertex shader '{1}' must be SM 4.0 level 9.1 or higher!", vsModel, vsFunction));
                        break;
                    case ShaderProfile.OpenGL:
                        ParseShaderModel(vsModel, _glslVertexShaderRegex, out major, out minor);
                        if (major > 3)
                            throw new Exception(String.Format("Invalid profile '{0}'. Vertex shader '{1}' must be SM 3.0 or lower!", vsModel, vsFunction));
                        break;
                    case ShaderProfile.PlayStation4:
                        throw new NotSupportedException("PlayStation 4 support isn't available in this build.");
                }
            }

            if (!string.IsNullOrEmpty(psFunction))
            {
                switch (profile)
                {
                    case ShaderProfile.DirectX_11:
                        ParseShaderModel(psModel, _hlslPixelShaderRegex, out major, out minor);
                        if (major <= 3)
                            throw new Exception(String.Format("Invalid profile '{0}'. Pixel shader '{1}' must be SM 4.0 level 9.1 or higher!", vsModel, psFunction));
                        break;
                    case ShaderProfile.OpenGL:
                        ParseShaderModel(psModel, _glslPixelShaderRegex, out major, out minor);
                        if (major > 3)
                            throw new Exception(String.Format("Invalid profile '{0}'. Pixel shader '{1}' must be SM 3.0 or lower!", vsModel, psFunction));
                        break;
                    case ShaderProfile.PlayStation4:
                        throw new NotSupportedException("PlayStation 4 support isn't available in this build.");
                }
            }
        }
Ejemplo n.º 24
0
        public static void ClaimShaderFiles(Project project, string filenameEnding, ShaderProfile shaderProfile, string entryName)
        {
            Strings hlsl_Files = new Strings(project.ResolvedSourceFiles.Where(file => file.EndsWith(filenameEnding, StringComparison.InvariantCultureIgnoreCase)));

            if (hlsl_Files.Count() > 0)
            {
                foreach (ProjConfig conf in project.Configurations)
                {
                    string targetName = conf.Target.Name;
                    string outputDir  = string.Format(@"{0}\{1}_{2}\", NetImguiTarget.GetPath(@"\_generated\Shaders"), project.Name, conf.Target.GetOptimization());
                    conf.IncludePaths.Add(outputDir);
                    foreach (string file in hlsl_Files)
                    {
                        CustomBuildFileHLSL HlslCompileTask = new CustomBuildFileHLSL(conf, targetName, shaderProfile, entryName, outputDir, Project.GetCapitalizedFile(file));
                        project.ResolvedSourceFiles.Add(HlslCompileTask.Output);
                        conf.CustomFileBuildSteps.Add(HlslCompileTask);
                    }
                }
            }
        }
Ejemplo n.º 25
0
        private void DrawShaderProfileDropdown(MaterialEditor editor)
        {
            Material mat = editor.target as Material;

            {
                // TODO: need to change this so it checks keywords instead of file names
                bool complex = mat.shader.name.Contains("Complex");
                bool mobile  = mat.shader.name.Contains("Mobile");

                shaderProfile = ShaderProfile.OPTIMIZED;
                if (complex)
                {
                    shaderProfile = ShaderProfile.COMPLEX;
                }
                if (mobile)
                {
                    shaderProfile = ShaderProfile.MOBILE;
                }
            }
        }
Ejemplo n.º 26
0
        //* ────________________________________*
        //* methods ───────────────────────────────-*

        //* -----------------------------------------------------------------------*
        /// <summary>XNA・ビデオ環境レポートを生成します。</summary>
        ///
        /// <returns>レポート文字列。</returns>
        protected override string createReport()
        {
            string strResult = "◆◆◆ DirectX環境情報" + Environment.NewLine;
            int    length    = GraphicsAdapter.Adapters.Count;

            for (int i = 0; i < length; i++)
            {
                GraphicsAdapter adapter = GraphicsAdapter.Adapters[i];
                bool            bCurrentDevice;
                ShaderProfile   ps;
                ShaderProfile   vs;
                strResult += adapter.createCapsReport(out bCurrentDevice, out ps, out vs)
                             + Environment.NewLine;
                if (bCurrentDevice)
                {
                    PixelShaderProfile  = ps;
                    VertexShaderProfile = vs;
                }
            }
            try
            {
                PlayerIndex[] all =
                {
                    PlayerIndex.One,
                    PlayerIndex.Two,
                    PlayerIndex.Three,
                    PlayerIndex.Four
                };
                foreach (PlayerIndex i in all)
                {
                    strResult += GamePad.GetCapabilities(i).createCapsReport(i);
                }
            }
            catch (Exception e)
            {
                strResult += "!▲! XBOX360コントローラ デバイスの性能取得に失敗。"
                             + Environment.NewLine + e.ToString();
            }
            return(strResult);
        }
Ejemplo n.º 27
0
        public GraphicsDeviceManager(Game game)
        {
            this.game = game;
            game.Services.AddService(typeof(IGraphicsDeviceManager), this);
            game.Services.AddService(typeof(IGraphicsDeviceService), this);

            graphicsDevice = null;

            preferredBackBufferWidth  = DefaultBackBufferWidth;
            preferredBackBufferHeight = DefaultBackBufferHeight;

            preferredBackBufferFormat   = SurfaceFormat.Color;
            preferredDepthStencilFormat = DepthFormat.Depth24;

            isFullScreen = false;

            minimumPixelShaderProfile  = ShaderProfile.PS_1_1;
            minimumVertexShaderProfile = ShaderProfile.VS_1_1;

            preferMultiSampling = false;

            synchronizeWithVerticalRetrace = true;
        }
Ejemplo n.º 28
0
        bool DetectProfile()
        {
            AsmCommand command = listing.GetCommand(0);

            for (int i = 0; i < VSprofiles.Length; i++)
            {
                if (VSprofiles[i] == command.Target)
                {
                    profile = VSprofileValues[i];
                    return(true);
                }
            }

            for (int i = 0; i < PSprofiles.Length; i++)
            {
                if (PSprofiles[i] == command.Target)
                {
                    profile = PSprofileValues[i];
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 29
0
 public static CompiledShader CompileFromSource(string shaderSourceCode, CompilerMacro[] preprocessorDefines,
                                                CompilerIncludeHandler includeHandler, CompilerOptions options, string functionName, ShaderProfile profile, TargetPlatform platform)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 30
0
        //* -----------------------------------------------------------------------*
        /// <summary>グラフィック アダプタの性能レポートを作成します。</summary>
        ///
        /// <param name="caps">グラフィック アダプタ性能オブジェクト</param>
        /// <param name="ps">ピクセル シェーダの対応バージョン</param>
        /// <param name="vs">頂点シェーダの対応バージョン</param>
        /// <returns>グラフィック アダプタの性能レポート 文字列</returns>
        public static string createCapsReport(this GraphicsDeviceCapabilities caps, out ShaderProfile ps, out ShaderProfile vs)
        {
            ps = caps.MaxPixelShaderProfile;
            vs = caps.MaxVertexShaderProfile;
            string strResult = "▽ グラフィック デバイス基本能力一覧" + Environment.NewLine;

            strResult += "  ヘッド参照順序           : " + caps.AdapterOrdinalInGroup + Environment.NewLine;
            strResult += "  デバイス 種別            : " + caps.DeviceType.ToString() + Environment.NewLine;
            strResult += "  ExtentsAdjust            : " + caps.ExtentsAdjust.ToString("F02") + Environment.NewLine;
            strResult += "  ガードバンド 下端座標    : " + caps.GuardBandBottom.ToString("F02") + Environment.NewLine;
            strResult += "  ガードバンド 左端座標    : " + caps.GuardBandLeft.ToString("F02") + Environment.NewLine;
            strResult += "  ガードバンド 右端座標    : " + caps.GuardBandRight.ToString("F02") + Environment.NewLine;
            strResult += "  ガードバンド 上端座標    : " + caps.GuardBandTop.ToString("F02") + Environment.NewLine;
            strResult += "  マスタ デバイス識別ID    : " + caps.MasterAdapterOrdinal + Environment.NewLine;
            strResult += "  異方性フィルタ最大有効値 : " + caps.MaxAnisotropy + Environment.NewLine;
            strResult += "  PS30命令スロット最大数   : " + caps.MaxPixelShader30InstructionSlots + Environment.NewLine;
            strResult += "  対応最大PSバージョン     : " + caps.MaxPixelShaderProfile.ToString() + Environment.NewLine;
            strResult += "  点プリミティブ最大サイズ : " + caps.MaxPointSize.ToString("F02") + Environment.NewLine;
            strResult += "  プリミティブ最大描画数   : " + caps.MaxPrimitiveCount + Environment.NewLine;
            strResult += "  レンダリング対象最大数   : " + caps.MaxSimultaneousRenderTargets + Environment.NewLine;
            strResult += "  MaxSimultaneousTextures  : " + caps.MaxSimultaneousTextures + Environment.NewLine;
            strResult += "  データ ストリーム最大数  : " + caps.MaxStreams + Environment.NewLine;
            strResult += "  最大ストリームストライド : " + caps.MaxStreamStride + Environment.NewLine;
            strResult += "  Textureの最大Aspect比率  : " + caps.MaxTextureAspectRatio + Environment.NewLine;
            strResult += "  MaxTextureRepeat         : " + caps.MaxTextureRepeat + Environment.NewLine;
            strResult += "  対応テクスチャ最大縦幅   : " + caps.MaxTextureHeight + Environment.NewLine;
            strResult += "  対応テクスチャ最大横幅   : " + caps.MaxTextureWidth + Environment.NewLine;
            strResult += "  最大定義可能クリップ面数 : " + caps.MaxUserClipPlanes + Environment.NewLine;
            strResult += "  HWインデックス最大サイズ : " + caps.MaxVertexIndex + Environment.NewLine;
            strResult += "  VS30命令スロット最大数   : " + caps.MaxVertexShader30InstructionSlots + Environment.NewLine;
            strResult += "  定数用VSレジスタ数       : " + caps.MaxVertexShaderConstants + Environment.NewLine;
            strResult += "  対応最大VSバージョン     : " + caps.MaxVertexShaderProfile.ToString() + Environment.NewLine;
            strResult += "  対応最大Wベース深度値    : " + caps.MaxVertexW.ToString("F02") + Environment.NewLine;
            strResult += "  VolumeTexture最大サイズ  : " + caps.MaxVolumeExtent + Environment.NewLine;
            strResult += "  このグループのアダプタ数 : " + caps.NumberOfAdaptersInGroup + Environment.NewLine;
            strResult += "  PS算術Component最大値    : " + caps.PixelShader1xMaxValue.ToString("F02") + Environment.NewLine;
            strResult += "  Pixelシェーダ バージョン : " + caps.PixelShaderVersion.ToString() + Environment.NewLine;
            strResult += "  画面スワップ間隔         : " + caps.PresentInterval.ToString() + Environment.NewLine;
            strResult += "  頂点シェーダ バージョン  : " + caps.VertexShaderVersion.ToString() + Environment.NewLine;
            strResult += caps.DeviceCapabilities.createCapsReport();
            strResult += caps.DriverCapabilities.createCapsReport();
            strResult += caps.CursorCapabilities.createCapsReport();
            strResult += caps.DeclarationTypeCapabilities.createCapsReport();
            strResult += caps.LineCapabilities.createCapsReport();
            strResult += caps.PrimitiveCapabilities.createCapsReport();
            strResult += caps.TextureCapabilities.createCapsReport();
            strResult += caps.VertexFormatCapabilities.createCapsReport();
            strResult += caps.VertexProcessingCapabilities.createCapsReport();
            strResult += caps.VertexShaderCapabilities.createCapsReport();
            strResult += caps.PixelShaderCapabilities.createCapsReport();
            strResult += caps.RasterCapabilities.createCapsReport();
            strResult += caps.ShadingCapabilities.createCapsReport();
            strResult += caps.StencilCapabilities.createCapsReport();

            strResult += caps.AlphaCompareCapabilities.createCapsReport("アルファテスト");
            strResult += caps.DepthBufferCompareCapabilities.createCapsReport("深度バッファ");

            strResult += caps.CubeTextureFilterCapabilities.createCapsReport("キューブ テクスチャ");
            strResult += caps.TextureFilterCapabilities.createCapsReport("テクスチャ");
            strResult += caps.VertexTextureFilterCapabilities.createCapsReport("頂点シェーダ");
            strResult += caps.VolumeTextureFilterCapabilities.createCapsReport("ボリューム テクスチャ");

            strResult += caps.TextureAddressCapabilities.createCapsReport("テクスチャ");
            strResult += caps.VolumeTextureAddressCapabilities.createCapsReport("ボリューム テクスチャ");

            strResult += caps.DestinationBlendCapabilities.createCapsReport("転送先");
            strResult += caps.SourceBlendCapabilities.createCapsReport("転送元");

            return(strResult);
        }
		bool DetectProfile()
		{
			AsmCommand command = listing.GetCommand(0);

			for (int i = 0; i < VSprofiles.Length; i++)
			{
				if (VSprofiles[i] == command.Target)
				{
					profile = VSprofileValues[i];
					return true;
				}
			}

			for (int i = 0; i < PSprofiles.Length; i++)
			{
				if (PSprofiles[i] == command.Target)
				{
					profile = PSprofileValues[i];
					return true;
				}
			}
			return false;
		}
		private byte[] ProcessMethod(HlslMethod method, IEnumerator<string> argsEnum, ShaderProfile shaderProfile)
		{
			//this is where things get silly... :-)

			//the method uses vfetch, and for various reasons, the shader code cannot be extracted from an Effect
			//the shader also cannot be decompiled.
			//However, a single shader can be compiled from HLSL. Which is great.... except...
			//the technique may define the method to use, and may pass in arguements..
			// like so:
			//
			// VertexShader = compile vs_2_0 zomg(true);
			//
			//In such a case, the method 'zomg' can't be directly compiled using ShaderCompiler.
			//When this is the case, things get stupid.
			//
			//The way to compile the method is to create a stub that calls the real method,
			//with values for the arguements. Modifying the method declaration with default arguements
			//wouldn't always work...

			//this is, of course, assuming the method has uniform arguements being passed in.
			//if it isn't, then no problem.

			List<string> rawArgs = new List<string>();
			while (argsEnum.MoveNext())
				rawArgs.Add(argsEnum.Current);

			CompiledShader compiledShader;
			string workingDirectory = null;

			if (rawArgs.Count == 0)
			{
				//just compile the method directly (easy)...
				
				try
				{
					//set the working directory, since it's using CompileFromFile
					workingDirectory = Directory.GetCurrentDirectory();

					string path = Path.GetDirectoryName(source.FileName);
					if (path != null && path.Length > 0)
						Directory.SetCurrentDirectory(Path.GetDirectoryName(source.FileName));

					compiledShader =
						ShaderCompiler.CompileFromFile(
							Path.GetFileName(source.FileName),
							DecompiledEffect.XboxCompileMacros,
							new VFetchIncludeHandler(source.FileName, false),
							source.CompilerOptions,
							method.Name,
							shaderProfile,
							Microsoft.Xna.Framework.TargetPlatform.Xbox360);
				}
				finally
				{
					if (workingDirectory != null)
						Directory.SetCurrentDirectory(workingDirectory);
				}
			}
			else
			{
				//this gets much trickier..
				//have to extract the args, and importantly, put them in the right place


				/*
				 * 
				 * eg, a method and it's technique may look like this:
				 * 
				 * float4 Test(float4 pos : POSITION, uniform float scale) : POSITION
				 * {
				 *   ... vfetch ...
				 * }
				 * 
				 * technique
				 * {
				 *   VertexShader = compile vs_2_0 Test(5.0);
				 *   ...
				 * }
				 * 
				 * 
				 * The stub that is generated must pull the '5.0' from the technique
				 * and pass it into the real method, like so:
				 * 
				 * 
				 * float4 Test_STUB(float4 pos : POSITION) : POSITION
				 * {
				 *	 return Test(pos, 5.0);
				 * }
				 * 
				 * 
				 * Note: the uniform was removed from the stub input declaration
				 * 
				 */


				//the actual arg values (passed into the real method)
				List<string> args = new List<string>();
				StringBuilder arg = new StringBuilder();

				int depth = 0;
				//break the args list up
				for (int i = 0; i < rawArgs.Count; i++)
				{
					if (rawArgs[i].Length == 1 && (rawArgs[i][0] == '(' || rawArgs[i][0] == '{' || rawArgs[i][0] == '['))
						depth++;
					if (rawArgs[i].Length == 1 && (rawArgs[i][0] == ')' || rawArgs[i][0] == '}' || rawArgs[i][0] == ']'))
						depth--;

					if (depth == 0 && rawArgs[i] == ",")
					{
						args.Add(arg.ToString());
						arg.Length = 0;
					}
					else
					{
						arg.Append(rawArgs[i]);
						arg.Append(' ');
					}
				}
				args.Add(arg.ToString());


				//the input args that are being replaced must be declared as 'uniform'

				//parse the method declaration...

				depth = 0;
				HlslStructure hs = method.HlslShader;
				bool parsingArgs = false;
				int argIndex = 0;

				StringBuilder stubMethodDeclaration = new StringBuilder();
				StringBuilder stubMethodInvoke = new StringBuilder();
				int stubMethodInvokeCount = 0;

				//random name
				string stubName = "_STUB" + Guid.NewGuid().ToString("N");

				bool includingArg = true;
				int replacedArgIndex = 0;
				int parseArgIndex = 0;

				int parseArgNameIndex = 0;
				bool parseCheckForName = true;

				bool stubReturnsValue = false;

				for (int i = 0; i < hs.Elements.Length; i++)
				{
					if (hs.Elements[i].Length == 1 && (hs.Elements[i][0] == ')' || hs.Elements[i][0] == '}' || hs.Elements[i][0] == ']'))
						depth--;
					if (hs.Elements[i].Length == 1 && (hs.Elements[i][0] == '(' || hs.Elements[i][0] == '{' || hs.Elements[i][0] == '['))
					{
						depth++;

						if (depth == 1 && hs.Elements[i][0] == '(' && !parsingArgs)
						{
							//about to begin the method args
							parsingArgs = true;

							//append the stub name, so to not conflict with the original method
							stubMethodDeclaration.Append(stubName);
							stubMethodDeclaration.Append('(');
							continue;
						}
					}

					//actually parsing the args within the (,,,,,) block
					if (parsingArgs)
					{
						if (argIndex == 0)
						{
							//check for uniform.
							if (hs.Elements[i] == "uniform" && replacedArgIndex != args.Count)
							{
								//replace this arg if possible


								//add technique value to the invoke
								if (stubMethodInvokeCount != 0)
									stubMethodInvoke.Append(',');

								stubMethodInvoke.Append(args[replacedArgIndex]);
								stubMethodInvokeCount++;

								replacedArgIndex++;

								//remove the last written character (a ,) from the stub method,
								//but only if it's not the first parsed arg
								if (parseArgIndex != 0 && includingArg)
									stubMethodDeclaration.Length--;

								//skip it in the stub declaration
								includingArg = false;
							}
							else
								includingArg = true;
						}

						if (depth == 1 && (hs.Elements[i].Length == 1 && (hs.Elements[i][0] == ',' || hs.Elements[i][0] == ')')))
						{
							argIndex = 0;
							parseArgIndex++;

							//write the element name into the arg invoke list
							if (includingArg)
							{
								if (stubMethodInvokeCount > 0)
									stubMethodInvoke.Append(',');

								stubMethodInvoke.Append(hs.Elements[parseArgNameIndex]);
								stubMethodInvokeCount++;
							}

							parseCheckForName = true;
							parseArgNameIndex = 0;
						}
						else
						{
							if (includingArg)
							{
								//want to include the name of the arg in the invoke list.
								if (hs.Elements[i].Length == 1 && (hs.Elements[i][0] == ':' || hs.Elements[i][0] == '='))
								{
									//the arg is declared, now it's being given a default or semantic
									parseCheckForName = false;
								}

								if (parseCheckForName && depth == 1)
								{
									//last value written should be the name of the arg
									parseArgNameIndex = i;
								}
							}

							argIndex++;
						}
					}

					if (includingArg || depth == 0)
					{
						if (stubMethodDeclaration.Length > 0 && i > 0 && Tokenizer.IsIdentifierToken(hs.Elements[i]) && Tokenizer.IsIdentifierToken(hs.Elements[i - 1]))
							stubMethodDeclaration.Append(' ');
						stubMethodDeclaration.Append(hs.Elements[i]);

						if (depth == 0 && hs.Elements[i].Length == 1 && hs.Elements[i][0] == ':')
						{
							//method returns a value that is important somehow...
							//ie,
							//float4 Method() : POSITION

							stubReturnsValue = true;
						}
					}
				}

				//yikes.
				//at this point,
				//stubMethodDeclaration will have the declaration of the method, without the uniform parametres
				//stubMethodInvoke will have the list of arguements to pass into the real method, from the stub method.

				//so construct the full stub


				string fullStub = string.Format("{0}{1}{5}{1}\t{2}{3}({4});{1}{6}",
					stubMethodDeclaration,
					Environment.NewLine,
					stubReturnsValue ? "return " : "",
					method.Name,
					stubMethodInvoke,
					"{","}");

				//append it to the end of the real shader
				StringBuilder fullShader = new StringBuilder();

				fullShader.Append(source.ShaderSource);
				fullShader.AppendLine();
				fullShader.Append(fullStub);

				//now compile the bugger...

				try
				{
					//set the working directory, since it's using CompileFromSource
					workingDirectory = Directory.GetCurrentDirectory();

					string path = Path.GetDirectoryName(source.FileName);
					if (path != null && path.Length > 0)
						Directory.SetCurrentDirectory(Path.GetDirectoryName(source.FileName));

					//not all compiler options apply when compiling a single shader (instead of an effect)
					CompilerOptions options = source.CompilerOptions &
						(CompilerOptions.AvoidFlowControl | CompilerOptions.PreferFlowControl);

					//compile it... finally...
					compiledShader =
						ShaderCompiler.CompileFromSource(
							fullShader.ToString(),
							DecompiledEffect.XboxCompileMacros,
							new VFetchIncludeHandler(source.FileName, false),
							options,
							method.Name + stubName,
							shaderProfile,
							Microsoft.Xna.Framework.TargetPlatform.Xbox360);
				}
				finally
				{
					if (workingDirectory != null)
						Directory.SetCurrentDirectory(workingDirectory);
				}
			}

			if (!compiledShader.Success)
				Common.ThrowError(compiledShader.ErrorsAndWarnings, source.ShaderSource);

			return compiledShader.GetShaderCode();
		}
Ejemplo n.º 33
0
        CompileUnit AddCompileUnit(GPUProgram gpuProgram, int multicompileIndex, string[] defines, LogItem[] warnings, LogItem[] errors, ShaderProfile profile, string entry)
        {
            var programIndex = m_Programs.IndexOf(gpuProgram);

            var unit = new CompileUnit(this, programIndex, multicompileIndex, defines, warnings, errors, profile, entry);

            m_CompileUnits.Add(unit);

            if (!m_ProgramCompileUnits.ContainsKey(unit.programIndex))
            {
                m_ProgramCompileUnits[unit.programIndex] = new Dictionary <int, int>();
            }

            m_ProgramCompileUnits[unit.programIndex][unit.multicompileIndex] = m_CompileUnits.Count - 1;

            return(unit);
        }
Ejemplo n.º 34
0
 public static string GetShaderProfile(ShaderProfile version)
 {
     return(version.ToString());
 }
Ejemplo n.º 35
0
            public CompileUnit AddCompileUnit(int multicompileIndex, string[] defines, LogItem[] warnings, LogItem[] errors, ShaderProfile profile, string entry)
            {
                m_CompileWarnings += warnings.Length;
                m_CompileErrors   += errors.Length;

                return(report.AddCompileUnit(this, multicompileIndex, defines, warnings, errors, profile, entry));
            }
Ejemplo n.º 36
0
        /// <summary>
        /// Processes the string representation of the specified effect into a platform-specific binary format using the specified context.
        /// </summary>
        /// <param name="input">The effect string to be processed.</param>
        /// <param name="context">Context for the specified processor.</param>
        /// <returns>A platform-specific compiled binary effect.</returns>
        /// <remarks>If you get an error during processing, compilation stops immediately. The effect processor displays an error message. Once you fix the current error, it is possible you may get more errors on subsequent compilation attempts.</remarks>
        public override CompiledEffectContent Process(EffectContent input, ContentProcessorContext context)
        {
#if WINDOWS
            var options = new Options();
            options.SourceFile = input.Identity.SourceFilename;

            options.Profile = ShaderProfile.ForPlatform(context.TargetPlatform.ToString());
            if (options.Profile == null)
            {
                throw new InvalidContentException(string.Format("{0} effects are not supported.", context.TargetPlatform), input.Identity);
            }

            options.Debug      = DebugMode == EffectProcessorDebugMode.Debug;
            options.Defines    = Defines;
            options.OutputFile = context.OutputFilename;

            // Parse the MGFX file expanding includes, macros, and returning the techniques.
            ShaderResult shaderResult;
            try
            {
                shaderResult = ShaderResult.FromFile(options.SourceFile, options,
                                                     new ContentPipelineEffectCompilerOutput(context));

                // Add the include dependencies so that if they change
                // it will trigger a rebuild of this effect.
                foreach (var dep in shaderResult.Dependencies)
                {
                    context.AddDependency(dep);
                }
            }
            catch (InvalidContentException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // TODO: Extract good line numbers from mgfx parser!
                throw new InvalidContentException(ex.Message, input.Identity, ex);
            }

            // Create the effect object.
            EffectObject effect = null;
            var          shaderErrorsAndWarnings = string.Empty;
            try
            {
                effect = EffectObject.CompileEffect(shaderResult, out shaderErrorsAndWarnings);

                // If there were any additional output files we register
                // them so that the cleanup process can manage them.
                foreach (var outfile in shaderResult.AdditionalOutputFiles)
                {
                    context.AddOutputFile(outfile);
                }
            }
            catch (ShaderCompilerException)
            {
                // This will log any warnings and errors and throw.
                ProcessErrorsAndWarnings(true, shaderErrorsAndWarnings, input, context);
            }

            // Process any warning messages that the shader compiler might have produced.
            ProcessErrorsAndWarnings(false, shaderErrorsAndWarnings, input, context);

            // Write out the effect to a runtime format.
            CompiledEffectContent result;
            try
            {
                using (var stream = new MemoryStream())
                {
                    using (var writer = new BinaryWriter(stream))
                        effect.Write(writer, options);

                    result = new CompiledEffectContent(stream.GetBuffer());
                }
            }
            catch (Exception ex)
            {
                throw new InvalidContentException("Failed to serialize the effect!", input.Identity, ex);
            }

            return(result);
#else
            throw new NotImplementedException();
#endif
        }
Ejemplo n.º 37
0
 public static CompiledShader CompileFromSource(string shaderSourceCode, CompilerMacro[] preprocessorDefines,
     CompilerIncludeHandler includeHandler, CompilerOptions options, string functionName, ShaderProfile profile, TargetPlatform platform)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 38
0
 private static bool IsValidShaderProfile(ShaderProfile capsShaderProfile, ShaderProfile minimumShaderProfile)
 {
     if ((capsShaderProfile == ShaderProfile.PS_2_B) && (minimumShaderProfile == ShaderProfile.PS_2_A))
     {
         return false;
     }
     return (capsShaderProfile >= minimumShaderProfile);
 }
Ejemplo n.º 39
0
        public GraphicsDeviceManager(Game game)
        {
			this.game = game;
            game.Services.AddService(typeof(IGraphicsDeviceManager), this);
            game.Services.AddService(typeof(IGraphicsDeviceService), this);
			
			graphicsDevice = null;
			
			preferredBackBufferWidth = DefaultBackBufferWidth;
			preferredBackBufferHeight = DefaultBackBufferHeight;
			
			preferredBackBufferFormat = SurfaceFormat.Color;
			preferredDepthStencilFormat = DepthFormat.Depth24;
			
			isFullScreen = false;
			
			minimumPixelShaderProfile = ShaderProfile.PS_1_1;
			minimumVertexShaderProfile = ShaderProfile.VS_1_1;
			
			preferMultiSampling = false;			
			
			synchronizeWithVerticalRetrace = true;
        }