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:
authorClément Foucault <foucault.clem@gmail.com>2020-09-18 20:59:51 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-18 23:41:49 +0300
commit649b0ccac8b514b471cdeede97b1a2839c2176b9 (patch)
treec76ff75bb16c3e022d1df201639d407ea531611d /source/blender/gpu/intern/gpu_immediate_private.hh
parentf17302be6b716ea5bc6b1ddfd09a2cf3b4969e37 (diff)
GPUImmediate: Add system wide workaround for wide line
This makes wide line supported on MacOS and other implementation that does not support wide line by default. This workaround works for all Line types but only if using one of the 5 default shaders. The workaround is completely isolated and invisible to the outside. It has no side effect. Note: This does not affect the GPUBatch drawing.
Diffstat (limited to 'source/blender/gpu/intern/gpu_immediate_private.hh')
-rw-r--r--source/blender/gpu/intern/gpu_immediate_private.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_immediate_private.hh b/source/blender/gpu/intern/gpu_immediate_private.hh
index 38db8131942..b867a85bb8b 100644
--- a/source/blender/gpu/intern/gpu_immediate_private.hh
+++ b/source/blender/gpu/intern/gpu_immediate_private.hh
@@ -55,6 +55,15 @@ class Immediate {
/** Batch in construction when using immBeginBatch. */
GPUBatch *batch = NULL;
+ /** Wide Line workaround. */
+
+ /** Previously bound shader to restore after drawing. */
+ GPUShader *prev_shader = NULL;
+ /** Builtin shader index. Used to test if the workaround can be done. */
+ eGPUBuiltinShader builtin_shader_bound = GPU_SHADER_TEXT;
+ /** Uniform color: Kept here to update the wideline shader just before immBegin. */
+ float uniform_color[4];
+
public:
Immediate(){};
virtual ~Immediate(){};