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:
authorCampbell Barton <campbell@blender.org>2022-01-31 16:01:58 +0300
committerCampbell Barton <campbell@blender.org>2022-01-31 16:01:58 +0300
commitcf871ab9679599a052f9ca50b0475403369b4bc3 (patch)
tree2c75a1066134195b9bd77578ed9bf0a7d254affa
parent9badd27fb7612b1a66e49c856c8228e53e666507 (diff)
parentdfc959eed607070a0e996911e689f029ae4b4861 (diff)
Merge branch 'blender-v3.1-release'
-rw-r--r--source/blender/draw/engines/image/image_drawing_mode.hh17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh
index bc0732488e8..ad672771c08 100644
--- a/source/blender/draw/engines/image/image_drawing_mode.hh
+++ b/source/blender/draw/engines/image/image_drawing_mode.hh
@@ -126,12 +126,19 @@ template<typename TextureMethod> class ScreenSpaceDrawingMode : public AbstractD
*/
void add_depth_shgroups(IMAGE_InstanceData &instance_data,
Image *image,
- ImageUser *UNUSED(image_user)) const
+ ImageUser *image_user) const
{
GPUShader *shader = IMAGE_shader_depth_get();
DRWShadingGroup *shgrp = DRW_shgroup_create(shader, instance_data.passes.depth_pass);
+
float image_mat[4][4];
unit_m4(image_mat);
+
+ ImageUser tile_user = {0};
+ if (image_user) {
+ tile_user = *image_user;
+ }
+
for (int i = 0; i < SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN; i++) {
const TextureInfo &info = instance_data.texture_infos[i];
if (!info.visible) {
@@ -139,10 +146,16 @@ template<typename TextureMethod> class ScreenSpaceDrawingMode : public AbstractD
}
LISTBASE_FOREACH (ImageTile *, image_tile_ptr, &image->tiles) {
- DRWShadingGroup *shsub = DRW_shgroup_create_sub(shgrp);
const ImageTileWrapper image_tile(image_tile_ptr);
const int tile_x = image_tile.get_tile_x_offset();
const int tile_y = image_tile.get_tile_y_offset();
+ tile_user.tile = image_tile.get_tile_number();
+
+ if (!BKE_image_has_ibuf(image, &tile_user)) {
+ continue;
+ }
+
+ DRWShadingGroup *shsub = DRW_shgroup_create_sub(shgrp);
float4 min_max_uv(tile_x, tile_y, tile_x + 1, tile_y + 1);
DRW_shgroup_uniform_vec4_copy(shsub, "min_max_uv", min_max_uv);
DRW_shgroup_call_obmat(shsub, info.batch, image_mat);