Try some swizzling instead of forcing everything to rgba8 with core profile. Avoids manual conversions with scratch buffers. Works for all pixel datatypes. Cleaner. Uses less vram.

Also, fixed textures when running core pofile.
This commit is contained in:
Shyotl
2014-05-14 03:05:53 -05:00
parent 98f9a09b39
commit 117eca3c98
3 changed files with 40 additions and 81 deletions

View File

@@ -471,10 +471,8 @@ void LLPostProcess::createNoiseTexture()
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mNoiseTexture);
stop_glerror();
if(gGLManager.mGLVersion >= 4.f)
LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_R8, NOISE_SIZE, NOISE_SIZE, GL_RED, GL_UNSIGNED_BYTE, &buffer[0], false);
else
LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_LUMINANCE8, NOISE_SIZE, NOISE_SIZE, GL_LUMINANCE, GL_UNSIGNED_BYTE, &buffer[0], false);
LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_LUMINANCE8, NOISE_SIZE, NOISE_SIZE, GL_LUMINANCE, GL_UNSIGNED_BYTE, &buffer[0], false);
stop_glerror();
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);