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:
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.c')
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index b051d4fe59a..d67ce0be310 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -43,7 +43,7 @@
#include "GPU_extensions.h"
#include "GPU_material.h"
#include "GPU_shader.h"
-#include "GPU_uniformbuffer.h"
+#include "GPU_uniform_buffer.h"
#include "GPU_vertex_format.h"
#include "BLI_sys_types.h" /* for intptr_t support */
@@ -686,7 +686,7 @@ static char *code_generate_vertex(GPUNodeGraph *graph,
BLI_dynstr_append(ds, "#define USE_ATTR\n\n");
BLI_dynstr_append(ds, vert_code);
- BLI_dynstr_append(ds, "\n");
+ BLI_dynstr_append(ds, "\n\n");
BLI_dynstr_append(ds, "void pass_attr(vec3 position, mat3 normalmat, mat4 modelmatinv) {\n");
@@ -755,15 +755,16 @@ static char *code_generate_geometry(GPUNodeGraph *graph,
/* Generate varying assignments. */
BLI_dynstr_append(ds, "#define USE_ATTR\n");
- BLI_dynstr_append(ds, "void pass_attr(const int vert) {\n");
+ /* This needs to be a define. Some drivers don't like variable vert index inside dataAttrIn. */
+ BLI_dynstr_append(ds, "#define pass_attr(vert) {\\\n");
if (builtins & GPU_BARYCENTRIC_TEXCO) {
- BLI_dynstr_append(ds, " dataAttrOut.barycentricTexCo = calc_barycentric_co(vert);\n");
+ BLI_dynstr_append(ds, "dataAttrOut.barycentricTexCo = calc_barycentric_co(vert);\\\n");
}
LISTBASE_FOREACH (GPUMaterialAttribute *, attr, &graph->attributes) {
/* TODO let shader choose what to do depending on what the attribute is. */
- BLI_dynstr_appendf(ds, " dataAttrOut.var%d = dataAttrIn[vert].var%d;\n", attr->id, attr->id);
+ BLI_dynstr_appendf(ds, "dataAttrOut.var%d = dataAttrIn[vert].var%d;\\\n", attr->id, attr->id);
}
BLI_dynstr_append(ds, "}\n\n");