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.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 8ec932f4184..aec94f9f2cb 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -853,11 +853,14 @@ static char *code_generate_geometry(ListBase *nodes, bool use_opensubdiv)
for (input = node->inputs.first; input; input = input->next) {
if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
if (input->attribtype == CD_MTFACE) {
+ /* NOTE: For now we are using varying on purpose,
+ * otherwise we are not able to write to the varying.
+ */
BLI_dynstr_appendf(ds, "%s %s var%d%s;\n",
- GLEW_VERSION_3_0 ? "in" : "varying",
+ "varying",
GPU_DATATYPE_STR[input->type],
input->attribid,
- GLEW_VERSION_3_0 ? "[]" : "");
+ "");
BLI_dynstr_appendf(ds, "uniform int fvar%d_offset;\n",
input->attribid);
}
@@ -872,11 +875,12 @@ static char *code_generate_geometry(ListBase *nodes, bool use_opensubdiv)
for (input = node->inputs.first; input; input = input->next) {
if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
if (input->attribtype == CD_MTFACE) {
- BLI_dynstr_appendf(ds,
- "\t// INTERP_FACE_VARYING_2(var%d, "
- "fvar%d_offset, st);\n",
- input->attribid,
- input->attribid);
+ BLI_dynstr_appendf(
+ ds,
+ "\tINTERP_FACE_VARYING_2(var%d, "
+ "int(texelFetch(FVarDataOffsetBuffer, fvar%d_offset).r), st);\n",
+ input->attribid,
+ input->attribid);
}
}
}