diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp index 75b2662a1c07..5c2337a91adb 100644 --- a/drivers/gles3/shader_gles3.cpp +++ b/drivers/gles3/shader_gles3.cpp @@ -584,6 +584,19 @@ bool ShaderGLES3::_load_from_cache(Version *p_version) { Version::Specialization specialization; specialization.id = glCreateProgram(); + if (feedback_count) { + Vector feedback; + for (int i = 0; i < feedback_count; i++) { + if (feedbacks[i].specialization == 0 || (feedbacks[i].specialization & specialization_key)) { + // Specialization for this feedback is enabled + feedback.push_back(feedbacks[i].name); + } + } + + if (feedback.size()) { + glTransformFeedbackVaryings(specialization.id, feedback.size(), feedback.ptr(), GL_INTERLEAVED_ATTRIBS); + } + } glProgramBinary(specialization.id, variant_format, variant_bytes.ptr(), variant_bytes.size()); GLint link_status = 0;