aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/OpenGL/OpenGLTexture.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-19 02:02:20 +0200
committerhachem <im@hachem.wtf>2026-08-19 02:02:20 +0200
commitf7e05555fb4ff6d8e51bdb5734db4dab1841d593 (patch)
tree353d350b19da7b84ca11e5801d33a921407a963e /src/Platform/OpenGL/OpenGLTexture.cpp
parent5c5fc10d8938fd2da1922f01c638d42e70eb1ab1 (diff)
[feat]: migrate to slang from glsl
Diffstat (limited to 'src/Platform/OpenGL/OpenGLTexture.cpp')
-rw-r--r--src/Platform/OpenGL/OpenGLTexture.cpp6
1 files changed, 4 insertions, 2 deletions
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);