Map SRVs of dynamic buffers with NO_OVERWRITE

Started by
4 comments, last by Ponkx 8 years, 11 months ago

Hello,

according to the documentation it should be possible to map SRVs of dynamic buffers with NO_OVERWRITE in D3D11.1. Does it mean, that it is possible to map contents of the texture with NO_OVERWRITE? But when I try to map 3d texture resource, it returns error E_INVALIDARG, and this debug information:

D3D11 ERROR: ID3D11DeviceContext::Map: Map cannot be called with MAP_WRITE_NO_OVERWRITE access, because it can only be used by D3D11_USAGE_DYNAMIC Resources which were created with GPU Input BindFlags that were restricted to only D3D11_BIND_VERTEX_BUFFER and D3D11_BIND_INDEX_BUFFER. Buffer resources created with bind flag D3D11_BIND_CONSTANT_BUFFER or D3D11_BIND_SHADER_RESOURCE also support MAP_WRITE_NO_OVERWRITE access when supported by the driver (when CheckFeatureSupport with D3D11_FEATURE_D3D11_OPTIONS returns D3D11_FEATURE_DATA_D3D11_OPTIONS.MapNoOverwriteOnDynamicConstantBuffer = TRUE or D3D11_FEATURE_DATA_D3D11_OPTIONS.MapNoOverwriteOnDynamicBufferSRV = TRUE, as appropriate). [ RESOURCE_MANIPULATION ERROR #2097210: RESOURCE_MAP_INVALIDMAPTYPE]

I was checking these flags (D3D11_FEATURE_DATA_D3D11_OPTIONS.MapNoOverwriteOnDynamicConstantBuffer and D3D11_FEATURE_DATA_D3D11_OPTIONS.MapNoOverwriteOnDynamicBufferSRV) and both returns true. Also, map doesnt accept ID3D11ShaderResourceView parameter.

Does anyone know how to map it?

Thanks, Michal.

Advertisement

Did you create it with CreateTexture3D or CreateBuffer? My understanding of the documentation is that it's only valid if you create it with CreateBuffer and D3D11_BIND_SHADER_RESOURCE.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

In addition to what mhagain said (it only works for resources created with CreateBuffer); D3D11.1 requires Windows 8.1

If you're on Windows 8, 7 or lower, you will get this error.

The third thing to watch out for is that you're actually using a D3D11.1 device context. It's not enough to take D3D11 code, run it on Windows 8.1, and expect that D3D11.1 features will work; you must successfully obtain a D3D11.1 context using QueryInterface with __uuidof (ID3D11DeviceContext1) before you can do stuff.

See http://blogs.msdn.com/b/chuckw/archive/2014/02/05/anatomy-of-direct3d-11-create-device.aspx for more info (paying particular attention to the section headed "Direct3D 11.1").

Your error message - particularly the part giving the call that generates the error: ID3D11DeviceContext::Map - suggests that you haven't done this (I would expect to see ID3D11DeviceContext1::Map here instead if you had - assuming that it even threw an error).

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Oh, I see. Thanks for your sugestions, I created it with CreateTexture3D. I'll try to change the code..

Hello, I changed the code and with CreateBuffer it works fine. One strange thing is, that it works even when I initialize DX as 11.0 only. (I'm using Win 8.1)

This topic is closed to new replies.

Advertisement