public bool TestExplicitVertexShader(ExplicitShader explicitShader)
        {
            bool success = true;

            var entries = Generic.GenericShaderStage.GetExplicitEntryPoints(explicitShader);

            foreach (var entry in entries)
            {
                string filePath = Path.Combine(Path.Combine(ReferencePath, explicitShader.ToString()), $"world\\0_{entry}.vertex_shader");
                var    file     = new FileInfo(filePath);

                if (file.Exists == false)
                {
                    Console.WriteLine($"No reference shader for {explicitShader}");
                    success = false;
                    continue;
                }

                var  disassembly = GenerateExplicitVertexShader(explicitShader, entry);
                bool equal       = CompareShaders(disassembly, filePath, "vs_3_0", out bool usesD3DX);
                success &= equal;
                DisplayPixelShaderTestResults(equal, explicitShader.ToString(), entry, usesD3DX);

                if (!equal)
                {
                    string filename = $"generated_{Application.ExplicitShader}_{entry}.vertex_shader";
                    Application.WriteShaderFile(filename, disassembly);
                }
            }

            return(success);
        }
Beispiel #2
0
        static public List <ShaderStage> GetExplicitEntryPoints(ExplicitShader explicitShader)
        {
            switch (explicitShader)
            {
            case ExplicitShader.shadow_apply:
            case ExplicitShader.shadow_apply2:
                return(new List <ShaderStage> {
                    ShaderStage.Default, ShaderStage.Albedo
                });

            case ExplicitShader.water_ripple:
                return(new List <ShaderStage> {
                    ShaderStage.Default, ShaderStage.Albedo, ShaderStage.Dynamic_Light, ShaderStage.Shadow_Apply, ShaderStage.Active_Camo
                });

            default:
                return(new List <ShaderStage> {
                    ShaderStage.Default
                });
            }
        }
Beispiel #3
0
 public override string GenerateExplicitVertexShader(ExplicitShader explicitShader, ShaderStage stage)
 {
     throw new System.NotImplementedException();
 }
Beispiel #4
0
 public override string GenerateExplicitPixelShader(ExplicitShader explicitShader, ShaderStage entry)
 {
     throw new System.NotImplementedException();
 }
 public abstract string GenerateExplicitVertexShader(ExplicitShader explicitShader, ShaderStage entry);
 public abstract string GenerateExplicitPixelShader(ExplicitShader explicitShader, ShaderStage entry);
Beispiel #7
0
        public override string GenerateExplicitVertexShader(ExplicitShader explicitShader, ShaderStage entry)
        {
            var bytecode = GenericVertexShaderGenerator.GenerateVertexShader(explicitShader.ToString(), entry.ToString().ToLower(), false).Bytecode;

            return(D3DCompiler.Disassemble(bytecode));
        }