GPUTexture


public final class GPUTexture implements AutoCloseable


A GPU texture object for image data storage.

Summary

Public methods

external void
final external @NonNull GPUTextureView

Creates a view of the texture, specifying its usage and subresource range.

final int
final external void

Immediately destroys the texture resource.

final int
boolean
equals(Object other)
final int
final external int

Gets the depth or number of array layers of the texture at mip level 0.

final external int

Gets the dimension of the texture (1D, 2D, or 3D).

final external int

Gets the texture format.

final long
final external int

Gets the height of the texture at mip level 0.

final external int

Gets the number of mipmap levels in the texture.

final external int

Gets the number of samples per texel (for multisampled textures).

final external int

Gets the usage flags the texture was created with.

final external int

Gets the width of the texture at mip level 0.

int
final int
final int
final int
final external void

Sets a debug label for the texture.

final int
final int

Extension functions

final @NonNull Bitmap
TexturesUtils.createBitmap(
    @NonNull GPUTexture receiver,
    @NonNull GPUDevice device
)

Public methods

close

Added in 1.0.0-alpha01
public external void close()

createView

Added in 1.0.0-alpha01
@FastNative
public final external @NonNull GPUTextureView createView(TextureViewDescriptor descriptor)

Creates a view of the texture, specifying its usage and subresource range.

Parameters
TextureViewDescriptor descriptor

A descriptor specifying creation options for the texture view.

Returns
@NonNull GPUTextureView

The newly created texture view.

depthOrArrayLayers

Added in 1.0.0-alpha01
public final int depthOrArrayLayers()

destroy

Added in 1.0.0-alpha01
@FastNative
public final external void destroy()

Immediately destroys the texture resource.

dimension

Added in 1.0.0-alpha01
public final int dimension()

equals

public boolean equals(Object other)

format

Added in 1.0.0-alpha01
public final int format()

getDepthOrArrayLayers

Added in 1.0.0-alpha01
@FastNative
public final external int getDepthOrArrayLayers()

Gets the depth or number of array layers of the texture at mip level 0.

Returns
int

The depth or array layer count.

getDimension

Added in 1.0.0-alpha01
@FastNative
public final external int getDimension()

Gets the dimension of the texture (1D, 2D, or 3D).

Returns
int

The texture dimension.

getFormat

Added in 1.0.0-alpha01
@FastNative
public final external int getFormat()

Gets the texture format.

Returns
int

The texture format.

getHandle

Added in 1.0.0-alpha01
public final long getHandle()

getHeight

Added in 1.0.0-alpha01
@FastNative
public final external int getHeight()

Gets the height of the texture at mip level 0.

Returns
int

The height in texels.

getMipLevelCount

Added in 1.0.0-alpha01
@FastNative
public final external int getMipLevelCount()

Gets the number of mipmap levels in the texture.

Returns
int

The number of mip levels.

getSampleCount

Added in 1.0.0-alpha01
@FastNative
public final external int getSampleCount()

Gets the number of samples per texel (for multisampled textures).

Returns
int

The sample count.

getUsage

Added in 1.0.0-alpha01
@FastNative
public final external int getUsage()

Gets the usage flags the texture was created with.

Returns
int

The texture's usage flags.

getWidth

Added in 1.0.0-alpha01
@FastNative
public final external int getWidth()

Gets the width of the texture at mip level 0.

Returns
int

The width in texels.

hashCode

public int hashCode()

height

Added in 1.0.0-alpha01
public final int height()

mipLevelCount

Added in 1.0.0-alpha01
public final int mipLevelCount()

sampleCount

Added in 1.0.0-alpha01
public final int sampleCount()

setLabel

Added in 1.0.0-alpha01
@FastNative
public final external void setLabel(@NonNull String label)

Sets a debug label for the texture.

Parameters
@NonNull String label

The label to assign to the texture.

usage

Added in 1.0.0-alpha01
public final int usage()

width

Added in 1.0.0-alpha01
public final int width()

Extension functions

TexturesUtils.createBitmap

public final @NonNull Bitmap TexturesUtils.createBitmap(
    @NonNull GPUTexture receiver,
    @NonNull GPUDevice device
)