I am implementing for my paper. However, there is a vague problem which I do not know exact reason. As debugging, the windows is frozen for a while, then goes black and it stops at code which mapping a constant buffer. The constant buffer is not null, but it is data is null after mapping.
D3D11_MAPPED_SUBRESOURCE MappedResource3; HR( gpImmediateContext->Map( mCBPS_ID, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource3 ) ); PS_CB_ID* pPSID = ( PS_CB_ID* )MappedResource3.pData; char DebugString; sprintf_s(DebugString,"ID_constant buffer is: %p\n", mCBPS_ID); OutputDebugString(DebugString); pPSID->g_iID = 0; // pPSID is null gpImmediateContext->Unmap( mCBPS_ID, 0 ); gpImmediateContext->PSSetConstantBuffers( 3, 1, &mCBPS_ID );
Have anybody experienced this problem before? Please, help me. Thanks in advanced