diff options
Diffstat (limited to 'source/blender/draw/intern/draw_manager_data.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_data.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index 98474c81209..c6fc244121c 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -1214,17 +1214,19 @@ 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, iuser, GL_TEXTURE_2D); + int textarget; + if (input->type == GPU_TEX2D_ARRAY) { + textarget = GL_TEXTURE_2D_ARRAY; + } + else if (input->type == GPU_TEX1D_ARRAY) { + textarget = GL_TEXTURE_1D_ARRAY; + } + else { + textarget = GL_TEXTURE_2D; + } + *tex_ref = tex = GPU_texture_from_blender(input->ima, input->iuser, textarget); GPU_texture_ref(tex); } |