From 974460b0723c4ab550779fbc46fb88f4cf6cac41 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 24 Jun 2023 13:26:43 +0200 Subject: [PATCH] REVIEWED: `rlLoadShaderBuffer()` #3104 --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index a104175c..470295b0 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -4143,7 +4143,7 @@ unsigned int rlLoadShaderBuffer(unsigned int size, const void *data, int usageHi glGenBuffers(1, &ssbo); glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo); glBufferData(GL_SHADER_STORAGE_BUFFER, size, data, usageHint? usageHint : RL_STREAM_COPY); - glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, 0); + if (data == NULL) glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, NULL); // Clear buffer data to 0 glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0); #endif