Skip to content

Instantly share code, notes, and snippets.

@BoyBaykiller
BoyBaykiller / AmdPerformanceglPushDebugGroup.md
Last active March 9, 2025 05:21
OpenGL Performance Issue: Cpu-Time for glPushDebugGroup is unreasonably long

Calling glPushDebugGroup can easily introduce performance issues. The following loop with 50 iterations takes 22ms!

int main()
{
    glfwInit();
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);
 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
@BoyBaykiller
BoyBaykiller / AmdBindlessSamplingCrash.md
Last active March 9, 2025 05:22
OpenGL Bug: Very simple shader sampling a texture and using Bindless Textures causes crash

Running this very simple shader causes a freeze for a few seconds and ultimately some kind of driver reset. This bug does not happen on latest public driver (24.3.1)!

Here is the shader code to reproduce it:

#version 460 core
#extension GL_ARB_bindless_texture : require

layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
@BoyBaykiller
BoyBaykiller / AmdBindlessCompressedLodArtifacts.md
Last active March 9, 2025 05:22
OpenGL Bug Generating Mipmap after getting TextureHandle causes texture sampling to return black at any other Lod than 0 if compressed format is used

High level steps to reproduce:

  • Create a valid 2D Texture with compressed internal format

  • Upload some pixels

  • Generate a bindless texture handle

  • Generate a mipmap for the texture

@BoyBaykiller
BoyBaykiller / AmdEXT_shader_image_load_formattedNotReported.md
Last active March 9, 2025 05:22
OpenGL Bug: GL_EXT_shader_image_load_formatted extension not reported even though its implemented

I can require and use GL_EXT_shader_image_load_formatted in OpenGL-GLSL shaders without any problems:

#extension GL_EXT_shader_image_load_formatted : require
layout(binding = 0) restrict uniform image2D ImgResult;

However on the client side the extension is not reported when asking for it like this:

GLint numExt;
glGetIntegerv(GL_NUM_EXTENSIONS, &numExt);
@BoyBaykiller
BoyBaykiller / boxTriangleIntersect.glsl
Last active October 27, 2023 03:00
Box vs Triangle Intersection test GLSL
float Min3(float a, float b, float c)
{
return min(a, min(b, c));
}
float Max3(float a, float b, float c)
{
return max(a, max(b, c));
}