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

Method ImageLoader

Source/RenderPasses/ImageLoader/ImageLoader.cpp:49–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49ImageLoader::ImageLoader(ref<Device> pDevice, const Properties& props) : RenderPass(pDevice)
50{
51 for (const auto& [key, value] : props)
52 {
53 if (key == kOutputSize)
54 mOutputSizeSelection = value;
55 else if (key == kOutputFormat)
56 mOutputFormat = value;
57 else if (key == kImage)
58 mImagePath = value.operator std::filesystem::path();
59 else if (key == kSrgb)
60 mLoadSRGB = value;
61 else if (key == kMips)
62 mGenerateMips = value;
63 else if (key == kArraySlice)
64 mArraySlice = value;
65 else if (key == kMipLevel)
66 mMipLevel = value;
67 else
68 logWarning("Unknown property '{}' in a ImageLoader properties.", key);
69 }
70
71 if (!mImagePath.empty())
72 {
73 if (!loadImage(mImagePath))
74 {
75 FALCOR_THROW("ImageLoader: Failed to load image from '{}'", mImagePath);
76 }
77 }
78}
79
80RenderPassReflection ImageLoader::reflect(const CompileData& compileData)
81{

Callers

nothing calls this directly

Calls 2

logWarningFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected