fix GL_INVALID_OPERATION error when compiling shader

This commit is contained in:
Moritz Zwerger 2023-12-24 16:36:43 +01:00
parent 92c9c99efc
commit 1fb2aac58e
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
6 changed files with 14 additions and 1 deletions

View File

@ -166,4 +166,10 @@ interface RenderSystem {
}
var viewport: Vec2i
fun reportErrors() {
val errors = getErrors()
if (errors.isEmpty()) return
throw Exception(errors.first().toString())
}
}

View File

@ -81,7 +81,6 @@ class OpenGLNativeShader(
defines["HAS_GEOMETRY_SHADER"] = " "
}
handler = glCreateProgram()
glUseProgram(handler)
if (handler.toLong() == MemoryUtil.NULL) {
throw ShaderLoadingException()

View File

@ -27,4 +27,6 @@ object AMDOpenGLVendor : OpenGLVendor {
override val hacks = DriverHacks.set(
DriverHacks.USE_QUADS_OVER_TRIANGLE,
)
override fun toString() = "amd"
}

View File

@ -19,4 +19,6 @@ object IntelOpenGLVendor : OpenGLVendor {
override val shaderDefine: String = "__INTEL"
override val hacks = DriverHacks.set()
override fun toString() = "intel"
}

View File

@ -31,4 +31,6 @@ object NvidiaOpenGLVendor : OpenGLVendor {
DriverHacks.UNIFORM_ARRAY_AS_ARRAY,
DriverHacks.USE_QUADS_OVER_TRIANGLE,
)
override fun toString() = "nvidia"
}

View File

@ -19,4 +19,6 @@ object OtherOpenGLVendor : OpenGLVendor {
override val shaderDefine: String = "__OTHER"
override val hacks = DriverHacks.set()
override fun toString() = "other"
}