Philip Rideout
18bff7ef5e
Repair generateMipmaps for cubemaps.
...
This functionality regressed when we replaced the OpenGL implementation
with our own.
I proved both the regression and the fix by running suzanne with the
following hacks.
```
--- a/libs/image/include/image/KtxUtility.h
+++ b/libs/image/include/image/KtxUtility.h
@@ -129,8 +129,9 @@ namespace KtxUtility {
for (uint32_t level = 0; level < nmips; ++level) {
ktx.getBlob({level, 0, 0}, &data, &size);
PixelBufferDescriptor pbd(data, size * 6, dataformat, datatype, cb, cbuser);
- texture->setImage(*engine, level, std::move(pbd), Texture::FaceOffsets(size));
+ if (level == 0) texture->setImage(*engine, level, std::move(pbd), Texture::FaceOffsets(size));
}
+ texture->generateMipmaps(*engine);
return texture;
}
--- a/samples/app/IBL.cpp
+++ b/samples/app/IBL.cpp
@@ -54,7 +54,7 @@ IBL::~IBL() {
bool IBL::loadFromKtx(const std::string& prefix) {
// First check for compressed variants of the environment.
Path iblPath(prefix + "_ibl_s3tc.ktx");
- if (!iblPath.exists()) {
+ if (true || !iblPath.exists()) {
```
2019-01-31 13:57:30 -08:00