fix crash with invalid frag dynamic shaders

This commit is contained in:
Vaxry 2022-12-01 13:40:05 +00:00
parent 7b020ffa84
commit 39a4f82460

View file

@ -31,7 +31,7 @@ CHyprOpenGLImpl::CHyprOpenGLImpl() {
} }
GLuint CHyprOpenGLImpl::createProgram(const std::string& vert, const std::string& frag, bool dynamic) { GLuint CHyprOpenGLImpl::createProgram(const std::string& vert, const std::string& frag, bool dynamic) {
auto vertCompiled = compileShader(GL_VERTEX_SHADER, vert); auto vertCompiled = compileShader(GL_VERTEX_SHADER, vert, dynamic);
if (dynamic) { if (dynamic) {
if (vertCompiled == 0) if (vertCompiled == 0)
return 0; return 0;
@ -39,7 +39,7 @@ GLuint CHyprOpenGLImpl::createProgram(const std::string& vert, const std::string
RASSERT(vertCompiled, "Compiling shader failed. VERTEX NULL! Shader source:\n\n%s", vert.c_str()); RASSERT(vertCompiled, "Compiling shader failed. VERTEX NULL! Shader source:\n\n%s", vert.c_str());
} }
auto fragCompiled = compileShader(GL_FRAGMENT_SHADER, frag); auto fragCompiled = compileShader(GL_FRAGMENT_SHADER, frag, dynamic);
if (dynamic) { if (dynamic) {
if (fragCompiled == 0) if (fragCompiled == 0)
return 0; return 0;