mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 18:05:51 -04:00
log shader code on error
This commit is contained in:
parent
29838bd5d3
commit
3f30134896
@ -12,7 +12,10 @@
|
||||
*/
|
||||
package de.bixilon.minosoft.gui.rendering.exceptions
|
||||
|
||||
import de.bixilon.minosoft.config.StaticConfiguration
|
||||
|
||||
class ShaderLoadingException : Exception {
|
||||
constructor()
|
||||
constructor(message: String) : super(message)
|
||||
constructor(message: String, code: String) : super(message + if (StaticConfiguration.DEBUG_MODE) "\n\n\n" + code else "")
|
||||
}
|
||||
|
@ -53,12 +53,13 @@ class OpenGLNativeShader(
|
||||
throw ShaderLoadingException()
|
||||
}
|
||||
|
||||
glShaderSource(program, code.code)
|
||||
val glsl = code.code
|
||||
glShaderSource(program, glsl)
|
||||
|
||||
glCompileShader(program)
|
||||
|
||||
if (glGetShaderi(program, GL_COMPILE_STATUS) == GL_FALSE) {
|
||||
throw ShaderLoadingException(getShaderInfoLog(program))
|
||||
throw ShaderLoadingException(getShaderInfoLog(program), glsl)
|
||||
}
|
||||
|
||||
return program
|
||||
|
Loading…
x
Reference in New Issue
Block a user