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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-12-08 20:31:01 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-12-08 20:47:53 +0300
commitf16bca72123b279a7c1e395abb75fb4032150391 (patch)
tree39a511258f3baaf8c51c1d6b7f6c0a40d8b0892c /source
parent5c234a558c1ac0921f171fa38c59bb51b21e2b74 (diff)
Fix T71480: crash with Eevee image texture node and clipping
Diffstat (limited to 'source')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_image.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c
index a6dfb2636fc..c81f4f9853f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c
@@ -126,6 +126,12 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat,
switch (tex->projection) {
case SHD_PROJ_FLAT:
if (do_texco_clip) {
+ /* This seems redundant, but is required to ensure the texco link
+ * is not freed by GPU_link, as it is still needed for GPU_stack_link.
+ * Intermediate links like this can only be used once and are then
+ * freed immediately, but if we make it the output link of a set_rgb
+ * node it will be kept and can be used multiple times. */
+ GPU_link(mat, "set_rgb", *texco, texco);
GPU_link(mat, "set_rgb", *texco, &input_coords);
}
if (do_texco_extend) {
@@ -151,6 +157,8 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat,
GPU_link(mat, "point_texco_remap_square", *texco, texco);
GPU_link(mat, "point_map_to_sphere", *texco, texco);
if (do_texco_clip) {
+ /* See SHD_PROJ_FLAT for explanation. */
+ GPU_link(mat, "set_rgb", *texco, texco);
GPU_link(mat, "set_rgb", *texco, &input_coords);
}
if (do_texco_extend) {
@@ -163,6 +171,8 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat,
GPU_link(mat, "point_texco_remap_square", *texco, texco);
GPU_link(mat, "point_map_to_tube", *texco, texco);
if (do_texco_clip) {
+ /* See SHD_PROJ_FLAT for explanation. */
+ GPU_link(mat, "set_rgb", *texco, texco);
GPU_link(mat, "set_rgb", *texco, &input_coords);
}
if (do_texco_extend) {