- assert(shader_it != program_shaders.end());
-
- glDeleteShader(shader_it->second.vs_obj);
- glDeleteShader(shader_it->second.fs_obj);
- program_shaders.erase(shader_it);
+ if (shader_it == program_shaders.end()) {
+ // Should be a compute shader.
+ map<GLuint, ComputeShaderSpec>::iterator compute_shader_it =
+ compute_program_shaders.find(glsl_program_num);
+ assert(compute_shader_it != compute_program_shaders.end());
+
+ glDeleteShader(compute_shader_it->second.cs_obj);
+ compute_program_shaders.erase(compute_shader_it);
+ } else {
+ glDeleteShader(shader_it->second.vs_obj);
+ glDeleteShader(shader_it->second.fs_obj);
+ program_shaders.erase(shader_it);
+ }