mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Merge pull request #10439 from sethalves/word-align--memorystorage
fix - avoid crash in glTextureSubImage2D
This commit is contained in:
commit
4b0e51ca54
3 changed files with 8 additions and 2 deletions
|
@ -14,7 +14,7 @@
|
|||
class OtherAvatar : public Avatar {
|
||||
public:
|
||||
explicit OtherAvatar(QThread* thread, RigPointer rig = nullptr);
|
||||
void instantiableAvatar() {};
|
||||
virtual void instantiableAvatar() override {};
|
||||
};
|
||||
|
||||
#endif // hifi_OtherAvatar_h
|
||||
|
|
|
@ -383,6 +383,7 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
|||
} else if (mipFormat == gpu::Element::COLOR_RGBA_32) {
|
||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||
compressionOptions.setPitchAlignment(4);
|
||||
compressionOptions.setPixelFormat(32,
|
||||
0x000000FF,
|
||||
0x0000FF00,
|
||||
|
@ -393,6 +394,7 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
|||
} else if (mipFormat == gpu::Element::COLOR_BGRA_32) {
|
||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||
compressionOptions.setPitchAlignment(4);
|
||||
compressionOptions.setPixelFormat(32,
|
||||
0x00FF0000,
|
||||
0x0000FF00,
|
||||
|
@ -403,6 +405,7 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
|||
} else if (mipFormat == gpu::Element::COLOR_SRGBA_32) {
|
||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||
compressionOptions.setPitchAlignment(4);
|
||||
compressionOptions.setPixelFormat(32,
|
||||
0x000000FF,
|
||||
0x0000FF00,
|
||||
|
@ -411,6 +414,7 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
|||
} else if (mipFormat == gpu::Element::COLOR_SBGRA_32) {
|
||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||
compressionOptions.setPitchAlignment(4);
|
||||
compressionOptions.setPixelFormat(32,
|
||||
0x00FF0000,
|
||||
0x0000FF00,
|
||||
|
@ -419,11 +423,13 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
|||
} else if (mipFormat == gpu::Element::COLOR_R_8) {
|
||||
compressionOptions.setFormat(nvtt::Format_RGB);
|
||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||
compressionOptions.setPitchAlignment(4);
|
||||
compressionOptions.setPixelFormat(8, 0, 0, 0);
|
||||
} else if (mipFormat == gpu::Element::VEC2NU8_XY) {
|
||||
inputOptions.setNormalMap(true);
|
||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||
compressionOptions.setPitchAlignment(4);
|
||||
compressionOptions.setPixelFormat(8, 8, 0, 0);
|
||||
} else {
|
||||
qCWarning(imagelogging) << "Unknown mip format";
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
void addSample(T sample) {
|
||||
if (numSamples > 0) {
|
||||
average = (sample * WEIGHTING) + (average * ONE_MINUS_WEIGHTING);
|
||||
average = (sample * (T)WEIGHTING) + (average * (T)ONE_MINUS_WEIGHTING);
|
||||
} else {
|
||||
average = sample;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue