Skip to content

Commit

Permalink
Merge pull request #88573 from Arthas92t/master
Browse files Browse the repository at this point in the history
Fix shader cache with transform feedback on some Android devices
  • Loading branch information
akien-mga authored Feb 21, 2024
2 parents aeaec00 + d31d3e5 commit 04c71d9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/gles3/shader_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 04c71d9

Please sign in to comment.