Home -> IndexAttribute -> BuildReadOnlyAttribute
Description
The BuildReadOnlyAttribute method attempts to populate a ReadOnlyIndexAttribute from this index 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 index 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(ReadOnlyIndexAttribute& targetAttribute) const;
Argument list
- targetAttribute [ReadOnlyIndexAttribute]
- The read-only index 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.