diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-10-12 16:39:32 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-10-12 16:39:32 +0800 |
commit | 4f26fe6430cd12914b0d6edf33baabe19829d014 (patch) | |
tree | 1e1ee5f7167b2d825cfea9a7e5ef8d0e0f9f37d3 /indra/llrender | |
parent | 722c63cec4c4a1aee2fc5e9699a54da19a634f12 (diff) |
Preprocess eTextureType like sGLTextureType
(cause eTextureType seems to have been designed to mirror sGLTextureType)
otherwise you'd get a GL error of invalid enum of the first argument
for glTexImage2D.
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llrender.cpp | 2 | ||||
-rw-r--r-- | indra/llrender/llrender.h | 6 | ||||
-rw-r--r-- | indra/llrender/llrendertarget.cpp | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index ca10e10b00..fd34a94ae8 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -2149,9 +2149,11 @@ void LLRender::debugTexUnits(void) case LLTexUnit::TT_TEXTURE: LL_CONT << "Texture 2D"; break; +#if GL_VERSION_3_1 case LLTexUnit::TT_RECT_TEXTURE: LL_CONT << "Texture Rectangle"; break; +#endif case LLTexUnit::TT_CUBE_MAP: LL_CONT << "Cube Map"; break; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index d198b0cd7c..4e568b2b2b 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -67,10 +67,16 @@ public: typedef enum { TT_TEXTURE = 0, // Standard 2D Texture +#if GL_VERSION_3_1 TT_RECT_TEXTURE, // Non power of 2 texture +#endif TT_CUBE_MAP, // 6-sided cube map texture +#if GL_VERSION_4_0 TT_CUBE_MAP_ARRAY, // Array of cube maps +#endif +#if GL_VERSION_3_2 TT_MULTISAMPLE_TEXTURE, // see GL_ARB_texture_multisample +#endif TT_TEXTURE_3D, // standard 3D Texture TT_NONE, // No texture type is currently enabled } eTextureType; diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 2674fa1ec6..1ff0dec23a 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -255,12 +255,14 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) stop_glerror(); } +#if GL_VERSION_3_1 if (mUsage != LLTexUnit::TT_RECT_TEXTURE) { gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_MIRROR); stop_glerror(); } else +#endif { // ATI doesn't support mirrored repeat for rectangular textures. gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); |