Files
XCSDD/docs/api/rhi/device/create-sampler.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

855 B

RHIDevice::CreateSampler

virtual RHISampler* CreateSampler(const SamplerDesc& desc) = 0;

创建纹理采样器。

参数:

  • desc - 采样器描述符,包含过滤模式、寻址模式等

返回: 新创建的采样器指针,失败返回 nullptr

复杂度: O(1)

示例:

SamplerDesc samplerDesc;
samplerDesc.filter = (uint32_t)FilterMode::Anisotropic;
samplerDesc.addressU = (uint32_t)TextureAddressMode::Wrap;
samplerDesc.addressV = (uint32_t)TextureAddressMode::Wrap;
samplerDesc.addressW = (uint32_t)TextureAddressMode::Wrap;
samplerDesc.maxAnisotropy = 16;
samplerDesc.minLod = 0;
samplerDesc.maxLod = FLT_MAX;

RHISampler* sampler = device->CreateSampler(samplerDesc);

相关文档