Skip to content

Commit

Permalink
fix(pp): add GL_OVR_multiview2 and provide a new method to custom exts (
Browse files Browse the repository at this point in the history
#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>
  • Loading branch information
yorkie and alixinne authored Nov 11, 2024
1 parent 783b8b8 commit b84eec0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lang-pp/src/exts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit b84eec0

Please sign in to comment.