mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:56:55 +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 {
|
class OtherAvatar : public Avatar {
|
||||||
public:
|
public:
|
||||||
explicit OtherAvatar(QThread* thread, RigPointer rig = nullptr);
|
explicit OtherAvatar(QThread* thread, RigPointer rig = nullptr);
|
||||||
void instantiableAvatar() {};
|
virtual void instantiableAvatar() override {};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_OtherAvatar_h
|
#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) {
|
} else if (mipFormat == gpu::Element::COLOR_RGBA_32) {
|
||||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||||
|
compressionOptions.setPitchAlignment(4);
|
||||||
compressionOptions.setPixelFormat(32,
|
compressionOptions.setPixelFormat(32,
|
||||||
0x000000FF,
|
0x000000FF,
|
||||||
0x0000FF00,
|
0x0000FF00,
|
||||||
|
@ -393,6 +394,7 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
||||||
} else if (mipFormat == gpu::Element::COLOR_BGRA_32) {
|
} else if (mipFormat == gpu::Element::COLOR_BGRA_32) {
|
||||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||||
|
compressionOptions.setPitchAlignment(4);
|
||||||
compressionOptions.setPixelFormat(32,
|
compressionOptions.setPixelFormat(32,
|
||||||
0x00FF0000,
|
0x00FF0000,
|
||||||
0x0000FF00,
|
0x0000FF00,
|
||||||
|
@ -403,6 +405,7 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
||||||
} else if (mipFormat == gpu::Element::COLOR_SRGBA_32) {
|
} else if (mipFormat == gpu::Element::COLOR_SRGBA_32) {
|
||||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||||
|
compressionOptions.setPitchAlignment(4);
|
||||||
compressionOptions.setPixelFormat(32,
|
compressionOptions.setPixelFormat(32,
|
||||||
0x000000FF,
|
0x000000FF,
|
||||||
0x0000FF00,
|
0x0000FF00,
|
||||||
|
@ -411,6 +414,7 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
||||||
} else if (mipFormat == gpu::Element::COLOR_SBGRA_32) {
|
} else if (mipFormat == gpu::Element::COLOR_SBGRA_32) {
|
||||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||||
|
compressionOptions.setPitchAlignment(4);
|
||||||
compressionOptions.setPixelFormat(32,
|
compressionOptions.setPixelFormat(32,
|
||||||
0x00FF0000,
|
0x00FF0000,
|
||||||
0x0000FF00,
|
0x0000FF00,
|
||||||
|
@ -419,11 +423,13 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
||||||
} else if (mipFormat == gpu::Element::COLOR_R_8) {
|
} else if (mipFormat == gpu::Element::COLOR_R_8) {
|
||||||
compressionOptions.setFormat(nvtt::Format_RGB);
|
compressionOptions.setFormat(nvtt::Format_RGB);
|
||||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||||
|
compressionOptions.setPitchAlignment(4);
|
||||||
compressionOptions.setPixelFormat(8, 0, 0, 0);
|
compressionOptions.setPixelFormat(8, 0, 0, 0);
|
||||||
} else if (mipFormat == gpu::Element::VEC2NU8_XY) {
|
} else if (mipFormat == gpu::Element::VEC2NU8_XY) {
|
||||||
inputOptions.setNormalMap(true);
|
inputOptions.setNormalMap(true);
|
||||||
compressionOptions.setFormat(nvtt::Format_RGBA);
|
compressionOptions.setFormat(nvtt::Format_RGBA);
|
||||||
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
compressionOptions.setPixelType(nvtt::PixelType_UnsignedNorm);
|
||||||
|
compressionOptions.setPitchAlignment(4);
|
||||||
compressionOptions.setPixelFormat(8, 8, 0, 0);
|
compressionOptions.setPixelFormat(8, 8, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
qCWarning(imagelogging) << "Unknown mip format";
|
qCWarning(imagelogging) << "Unknown mip format";
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
|
|
||||||
void addSample(T sample) {
|
void addSample(T sample) {
|
||||||
if (numSamples > 0) {
|
if (numSamples > 0) {
|
||||||
average = (sample * WEIGHTING) + (average * ONE_MINUS_WEIGHTING);
|
average = (sample * (T)WEIGHTING) + (average * (T)ONE_MINUS_WEIGHTING);
|
||||||
} else {
|
} else {
|
||||||
average = sample;
|
average = sample;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue