From 94960a7a80881b7699d7708ff4c0a3397b3092d4 Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 17 Feb 2017 16:05:11 -0800 Subject: [PATCH 1/2] Small bug when accessing inexisting storage from the Pixels --- libraries/gpu/src/gpu/Texture.cpp | 4 +++- libraries/model/src/model/TextureMap.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/gpu/src/gpu/Texture.cpp b/libraries/gpu/src/gpu/Texture.cpp index 833647bbda..281d768182 100755 --- a/libraries/gpu/src/gpu/Texture.cpp +++ b/libraries/gpu/src/gpu/Texture.cpp @@ -127,7 +127,9 @@ Texture::Pixels::Pixels(const Element& format, Size size, const Byte* bytes) : } Texture::Pixels::~Pixels() { - Texture::updateTextureCPUMemoryUsage(_storage->size(), 0); + if (_storage) { + Texture::updateTextureCPUMemoryUsage(_storage->size(), 0); + } } void Texture::Storage::assignTexture(Texture* texture) { diff --git a/libraries/model/src/model/TextureMap.cpp b/libraries/model/src/model/TextureMap.cpp index 3f10f66256..417fd6992e 100755 --- a/libraries/model/src/model/TextureMap.cpp +++ b/libraries/model/src/model/TextureMap.cpp @@ -85,7 +85,7 @@ QImage processSourceImage(const QImage& srcImage, bool cubemap) { return srcImage; } -gpu::Texture* cacheTexture(const std::string& name, gpu::Texture* srcTexture, bool write = true, bool read = true) { +gpu::Texture* cacheTexture(const std::string& name, gpu::Texture* srcTexture, bool write = true, bool read = false) { if (!srcTexture) { return nullptr; } From 900615fcd5ac071eed64046c16c3f496786390d1 Mon Sep 17 00:00:00 2001 From: samcake Date: Tue, 14 Mar 2017 15:53:29 -0700 Subject: [PATCH 2/2] Fix the unsupported ktx format, it was coming from the BUmp map case --- libraries/model/src/model/TextureMap.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/model/src/model/TextureMap.cpp b/libraries/model/src/model/TextureMap.cpp index e41b5d0454..d07eae2166 100755 --- a/libraries/model/src/model/TextureMap.cpp +++ b/libraries/model/src/model/TextureMap.cpp @@ -354,7 +354,6 @@ gpu::Texture* TextureUsage::createNormalTextureFromBumpImage(const QImage& srcIm const double pStrength = 2.0; int width = image.width(); int height = image.height(); - // QImage result(width, height, QImage::Format_RGB888); QImage result(width, height, QImage::Format_ARGB32);