diff options
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_draw.h | 3 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 1 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 12 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 2 |
5 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index c36af74e55e..d602d75bb35 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -38,6 +38,7 @@ extern "C" { #endif struct Image; +struct ImageUser; struct MTFace; struct Object; struct Scene; @@ -113,7 +114,7 @@ void GPU_paint_set_mipmap(int mipmap); void GPU_paint_update_image(struct Image *ima, int x, int y, int w, int h, int mipmap); void GPU_update_images_framechange(void); int GPU_update_image_time(struct Image *ima, double time); -int GPU_verify_image(struct Image *ima, int tftile, int tfmode, int compare, int mipmap); +int GPU_verify_image(struct Image *ima, struct ImageUser *iuser, int tftile, int tfmode, int compare, int mipmap); void GPU_free_image(struct Image *ima); void GPU_free_images(void); diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 168c6645910..efaae5c2720 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -997,6 +997,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type) input->source = GPU_SOURCE_TEX; input->ima = link->ptr1; + input->iuser = link->ptr2; input->textarget = GL_TEXTURE_2D; input->textype = GPU_TEX2D; MEM_freeN(link); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index fea93d13cc5..10638ca552a 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -392,7 +392,7 @@ static void gpu_verify_reflection(Image *ima) } } -int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare, int mipmap) +int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int tfmode, int compare, int mipmap) { ImBuf *ibuf = NULL; unsigned int *bind = NULL; @@ -444,7 +444,7 @@ int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare, int mipmap return 0; /* check if we have a valid image buffer */ - ibuf= BKE_image_get_ibuf(ima, NULL); + ibuf= BKE_image_get_ibuf(ima, iuser); if(ibuf==NULL) return 0; @@ -453,6 +453,12 @@ int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare, int mipmap if ((ibuf->rect==NULL) && ibuf->rect_float) IMB_rect_from_float(ibuf); + /* currently, tpage refresh is used by ima sequences */ + if(ima->tpageflag & IMA_TPAGE_REFRESH) { + GPU_free_image(ima); + ima->tpageflag &= ~IMA_TPAGE_REFRESH; + } + if(GTS.tilemode) { /* tiled mode */ if(ima->repbind==0) gpu_make_repbind(ima); @@ -585,7 +591,7 @@ int GPU_set_tpage(MTFace *tface, int mipmap) gpu_verify_alpha_mode(tface); gpu_verify_reflection(ima); - if(GPU_verify_image(ima, tface->tile, tface->mode, 1, mipmap)) { + if(GPU_verify_image(ima, NULL, tface->tile, tface->mode, 1, mipmap)) { GTS.curtile= GTS.tile; GTS.curima= GTS.ima; GTS.curtilemode= GTS.tilemode; diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 8d0bd819deb..3ca55c12ce2 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -471,7 +471,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time, glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode); GPU_update_image_time(ima, time); - bindcode = GPU_verify_image(ima, 0, 0, 0, mipmap); + bindcode = GPU_verify_image(ima, iuser, 0, 0, 0, mipmap); if(ima->gputexture) { ima->gputexture->bindcode = bindcode; diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 3b33c2eba62..0d2b6747f79 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -960,7 +960,7 @@ static void do_material_tex(GPUShadeInput *shi) rgbnor = 0; if(tex && tex->type == TEX_IMAGE && tex->ima) { - GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, NULL), &tin, &trgb, &tnor); + GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, &tex->iuser), &tin, &trgb, &tnor); rgbnor= TEX_RGB; if(tex->imaflag & TEX_USEALPHA) |