Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/gpu/intern/gpu_draw.c5
-rw-r--r--source/gameengine/Ketsji/BL_Texture.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 8a31a454633..f4e1e0c1147 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -638,8 +638,9 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *pix, float * frect, int
int tpy = recth;
/* scale if not a power of two. this is not strictly necessary for newer
- * GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures */
- if (!is_pow2_limit(rectw) || !is_pow2_limit(recth)) {
+ * GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures
+ * Then don't bother scaling for hardware that supports NPOT textures! */
+ if (!GLEW_ARB_texture_non_power_of_two && (!is_pow2_limit(rectw) || !is_pow2_limit(recth))) {
rectw= smaller_pow2_limit(rectw);
recth= smaller_pow2_limit(recth);
diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp
index 19247664dfa..f2d67e9131d 100644
--- a/source/gameengine/Ketsji/BL_Texture.cpp
+++ b/source/gameengine/Ketsji/BL_Texture.cpp
@@ -169,7 +169,7 @@ bool BL_Texture::InitFromImage(int unit, Image *img, bool mipmap)
void BL_Texture::InitGLTex(unsigned int *pix,int x,int y,bool mipmap)
{
- if (!is_power_of_2_i(x) || !is_power_of_2_i(y) ) {
+ if (!GLEW_ARB_texture_non_power_of_two && (!is_power_of_2_i(x) || !is_power_of_2_i(y)) ) {
InitNonPow2Tex(pix, x,y,mipmap);
return;
}