Help me to make work D2D with D3D11

Started by
16 comments, last by BlackJoker 11 years, 1 month ago
I suggest you enable the directx debug runtimes and fix all the errors it reports. There are several of them
Advertisement

Ok, but coul you explain how I can do this, please? If you mean D3D11_CREATE_DEVICE_DEBUG in CreateDeviceAnSwapChain, I have already activated debug, but I can`t see any error of DirectX

See here for instructions: http://blog.rthand.com/post/2010/10/25/Capture-DirectX-1011-debug-output-to-Visual-Studio.aspx

I think you need to add the application to the list before D3D11_CREATE_DEVICE_DEBUG has any effect

OK, thanks. In output message I found 3 errors:

D3D11 ERROR: ID3D11DeviceContext::UpdateSubresource: Can only invoke UpdateSubresource when the destination Resource was created with D3D11_USAGE_DEFAULT and is not a multisampled Resource. The destination Resource has (1) samples. [ RESOURCE_MANIPULATION ERROR #289: UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE]

D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. Semantic 'NORMAL' is defined for mismatched hardware registers between the output stage and input stage. [ EXECUTION ERROR #343: DEVICE_SHADER_LINKAGE_REGISTERINDEX]

D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. Semantic 'TEXCOORD' is defined for mismatched hardware registers between the output stage and input stage. [ EXECUTION ERROR #343: DEVICE_SHADER_LINKAGE_REGISTERINDEX]

Could you please explain what does they mean?

Your matrix buffer needs to be created with D3D11_USAGE_DEFAULT instead of dynamic. The 2nd and 3rd are the same error. Your PixelInputType structs don't match in your two shaders

After I set matrix buffer usage DEFAULT I get 2 different erros for DarwInexed method

D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: A Vertex Shader is always required when drawing, but none is currently bound. [ EXECUTION ERROR #341: DEVICE_DRAW_VERTEX_SHADER_NOT_SET]

D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Rasterization Unit is enabled (PixelShader is not NULL or Depth/Stencil test is enabled and RasterizedStream is not

D3D11_SO_NO_RASTERIZED_STREAM) but position is not provided by the last shader before the Rasterization Unit. [ EXECUTION ERROR #362: DEVICE_DRAW_POSITION_NOT_PRESENT]

OMG, I see a huge amount of errors in my project and this scares me a lot

OK, I fixed almost all erors except one:

D3D11 ERROR: ID3D11DeviceContext::UpdateSubresource: Can only invoke UpdateSubresource when the destination Resource was created with D3D11_USAGE_DEFAULT and is not a multisampled Resource. The destination Resource has (1) samples. [ RESOURCE_MANIPULATION ERROR #289: UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE]

I have dynamic matrix buffer when I initialize shaders and it is ok - no errors,

My vertex and index buffers are also dynamic by the way.

but if i make matrix buffer usage DEFAULT, during call Map function it returns error.

So, I can`t understand what I need to do to fix this error.

I forgot to mention that error apprears when executing this method:

d3d11_DeviceContext->UpdateSubresource(matrixBuffer, 0, NULL, &cbPerObj, 0, 0);

update:

I found out how to use D2D1_1 with D3D11 with help of jrh2365 and I think that this hack with creating 2 devices no longer needed.

If you want, look theme http://www.gamedev.net/topic/639578-d2d-d3d11-help-me-to-make-them-work-together/?p=5037982

This topic is closed to new replies.

Advertisement