3

I am using Cubemaps in my renderer and have TextureCubeMapSeamless enabled to filter between the 6 images. Works fine. Currently I am experimenting with ARB_bindless_texture on sampler2D. My problem is that as soon as I make use of this extension, that could be declaring a UBO with sampler2D[] in it or doing an explicit cast to sampler2D, TextureCubeMapSeamless gets disabled and I have visible lines between the Cubemap images. Now bindless texture itself works just like expected. I can read from the sampler2D and the output is the same as with a "normal" texture.

My question would be: How can I use ARB_bindless_texture on sampler2D and have TextureCubeMapSeamless enabled at the same time? Is it a driver bug, they seem somewhat unrelated to me?

BoyBaykiller
  • 109
  • 1
  • 7
  • 1
    Your question makes no sense. Seamless cubemapping applies... to *cube maps*. Not to `sampler2D`; cubemaps come from `samplerCube`. – Nicol Bolas Aug 11 '21 at 13:24
  • I know that seamless cubemapping only applies to cubemaps, obviously. However it gets disabled as soon as I start to use sampler2D (not a samplerCube) as a bindless texture. I can sample from both of the textures sampler2D (bindless) and samplerCube (uniform). But because Seamless cubemapping is disabled I get these unfiltered lines between my cubemap images. – BoyBaykiller Aug 11 '21 at 14:19
  • If you're using bindless textures for 2D textures, why not for cubemaps too? – Nicol Bolas Aug 11 '21 at 15:11
  • Because in the [documenation](https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_bindless_texture.txt) for ARB_bindless_texture it says: _When accessing cube map textures using texture handles, the seamless cube map enable is ignored and treated as disabled._ I tried it out anyways and the result was as expected. But the main question is why does it get disabled when I am NOT accessing a cubemap via a texture handle, but a simple uniform? – BoyBaykiller Aug 11 '21 at 17:12

1 Answers1

2

As far as I can tell, this is not the intended behavior, but people who need bindless are less likely to conditionally use bindless vs. a regular uniform based on seamless cubemap texturing. So that's likely why the bug came into being; nobody noticed it.

That being said, I would suggest switching to ARB/AMD_seamless_cubemap_per_texture. This seamless cubemap field is respected by bindless texturing. The ARB version is pretty widely implemented, particularly since you're using bindless.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • Hm ok. Not quite sure how to make use of one of these extensions, but I guess I'll figure it out. Thanks. – BoyBaykiller Aug 11 '21 at 18:34
  • @JulianStambuk: You managed to use bindless texturing successfully. I think you can handle a single new enumerator for in `glTexture/SamplerParameter`. – Nicol Bolas Aug 11 '21 at 18:37
  • Turns out I can with: `GL.TexParameter(TextureTarget, (TextureParameterName)All.TextureCubeMapSeamless, 1);` – BoyBaykiller Aug 11 '21 at 19:03
  • @JulianStambuk: Oh, right, you're using C#. That does make things a bit more complicated, but yes, that should work. – Nicol Bolas Aug 11 '21 at 19:04