0
\$\begingroup\$

I have a problem but I can't figure out what is happenning (I think that there is an alignment problem...), so in my OpenGL application I use bindless textures which handles are sent to the shader via an uniform buffer. Note that a handle is an unsigned int on 64 bits.

In my shaders it looks like this :

layout(std140) uniform TEXTURES {
    sampler2D tex[4]; //There not necessarely 4 textures, there can be more or less textures
};

I send the data to this buffer with an offset of index * sizeof(uint64_t) and none of the value are correctly received by the shader, only the two first values appears in Nsight when I inspect the buffer but only the first value is correct.

I tried using a shader storage buffer object but on Intel iGPUs there's too much shader storage binding at the same time, since I can't have as many SSBO bindings as I want, how could I use uniforms buffers for that purpose?

\$\endgroup\$
3
  • \$\begingroup\$ Just a guess from you seeing two values in Nsight, have you tried index * sizeof(uint32_t)? \$\endgroup\$ Commented Aug 24, 2021 at 15:29
  • \$\begingroup\$ @Tyyppi_77 I didn't, it sounds weird but I'll try \$\endgroup\$ Commented Aug 24, 2021 at 15:30
  • \$\begingroup\$ @Tyyppi_77 just tried it, it doesn't change anything (except the values received) \$\endgroup\$ Commented Aug 24, 2021 at 15:32

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.