Issue: glbindbufferrange GL_INVALID_VALUE in SDK 2019 R1

I’m trying to use glbindbufferrange to GL_Uniform_buffer, it continue throw out the GL_INVALID_VALUE, even though i’ve already follow the gles rule, such as offset is a multiple of GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, etc. Here is my test code:

        GLint uniformBufferAlignSize = 0;
		glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT,&uniformBufferAlignSize);
        GLuint res = 0;
		glGenBuffers(1, &res);
		glBindBuffer(GL_UNIFORM_BUFFER, res);
		CheckOpenGLES3Error(""); --- no error
		glBufferData(GL_UNIFORM_BUFFER, 10 * uniformBufferAlignSize, NULL, GL_DYNAMIC_DRAW);
		CheckOpenGLES3Error(""); -- noerror
		glBindBufferRange(GL_UNIFORM_BUFFER, 1, res, 0, uniformBufferAlignSize);
		CheckOpenGLES3Error(""); -- GL_INVALID_VALUE
		glBindBufferRange(GL_UNIFORM_BUFFER, 1, res, uniformBufferAlignSize, uniformBufferAlignSize);
		CheckOpenGLES3Error(""); -- GL_INVALID_VALUE

any solution? still waiting for the response. Thanks

Hi,

can you please tell me a bit about the environment where you are trying to run this?
what value do you get for uniformBufferAlignSize?

thanks,
Marton

I’m running this on windows 10, with nvidia gtx1060.
the uniformBufferAlignSize is 256

I’v tested this code, it works fine and no error throwed on adreno 540 device