public final class MetalKit
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static MTLVertexDescriptor |
MTKMetalVertexDescriptorFromModelIO(MDLVertexDescriptor modelIODescriptor)
[@function] MTKMetalVertexDescriptorFromModelIO
|
static MTLVertexDescriptor |
MTKMetalVertexDescriptorFromModelIOWithError(MDLVertexDescriptor modelIODescriptor,
org.moe.natj.general.ptr.Ptr<NSError> error)
[@function] MTKMetalVertexDescriptorFromModelIOWithError
|
static long |
MTKMetalVertexFormatFromModelIO(long vertexFormat)
[@function] MTKMetalVertexFormatFromModelIO
|
static java.lang.String |
MTKModelErrorDomain()
[@constant] MTKModelErrorDomain
|
static java.lang.String |
MTKModelErrorKey()
[@constant] MTKModelErrorKey
|
static MDLVertexDescriptor |
MTKModelIOVertexDescriptorFromMetal(MTLVertexDescriptor metalDescriptor)
[@function] MTKModelIOVertexDescriptorFromMetal
|
static MDLVertexDescriptor |
MTKModelIOVertexDescriptorFromMetalWithError(MTLVertexDescriptor metalDescriptor,
org.moe.natj.general.ptr.Ptr<NSError> error)
[@function] MTKModelIOVertexDescriptorFromMetalWithError
|
static long |
MTKModelIOVertexFormatFromMetal(long vertexFormat)
[@function] MTKModelIOVertexFormatFromMetal
|
static java.lang.String |
MTKTextureLoaderCubeLayoutVertical()
[@constant] MTKTextureLoaderCubeLayoutVertical
|
static java.lang.String |
MTKTextureLoaderErrorDomain()
[@constant] MTKTextureLoaderErrorDomain
|
static java.lang.String |
MTKTextureLoaderErrorKey()
[@constant] MTKTextureLoaderErrorKey
|
static java.lang.String |
MTKTextureLoaderOptionAllocateMipmaps()
[@constant] MTKTextureLoaderOptionAllocateMipmaps
|
static java.lang.String |
MTKTextureLoaderOptionCubeLayout()
[@constant] MTKTextureLoaderOptionCubeLayout
|
static java.lang.String |
MTKTextureLoaderOptionGenerateMipmaps()
[@constant] MTKTextureLoaderOptionGenerateMipmaps
|
static java.lang.String |
MTKTextureLoaderOptionOrigin()
[@constant] MTKTextureLoaderOptionOrigin
|
static java.lang.String |
MTKTextureLoaderOptionSRGB()
[@constant] MTKTextureLoaderOptionSRGB
|
static java.lang.String |
MTKTextureLoaderOptionTextureCPUCacheMode()
[@constant] MTKTextureLoaderOptionTextureCPUCacheMode
|
static java.lang.String |
MTKTextureLoaderOptionTextureStorageMode()
[@constant] MTKTextureLoaderOptionTextureStorageMode
|
static java.lang.String |
MTKTextureLoaderOptionTextureUsage()
[@constant] MTKTextureLoaderOptionTextureUsage
|
static java.lang.String |
MTKTextureLoaderOriginBottomLeft()
[@constant] MTKTextureLoaderOriginBottomLeft
|
static java.lang.String |
MTKTextureLoaderOriginFlippedVertically()
[@constant] MTKTextureLoaderOriginFlippedVertically
|
static java.lang.String |
MTKTextureLoaderOriginTopLeft()
[@constant] MTKTextureLoaderOriginTopLeft
|
public static MDLVertexDescriptor MTKModelIOVertexDescriptorFromMetal(MTLVertexDescriptor metalDescriptor)
Partially converts a Metal vertex descriptor to a Model I/O vertex descriptor
This method can only set vertex format, offset, bufferIndex, and stride information in the produced Model I/O vertex descriptor. It does not add any semantic information such at attributes names. Names must be set in the returned Model I/O vertex descriptor before it can be applied to a a Model I/O mesh.
public static MDLVertexDescriptor MTKModelIOVertexDescriptorFromMetalWithError(MTLVertexDescriptor metalDescriptor, org.moe.natj.general.ptr.Ptr<NSError> error)
Partially converts a Metal vertex descriptor to a Model I/O vertex descriptor
This method can only set vertex format, offset, bufferIndex, and stride information in the produced Model I/O vertex descriptor. It does not add any semantic information such at attributes names. Names must be set in the returned Model I/O vertex descriptor before it can be applied to a a Model I/O mesh. If error is nonnull, and the conversion cannot be made, it will be set.
public static MTLVertexDescriptor MTKMetalVertexDescriptorFromModelIO(MDLVertexDescriptor modelIODescriptor)
Partially converts a Model I/O vertex descriptor to a Metal vertex descriptor
This method can only set vertex format, offset, bufferIndex, and stride information in the produced Metal vertex descriptor. It simply copies attributes 1 for 1. Thus attributes in the given Model I/O vertex descriptor must be arranged in the correct order for the resulting descriptor to properly map mesh data to vertex shader inputs. Layout stepFunction and stepRates for the resulting MTLVertexDescriptor must also be set by application.
public static MTLVertexDescriptor MTKMetalVertexDescriptorFromModelIOWithError(MDLVertexDescriptor modelIODescriptor, org.moe.natj.general.ptr.Ptr<NSError> error)
Partially converts a Model I/O vertex descriptor to a Metal vertex descriptor
This method can only set vertex format, offset, bufferIndex, and stride information in the produced Metal vertex descriptor. It simply copies attributes 1 for 1. Thus attributes in the given Model I/O vertex descriptor must be arranged in the correct order for the resulting descriptor to properly map mesh data to vertex shader inputs. Layout stepFunction and stepRates for the resulting MTLVertexDescriptor must also be set by application. If error is nonnull, and the conversion cannot be made, it will be set.
public static long MTKModelIOVertexFormatFromMetal(long vertexFormat)
Converts a Metal vertex format to a Model I/O vertex format
public static long MTKMetalVertexFormatFromModelIO(long vertexFormat)
Converts a Model I/O vertex format to a Metal vertex format
public static java.lang.String MTKTextureLoaderErrorDomain()
public static java.lang.String MTKTextureLoaderErrorKey()
public static java.lang.String MTKTextureLoaderOptionAllocateMipmaps()
Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to allocate memory for mipmaps when creating the texture
If the boolean value specified with this string is true, the resulting Metal texture will have been created with mipmaps whose contents are undefined. It is the responsibility of the caller to fill out the contents of the mipmap data unless MTLTextureLoaderOptionGenerateMipmaps is specified. If the file being loaded contains data for mipmaps (such as in a PVR or KTX file) this option does not need to be specified. In those cases the mipmap memory will be allocated and the image data loaded.
public static java.lang.String MTKTextureLoaderOptionGenerateMipmaps()
Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to generate mipmaps when creating the texture
If the boolean value specified with this string is true, the resulting Metal texture will be created with mipmaps. If the file being loaded contains data for mipmaps (such as in a PVR or KTX file), specifying this option will overwrite the existing mipmap data in the loaded texture. This option can only be used if the pixel format of the texture is color filterable and color renderable. This option implies MTKTextureLoaderOptionAllocateMipmaps. Specifying this option will cause the MTKTextureLoader to submit work to the GPU on behalf of the caller.
public static java.lang.String MTKTextureLoaderOptionSRGB()
Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to create the texture with an sRGB (gamma corrected) pixel format
If the boolean value specified with this string is true, the texture will be created with an sRGB pixel format regardless of whether the image file specifies that the data has already been gamma corrected. Likewise, if false, the texture will be created with a non-sRGB pixel format regardless of whether the image file specifies that the data has been gamma corrected. To use the sRGB information specified in the file, do not specify this in the options dictionary. [@warning] When deploying to OS's prior to macOS 10.15 / iOS 13.0, this option is ignored for loading KTX textures.
public static java.lang.String MTKTextureLoaderOptionTextureUsage()
Identifier to be used with an NSNumber specifying the MTLTextureUsage flags
The resulting Metal texture will be created with the MTLTextureUsage flags indicated by the NSNumber associated with this string.
public static java.lang.String MTKTextureLoaderOptionTextureCPUCacheMode()
Identifier to be used with an NSNumber specifying the MTLCPUCacheMode
The resulting Metal texture will be created with the MTLCPUCacheMode indicated by the NSNumber associated with this string.
public static java.lang.String MTKTextureLoaderOptionTextureStorageMode()
Identifier to be used with an NSNumber specifying the MTLStorageMode
The resulting Metal texture will be created with the MTLStorageMode indicated by the NSNumber associated with this string. If this option is omitted, the texture will be created with the default storage mode for Metal textures: MTLStorageModeShared on iOS, and MTLStorageModeManaged on OS X. Specifying this option with MTLTextureStorageModePrivate cause the MTKTextureLoader to submit work to the GPU on behalf of the caller.
public static java.lang.String MTKTextureLoaderOptionCubeLayout()
Identifier to be used in an options NSDictionary with an MTKTextureLoaderCubeLayout NSString specifying whether to create a cubemap from a 2D image
The NSString value specified with this string must be one option of MTKTextureLoaderCubeLayout. If this option is omitted, the texture loader will not create cubemaps from 2D textures. This option cannot be used with PVR files, KTX files, or MDLTextures, which support cube textures directly.
public static java.lang.String MTKTextureLoaderCubeLayoutVertical()
Identifier specifying that the texture loader will create a cube texture from six faces arranged vertically within a single 2D image
A texture cube will be created from six faces arranged vertically within a single 2D image. The image height must be six times the image width, with faces arranged in the following order from top to bottom: +X, -X, +Y, -Y, +Z, -Z.
public static java.lang.String MTKTextureLoaderOptionOrigin()
Identifier to be used in an options NSDictionary with an MTKTextureLoaderOrigin NSString specifying whether to flip textures vertically
The NSString value specified with this string must be one option of MTKTextureLoaderOrigin. If this option is omitted, the texture loader will not flip loaded textures. This option cannot be used with block-compressed texture formats, and can only be used with 2D, 2D array, and cube map textures. Each mipmap level and slice of a texture will be flipped.
public static java.lang.String MTKTextureLoaderOriginTopLeft()
Identifier specifying that the texture loader should flip textures whose origin is in the bottom-left corner
The texture will be flipped vertically if metadata in the file being loaded indicates that the source data starts with the bottom-left corner of the texture.
public static java.lang.String MTKTextureLoaderOriginBottomLeft()
Identifier specifying that the texture loader should flip textures whose origin is in the top-left corner
The texture will be flipped vertically if metadata in the file being loaded indicates that the source data starts with the top-left corner of the texture.
public static java.lang.String MTKTextureLoaderOriginFlippedVertically()
Identifier specifying that the texture loader should always flip textures
The texture will be flipped vertically regardless of any metadata in the file indicating the placement of the origin in the source data
public static java.lang.String MTKModelErrorDomain()
public static java.lang.String MTKModelErrorKey()