Package icyllis.arc3d.engine

# Interface IResourceKey

All Known Implementing Classes:
  `Buffer.ResourceKey`, `GLImage.ResourceKey`, `GpuRenderTarget.ResourceKey`, `Image.ResourceKey`, `SamplerDesc`, `VulkanImage.ResourceKey`

public interface IResourceKey
Marker interface for scratch resource keys. There are three important rules about scratch keys:

- Multiple resources can share the same scratch key. Therefore resources assigned the same scratch key should be interchangeable with respect to the code that uses them.
- A resource can have at most one scratch key and it is set at resource creation by the resource itself.
- When a scratch resource is referenced it will not be returned from the cache for a subsequent cache request until all refs are released. This facilitates using a scratch key for multiple render-to-texture scenarios. An example is a separable blur:

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IResourceKey`
  `copy()`
  `boolean`
  `equals(Object o)`
  `int`
  `hashCode()`
  `default boolean`
  `isShareable()`
  Can the resource be held by multiple users at the same time? For example, pipelines, samplers, etc.

- ## Method Details

  - ### isShareable

    default boolean isShareable()
    Can the resource be held by multiple users at the same time? For example, pipelines, samplers, etc.
    Returns:
      true if shareable, false if scratch

  - ### copy

    IResourceKey copy()

  - ### hashCode

    int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    boolean equals(Object o)
    Overrides:
      `equals` in class `Object`