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:
authorJeroen Bakker <jeroen@blender.org>2019-12-05 16:21:57 +0300
committerJeroen Bakker <jeroen@blender.org>2019-12-06 09:45:07 +0300
commit15abc9fe743e09f2ec7ef3a6bcfb8f4954bcf28c (patch)
tree49fc31a16b2e89d0fd67f8756dc164c82098a23c /source/blender/draw/engines/overlay/overlay_antialiasing.c
parent601eafd104ca66e3baaa45e9ecb00989395c55d9 (diff)
Draw: Removal of MultiSample Buffers
Multisample buffers were used for smooth line drawing. As we now have an algorithm that doesn't need the multisample buffers we can remove them. The user preference for viewport multi_sampling is replaced by single toggle overlay `use_overlay_smooth_wire`. By default this setting is enabled as the new drawing is really quick (<1ms) and uses zero hacks. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6367
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_antialiasing.c')
-rw-r--r--source/blender/draw/engines/overlay/overlay_antialiasing.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_antialiasing.c b/source/blender/draw/engines/overlay/overlay_antialiasing.c
index 54bcd91441c..8c50bfac908 100644
--- a/source/blender/draw/engines/overlay/overlay_antialiasing.c
+++ b/source/blender/draw/engines/overlay/overlay_antialiasing.c
@@ -76,8 +76,8 @@ void OVERLAY_antialiasing_init(OVERLAY_Data *vedata)
}
bool need_wire_expansion = (G_draw.block.sizePixel > 1.0f);
- /* TODO Get real userpref option and remove MSAA buffer. */
- pd->antialiasing.enabled = (dtxl->multisample_color != NULL) || need_wire_expansion;
+ pd->antialiasing.enabled = need_wire_expansion ||
+ ((U.gpu_flag & USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE) > 0);
GPUTexture *color_tex = NULL;
GPUTexture *line_tex = NULL;
@@ -122,8 +122,9 @@ void OVERLAY_antialiasing_cache_init(OVERLAY_Data *vedata)
DRWShadingGroup *grp;
if (pd->antialiasing.enabled) {
- /* TODO Get real userpref option and remove MSAA buffer. */
- const bool do_smooth_lines = (dtxl->multisample_color != NULL);
+ /* `antialiasing.enabled` is also enabled for wire expansion. Check here if
+ * anti aliasing is needed. */
+ const bool do_smooth_lines = (U.gpu_flag & USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE) > 0;
DRW_PASS_CREATE(psl->antialiasing_ps, DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA_PREMUL);