mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 04:19:29 -07:00
gpu-buffer now eliminates whitespace from types before identifying them
This commit is contained in:
@@ -48,6 +48,7 @@ const simpleTypes = {
|
||||
};
|
||||
|
||||
const getTypeData = (type, attributes, otherStructLayouts) => {
|
||||
type = type.replaceAll(/\s/g, "");
|
||||
if (simpleTypes[type] != null) {
|
||||
let [align, size, baseType, defaultValue] = simpleTypes[type];
|
||||
if (attributes.align != null) {
|
||||
@@ -79,8 +80,8 @@ const getTypeData = (type, attributes, otherStructLayouts) => {
|
||||
defaultValue: () => makeDataForLayout(otherStructLayouts, innerLayout),
|
||||
};
|
||||
} else if (type.startsWith("array<")) {
|
||||
const arrayMatch = type.match(/array<(.*?)(, )?(\d+)?>$/);
|
||||
const [_, innerType, __, fixedSize] = arrayMatch;
|
||||
const arrayMatch = type.match(/array<(.*?),?(\d+)?>$/);
|
||||
const [_, innerType, fixedSize] = arrayMatch;
|
||||
if (innerType == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user