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
parent 276337cb
...@@ -1650,17 +1650,44 @@ void Renderer11::markAllStateDirty() ...@@ -1650,17 +1650,44 @@ void Renderer11::markAllStateDirty()
mDepthStencilInitialized = false; mDepthStencilInitialized = false;
mRenderTargetDescInitialized = false; mRenderTargetDescInitialized = false;
bool clearVertexTextureResources = false;
for (int i = 0; i < gl::IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS; i++) for (int i = 0; i < gl::IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS; i++)
{ {
if (mCurVertexTextureSerials[i] != 0)
{
clearVertexTextureResources = true;
}
mForceSetVertexSamplerStates[i] = true; mForceSetVertexSamplerStates[i] = true;
mCurVertexTextureSerials[i] = 0; 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++) for (int i = 0; i < gl::MAX_TEXTURE_IMAGE_UNITS; i++)
{ {
if (mCurPixelTextureSerials[i] != 0)
{
clearPixelTextureResources = true;
}
mForceSetPixelSamplerStates[i] = true; mForceSetPixelSamplerStates[i] = true;
mCurPixelTextureSerials[i] = 0; 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; mForceSetBlendState = true;
mForceSetRasterState = true; mForceSetRasterState = true;
mForceSetDepthStencilState = true; mForceSetDepthStencilState = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment