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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-09-12 15:30:28 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-09-12 15:30:28 +0300
commit39fabaddfd770f7d92a5aabb0d0255d6fc97cd24 (patch)
treed44e6c37094e53287596f33ecf8423eec8e7c51b /source/blender/gpu/intern/gpu_codegen.c
parent721c691a2750d9eb005343a9d2e25fdac6ff1493 (diff)
GPU: Remove residue of OpenSubdiv
Was done more like a hack on top of old drawing pipeline. Should be re-implemented to fit new draw manager closer.
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.c')
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 2b81ec02c9c..7c312f5f36b 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -636,21 +636,10 @@ static int codegen_process_uniforms_functions(GPUMaterial *material, DynStr *ds,
BLI_dynstr_append(ds, ";\n");
}
else if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
-#ifdef WITH_OPENSUBDIV
- bool skip_opensubdiv = input->attribtype == CD_TANGENT;
- if (skip_opensubdiv) {
- BLI_dynstr_appendf(ds, "#ifndef USE_OPENSUBDIV\n");
- }
-#endif
BLI_dynstr_appendf(
ds, "%s %s var%d;\n",
GLEW_VERSION_3_0 ? "in" : "varying",
GPU_DATATYPE_STR[input->type], input->attribid);
-#ifdef WITH_OPENSUBDIV
- if (skip_opensubdiv) {
- BLI_dynstr_appendf(ds, "#endif\n");
- }
-#endif
}
}
}
@@ -774,12 +763,6 @@ static char *code_generate_fragment(GPUMaterial *material, ListBase *nodes, GPUO
char *code;
int builtins;
-#ifdef WITH_OPENSUBDIV
- GPUNode *node;
- GPUInput *input;
-#endif
-
-
#if 0
BLI_dynstr_append(ds, FUNCTION_PROTOTYPES);
#endif
@@ -819,36 +802,6 @@ static char *code_generate_fragment(GPUMaterial *material, ListBase *nodes, GPUO
if (builtins & GPU_VIEW_POSITION)
BLI_dynstr_append(ds, "\tvec3 viewposition = viewPosition;\n");
- /* Calculate tangent space. */
-#ifdef WITH_OPENSUBDIV
- {
- bool has_tangent = false;
- for (node = nodes->first; node; node = node->next) {
- for (input = node->inputs.first; input; input = input->next) {
- if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
- if (input->attribtype == CD_TANGENT) {
- BLI_dynstr_appendf(
- ds, "#ifdef USE_OPENSUBDIV\n");
- BLI_dynstr_appendf(
- ds, "\t%s var%d;\n",
- GPU_DATATYPE_STR[input->type],
- input->attribid);
- if (has_tangent == false) {
- BLI_dynstr_appendf(ds, "\tvec3 Q1 = dFdx(inpt.v.position.xyz);\n");
- BLI_dynstr_appendf(ds, "\tvec3 Q2 = dFdy(inpt.v.position.xyz);\n");
- BLI_dynstr_appendf(ds, "\tvec2 st1 = dFdx(inpt.v.uv);\n");
- BLI_dynstr_appendf(ds, "\tvec2 st2 = dFdy(inpt.v.uv);\n");
- BLI_dynstr_appendf(ds, "\tvec3 T = normalize(Q1 * st2.t - Q2 * st1.t);\n");
- }
- BLI_dynstr_appendf(ds, "\tvar%d = vec4(T, 1.0);\n", input->attribid);
- BLI_dynstr_appendf(ds, "#endif\n");
- }
- }
- }
- }
- }
-#endif
-
codegen_declare_tmps(ds, nodes);
codegen_call_functions(ds, nodes, output);