Home -> VertexAttribute -> BuildReadOnlyAttribute
Description
The BuildReadOnlyAttribute method attempts to populate a ReadOnlyVertexAttribute from this vertex attribute. The resulting read-only attribute references the same bound buffer allocation and layout information, but does not allow CPU data writes through the attribute object.
This is useful when the same underlying vertex data needs to be exposed through an immutable or restricted attribute view. The source attribute must already be bound to a buffer so the read-only view can capture the buffer binding metadata.
Usage
SuccessToken BuildReadOnlyAttribute(ReadOnlyVertexAttribute& targetAttribute) const;
Argument list
- targetAttribute [ReadOnlyVertexAttribute]
- The read-only vertex attribute object to populate with this attribute's buffer binding information.
Return value
- [SuccessToken]
- True if the operation succeeded, false otherwise. An assertion will be raised in debug builds if the result is not tested.