GPUTexture


class GPUTexture : AutoCloseable


A GPU texture object.

Summary

Public functions

open external Unit

Decrements the reference count of the object and frees resources when the count reaches zero.

external GPUTextureView

Creates a new view of the texture.

external Unit

Destroys the texture and releases its resources.

open operator Boolean
equals(other: Any?)
external Int

Gets the depth or number of array layers of the texture.

external Int

Gets the dimension of the texture.

external Int

Gets the format of the texture.

external Int

Gets the height of the texture.

external Int

Gets the number of mipmap levels of the texture.

external Int

Gets the sample count of the texture.

external Int
external Int

Gets the allowed usages of the texture.

external Int

Gets the width of the texture.

open Int
external Unit

Sets a human-readable label for debugging.

Extension functions

suspend Bitmap

Public functions

close

Added in 1.0.0-alpha04
open external fun close(): Unit

Decrements the reference count of the object and frees resources when the count reaches zero.

This is the standard way to manage object lifetimes and should be used in use blocks. After calling this, the object is no longer usable.

createView

Added in 1.0.0-alpha04
@FastNative
external fun createView(descriptor: GPUTextureViewDescriptor? = null): GPUTextureView

Creates a new view of the texture.

Parameters
descriptor: GPUTextureViewDescriptor? = null

The descriptor for the texture view.

Returns
GPUTextureView

The created texture view.

destroy

Added in 1.0.0-alpha04
@FastNative
external fun destroy(): Unit

Destroys the texture and releases its resources.

equals

open operator fun equals(other: Any?): Boolean

getDepthOrArrayLayers

Added in 1.0.0-alpha04
@FastNative
external fun getDepthOrArrayLayers(): Int

Gets the depth or number of array layers of the texture.

Returns
Int

The texture depth or layer count.

getDimension

Added in 1.0.0-alpha04
@FastNative
external fun getDimension(): Int

Gets the dimension of the texture.

Returns
Int

The texture dimension.

getFormat

Added in 1.0.0-alpha04
@FastNative
external fun getFormat(): Int

Gets the format of the texture.

Returns
Int

The texture format.

getHeight

Added in 1.0.0-alpha04
@FastNative
external fun getHeight(): Int

Gets the height of the texture.

Returns
Int

The texture height.

getMipLevelCount

Added in 1.0.0-alpha04
@FastNative
external fun getMipLevelCount(): Int

Gets the number of mipmap levels of the texture.

Returns
Int

The mipmap level count.

getSampleCount

Added in 1.0.0-alpha04
@FastNative
external fun getSampleCount(): Int

Gets the sample count of the texture.

Returns
Int

The sample count.

getTextureBindingViewDimension

Added in 1.0.0-alpha04
@FastNative
external fun getTextureBindingViewDimension(): Int

getUsage

Added in 1.0.0-alpha04
@FastNative
external fun getUsage(): Int

Gets the allowed usages of the texture.

Returns
Int

The texture usage flags.

getWidth

Added in 1.0.0-alpha04
@FastNative
external fun getWidth(): Int

Gets the width of the texture.

Returns
Int

The texture width.

hashCode

open fun hashCode(): Int

setLabel

Added in 1.0.0-alpha04
@FastNative
external fun setLabel(label: String): Unit

Sets a human-readable label for debugging.

Parameters
label: String

The label string.

Public properties

depthOrArrayLayers

Added in 1.0.0-alpha04
val depthOrArrayLayersInt

dimension

Added in 1.0.0-alpha04
val dimensionInt

format

Added in 1.0.0-alpha04
val formatInt

handle

Added in 1.0.0-alpha04
val handleLong

height

Added in 1.0.0-alpha04
val heightInt

mipLevelCount

Added in 1.0.0-alpha04
val mipLevelCountInt

sampleCount

Added in 1.0.0-alpha04
val sampleCountInt

textureBindingViewDimension

Added in 1.0.0-alpha04
val textureBindingViewDimensionInt

usage

Added in 1.0.0-alpha04
val usageInt

width

Added in 1.0.0-alpha04
val widthInt

Extension functions

createBitmap

suspend fun GPUTexture.createBitmap(device: GPUDevice): Bitmap