-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vector-pools): add GLType alias, AttribPoolOpts, update pool impls
- Loading branch information
1 parent
019c0af
commit 4fe2047
Showing
5 changed files
with
168 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Type } from "@thi.ng/malloc/api"; | ||
import { GL2TYPE, GLType, TYPE2GL } from "./api"; | ||
|
||
/** | ||
* Returns canonical `Type` value of `type` by first attempting to | ||
* resolve it as `GLType` enum. | ||
* | ||
* ``` | ||
* nativeType(GLType.F32) => Type.F32 | ||
* nativeType(Type.F32) => Type.F32 | ||
* ``` | ||
* | ||
* @param type | ||
*/ | ||
export const asNativeType = (type: GLType | Type): Type => { | ||
const t = GL2TYPE[type]; | ||
return t !== undefined ? t : type; | ||
}; | ||
|
||
export const asGLType = (type: GLType | Type): GLType => { | ||
const t = TYPE2GL[type]; | ||
return t !== undefined ? t : type; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters