Skip to content

Commit

Permalink
Merge pull request IrisShaders#981 from maximumpower55/1.16/detach-sh…
Browse files Browse the repository at this point in the history
…aders

Detach shaders from program after linking
  • Loading branch information
coderbot16 authored Nov 22, 2021
2 parents 88442e0 + 76ee6fc commit 552eae3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/net/coderbot/iris/gl/shader/ProgramCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public static int create(String name, GlShader... shaders) {

GL20C.glLinkProgram(program);

//Always detach shaders according to https://www.khronos.org/opengl/wiki/Shader_Compilation#Cleanup
for (GlShader shader : shaders) {
GL20C.glDetachShader(program, shader.getHandle());
}

String log = GL20C.glGetProgramInfoLog(program);

if (!log.isEmpty()) {
Expand Down

0 comments on commit 552eae3

Please sign in to comment.