Skip to content

Instantly share code, notes, and snippets.

@alaingalvan
Last active December 27, 2023 20:51
Show Gist options
  • Save alaingalvan/38f4e315f922371bf8062a42d52eb802 to your computer and use it in GitHub Desktop.
Save alaingalvan/38f4e315f922371bf8062a42d52eb802 to your computer and use it in GitHub Desktop.
void printOpenGLDebugInfo()
{
int majorVersion, minorVersion;
glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
std::cout << "OpenGL Version: " << majorVersion << "." << minorVersion
<< std::endl;
int work_grp_cnt[3];
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &work_grp_cnt[0]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, &work_grp_cnt[1]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, &work_grp_cnt[2]);
std::cout << "max global (total) work group size x: " << work_grp_cnt[0]
<< " y: " << work_grp_cnt[1] << " z: " << work_grp_cnt[2]
<< std::endl;
int work_grp_size[3];
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &work_grp_size[0]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1, &work_grp_size[1]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2, &work_grp_size[2]);
std::cout << "max local (in one shader) work group sizes x:"
<< work_grp_size[0] << " y: " << work_grp_size[1]
<< " z: " << work_grp_size[2] << std::endl;
int work_grp_inv;
glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &work_grp_inv);
std::cout << "max local work group invocations: " << work_grp_inv
<< std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment