diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-10-21 17:07:33 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-10-21 17:07:33 +0000 |
| commit | c78b02a8dae288133d80b65736063f4bcf8e095e (patch) | |
| tree | 274b73a4e8334834c7d092650a1cd131e53b2aca /TextureLoader/src/TextureLoader.cpp | |
| parent | Texture loader: fixed mipmap generation (closed https://github.com/DiligentGr... (diff) | |
| download | DiligentTools-c78b02a8dae288133d80b65736063f4bcf8e095e.tar.gz DiligentTools-c78b02a8dae288133d80b65736063f4bcf8e095e.zip | |
ComputeCoarseMip: minor fix that was missed
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 6b13030..9783058 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)); + return static_cast<ChannelType>(static_cast<Uint32>(c0) + static_cast<Uint32>(c1) + static_cast<Uint32>(c2) + static_cast<Uint32>(c3)) / 4; } template <typename ChannelType> |
