(D3D) Some fixes to render_chain.cpp and d3d_wrapper.c