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:
authorJulian Eisel <julian@blender.org>2021-02-24 13:16:51 +0300
committerJulian Eisel <julian@blender.org>2021-02-24 13:16:51 +0300
commitdaf7f423642cad3e807ac35d669a404eac39a640 (patch)
tree0548194d2379510a69ffb63086583c0e14d8056b /source/blender/gpu/intern/gpu_immediate_private.hh
parent0fe25a6232c4f8eacda02e23945ac3d2ad8808ff (diff)
Fix line width broken for consecutive line draw calls
D9054 did multiple consecutive `immBegin()`/`immEnd()` draw calls to draw multiple lines at varying thickness. This would only work for the first line, then they'd all get a 1px thickness (at least on macOS). Issue was that `wide_line_workaround_end()` called `immBindShader()` directly to restore the old shader (which the workaround overrides). However this doesn't set `imm->builtin_shader_bound` which has to be done for the workaround to work on the next `immBegin()` call. Instead `immBindBuiltinProgram()` can be called. Differential Revision: https://developer.blender.org/D10520 Reviewed by: Clément Foucault
Diffstat (limited to 'source/blender/gpu/intern/gpu_immediate_private.hh')
-rw-r--r--source/blender/gpu/intern/gpu_immediate_private.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_immediate_private.hh b/source/blender/gpu/intern/gpu_immediate_private.hh
index 98399897ea9..382f70eeec4 100644
--- a/source/blender/gpu/intern/gpu_immediate_private.hh
+++ b/source/blender/gpu/intern/gpu_immediate_private.hh
@@ -58,7 +58,7 @@ class Immediate {
/** Wide Line workaround. */
/** Previously bound shader to restore after drawing. */
- GPUShader *prev_shader = NULL;
+ eGPUBuiltinShader prev_builtin_shader = GPU_SHADER_TEXT;
/** 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 wide-line shader just before #immBegin. */