Fixed bug with sourcing from multiple gl shaders
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 28 Jan 2022 16:55:11 +0000 (10:55 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 28 Jan 2022 16:55:11 +0000 (10:55 -0600)
modules/opengles/onyx_opengles.c
modules/opengles/onyx_opengles.so

index ba757fcce61dfe773a63fc0fd56bb7b86bc4726d..c03b479c7861ed16c352b8d42644ca4b395c224b 100644 (file)
@@ -527,10 +527,10 @@ ONYX_GL_INT_4_PTR(glGetInternalformativ, GLint)
 
 ONYX_DEF(glShaderSource, (INT, INT, PTR, PTR), ()) {
     GLsizei count = params->data[1].of.i32;
-    int base_ptr = *(int *) ONYX_PTR(params->data[2].of.i32);
+    int* base_ptr = (int *) ONYX_PTR(params->data[2].of.i32);
     char** strs = alloca(count * sizeof(char *));
     for (int i=0; i<count; i++) {
-        strs[i] = (char *) ONYX_PTR(base_ptr + i * 4);
+        strs[i] = (char *) ONYX_PTR(*(base_ptr + i));
     }
 
     glad_glShaderSource(params->data[0].of.i32, count, strs, (GLint *) ONYX_PTR(params->data[3].of.i32));
@@ -539,10 +539,10 @@ ONYX_DEF(glShaderSource, (INT, INT, PTR, PTR), ()) {
 
 ONYX_DEF(glGetUniformIndices, (INT, INT, PTR, PTR), ()) {
     GLsizei count = params->data[1].of.i32;
-    int base_ptr = *(int *) ONYX_PTR(params->data[2].of.i32);
+    int* base_ptr = (int *) ONYX_PTR(params->data[2].of.i32);
     char** strs = alloca(count * sizeof(char *));
     for (int i=0; i<count; i++) {
-        strs[i] = (char *) ONYX_PTR(base_ptr + i * 4);
+        strs[i] = (char *) ONYX_PTR(*(base_ptr + i));
     }
     
     glad_glGetUniformIndices(params->data[0].of.i32, count, (const char *const*) strs, (int *) ONYX_PTR(params->data[3].of.i32));
index cc89c8ceae7de89bc5d293eed274a2f643a69003..2b34641b14c9c438794dd39ee4952e529eff0345 100755 (executable)
Binary files a/modules/opengles/onyx_opengles.so and b/modules/opengles/onyx_opengles.so differ