Implements fixes for problems discovered running San Angeles demo on Chrome

TRAC #13077 - clamp scissor to rendertarget size - ensure textures are renderable when required Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@369 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 31273558
......@@ -1409,6 +1409,7 @@ bool Context::applyRenderTarget(bool ignoreViewport)
{
device->SetRenderTarget(0, renderTarget);
mAppliedRenderTargetSerial = renderTargetSerial;
mScissorStateDirty = true; // Scissor area must be clamped to render target's size-- this is different for different render targets.
}
unsigned int depthbufferSerial = 0;
......@@ -1470,7 +1471,8 @@ bool Context::applyRenderTarget(bool ignoreViewport)
mState.scissorY,
mState.scissorX + mState.scissorWidth,
mState.scissorY + mState.scissorHeight};
rect.right = std::min(static_cast<UINT>(rect.right), desc.Width);
rect.bottom = std::min(static_cast<UINT>(rect.bottom), desc.Height);
device->SetScissorRect(&rect);
device->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
}
......@@ -1478,7 +1480,7 @@ bool Context::applyRenderTarget(bool ignoreViewport)
{
device->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
}
mScissorStateDirty = false;
}
......
......@@ -581,6 +581,10 @@ void Texture2D::copyImage(GLint level, GLenum internalFormat, GLint x, GLint y,
convertToRenderTarget();
pushTexture(mTexture, true);
}
else
{
needRenderTarget();
}
if (width != 0 && height != 0 && level < levelCount())
{
......@@ -1301,6 +1305,10 @@ void TextureCubeMap::copyImage(GLenum face, GLint level, GLenum internalFormat,
convertToRenderTarget();
pushTexture(mTexture, true);
}
else
{
needRenderTarget();
}
ASSERT(width == height);
......@@ -1370,7 +1378,7 @@ void TextureCubeMap::copySubImage(GLenum face, GLint level, GLint xoffset, GLint
}
else
{
getRenderTarget(face);
needRenderTarget();
}
if (level < levelCount())
......
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