docs: 修复 D3D12 后端 API 文档问题

- 修复 texture/dtor.md 和 enums/enums.md 的错误链接
- 重命名 texture/ctor.md → constructor.md, texture/dtor.md → destructor.md
- 创建 command-list, fence, device, query-heap, sampler 的 constructor/destructor 文档
- 创建 D3D12Texture 缺失的 16 个方法文档
- 创建 D3D12CommandList 缺失的 12 个 internal 方法文档
- 补充 shader-resource-view 缺少的头文件和类型字段
This commit is contained in:
2026-03-22 02:08:51 +08:00
parent 2432a646ce
commit 1358bb0a5a
43 changed files with 1264 additions and 4 deletions

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::AliasBarrierInternal
别名屏障内部实现。
```cpp
void AliasBarrierInternal(ID3D12Resource* beforeResource, ID3D12Resource* afterResource);
```
## 参数
- `beforeResource` - 屏障前的资源
- `afterResource` - 屏障后的资源
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.AliasBarrierInternal(resource1.GetResource(), resource2.GetResource());
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [AliasBarrier](alias-barrier.md) - 别名屏障

View File

@@ -0,0 +1,35 @@
# D3D12CommandList::ClearDepthStencilView
清除深度模板视图(句柄重载)。
```cpp
void ClearDepthStencilView(D3D12_CPU_DESCRIPTOR_HANDLE depthStencilHandle, uint32_t clearFlags, float depth = 1.0f, uint8_t stencil = 0, uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
```
## 参数
- `depthStencilHandle` - 深度模板视图 CPU 句柄
- `clearFlags` - 清除标志D3D12_CLEAR_FLAG_DEPTH / D3D12_CLEAR_FLAG_STENCIL
- `depth` - 深度值默认1.0f
- `stencil` - 模板值默认0
- `rectCount` - 矩形数量默认为0表示整个资源
- `rects` - 要清除的矩形数组默认为nullptr表示整个资源
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
commandList.ClearDepthStencilView(depthStencilHandle, D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, 1.0f, 0);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [ClearDepthStencil](clear-depth-stencil.md) - 清除深度模板

View File

