Original Post
Hi GameDev!
I'm currently on that D3D11 with D2D thingy and there seems to be a problem with the mutexes.
When I call this code:
I get this:
from the Begin/End calls of Direct2D. Yes, that are just infos and I can disable them. But maybe they are important to fix my real problem:
The first time I call AcquireSync() on the D3D11 mutex it works well, but when it comes to the second time I get a E_INVALIDARG error. Even if the inputs didn't change since the last frame (I think so..).
Why could that be? Any ideas?
I'm currently on that D3D11 with D2D thingy and there seems to be a problem with the mutexes.
When I call this code:
//Sync the texture with D3D10 hr = SharedTexture->GetKeyedMutex10()->AcquireSync(0, INFINITE); if(FAILED(hr)) { LE(hr); return hr; } D2D.GetRenderTarget()->BeginDraw(); RenderHUD(); D2D.GetRenderTarget()->EndDraw(); hr = SharedTexture->GetKeyedMutex10()->ReleaseSync(1); if(FAILED(hr)) { LE(hr); return hr; } //Sync the texture with D3D11 and render to backbuffer hr = SharedTexture->GetKeyedMutex11()->AcquireSync(1, INFINITE); if(FAILED(hr)) { LE(hr); return hr; } ID3DX11EffectShaderResourceVariable* SRV=NULL; ScreenQuad.GetQuadShader()->GetCustomVariable(SharedTextureIdx, &SRV); if(SRV) { SRV->SetResource(SharedTexture->GetShaderResourceView()); } ScreenQuad.Render(); hr = SharedTexture->GetKeyedMutex11()->ReleaseSync(0); if(FAILED(hr)) { LE(hr); return hr; }I get this:
D3D10: INFO: ID3D10Device::IASetPrimitiveTopology: Topology value D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED is OK to set during IASetPrimitiveTopology; but will not be valid for any Draw routine. [ STATE_SETTING INFO #237: DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED ]D3D10: INFO: As many as 1 previous debug layer message(s) may be a result of restoring device state saved by D2D. [ APPLICATION_DEFINED INFO #11: STRING_FROM_APPLICATION ]D3D10: INFO: ID3D10Device::IASetPrimitiveTopology: Topology value D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED is OK to set during IASetPrimitiveTopology; but will not be valid for any Draw routine. [ STATE_SETTING INFO #237: DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED ]D3D10: INFO: ID3D10Device::IASetPrimitiveTopology: Topology value D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED is OK to set during IASetPrimitiveTopology; but will not be valid for any Draw routine. [ STATE_SETTING INFO #237: DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED ]D3D10: INFO: As many as 1 previous debug layer message(s) may be a result of restoring device state saved by D2D. [ APPLICATION_DEFINED INFO #11: STRING_FROM_APPLICATION ]D3D10: INFO: ID3D10Device::IASetPrimitiveTopology: Topology value D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED is OK to set during IASetPrimitiveTopology; but will not be valid for any Draw routine. [ STATE_SETTING INFO #237: DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED ]D3D10: INFO: As many as 1 previous debug layer message(s) may be a result of restoring device state saved by D2D. [ APPLICATION_DEFINED INFO #11: STRING_FROM_APPLICATION ]from the Begin/End calls of Direct2D. Yes, that are just infos and I can disable them. But maybe they are important to fix my real problem:
The first time I call AcquireSync() on the D3D11 mutex it works well, but when it comes to the second time I get a E_INVALIDARG error. Even if the inputs didn't change since the last frame (I think so..).
Why could that be? Any ideas?
