(hookType)
| 75 | sampler: { fnName: "sampler", baseType: BaseType.SAMPLER, dimension: 1, priority: -11 }, |
| 76 | } |
| 77 | export const structType = function (hookType) { |
| 78 | let T = hookType.type === undefined ? hookType : hookType.type; |
| 79 | const structType = { |
| 80 | name: hookType.name, |
| 81 | properties: [], |
| 82 | typeName: T.typeName, |
| 83 | }; |
| 84 | // TODO: handle struct properties that are themselves structs |
| 85 | for (const prop of T.properties) { |
| 86 | const propType = prop.type.dataType; |
| 87 | structType.properties.push( |
| 88 | {name: prop.name, dataType: propType } |
| 89 | ); |
| 90 | } |
| 91 | return structType; |
| 92 | }; |
| 93 | export function isStructType(typeInfo) { |
| 94 | return !!(typeInfo && typeInfo.properties); |
| 95 | } |
no test coverage detected