mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -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) => {
|
const getTypeData = (type, attributes, otherStructLayouts) => {
|
||||||
|
type = type.replaceAll(/\s/g, "");
|
||||||
if (simpleTypes[type] != null) {
|
if (simpleTypes[type] != null) {
|
||||||
let [align, size, baseType, defaultValue] = simpleTypes[type];
|
let [align, size, baseType, defaultValue] = simpleTypes[type];
|
||||||
if (attributes.align != null) {
|
if (attributes.align != null) {
|
||||||
@@ -79,8 +80,8 @@ const getTypeData = (type, attributes, otherStructLayouts) => {
|
|||||||
defaultValue: () => makeDataForLayout(otherStructLayouts, innerLayout),
|
defaultValue: () => makeDataForLayout(otherStructLayouts, innerLayout),
|
||||||
};
|
};
|
||||||
} else if (type.startsWith("array<")) {
|
} else if (type.startsWith("array<")) {
|
||||||
const arrayMatch = type.match(/array<(.*?)(, )?(\d+)?>$/);
|
const arrayMatch = type.match(/array<(.*?),?(\d+)?>$/);
|
||||||
const [_, innerType, __, fixedSize] = arrayMatch;
|
const [_, innerType, fixedSize] = arrayMatch;
|
||||||
if (innerType == null) {
|
if (innerType == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user