summaryrefslogtreecommitdiff
path: root/drivers/gles3/shader_gles3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/shader_gles3.cpp')
-rw-r--r--drivers/gles3/shader_gles3.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp
index 1c946895a5..e356fa8c1f 100644
--- a/drivers/gles3/shader_gles3.cpp
+++ b/drivers/gles3/shader_gles3.cpp
@@ -165,6 +165,7 @@ void ShaderGLES3::_build_variant_code(StringBuilder &builder, uint32_t p_variant
builder.append("\n"); //make sure defines begin at newline
builder.append(general_defines.get_data());
builder.append(variant_defines[p_variant]);
+ builder.append("\n");
for (int j = 0; j < p_version->custom_defines.size(); j++) {
builder.append(p_version->custom_defines[j].get_data());
}
@@ -327,7 +328,7 @@ void ShaderGLES3::_compile_specialization(Version::Specialization &spec, uint32_
glDeleteProgram(spec.id);
spec.id = 0;
- ERR_PRINT("No OpenGL program link log. What the frick?");
+ ERR_PRINT("No OpenGL program link log. Something is wrong.");
ERR_FAIL();
}
@@ -552,9 +553,11 @@ void ShaderGLES3::_clear_version(Version *p_version) {
for (int i = 0; i < variant_count; i++) {
for (OAHashMap<uint64_t, Version::Specialization>::Iterator it = p_version->variants[i].iter(); it.valid; it = p_version->variants[i].next_iter(it)) {
- glDeleteShader(it.value->vert_id);
- glDeleteShader(it.value->frag_id);
- glDeleteProgram(it.value->id);
+ if (it.value->id != 0) {
+ glDeleteShader(it.value->vert_id);
+ glDeleteShader(it.value->frag_id);
+ glDeleteProgram(it.value->id);
+ }
}
}