diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-03-22 17:38:41 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-03-22 21:43:08 +0300 |
commit | 6c0bd890475c7de2406c9383774ba8777724313f (patch) | |
tree | 02058ecfc0a868a9948b0e18025a708e0095d9b5 /source/blender/gpu/intern | |
parent | 8b4e0eb88e715392490aefa520d2c5444f084a44 (diff) |
Fix T58392 Texture limit size not working
It was removed by inadvertence.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 65c07ea01a8..c9989703d5b 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -429,6 +429,28 @@ void GPU_create_gl_tex( { ImBuf *ibuf = NULL; + if (textarget == GL_TEXTURE_2D && + is_over_resolution_limit(textarget, rectw, recth)) + { + int tpx = rectw; + int tpy = 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; + } + } + /* create image */ glGenTextures(1, (GLuint *)bind); glBindTexture(textarget, *bind); |