| 484 | } |
| 485 | |
| 486 | std::shared_ptr<LoadedTexture> TextureCache::LoadTextureFromFile( |
| 487 | const std::filesystem::path& path, |
| 488 | bool sRGB, |
| 489 | CommonRenderPasses* passes, |
| 490 | nvrhi::ICommandList* commandList) |
| 491 | { |
| 492 | std::shared_ptr<TextureData> texture; |
| 493 | |
| 494 | if (FindTextureInCache(path, texture)) |
| 495 | return texture; |
| 496 | |
| 497 | texture->forceSRGB = sRGB; |
| 498 | texture->path = path.generic_string(); |
| 499 | |
| 500 | auto fileData = ReadTextureFile(path); |
| 501 | if (fileData) |
| 502 | { |
| 503 | if (FillTextureData(fileData, texture, path.extension().generic_string(), "")) |
| 504 | { |
| 505 | TextureLoaded(texture); |
| 506 | |
| 507 | FinalizeTexture(texture, passes, commandList); |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | ++m_TexturesLoaded; |
| 512 | |
| 513 | return texture; |
| 514 | } |
| 515 | |
| 516 | std::shared_ptr<LoadedTexture> TextureCache::LoadTextureFromFileDeferred( |
| 517 | const std::filesystem::path& path, |
nothing calls this directly
no outgoing calls
no test coverage detected