diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-01-31 10:52:43 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-01-31 10:52:43 +0300 |
commit | b997914f8074a8a715ddcf80f16e5b0ddd5549c6 (patch) | |
tree | 5950f7dd2bf367ce7a1347ff1fbe6ed0f830ca3f /source/blender/gpu/intern | |
parent | 2081dac93be916a2204ffe1bef2514789a7f8842 (diff) |
OpenGL: remove NPOT texture rescaling logic
This code was already disabled.
We might be able to simplify GPU_check_scaled_image even further. Maybe even delete it? Just removing the obvious stuff now.
Keeping is_power_of_2_resolution function since it is still used in DXT logic.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index c8d5d92b66b..12a9ab87d5e 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -38,8 +38,6 @@ #include <string.h> -#include "GPU_glew.h" - #include "BLI_blenlib.h" #include "BLI_linklist.h" #include "BLI_math.h" @@ -853,32 +851,6 @@ void GPU_create_gl_tex( int tpx = rectw; int tpy = recth; -#if 0 /* NPOT support should be a compile-time check */ - /* 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 - * Then don't bother scaling for hardware that supports NPOT textures! */ - if (textarget == GL_TEXTURE_2D && - ((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(rectw, recth)) || - is_over_resolution_limit(textarget, rectw, recth))) - { - rectw = smaller_power_of_2_limit(rectw); - recth = smaller_power_of_2_limit(recth); - - if (use_high_bit_depth) { - ibuf = IMB_allocFromBuffer(NULL, frect, tpx, tpy); - IMB_scaleImBuf(ibuf, rectw, recth); - - frect = ibuf->rect_float; - } - else { - ibuf = IMB_allocFromBuffer(rect, NULL, tpx, tpy); - IMB_scaleImBuf(ibuf, rectw, recth); - - rect = ibuf->rect; - } - } -#endif - /* create image */ glGenTextures(1, (GLuint *)bind); glBindTexture(textarget, *bind); @@ -1203,13 +1175,7 @@ void GPU_paint_set_mipmap(bool mipmap) /* check if image has been downscaled and do scaled partial update */ static bool GPU_check_scaled_image(ImBuf *ibuf, Image *ima, float *frect, int x, int y, int w, int h) { -#if 0 /* NPOT suport should be a compile-time check */ - if ((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(ibuf->x, ibuf->y)) || - is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y)) -#else - if (is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y)) -#endif - { + if (is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y)) { int x_limit = smaller_power_of_2_limit(ibuf->x); int y_limit = smaller_power_of_2_limit(ibuf->y); |