glCopyNamedBufferSubData fails with persistently mapped buffer

I want to do the following:

glCopyNamedBufferSubData(pSSBO, pSSBOLocal, 0, 0, GetElementStride() * elementCount);

pSSBO is a regular GPU side SSBO and pSSBOLocal is a CPU side persistently mapped, immutable storage buffer. They have been created like this:

glNamedBufferData(pSSBO, size, nullptr, GL_DYNAMIC_DRAW));

glNamedBufferStorage(pSSBOLocal, size, nullptr, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT | GL_CLIENT_STORAGE_BIT));
pPersistentMapped = glMapNamedBufferRange(pSSBOLocal, 0, size, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT));

On Linux using an AMD driver this works. On Windows using an nVidia driver this fails at glCopyNamedBufferSubData(...) with error GL_INVALID_VALUE. I’ve verified using the specification that all conditions for GL_INVALID_VALUE are not fulfilled. Hence I think this is a driver bug or is some strange special rule applying here which is not mentioned anywhere in the specifications?

EDIT: I’ve done some more testing. On the “same” machine using “Linux” the nVidia driver does not fail for this code. Hence it is a Windows driver problem it looks like.

Hi @roland7,

thanks for bringing this to our notice!

Would you be able to share a minimal repro app with us so we can reproduce and debug in-house?

Thanks!

Not a small test case no. The application is this: GitHub - LordOfDragons/dragengine: Drag[en]gine Game Engine .

Can’t post two links in the same post.

You have to remove the temporary workaround on line dragengine/deoglSPBlockSSBO.cpp at 4299c7aab82913f2350490eca87bff2cacfd13fa · LordOfDragons/dragengine · GitHub otherwise the bug won’t show.