Clear all applied texture resources in Renderer11::markAllStateDirty.

This fixes some D3D11 warnings about having the current render target bound to a shader resource view.

Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1934 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index 66a2838..4ca5285 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -1650,17 +1650,44 @@
     mDepthStencilInitialized = false;
     mRenderTargetDescInitialized = false;
 
+    bool clearVertexTextureResources = false;
+
     for (int i = 0; i < gl::IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS; i++)
     {
+        if (mCurVertexTextureSerials[i] != 0)
+        {
+            clearVertexTextureResources = true;
+        }
+
         mForceSetVertexSamplerStates[i] = true;
         mCurVertexTextureSerials[i] = 0;
     }
+
+    if (clearVertexTextureResources && mDeviceContext)
+    {
+        ID3D11ShaderResourceView *nullSRVs[gl::IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS] = {0};
+        mDeviceContext->VSSetShaderResources(0, getMaxVertexTextureImageUnits(), nullSRVs);
+    }
+
+    bool clearPixelTextureResources = false;
+
     for (int i = 0; i < gl::MAX_TEXTURE_IMAGE_UNITS; i++)
     {
+        if (mCurPixelTextureSerials[i] != 0)
+        {
+            clearPixelTextureResources = true;
+        }
+
         mForceSetPixelSamplerStates[i] = true;
         mCurPixelTextureSerials[i] = 0;
     }
 
+    if (clearPixelTextureResources && mDeviceContext)
+    {
+        ID3D11ShaderResourceView *nullSRVs[gl::MAX_TEXTURE_IMAGE_UNITS] = {0};
+        mDeviceContext->PSSetShaderResources(0, gl::MAX_TEXTURE_IMAGE_UNITS, nullSRVs);
+    }
+
     mForceSetBlendState = true;
     mForceSetRasterState = true;
     mForceSetDepthStencilState = true;