Merge pull request #77163 from ChibiDenDen/gles_verify_shader_cache

Verify that GLES3 cached shader load is successful
This commit is contained in:
Rémi Verschelde 2023-05-17 19:11:28 +02:00
commit 72e98fc8e4
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 7 additions and 0 deletions

View File

@ -564,6 +564,13 @@ bool ShaderGLES3::_load_from_cache(Version *p_version) {
specialization.id = glCreateProgram();
glProgramBinary(specialization.id, variant_format, variant_bytes.ptr(), variant_bytes.size());
GLint link_status = 0;
glGetProgramiv(specialization.id, GL_LINK_STATUS, &link_status);
if (link_status != GL_TRUE) {
WARN_PRINT_ONCE("Failed to load cached shader, recompiling.");
return false;
}
_get_uniform_locations(specialization, p_version);
specialization.ok = true;