#gpu/layout
Xu 0.13.1 API
导入方式: #gpu/layout
公开 API: 3 函数, 3 方法, 3 类型, 20 常量, 0 方法集
标准库包 `#gpu/layout`。
struct Level2D
pub struct Level2D {
pub width int
pub height int
pub block_columns int
pub block_rows int
pub row_bytes int
pub row_pitch int
pub offset int
pub size_bytes int
}
用途
承载 width、height、block_columns、block_rows、row_bytes 等属性的结构体。
公开字段
width int- 字段(int)
height int- 字段(int)
block_columns int- 字段(int)
block_rows int- 字段(int)
row_bytes int- 字段(int)
row_pitch int- 字段(int)
offset int- 偏移
size_bytes int- 字段(int)
struct TextureLayout2D
pub struct TextureLayout2D {
}
用途
TextureLayout2D 上下文或状态结构体。
公开字段
此类型没有公开字段。
(&TextureLayout2D) level_count
pub fn (texture &TextureLayout2D) level_count() int
用途
&TextureLayout2D 上的操作:执行 level count 操作。
参数
texture &TextureLayout2D- 本次调用使用的
TextureLayout2D 实例;以只读借用传入,调用方仍持有实例。
返回值
int — 该类型的值
(&TextureLayout2D) total_bytes
pub fn (texture &TextureLayout2D) total_bytes() int
用途
&TextureLayout2D 上的操作:执行 total bytes 操作。
参数
texture &TextureLayout2D- 本次调用使用的
TextureLayout2D 实例;以只读借用传入,调用方仍持有实例。
返回值
int — 该类型的值
(&TextureLayout2D) level
pub fn (texture &TextureLayout2D) level(index int) Level2D
用途
在 &TextureLayout2D 上执行 level 操作。失败时抛出错误,调用方需处理或继续传播。
参数
texture &TextureLayout2D- 本次调用使用的
TextureLayout2D 实例;以只读借用传入,调用方仍持有实例。
index int- index(int)
返回值
Level2D — 该类型的值
mip_count_2d
pub fn mip_count_2d(width int, height int) int
用途
执行 mip count 2d 操作。失败时抛出错误,调用方需处理或继续传播。
参数
width int- width(int)
height int- height(int)
返回值
int — 该类型的值
texture_2d
pub fn texture_2d(format int, width int, height int, levels int, row_alignment int, level_alignment int) TextureLayout2D
用途
执行 texture 2d 操作。失败时抛出错误,调用方需处理或继续传播。
参数
format int- format(int)
width int- width(int)
height int- height(int)
levels int- levels(int)
row_alignment int- row_alignment(int)
level_alignment int- level_alignment(int)
返回值
TextureLayout2D — 该类型的值
const R8_UNORM
用途
常量 R8_UNORM,定义了相关的协议或算法配置参数。
const RG8_UNORM
用途
常量 RG8_UNORM,定义了相关的协议或算法配置参数。
const RGBA8_UNORM
pub const RGBA8_UNORM = 3
用途
常量 RGBA8_UNORM,定义了相关的协议或算法配置参数。
const RGBA8_SRGB
用途
常量 RGBA8_SRGB,定义了相关的协议或算法配置参数。
const BGRA8_UNORM
pub const BGRA8_UNORM = 5
用途
常量 BGRA8_UNORM,定义了相关的协议或算法配置参数。
const BGRA8_SRGB
用途
常量 BGRA8_SRGB,定义了相关的协议或算法配置参数。
const R16_FLOAT
用途
常量 R16_FLOAT,定义了相关的协议或算法配置参数。
const RG16_FLOAT
用途
常量 RG16_FLOAT,定义了相关的协议或算法配置参数。
const RGBA16_FLOAT
pub const RGBA16_FLOAT = 9
用途
常量 RGBA16_FLOAT,定义了相关的协议或算法配置参数。
const R32_FLOAT
用途
常量 R32_FLOAT,定义了相关的协议或算法配置参数。
const RG32_FLOAT
pub const RG32_FLOAT = 11
用途
常量 RG32_FLOAT,定义了相关的协议或算法配置参数。
const RGBA32_FLOAT
pub const RGBA32_FLOAT = 12
用途
常量 RGBA32_FLOAT,定义了相关的协议或算法配置参数。
const DEPTH32_FLOAT
pub const DEPTH32_FLOAT = 13
用途
常量 DEPTH32_FLOAT,定义了相关的协议或算法配置参数。
const BC1_RGBA_UNORM
pub const BC1_RGBA_UNORM = 14
用途
常量 BC1_RGBA_UNORM,定义了相关的协议或算法配置参数。
const BC1_RGBA_SRGB
pub const BC1_RGBA_SRGB = 15
用途
常量 BC1_RGBA_SRGB,定义了相关的协议或算法配置参数。
const BC3_RGBA_UNORM
pub const BC3_RGBA_UNORM = 16
用途
常量 BC3_RGBA_UNORM,定义了相关的协议或算法配置参数。
const BC3_RGBA_SRGB
pub const BC3_RGBA_SRGB = 17
用途
常量 BC3_RGBA_SRGB,定义了相关的协议或算法配置参数。
const BC5_RG_UNORM
pub const BC5_RG_UNORM = 18
用途
常量 BC5_RG_UNORM,定义了相关的协议或算法配置参数。
const BC7_RGBA_UNORM
pub const BC7_RGBA_UNORM = 19
用途
常量 BC7_RGBA_UNORM,定义了相关的协议或算法配置参数。
const BC7_RGBA_SRGB
pub const BC7_RGBA_SRGB = 20
用途
常量 BC7_RGBA_SRGB,定义了相关的协议或算法配置参数。
struct FormatInfo
pub struct FormatInfo {
pub block_width int
pub block_height int
pub block_bytes int
pub srgb bool
pub depth bool
}
用途
承载 block_width、block_height、block_bytes、srgb、depth 等属性的结构体。
公开字段
block_width int- 字段(int)
block_height int- 字段(int)
block_bytes int- 字段(int)
srgb bool- 字段(bool)
depth bool- 字段(bool)
format_info
pub fn format_info(format int) FormatInfo
用途
格式化为 info。失败时抛出错误,调用方需处理或继续传播。
参数
format int- format(int)
返回值
FormatInfo — 该类型的值