From f7e05555fb4ff6d8e51bdb5734db4dab1841d593 Mon Sep 17 00:00:00 2001 From: hachem Date: Wed, 19 Aug 2026 02:02:20 +0200 Subject: [feat]: migrate to slang from glsl --- src/Platform/OpenGL/OpenGLTexture.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Platform/OpenGL/OpenGLTexture.cpp') diff --git a/src/Platform/OpenGL/OpenGLTexture.cpp b/src/Platform/OpenGL/OpenGLTexture.cpp index 1895575..16892c6 100644 --- a/src/Platform/OpenGL/OpenGLTexture.cpp +++ b/src/Platform/OpenGL/OpenGLTexture.cpp @@ -225,7 +225,9 @@ namespace Donut glUseProgram(shaderProgram); glUniform1i(glGetUniformLocation(shaderProgram, "u_EquirectangularMap"), 0); - glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "u_Projection"), 1, GL_FALSE, &captureProjection[0][0]); + // EquirectToCubemap is authored in Slang (row-major); transpose glm's + // column-major matrices on upload (GL_TRUE) to match. + glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "u_Projection"), 1, GL_TRUE, &captureProjection[0][0]); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, hdrTexture); @@ -233,7 +235,7 @@ namespace Donut glBindFramebuffer(GL_FRAMEBUFFER, captureFBO); for (unsigned int i = 0; i < 6; ++i) { - glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "u_View"), 1, GL_FALSE, &captureViews[i][0][0]); + glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "u_View"), 1, GL_TRUE, &captureViews[i][0][0]); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, m_RendererID, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBindVertexArray(cubeVAO); -- cgit v1.3