MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / loadBitmapFromDDS

Method loadBitmapFromDDS

Source/Falcor/Utils/Image/ImageIO.cpp:557–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

555} // namespace
556
557Bitmap::UniqueConstPtr ImageIO::loadBitmapFromDDS(const std::filesystem::path& path)
558{
559 ImportData data;
560 try
561 {
562 loadDDS(path, false, data);
563 }
564 catch (const RuntimeError& e)
565 {
566 logWarning("Failed to load DDS image from '{}': {}", path, e.what());
567 return nullptr;
568 }
569
570 if (data.type == Resource::Type::Texture3D || data.type == Resource::Type::TextureCube)
571 {
572 logWarning("Failed to load DDS image from '{}': Invalid resource type {}.", path, to_string(data.type));
573 return nullptr;
574 }
575
576 // Create from first image
577 return Bitmap::create(data.width, data.height, data.format, data.imageData.data());
578}
579
580ref<Texture> ImageIO::loadTextureFromDDS(ref<Device> pDevice, const std::filesystem::path& path, bool loadAsSrgb)
581{

Callers

nothing calls this directly

Calls 6

loadDDSFunction · 0.85
whatMethod · 0.80
logWarningFunction · 0.50
to_stringFunction · 0.50
createFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected