summaryrefslogtreecommitdiff
path: root/drivers/gles3/shader_compiler_gles3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/shader_compiler_gles3.cpp')
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index 325df8e4f1..05381da9b9 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -81,6 +81,16 @@ static int _get_datatype_size(SL::DataType p_type) {
ERR_FAIL_V(0);
}
+static String _interpstr(SL::DataInterpolation p_interp) {
+
+ switch (p_interp) {
+ case SL::INTERPOLATION_FLAT: return "flat ";
+ case SL::INTERPOLATION_NO_PERSPECTIVE: return "noperspective ";
+ case SL::INTERPOLATION_SMOOTH: return "smooth ";
+ }
+ return "";
+}
+
static String _prestr(SL::DataPrecision p_pres) {
switch (p_pres) {
@@ -383,12 +393,13 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
for (Map<StringName, SL::ShaderNode::Varying>::Element *E = pnode->varyings.front(); E; E = E->next()) {
String vcode;
+ String interp_mode = _interpstr(E->get().interpolation);
vcode += _prestr(E->get().precission);
vcode += _typestr(E->get().type);
vcode += " " + _mkid(E->key());
vcode += ";\n";
- r_gen_code.vertex_global += "out " + vcode;
- r_gen_code.fragment_global += "in " + vcode;
+ r_gen_code.vertex_global += interp_mode + "out " + vcode;
+ r_gen_code.fragment_global += interp_mode + "in " + vcode;
}
Map<StringName, String> function_code;