diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-07-10 23:23:57 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-07-10 23:23:57 +0400 |
commit | 831ae18622971c9d3be878d0e44db77217e605ad (patch) | |
tree | 4c1564402c284accd85c0aab2e87d76b62386d47 /source/blender/gpu/intern | |
parent | f279576f1afc7a7ac67dc10a2a62932eda4989f7 (diff) |
Scaling non-power-of-two (NPOT) textures to powers of two is really time consuming and not necessary on graphics cards that can support NPOT textures. So, if the graphics card has NPOT texture support, don't bother scaling. If this patch causes issues, it can always be reverted and applied to Swiss instead.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 5 |
1 files changed, 3 insertions, 2 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); |