From b84eec039f0d30d8560a8a81056bc2c4b214ecf3 Mon Sep 17 00:00:00 2001 From: Yorkie Makoto Date: Tue, 12 Nov 2024 06:04:04 +0800 Subject: [PATCH] fix(pp): add GL_OVR_multiview2 and provide a new method to custom exts (#55) This PR: 1. adds `GL_OVR_multiview2` 2. adds a new method `add()` on `Registry` to allow developers to add extenisions which is not supported To repro this case: ```glsl #extension GL_OVR_multiview2 : enable void main() { gl_FragColor = vec4(1, 1, 1, 1); } ``` Co-authored-by: Alixinne <13561842+alixinne@users.noreply.github.com> --- lang-pp/src/exts.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lang-pp/src/exts.rs b/lang-pp/src/exts.rs index a12536a6f..db636c9f3 100644 --- a/lang-pp/src/exts.rs +++ b/lang-pp/src/exts.rs @@ -46,6 +46,10 @@ impl Registry { pub fn get(&self, name: &ExtNameAtom) -> Option<&ExtensionSpec> { self.extensions.get(name) } + + pub fn add(&mut self, spec: ExtensionSpec) { + self.extensions.insert(spec.name.clone(), spec); + } } // TODO: Fill registry with extension data from Khronos @@ -568,6 +572,7 @@ impl Default for Registry { ], ), ExtensionSpec::new(ExtNameAtom::from("GL_OVR_multiview"), vec![]), + ExtensionSpec::new(ExtNameAtom::from("GL_OVR_multiview2"), vec![]), ] .into_iter() .map(|spec| (spec.name.clone(), spec))