public static ShaderProgramPerfInfo Create(MaliOcReport report, int variantIdx) { if (variantIdx < 0) { return(null); } if (report == null) { return(null); } if (report.shaders == null || report.shaders.Length <= 0) { return(null); } var shader = report.shaders[0]; var variants = shader.variants; if (variants == null || variants.Length <= variantIdx) { return(null); } if (shader == null) { return(null); } var info = new ShaderProgramPerfInfo(); info.SetVariantProperties(variants[variantIdx].properties); info.SetPerformanceInfo(variants[variantIdx].performance); info.SetShaderProperties(shader.properties); return(info); }
public static ShaderProgramInfo Create(MaliOcReport vertReport, MaliOcReport fragReport) { ShaderProgramInfo info = new ShaderProgramInfo(); info.positionVertPerf = ShaderProgramPerfInfo.Create(vertReport, "Position"); info.varyingVertPerf = ShaderProgramPerfInfo.Create(vertReport, "Varying"); info.fragPerf = ShaderProgramPerfInfo.Create(fragReport, 0); return(info); }
public static ShaderProgramPerfInfo Create(MaliOcReport report, string variantName) { if (report == null || report.shaders == null || report.shaders.Length <= 0 || report.shaders[0] == null) { return(null); } int variantIdx = ShaderVariantsReport.GetIndexByName(report.shaders[0].variants, variantName); return(ShaderProgramPerfInfo.Create(report, variantIdx)); }