static void PrefetchPassSources(MyStringId id) { if (!MaterialPassSources.ContainsKey(id)) { var info = new MyMaterialPassInfo(); using (var stream = MyFileSystem.OpenRead(Path.Combine(MyFileSystem.ContentPath, MyShadersDefines.ShadersContentPath, "passes", id.ToString()), "vertex_stage.hlsl")) { info.VertexStageTemplate = new StreamReader(stream).ReadToEnd(); } using (var stream = MyFileSystem.OpenRead(Path.Combine(MyFileSystem.ContentPath, MyShadersDefines.ShadersContentPath, "passes", id.ToString()), "pixel_stage.hlsl")) { info.PixelStageTemplate = new StreamReader(stream).ReadToEnd(); } MaterialPassSources[id] = info; } }
static void PrefetchPassSources(MyStringId id) { if (!MaterialPassSources.ContainsKey(id)) { var info = new MyMaterialPassInfo(); using (var stream = MyFileSystem.OpenRead(Path.Combine(MyFileSystem.ContentPath, MyShaders.ShadersContentPath, "passes", id.ToString()), "vertex_stage.hlsl")) { info.VertexStageTemplate = new StreamReader(stream).ReadToEnd(); } using (var stream = MyFileSystem.OpenRead(Path.Combine(MyFileSystem.ContentPath, MyShaders.ShadersContentPath, "passes", id.ToString()), "pixel_stage.hlsl")) { info.PixelStageTemplate = new StreamReader(stream).ReadToEnd(); } MaterialPassSources[id] = info; } }