diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-10-21 18:06:45 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-10-21 18:06:45 +0000 |
| commit | 49b3ff04cef68c5d2174b1f1bfd4820b18cf01d8 (patch) | |
| tree | a8997dab84750ca8b0a420b6693c8dc5c068f9c2 /TextureLoader/src/TextureLoader.cpp | |
| parent | ComputeCoarseMip: minor fix that was missed (diff) | |
| download | DiligentTools-49b3ff04cef68c5d2174b1f1bfd4820b18cf01d8.tar.gz DiligentTools-49b3ff04cef68c5d2174b1f1bfd4820b18cf01d8.zip | |
Another minor fix to mipmap generation
Diffstat (limited to 'TextureLoader/src/TextureLoader.cpp')
| -rw-r--r-- | TextureLoader/src/TextureLoader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/TextureLoader/src/TextureLoader.cpp b/TextureLoader/src/TextureLoader.cpp index 9783058..999070a 100644 --- a/TextureLoader/src/TextureLoader.cpp +++ b/TextureLoader/src/TextureLoader.cpp @@ -87,7 +87,7 @@ template <typename ChannelType> ChannelType LinearAverage(ChannelType c0, ChannelType c1, ChannelType c2, ChannelType c3) { static_assert(std::numeric_limits<ChannelType>::is_integer && !std::numeric_limits<ChannelType>::is_signed, "Unsigned integers are expected"); - return static_cast<ChannelType>(static_cast<Uint32>(c0) + static_cast<Uint32>(c1) + static_cast<Uint32>(c2) + static_cast<Uint32>(c3)) / 4; + return static_cast<ChannelType>((static_cast<Uint32>(c0) + static_cast<Uint32>(c1) + static_cast<Uint32>(c2) + static_cast<Uint32>(c3)) / 4); } template <typename ChannelType> |
