From 32fe1fc44ab53c0d9b633ad7c65a26e347916737 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Tue, 6 Feb 2024 20:07:48 +0100 Subject: [PATCH] [OpenGL] Fix compute texture bindings Fixes #851 --- .../OpenGL/Sources/kinc/backend/graphics4/compute.c.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/compute.c.h b/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/compute.c.h index 0ce647c57..5021e2643 100644 --- a/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/compute.c.h +++ b/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/compute.c.h @@ -182,6 +182,11 @@ void kinc_g4_set_compute_shader(kinc_g4_compute_shader *shader) { #ifdef HAS_COMPUTE glUseProgram(shader->impl._programid); glCheckErrors(); + + for (int index = 0; index < shader->impl.textureCount; ++index) { + glUniform1i(shader->impl.textureValues[index], index); + glCheckErrors(); + } #endif }