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 <ideasman42@gmail.com>2019-01-21 15:51:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-21 15:55:53 +0300
commit9bc47ed0f6d0db9e43af30c741a7e5ac347cbecd (patch)
treeca8dbd6ce37e3529a3c5fe8c0bc944c535128ec3 /source/blender/draw/engines/workbench/workbench_forward.c
parent0c829e8240eebd7ce4ed9d61f8682c0d6bf534f4 (diff)
Fix clipping shaders with some AMD/Intel drivers
Caused: error: unsized array index must be constant Use hard coded number of clipping planes, copying the 4th to 5 & 6 when only 4 are used.
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_forward.c')
-rw-r--r--source/blender/draw/engines/workbench/workbench_forward.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c
index 94cbb20ef5f..485348f65f3 100644
--- a/source/blender/draw/engines/workbench/workbench_forward.c
+++ b/source/blender/draw/engines/workbench/workbench_forward.c
@@ -29,6 +29,7 @@
#include "BLI_alloca.h"
#include "BLI_dynstr.h"
+#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "BKE_node.h"
@@ -66,6 +67,7 @@ static struct {
} e_data = {{NULL}};
/* Shaders */
+extern char datatoc_common_world_clip_lib_glsl[];
extern char datatoc_common_hair_lib_glsl[];
extern char datatoc_workbench_forward_composite_frag_glsl[];
@@ -85,12 +87,15 @@ static char *workbench_build_forward_vert(bool is_hair)
{
char *str = NULL;
if (!is_hair) {
- return BLI_strdup(datatoc_workbench_prepass_vert_glsl);
+ return BLI_string_joinN(
+ datatoc_common_world_clip_lib_glsl,
+ datatoc_workbench_prepass_vert_glsl);
}
DynStr *ds = BLI_dynstr_new();
BLI_dynstr_append(ds, datatoc_common_hair_lib_glsl);
+ BLI_dynstr_append(ds, datatoc_common_world_clip_lib_glsl);
BLI_dynstr_append(ds, datatoc_workbench_prepass_vert_glsl);
str = BLI_dynstr_get_cstring(ds);