diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2020-01-16 18:08:17 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2020-01-16 18:08:17 +0300 |
commit | 5b8c2301d8b7400013903fe0b02071ba19aafb9f (patch) | |
tree | 68e48ef00213eced561c84f18c5e409d573bd72d /source/blender/gpu/intern | |
parent | 59d3e4357a9054fd65be455198051634e4b40156 (diff) | |
parent | d74f9c4b7b4f2b9b72462f908bdd7e251a42f478 (diff) |
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 1da7274b2cd..5a5c3ace552 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1340,17 +1340,12 @@ static char *code_generate_geometry(ListBase *nodes, const char *geom_code, cons "barycentricPosg[2]);\n"); } - BLI_dynstr_append(ds, "\tgl_Position = gl_in[0].gl_Position;\n"); - BLI_dynstr_append(ds, "\tpass_attr(0);\n"); - BLI_dynstr_append(ds, "\tEmitVertex();\n"); - - BLI_dynstr_append(ds, "\tgl_Position = gl_in[1].gl_Position;\n"); - BLI_dynstr_append(ds, "\tpass_attr(1);\n"); - BLI_dynstr_append(ds, "\tEmitVertex();\n"); - - BLI_dynstr_append(ds, "\tgl_Position = gl_in[2].gl_Position;\n"); - BLI_dynstr_append(ds, "\tpass_attr(2);\n"); - BLI_dynstr_append(ds, "\tEmitVertex();\n"); + for (int i = 0; i < 3; i++) { + BLI_dynstr_appendf(ds, "\tgl_Position = gl_in[%d].gl_Position;\n", i); + BLI_dynstr_appendf(ds, "\tgl_ClipDistance[0] = gl_in[%d].gl_ClipDistance[0];\n", i); + BLI_dynstr_appendf(ds, "\tpass_attr(%d);\n", i); + BLI_dynstr_append(ds, "\tEmitVertex();\n"); + } BLI_dynstr_append(ds, "}\n"); } } |