Module Metal.Resource

Common interface for Metal resources like buffers and textures. See MTLResource.

type t
val sexp_of_t : t -> Sexplib0.Sexp.t
val set_label : t -> string -> unit
val get_label : t -> string
val get_device : t -> Device.t

Gets the device the resource belongs to.

module PurgeableState : sig ... end

Resource purgeability states. See MTLPurgeableState.

val set_purgeable_state : t -> PurgeableState.t -> PurgeableState.t

Sets the purgeable state and returns the previous state.

module CPUCacheMode : sig ... end

CPU cache modes. See MTLCPUCacheMode.

val get_cpu_cache_mode : t -> CPUCacheMode.t
module StorageMode : sig ... end

Resource storage modes. See MTLStorageMode.

val get_storage_mode : t -> StorageMode.t
module HazardTrackingMode : sig ... end

Resource hazard tracking modes. See MTLHazardTrackingMode.

val get_hazard_tracking_mode : t -> HazardTrackingMode.t
val get_resource_options : t -> ResourceOptions.t
val get_heap : t -> Objc.object_t

Gets the heap the resource was allocated from (if any). Result type needs Heap module.

val get_heap_offset : t -> int

Gets the offset within the heap (if placed).

val get_allocated_size : t -> int
val make_aliasable : t -> unit

Allows future heap allocations to alias this resource's memory.

val is_aliasable : t -> bool