mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
Driving more uniforms.read calls from the actual shaders.
This commit is contained in:
@@ -211,9 +211,13 @@ const makeGenerator = (layout, structLayouts) => {
|
||||
|
||||
const api = Object.freeze({
|
||||
read: (wgsl) => {
|
||||
if (typeof wgsl !== "string") {
|
||||
throw new Error("Input is not a string.");
|
||||
}
|
||||
const structLayouts = parseStructLayoutsFromShader(wgsl);
|
||||
return Object.fromEntries(Object.entries(structLayouts).map(([name, layout]) => [name, makeGenerator(layout, structLayouts)]));
|
||||
},
|
||||
byteSizeOf: (simpleType) => simpleTypes[simpleType][1] * BYTES_PER_ELEMENT,
|
||||
});
|
||||
|
||||
export default api;
|
||||
|
||||
Reference in New Issue
Block a user