mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 02:15:34 -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
|
package de.bixilon.minosoft.gui.rendering.exceptions
|
||||||
|
|
||||||
|
import de.bixilon.minosoft.config.StaticConfiguration
|
||||||
|
|
||||||
class ShaderLoadingException : Exception {
|
class ShaderLoadingException : Exception {
|
||||||
constructor()
|
constructor()
|
||||||
constructor(message: String) : super(message)
|
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()
|
throw ShaderLoadingException()
|
||||||
}
|
}
|
||||||
|
|
||||||
glShaderSource(program, code.code)
|
val glsl = code.code
|
||||||
|
glShaderSource(program, glsl)
|
||||||
|
|
||||||
glCompileShader(program)
|
glCompileShader(program)
|
||||||
|
|
||||||
if (glGetShaderi(program, GL_COMPILE_STATUS) == GL_FALSE) {
|
if (glGetShaderi(program, GL_COMPILE_STATUS) == GL_FALSE) {
|
||||||
throw ShaderLoadingException(getShaderInfoLog(program))
|
throw ShaderLoadingException(getShaderInfoLog(program), glsl)
|
||||||
}
|
}
|
||||||
|
|
||||||
return program
|
return program
|
||||||
|
Loading…
x
Reference in New Issue
Block a user