public BlockVariable Build() { var blockVariableInternal = new BlockVariableInternal() { m_TypeHandle = Type.handle, m_NameHandle = container.AddString(Name), }; blockVariableInternal.m_AttributeListHandle = container.AddHandleBlob((uint)Attributes.Count); for (int i = 0; i < Attributes.Count; ++i) { container.SetHandleBlobElement(blockVariableInternal.m_AttributeListHandle, (uint)i, Attributes[i].handle); } var returnTypeHandle = container.AddBlockVariableInternal(blockVariableInternal); return(new BlockVariable(container, returnTypeHandle)); }
internal extern FoundryHandle AddBlockVariableInternal(BlockVariableInternal block);
// private internal BlockVariable(ShaderContainer container, FoundryHandle handle) { this.container = container; this.handle = handle; this.variable = container?.GetBlockVariable(handle) ?? BlockVariableInternal.Invalid(); }