@@ -0,0 +1,34 @@
# D3D12CommandList::ClearRenderTargetView
清除渲染目标视图(资源指针重载)。
```cpp
void ClearRenderTargetView(ID3D12Resource* renderTarget, const float color[4], uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
```
## 参数
- `renderTarget` - D3D12 资源指针
- `color` - 清除颜色 RGBA
- `rectCount` - 矩形数量默认为0表示整个资源
- `rects` - 要清除的矩形数组默认为nullptr表示整个资源
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
float color[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
commandList.ClearRenderTargetView(renderTarget.GetResource(), color);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [ClearRenderTarget](clear-render-target.md) - 清除渲染目标

View File

@@ -0,0 +1,35 @@
# D3D12CommandList::D3D12CommandList
构造函数,创建一个空的 D3D12CommandList 对象。
```cpp
D3D12CommandList();
```
## 参数
## 返回值
**线程安全:** 非线程安全
**复杂度:** O(1)
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12CommandList.h"
D3D12CommandList commandList;
// 需要调用 Initialize 进行初始化
commandList.Initialize(device, CommandQueueType::Direct);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [Initialize](initialize.md) - 初始化命令列表
- [Shutdown](shutdown.md) - 关闭命令列表

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::CopyResourceInternal
复制资源内部实现。
```cpp
void CopyResourceInternal(ID3D12Resource* dst, ID3D12Resource* src);
```
## 参数
- `dst` - 目标资源
- `src` - 源资源
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
commandList.CopyResourceInternal(dstResource.GetResource(), srcResource.GetResource());
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [CopyResource](copy-resource.md) - 复制资源

View File

@@ -0,0 +1,36 @@
# D3D12CommandList::~D3D12CommandList
析构函数,销毁 D3D12CommandList 对象。
```cpp
~D3D12CommandList() override;
```
## 参数
## 返回值
**线程安全:** 非线程安全,请在所有 GPU 操作完成后销毁对象
**复杂度:** O(n) - 取决于资源释放时间
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12CommandList.h"
{
D3D12CommandList commandList;
commandList.Initialize(device, CommandQueueType::Direct);
// ... 使用 commandList ...
} // 超出作用域时自动调用析构函数
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [Shutdown](shutdown.md) - 关闭命令列表

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::DispatchIndirectInternal
间接分发计算任务内部实现。
```cpp
void DispatchIndirectInternal(ID3D12Resource* argBuffer, uint64_t alignedByteOffset);
```
## 参数
- `argBuffer` - 参数缓冲区
- `alignedByteOffset` - 字节偏移
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.DispatchIndirectInternal(argBuffer.GetResource(), 0);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [DispatchIndirect](dispatch-indirect.md) - 间接分发计算任务

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::DrawIndexedInstancedIndirectInternal
索引实例化间接绘制内部实现。
```cpp
void DrawIndexedInstancedIndirectInternal(ID3D12Resource* argBuffer, uint64_t alignedByteOffset);
```
## 参数
- `argBuffer` - 参数缓冲区
- `alignedByteOffset` - 字节偏移
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.DrawIndexedInstancedIndirectInternal(argBuffer.GetResource(), 0);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [DrawIndexedInstancedIndirect](draw-indexed-instanced-indirect.md) - 索引实例化间接绘制

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::DrawInstancedIndirectInternal
实例化间接绘制内部实现。
```cpp
void DrawInstancedIndirectInternal(ID3D12Resource* argBuffer, uint64_t alignedByteOffset);
```
## 参数
- `argBuffer` - 参数缓冲区
- `alignedByteOffset` - 字节偏移
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.DrawInstancedIndirectInternal(argBuffer.GetResource(), 0);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [DrawInstancedIndirect](draw-instanced-indirect.md) - 实例化间接绘制

View File

@@ -0,0 +1,32 @@
# D3D12CommandList::SetIndexBufferInternal
设置索引缓冲区内部实现。
```cpp
void SetIndexBufferInternal(ID3D12Resource* buffer, uint64_t offset, Format indexFormat);
```
## 参数
- `buffer` - D3D12 资源指针
- `offset` - 缓冲区偏移
- `indexFormat` - 索引格式
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.SetIndexBufferInternal(indexBuffer.GetResource(), 0, Format::R16_UINT);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [SetIndexBuffer](set-index-buffer.md) - 设置索引缓冲区

View File

@@ -0,0 +1,30 @@
# D3D12CommandList::SetPipelineStateInternal
设置管线状态内部实现。
```cpp
void SetPipelineStateInternal(ID3D12PipelineState* pso);
```
## 参数
- `pso` - D3D12 管线状态对象
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.SetPipelineStateInternal(pipelineState->GetPipelineState());
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [SetPipelineState](set-pipeline-state.md) - 设置管线状态

View File

@@ -0,0 +1,33 @@
# D3D12CommandList::SetVertexBufferInternal
设置顶点缓冲区内部实现。
```cpp
void SetVertexBufferInternal(uint32_t slot, ID3D12Resource* buffer, uint64_t offset, uint32_t stride);
```
## 参数
- `slot` - 顶点缓冲区槽位
- `buffer` - D3D12 资源指针
- `offset` - 缓冲区偏移
- `stride` - 顶点步长
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.SetVertexBufferInternal(0, vertexBuffer.GetResource(), 0, sizeof(Vertex));
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [SetVertexBuffer](set-vertex-buffer.md) - 设置顶点缓冲区

View File

@@ -0,0 +1,35 @@
# D3D12CommandList::SetVertexBuffersInternal
设置多个顶点缓冲区内部实现。
```cpp
void SetVertexBuffersInternal(uint32_t startSlot, uint32_t count, const D3D12_VERTEX_BUFFER_VIEW* views);
```
## 参数
- `startSlot` - 起始槽位
- `count` - 缓冲区数量
- `views` - 顶点缓冲区视图数组
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
D3D12_VERTEX_BUFFER_VIEW views[2];
views[0] = vertexBuffer1View;
views[1] = vertexBuffer2View;
commandList.SetVertexBuffersInternal(0, 2, views);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [SetVertexBuffers](set-vertex-buffers.md) - 设置多个顶点缓冲区

View File

@@ -0,0 +1,30 @@
# D3D12CommandList::UAVBarrierInternal
UAV 屏障内部实现。
```cpp
void UAVBarrierInternal(ID3D12Resource* resource);
```
## 参数
- `resource` - D3D12 资源指针
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.UAVBarrierInternal(texture.GetResource());
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [UAVBarrier](uav-barrier.md) - UAV 屏障

View File

@@ -0,0 +1,35 @@
# D3D12Device::D3D12Device
构造函数,创建一个空的 D3D12Device 对象。
```cpp
D3D12Device();
```
## 参数
## 返回值
**线程安全:** 非线程安全
**复杂度:** O(1)
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12Device.h"
D3D12Device* device = new D3D12Device();
// 需要调用 Initialize 进行初始化
device->Initialize(desc);
```
## 相关文档
- [D3D12Device 总览](device.md)
- [Initialize](initialize.md) - 初始化设备
- [Shutdown](shutdown.md) - 关闭设备

View File

@@ -0,0 +1,38 @@
# D3D12Device::~D3D12Device
析构函数,销毁 D3D12Device 对象。
```cpp
~D3D12Device() override;
```
## 参数
## 返回值
**线程安全:** 非线程安全
**复杂度:** O(n) - 取决于资源释放时间
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12Device.h"
{
D3D12Device* device = new D3D12Device();
device->Initialize(desc);
// ... 使用 device ...
device->Shutdown();
delete device;
} // 或者超出作用域时自动调用析构函数
```
## 相关文档
- [D3D12Device 总览](device.md)
- [Shutdown](shutdown.md) - 关闭设备

View File

@@ -75,4 +75,4 @@ void TransitionResource(XCEngine::RHI::ResourceStates state) {
- [D3D12 后端概览](../d3d12.md)
- [D3D12Types](../../types/types.md) - 类型转换
- [RHI 枚举定义](../../../threading/task-system-config/README.md) - RHI 抽象层枚举定义
- [RHI 枚举定义](../../enums/enums.md) - RHI 抽象层枚举定义

View File

@@ -0,0 +1,35 @@
# D3D12Fence::D3D12Fence
构造函数,创建一个空的 D3D12Fence 对象。
```cpp
D3D12Fence();
```
## 参数
## 返回值
**线程安全:** 非线程安全
**复杂度:** O(1)
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12Fence.h"
D3D12Fence fence;
// 需要调用 Initialize 进行初始化
fence.Initialize(device, 0);
```
## 相关文档
- [D3D12Fence 总览](fence.md)
- [Initialize](initialize.md) - 初始化栅栏
- [Shutdown](shutdown.md) - 关闭栅栏

View File

@@ -0,0 +1,36 @@
# D3D12Fence::~D3D12Fence
析构函数,销毁 D3D12Fence 对象。
```cpp
~D3D12Fence() override;
```
## 参数
## 返回值
**线程安全:** 非线程安全,请在所有 GPU 操作完成后销毁对象
**复杂度:** O(n) - 取决于资源释放时间
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12Fence.h"
{
D3D12Fence fence;
fence.Initialize(device, 0);
// ... 使用 fence ...
} // 超出作用域时自动调用析构函数
```
## 相关文档
- [D3D12Fence 总览](fence.md)
- [Shutdown](shutdown.md) - 关闭栅栏

View File

@@ -0,0 +1,35 @@
# D3D12QueryHeap::D3D12QueryHeap
构造函数,创建一个空的 D3D12QueryHeap 对象。
```cpp
D3D12QueryHeap();
```
## 参数
## 返回值
**线程安全:** 非线程安全
**复杂度:** O(1)
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12QueryHeap.h"
D3D12QueryHeap queryHeap;
// 需要调用 Initialize 进行初始化
queryHeap.Initialize(device, QueryType::Timestamp, 1024);
```
## 相关文档
- [D3D12QueryHeap 总览](query-heap.md)
- [Initialize](initialize.md) - 初始化查询堆
- [Shutdown](shutdown.md) - 关闭查询堆

View File

@@ -0,0 +1,36 @@
# D3D12QueryHeap::~D3D12QueryHeap
析构函数,销毁 D3D12QueryHeap 对象。
```cpp
~D3D12QueryHeap();
```
## 参数
## 返回值
**线程安全:** 非线程安全,请在所有 GPU 操作完成后销毁对象
**复杂度:** O(n) - 取决于资源释放时间
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12QueryHeap.h"
{
D3D12QueryHeap queryHeap;
queryHeap.Initialize(device, QueryType::Timestamp, 1024);
// ... 使用 queryHeap ...
} // 超出作用域时自动调用析构函数
```
## 相关文档
- [D3D12QueryHeap 总览](query-heap.md)
- [Shutdown](shutdown.md) - 关闭查询堆

View File

@@ -0,0 +1,37 @@
# D3D12Sampler::D3D12Sampler
构造函数,创建一个空的 D3D12Sampler 对象。
```cpp
D3D12Sampler();
```
## 参数
## 返回值
**线程安全:** 非线程安全
**复杂度:** O(1)
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12Sampler.h"
D3D12Sampler sampler;
// 需要调用 Initialize 进行初始化
D3D12_SAMPLER_DESC desc = {};
desc.Filter = D3D12_FILTER_MIN_MAG_MIP_LINEAR;
sampler.Initialize(device, desc);
```
## 相关文档
- [D3D12Sampler 总览](sampler.md)
- [Initialize](initialize.md) - 初始化采样器
- [Shutdown](shutdown.md) - 关闭采样器

View File

@@ -0,0 +1,36 @@
# D3D12Sampler::~D3D12Sampler
析构函数,销毁 D3D12Sampler 对象。
```cpp
~D3D12Sampler() override;
```
## 参数
## 返回值
**线程安全:** 非线程安全
**复杂度:** O(n) - 取决于资源释放时间
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12Sampler.h"
{
D3D12Sampler sampler;
sampler.Initialize(device, desc);
// ... 使用 sampler ...
} // 超出作用域时自动调用析构函数
```
## 相关文档
- [D3D12Sampler 总览](sampler.md)
- [Shutdown](shutdown.md) - 关闭采样器

View File

@@ -2,6 +2,10 @@
**命名空间**: `XCEngine::RHI`
**类型**: `class`
**头文件**: `XCEngine/RHI/D3D12/D3D12ShaderResourceView.h`
**描述**: DirectX 12 着色器资源视图Shader Resource View, SRV的 D3D12 实现。SRV 允许着色器访问纹理、缓冲区等资源。
## 概述

View File

@@ -39,4 +39,4 @@ O(n) - 取决于资源释放时间
## 相关文档
- [D3D12Texture](texture.md) - 类总览
- [Shutdown](../../../threading/task-system/shutdown.md) - 关闭纹理
- [Shutdown](../../../texture/shutdown.md) - 关闭纹理

View File

@@ -0,0 +1,33 @@
# D3D12Texture::GetDepth
获取纹理深度或数组大小。
```cpp
uint32_t GetDepth() const override;
```
## 参数
## 返回值
`uint32_t` - 纹理深度3D 纹理或数组大小1D/2D 纹理数组)
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
uint32_t depth = texture.GetDepth();
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [GetWidth](get-width.md) - 获取纹理宽度
- [GetHeight](get-height.md) - 获取纹理高度

View File

@@ -0,0 +1,31 @@
# D3D12Texture::GetDesc
获取纹理描述符。
```cpp
D3D12_RESOURCE_DESC GetDesc() const;
```
## 参数
## 返回值
`D3D12_RESOURCE_DESC` - D3D12 资源描述符
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
D3D12_RESOURCE_DESC resourceDesc = texture.GetDesc();
```
## 相关文档
- [D3D12Texture 总览](texture.md)

View File

@@ -0,0 +1,31 @@
# D3D12Texture::GetFormat
获取纹理格式。
```cpp
Format GetFormat() const override;
```
## 参数
## 返回值
`Format` - 纹理格式
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
Format format = texture.GetFormat();
```
## 相关文档
- [D3D12Texture 总览](texture.md)

View File

@@ -0,0 +1,31 @@
# D3D12Texture::GetGPUAddress
获取 GPU 虚拟地址。
```cpp
uint64_t GetGPUAddress() const;
```
## 参数
## 返回值
`uint64_t` - GPU 虚拟地址
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
uint64_t gpuAddress = texture.GetGPUAddress();
```
## 相关文档
- [D3D12Texture 总览](texture.md)

View File

@@ -0,0 +1,33 @@
# D3D12Texture::GetHeight
获取纹理高度。
```cpp
uint32_t GetHeight() const override;
```
## 参数
## 返回值
`uint32_t` - 纹理高度(像素)
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
uint32_t height = texture.GetHeight();
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [GetWidth](get-width.md) - 获取纹理宽度
- [GetDepth](get-depth.md) - 获取纹理深度

View File

@@ -0,0 +1,31 @@
# D3D12Texture::GetMipLevels
获取 Mip 级别数量。
```cpp
uint32_t GetMipLevels() const override;
```
## 参数
## 返回值
`uint32_t` - Mip 级别数量
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
uint32_t mipLevels = texture.GetMipLevels();
```
## 相关文档
- [D3D12Texture 总览](texture.md)

View File

@@ -0,0 +1,33 @@
# D3D12Texture::GetName
获取纹理名称。
```cpp
const std::string& GetName() const override;
```
## 参数
## 返回值
`const std::string&` - 纹理名称
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
texture.SetName(L"MyTexture");
const std::string& name = texture.GetName();
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [SetName](set-name.md) - 设置纹理名称

View File

@@ -0,0 +1,32 @@
# D3D12Texture::GetNativeHandle
获取原生句柄。
```cpp
void* GetNativeHandle() override;
```
## 参数
## 返回值
`void*` - D3D12 资源原生句柄
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
void* handle = texture.GetNativeHandle();
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [GetResource](get-resource.md) - 获取 D3D12 资源

View File

@@ -0,0 +1,32 @@
# D3D12Texture::GetResource
获取 D3D12 资源指针。
```cpp
ID3D12Resource* GetResource() const;
```
## 参数
## 返回值
`ID3D12Resource*` - D3D12 资源指针
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
ID3D12Resource* resource = texture.GetResource();
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [Initialize](initialize.md) - 初始化纹理

View File

@@ -0,0 +1,32 @@
# D3D12Texture::GetState
获取资源状态。
```cpp
ResourceStates GetState() const override;
```
## 参数
## 返回值
`ResourceStates` - 当前资源状态
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
ResourceStates state = texture.GetState();
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [SetState](set-state.md) - 设置资源状态

View File

@@ -0,0 +1,31 @@
# D3D12Texture::GetTextureType
获取纹理类型。
```cpp
TextureType GetTextureType() const override;
```
## 参数
## 返回值
`TextureType` - 纹理类型(目前固定返回 `TextureType::Texture2D`
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
TextureType type = texture.GetTextureType();
```
## 相关文档
- [D3D12Texture 总览](texture.md)

View File

@@ -0,0 +1,33 @@
# D3D12Texture::GetWidth
获取纹理宽度。
```cpp
uint32_t GetWidth() const override;
```
## 参数
## 返回值
`uint32_t` - 纹理宽度(像素)
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
uint32_t width = texture.GetWidth();
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [GetHeight](get-height.md) - 获取纹理高度
- [GetDepth](get-depth.md) - 获取纹理深度

View File

@@ -0,0 +1,33 @@
# D3D12Texture::OwnsResource
检查是否拥有资源所有权。
```cpp
bool OwnsResource() const;
```
## 参数
## 返回值
`bool` - 如果拥有资源所有权返回 true否则返回 false
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
if (texture.OwnsResource()) {
// 纹理拥有资源所有权,需要负责释放
}
```
## 相关文档
- [D3D12Texture 总览](texture.md)

View File

@@ -0,0 +1,32 @@
# D3D12Texture::SetName
设置纹理名称。
```cpp
void SetName(const std::string& name) override;
```
## 参数
- `name` - 纹理名称
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
texture.SetName(L"MyTexture");
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [GetName](get-name.md) - 获取纹理名称

View File

@@ -0,0 +1,32 @@
# D3D12Texture::SetState
设置资源状态。
```cpp
void SetState(ResourceStates state) override;
```
## 参数
- `state` - 新的资源状态
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
texture.SetState(ResourceStates::RenderTarget);
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [GetState](get-state.md) - 获取资源状态

View File

@@ -0,0 +1,33 @@
# D3D12Texture::Shutdown
关闭并释放纹理资源。
```cpp
void Shutdown() override;
```
## 参数
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
D3D12Texture texture;
texture.Initialize(device, desc);
// 使用纹理...
texture.Shutdown();
```
## 相关文档
- [D3D12Texture 总览](texture.md)
- [Initialize](initialize.md) - 初始化纹理

View File

@@ -8,8 +8,8 @@
| 方法 | 描述 |
|------|------|
| [`D3D12Texture`](ctor.md) | 默认构造函数 |
| [`~D3D12Texture`](dtor.md) | 析构函数 |
| [`D3D12Texture`](constructor.md) | 默认构造函数 |
| [`~D3D12Texture`](destructor.md) | 析构函数 |
| [`Initialize`](initialize.md) | 初始化纹理 |
| [`InitializeFromExisting`](initialize-from-existing.md) | 从现有资源初始化 |
| [`InitializeFromData`](initialize-from-data.md) | 从数据初始化纹理 |