Removes an unneeded GetDesc call from Clear

TRAC #19330 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Authored-by: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@930 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent c8d46066
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 929
#define BUILD_REVISION 930
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -2598,18 +2598,7 @@ void Context::clear(GLbitfield mask)
float depth = clamp01(mState.depthClearValue);
int stencil = mState.stencilClearValue & 0x000000FF;
IDirect3DSurface9 *renderTarget = framebufferObject->getRenderTarget();
if (!renderTarget)
{
return; // Context must be lost, return silently
}
D3DSURFACE_DESC desc;
renderTarget->GetDesc(&desc);
renderTarget->Release();
renderTarget = NULL;
bool alphaUnmasked = (dx2es::GetAlphaSize(desc.Format) == 0) || mState.colorMaskAlpha;
bool alphaUnmasked = (dx2es::GetAlphaSize(mRenderTargetDesc.Format) == 0) || mState.colorMaskAlpha;
const bool needMaskedStencilClear = (flags & D3DCLEAR_STENCIL) &&
(mState.stencilWritemask & stencilUnmasked) != stencilUnmasked;
......@@ -2710,12 +2699,12 @@ void Context::clear(GLbitfield mask)
float quad[4][4]; // A quadrilateral covering the target, aligned to match the edges
quad[0][0] = -0.5f;
quad[0][1] = desc.Height - 0.5f;
quad[0][1] = mRenderTargetDesc.Height - 0.5f;
quad[0][2] = 0.0f;
quad[0][3] = 1.0f;
quad[1][0] = desc.Width - 0.5f;
quad[1][1] = desc.Height - 0.5f;
quad[1][0] = mRenderTargetDesc.Width - 0.5f;
quad[1][1] = mRenderTargetDesc.Height - 0.5f;
quad[1][2] = 0.0f;
quad[1][3] = 1.0f;
......@@ -2724,7 +2713,7 @@ void Context::clear(GLbitfield mask)
quad[2][2] = 0.0f;
quad[2][3] = 1.0f;
quad[3][0] = desc.Width - 0.5f;
quad[3][0] = mRenderTargetDesc.Width - 0.5f;
quad[3][1] = -0.5f;
quad[3][2] = 0.0f;
quad[3][3] = 1.0f;
......
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