D3D11DynamicBuffer::map exception. D3D11_MAP_WRITE_NO_OVERWRITE problem? Topic is solved

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
rujialiu
Goblin
Posts: 296
Joined: Mon May 09, 2016 8:21 am
x 35

D3D11DynamicBuffer::map exception. D3D11_MAP_WRITE_NO_OVERWRITE problem?

Post by rujialiu »

Hi!

We're having this error on Win7, NVidia GTX 750Ti, feature level 11.0

Code: Select all

Error calling Map: invalid parameters were passed.
 in D3D11DynamicBuffer::map at C:\ogremygui\OGRE19\RenderSystems\Direct3D11\src\Vao\OgreD3D11DynamicBuffer.cpp (line 92)
Looking at the doc here https://docs.microsoft.com/en-us/window ... -d3d11_map we found that for feature level <= 11.0, D3D11_MAP_WRITE_NO_OVERWRITE can only be used for vertex/index buffer. We changed the mapping flags from D3D11_MAP_WRITE_NO_OVERWRITE to D3D11_MAP_WRITE_DISCARD and the error is gone.

Since the flag is there for a looooooong time, that means origianlly only vertex/index buffer was using DynamicBuffer? Then at some time point after we last upgraded Ogre (over a year I think), Dynamic Buffer was starting to use on some other buffers. However, none of our Win10 machines have this problem even with feature level 11.0 instead of 11.1, that means the actual driver allows this despite the doc says otherwise.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: D3D11DynamicBuffer::map exception. D3D11_MAP_WRITE_NO_OVERWRITE problem?

Post by dark_sylinc »

Hi!

createTexBuffer and createReadOnlyBuffer should be creating a D3D11CompatBufferInterface instead of a D3D11BufferInterface in this case.

This is an Ogre bug. Likely it's because we're ignoring what D3D11_FEATURE_DATA_D3D11_OPTIONS::MapNoOverwriteOnDynamicBufferSRV says.

Creating the device as FL 11.0 (instead of 11.1) should be a workaround for the time being. If the error is also happening with FL 11.0, then something wrong is going in the logic that decides whether D3D11CompatBufferInterface should be used.

Update: mReadOnlyIsTexBuffer is set when FL 11.0 is available (correct), but then D3D11VaoManager::createReadOnlyBufferImpl assumes mReadOnlyIsTexBuffer = true means FL 11.1+; this part is wrong.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: D3D11DynamicBuffer::map exception. D3D11_MAP_WRITE_NO_OVERWRITE problem?

Post by dark_sylinc »

Fixed

Thanks for the report!
rujialiu
Goblin
Posts: 296
Joined: Mon May 09, 2016 8:21 am
x 35

Re: D3D11DynamicBuffer::map exception. D3D11_MAP_WRITE_NO_OVERWRITE problem?

Post by rujialiu »

dark_sylinc wrote: Sat Feb 20, 2021 12:50 am Fixed

Thanks for the report!
Thanks! :)
Post Reply