소스 검색

Fix potential crash with D3D11

rextimmy 8 년 전
부모
커밋
5f69ab1264
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 1
      Engine/source/gfx/D3D11/gfxD3D11Device.cpp
  2. 0 1
      Engine/source/gfx/D3D11/gfxD3D11Device.h

+ 3 - 1
Engine/source/gfx/D3D11/gfxD3D11Device.cpp

@@ -824,7 +824,9 @@ void GFXD3D11Device::reset(DXGI_SWAP_CHAIN_DESC &d3dpp)
 
    // Now re aquire all the resources we trashed earlier
    reacquireDefaultPoolResources();
-
+   //set last bound shaders
+   mD3DDeviceContext->PSSetShader(mLastPixShader, NULL, 0);
+   mD3DDeviceContext->VSSetShader(mLastVertShader, NULL, 0);
    // Mark everything dirty and flush to card, for sanity.
    updateStates(true);
 }

+ 0 - 1
Engine/source/gfx/D3D11/gfxD3D11Device.h

@@ -134,7 +134,6 @@ protected:
    ID3D11DeviceContext1* mD3DDeviceContext1;
    ID3DUserDefinedAnnotation* mUserAnnotation;
 
-   GFXShader* mCurrentShader;
    GFXShaderRef mGenericShader[GS_COUNT];
    GFXShaderConstBufferRef mGenericShaderBuffer[GS_COUNT];
    GFXShaderConstHandle *mModelViewProjSC[GS_COUNT];