summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArthasMenethil <dinobot92t@gmail.com>2024-02-20 20:24:05 +0700
committerArthasMenethil <dinobot92t@gmail.com>2024-02-21 07:31:40 +0700
commitd31d3e503e2a0b5719f6de57b2b350ed7b4160a0 (patch)
tree0924916242321713b866d798d566fdb8c41fe791 /drivers
parentb7145638d5b235e8e1b2fe039a0cee48a4bbb26d (diff)
downloadredot-engine-d31d3e503e2a0b5719f6de57b2b350ed7b4160a0.tar.gz
Fix shader cache with transform feedback on some android devices
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/shader_gles3.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp
index 551136ce36..43b146152d 100644
--- a/drivers/gles3/shader_gles3.cpp
+++ b/drivers/gles3/shader_gles3.cpp
@@ -585,6 +585,19 @@ bool ShaderGLES3::_load_from_cache(Version *p_version) {
Version::Specialization specialization;
specialization.id = glCreateProgram();
+ if (feedback_count) {
+ Vector<const char *> feedback;
+ for (int feedback_index = 0; feedback_index < feedback_count; feedback_index++) {
+ if (feedbacks[feedback_index].specialization == 0 || (feedbacks[feedback_index].specialization & specialization_key)) {
+ // Specialization for this feedback is enabled.
+ feedback.push_back(feedbacks[feedback_index].name);
+ }
+ }
+
+ if (!feedback.is_empty()) {
+ 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;