From b6c421b0bbc9c8c94ee93a34bd1d5d3301c9c6f5 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 8 Feb 2024 14:05:01 -0800 Subject: [PATCH] fix glClearBufferData on non nvidia gpus glClearBufferData generates GL_INVALID_OPERATION on Intel GPUs if the format parameter is GL_RED instead of GL_RED_INTEGER. --- src/radix_sort.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/radix_sort.hpp b/src/radix_sort.hpp index d7523fe..06997a9 100644 --- a/src/radix_sort.hpp +++ b/src/radix_sort.hpp @@ -281,10 +281,10 @@ namespace rgc::radix_sort // ------------------------------------------------------------------------------------------------ glBindBuffer(GL_SHADER_STORAGE_BUFFER, m_glob_counts_buf); - glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R32UI, GL_RED, GL_UNSIGNED_INT, &k_zero); + glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT, &k_zero); glBindBuffer(GL_SHADER_STORAGE_BUFFER, m_local_offsets_buf); - glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R32UI, GL_RED, GL_UNSIGNED_INT, &k_zero); + glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT, &k_zero); // ------------------------------------------------------------------------------------------------ // Counting