OpenGL.Net icon indicating copy to clipboard operation
OpenGL.Net copied to clipboard

GL_ARB_bindless_texture Object reference not set

Open Rosux opened this issue 1 year ago • 1 comments

I want to use bindless textures but any attempt at calling a bindless_texture method results in this error and then just crashes the program:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at OpenGL.Gl.GetTextureHandleARB(UInt32 texture)

I cant find any reason as to why this happens since my extensions does include the GL_ARB_bindless_texture.

code i used:

uint textureId = Gl.GenTexture();`
Gl.BindTexture(TextureTarget.Texture2d, textureId);

Gl.TexImage2D(TextureTarget.Texture2d, 0, InternalFormat.Rgba, 2, 2, 0, PixelFormat.Rgba, PixelType.UnsignedByte, new byte[] {0, 0, 0, 255, 255, 0, 255, 255, 255, 0, 255, 255, 0, 0, 0, 255});

Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMagFilter, Gl.NEAREST);
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMinFilter, Gl.NEAREST);

Gl.GetTextureHandleARB(textureId);

GLFW initialization settings:

Glfw.WindowHint(Hint.ClientApi, ClientApi.OpenGL);
Glfw.WindowHint(Hint.ContextVersionMajor, 4);
Glfw.WindowHint(Hint.ContextVersionMinor, 6);
Glfw.WindowHint(Hint.OpenglProfile, Profile.Compatibility);
Glfw.WindowHint(Hint.Doublebuffer, true);

my question is, is this method implemented? am i missing something?

Rosux avatar Apr 18 '24 00:04 Rosux