diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-03-01 13:46:53 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-03-01 13:46:53 +0300 |
commit | f493e2f23a04da77b423dfe0699cae8368bc2062 (patch) | |
tree | b302c81f81ff190b889d4d4563235749b5147580 /source/blender/draw/engines/image | |
parent | 90ec634135a0a79534fc34146c4860805279a3a9 (diff) | |
parent | 629f22f161abfbe492d71e08cc89651da683aded (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender/draw/engines/image')
-rw-r--r-- | source/blender/draw/engines/image/image_drawing_mode.hh | 8 | ||||
-rw-r--r-- | source/blender/draw/engines/image/image_instance_data.hh | 2 | ||||
-rw-r--r-- | source/blender/draw/engines/image/image_usage.hh | 6 |
3 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh index c727fbcd98f..c091f800d95 100644 --- a/source/blender/draw/engines/image/image_drawing_mode.hh +++ b/source/blender/draw/engines/image/image_drawing_mode.hh @@ -491,7 +491,9 @@ template<typename TextureMethod> class ScreenSpaceDrawingMode : public AbstractD /* Step: Add the GPU textures to the shgroup. */ instance_data->update_batches(); - add_depth_shgroups(*instance_data, image, iuser); + if (!instance_data->flags.do_tile_drawing) { + add_depth_shgroups(*instance_data, image, iuser); + } add_shgroups(instance_data); } @@ -507,8 +509,10 @@ template<typename TextureMethod> class ScreenSpaceDrawingMode : public AbstractD DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); GPU_framebuffer_bind(dfbl->default_fb); + static float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - GPU_framebuffer_clear_color_depth(dfbl->default_fb, clear_col, 1.0); + float clear_depth = instance_data->flags.do_tile_drawing ? 0.75 : 1.0f; + GPU_framebuffer_clear_color_depth(dfbl->default_fb, clear_col, clear_depth); DRW_view_set_active(instance_data->view); DRW_draw_pass(instance_data->passes.depth_pass); diff --git a/source/blender/draw/engines/image/image_instance_data.hh b/source/blender/draw/engines/image/image_instance_data.hh index a7ae8666968..682b93a80b3 100644 --- a/source/blender/draw/engines/image/image_instance_data.hh +++ b/source/blender/draw/engines/image/image_instance_data.hh @@ -106,7 +106,7 @@ struct IMAGE_InstanceData { void update_image_usage(const ImageUser *image_user) { - ImageUsage usage(image, image_user); + ImageUsage usage(image, image_user, flags.do_tile_drawing); if (last_usage != usage) { last_usage = usage; reset_dirty_flag(true); diff --git a/source/blender/draw/engines/image/image_usage.hh b/source/blender/draw/engines/image/image_usage.hh index 0643cc87304..bea5c3853b0 100644 --- a/source/blender/draw/engines/image/image_usage.hh +++ b/source/blender/draw/engines/image/image_usage.hh @@ -9,7 +9,7 @@ /** * ImageUsage contains data of the image and image user to identify changes that require a rebuild - * of the texture slots. + * the texture slots. */ struct ImageUsage { /** Render pass of the image that is used. */ @@ -22,11 +22,12 @@ struct ImageUsage { ColorManagedColorspaceSettings colorspace_settings; /** IMA_ALPHA_* */ char alpha_mode; + bool last_tile_drawing; const void *last_image = nullptr; ImageUsage() = default; - ImageUsage(const struct Image *image, const struct ImageUser *image_user) + ImageUsage(const struct Image *image, const struct ImageUser *image_user, bool do_tile_drawing) { pass = image_user ? image_user->pass : 0; layer = image_user ? image_user->layer : 0; @@ -34,6 +35,7 @@ struct ImageUsage { colorspace_settings = image->colorspace_settings; alpha_mode = image->alpha_mode; last_image = static_cast<const void *>(image); + last_tile_drawing = do_tile_drawing; } bool operator==(const ImageUsage &other) const |