Help me to make work D2D with D3D11
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
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?
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]
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