Hi,
I’m using the NV Command List extension and have some questions about the use of uniform buffers together with glDrawCommandsNV. According to the spec. it says (about glDrawCommandsNV) that:
“The current binding state of vertex, element and uniform buffers will not be effective but must be set via commands within the buffer, other state will however be inherited from the current OpenGL context.”
As I read it, I then have to supply anything related to the uniform buffers (bindless/address) in the command/token buffer? I have done that and it works great!
Now, I’ve also tried to skip adding anything related to uniform buffers in the command/token buffer and instead used a “regular” OpenGL approach for the uniform buffers (just glBindBufferBase(GL_UNIFORM_BUFFER,…), NO glEnableClientState(GL_UNIFORM_BUFFER_UNIFIED_NV), and NO layout(commandBindableNV) uniform in the shader) and that seems to also work well. My question is now, is this going to be consistent behaviour? Or did I just get lucky because there are some fallback mechanisms in the driver or something?
The reason I’m asking is that I want to re-use the same command/token buffer when rendering depth textures for shadows, but my shader for doing that has different content/size/number of uniform buffers in that case, so if I must supply uniform buffer information through the command/token buffer I will have to create a separate command/token buffer for that case. I know that I can probably do some kung-fu to make re-use possible anyway, but I wanted to fully understand the behaviour.
So, to summarize: Can I use a “regular” OpenGL approach for uniform buffers (no command/token/bindless/address) together with glDrawCommandsNV? I know that the spec. says that default-block uniforms works, but I’m not sure about uniform buffers. It does work, but can I rely on it?
Also, just to clarify, this is how I typically use the uniform buffer(s) it in the shader:
struct UBOUniformData
{
mat4 viewMatrix;
mat4 viewProjMatrix;
vec4 lightDirWS;
};
layout(std140, binding=1) uniform UBOUniformDataBuffer {
UBOUniformData uboUniforms;
};
Thanks,
Mikael