| 292 | } |
| 293 | |
| 294 | GPUSampler* Streaming::GetTextureGroupSampler(int32 index) |
| 295 | { |
| 296 | GPUSampler* sampler = nullptr; |
| 297 | if (index >= 0 && index < TextureGroupSamplers.Count()) |
| 298 | { |
| 299 | // Sampler from texture group options |
| 300 | auto& group = TextureGroups[index]; |
| 301 | auto desc = GPUSamplerDescription::New(group.SamplerFilter); |
| 302 | desc.MaxAnisotropy = group.MaxAnisotropy; |
| 303 | sampler = TextureGroupSamplers[index]; |
| 304 | if (!sampler) |
| 305 | { |
| 306 | sampler = GPUSampler::New(); |
| 307 | #if GPU_ENABLE_RESOURCE_NAMING |
| 308 | sampler->SetName(group.Name); |
| 309 | #endif |
| 310 | sampler->Init(desc); |
| 311 | TextureGroupSamplers[index] = sampler; |
| 312 | } |
| 313 | if (sampler->GetDescription().Filter != desc.Filter || sampler->GetDescription().MaxAnisotropy != desc.MaxAnisotropy) |
| 314 | sampler->Init(desc); |
| 315 | } |
| 316 | if (!sampler) |
| 317 | { |
| 318 | // Default sampler to prevent issue |
| 319 | if (!FallbackSampler) |
| 320 | { |
| 321 | FallbackSampler = GPUSampler::New(); |
| 322 | #if GPU_ENABLE_RESOURCE_NAMING |
| 323 | FallbackSampler->SetName(TEXT("FallbackSampler")); |
| 324 | #endif |
| 325 | FallbackSampler->Init(GPUSamplerDescription::New(GPUSamplerFilter::Trilinear)); |
| 326 | } |
| 327 | sampler = FallbackSampler; |
| 328 | } |
| 329 | return sampler; |
| 330 | } |
nothing calls this directly
no test coverage detected