GPUTexture
class GPUTexture : AutoCloseable
A GPU texture object for image data storage.
Summary
Public functions |
|
|---|---|
open external Unit |
close() |
external GPUTextureView |
@FastNativeCreates a view of the texture, specifying its usage and subresource range. |
external Unit |
Immediately destroys the texture resource. |
open operator Boolean |
|
external Int |
Gets the depth or number of array layers of the texture at mip level 0. |
external Int |
Gets the dimension of the texture (1D, 2D, or 3D). |
external Int |
Gets the texture format. |
external Int |
Gets the height of the texture at mip level 0. |
external Int |
Gets the number of mipmap levels in the texture. |
external Int |
Gets the number of samples per texel (for multisampled textures). |
external Int |
Gets the usage flags the texture was created with. |
external Int |
Gets the width of the texture at mip level 0. |
open Int |
hashCode() |
external Unit |
@FastNativeSets a debug label for the texture. |
Extension functions |
|
|---|---|
suspend Bitmap |
GPUTexture.createBitmap(device: GPUDevice) |
Public functions
createView
@FastNative
external fun createView(descriptor: TextureViewDescriptor? = null): GPUTextureView
Creates a view of the texture, specifying its usage and subresource range.
| Parameters | |
|---|---|
descriptor: TextureViewDescriptor? = null |
A descriptor specifying creation options for the texture view. |
| Returns | |
|---|---|
GPUTextureView |
The newly created texture view. |
destroy
@FastNative
external fun destroy(): Unit
Immediately destroys the texture resource.
getDepthOrArrayLayers
@FastNative
external fun getDepthOrArrayLayers(): Int
Gets the depth or number of array layers of the texture at mip level 0.
| Returns | |
|---|---|
Int |
The depth or array layer count. |
getDimension
@FastNative
external fun getDimension(): Int
Gets the dimension of the texture (1D, 2D, or 3D).
| Returns | |
|---|---|
Int |
The texture dimension. |
getFormat
@FastNative
external fun getFormat(): Int
Gets the texture format.
| Returns | |
|---|---|
Int |
The texture format. |
getHeight
@FastNative
external fun getHeight(): Int
Gets the height of the texture at mip level 0.
| Returns | |
|---|---|
Int |
The height in texels. |
getMipLevelCount
@FastNative
external fun getMipLevelCount(): Int
Gets the number of mipmap levels in the texture.
| Returns | |
|---|---|
Int |
The number of mip levels. |
getSampleCount
@FastNative
external fun getSampleCount(): Int
Gets the number of samples per texel (for multisampled textures).
| Returns | |
|---|---|
Int |
The sample count. |
getUsage
@FastNative
external fun getUsage(): Int
Gets the usage flags the texture was created with.
| Returns | |
|---|---|
Int |
The texture's usage flags. |
getWidth
@FastNative
external fun getWidth(): Int
Gets the width of the texture at mip level 0.
| Returns | |
|---|---|
Int |
The width in texels. |
setLabel
@FastNative
external fun setLabel(label: String): Unit
Sets a debug label for the texture.
| Parameters | |
|---|---|
label: String |
The label to assign to the texture. |
Public properties
Extension functions
createBitmap
suspend fun GPUTexture.createBitmap(device: GPUDevice): Bitmap