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:
Diffstat (limited to 'source/blender/draw/intern/draw_manager_data.c')
-rw-r--r--source/blender/draw/intern/draw_manager_data.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 4b3be3ab924..83b764317a9 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -25,6 +25,7 @@
#include "BKE_anim.h"
#include "BKE_curve.h"
#include "BKE_global.h"
+#include "BKE_image.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
#include "BKE_paint.h"
@@ -1213,9 +1214,17 @@ static DRWShadingGroup *drw_shgroup_material_inputs(DRWShadingGroup *grp,
GPUTexture *tex = NULL;
if (input->ima) {
+ /* If there's no specified iuser but we need a different tile, create a temporary one. */
+ ImageUser local_iuser;
+ BKE_imageuser_default(&local_iuser);
+ local_iuser.tile = input->image_tile;
+
+ ImageUser *iuser = input->iuser ? input->iuser : &local_iuser;
+ iuser->tile = input->image_tile;
+
GPUTexture **tex_ref = BLI_memblock_alloc(DST.vmempool->images);
- *tex_ref = tex = GPU_texture_from_blender(input->ima, input->iuser, GL_TEXTURE_2D);
+ *tex_ref = tex = GPU_texture_from_blender(input->ima, iuser, GL_TEXTURE_2D);
GPU_texture_ref(tex);
}