docs: update resources API docs
This commit is contained in:
36
docs/api/resources/texture/getarraysize.md
Normal file
36
docs/api/resources/texture/getarraysize.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Texture::GetArraySize
|
||||
|
||||
```cpp
|
||||
Core::uint32 GetArraySize() const
|
||||
```
|
||||
|
||||
获取纹理数组大小。对于非数组纹理返回 1。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 纹理数组大小
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Texture tex;
|
||||
tex.Create(1024, 1024, 1, 1,
|
||||
TextureType::Texture2D,
|
||||
TextureFormat::RGBA8_UNORM,
|
||||
nullptr, 0);
|
||||
Core::uint32 arraySize = tex.GetArraySize(); // 返回 1
|
||||
|
||||
Texture texArray;
|
||||
texArray.Create(1024, 1024, 1, 1,
|
||||
TextureType::Texture2DArray,
|
||||
TextureFormat::RGBA8_UNORM,
|
||||
nullptr, 0);
|
||||
Core::uint32 arraySizeArray = texArray.GetArraySize(); // 返回数组长度
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Texture 总览](texture.md) - 返回类总览
|
||||
- [GetTextureType](gettexturetype.md) - 获取纹理类型
|
||||
Reference in New Issue
Block a user