Image11 and TextureStorage11 make sure sizes are aligned properly.
TRAC #22422
Signed-off-by: Jamie Madill
Signed-off-by: Nicolas Capens
Author: Geoff Lang
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1915 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Image11.cpp b/src/libGLESv2/renderer/Image11.cpp
index df9965b..cac1f55 100644
--- a/src/libGLESv2/renderer/Image11.cpp
+++ b/src/libGLESv2/renderer/Image11.cpp
@@ -371,9 +371,14 @@
{
ID3D11Device *device = mRenderer->getDevice();
+ // Round up the width and height to the nearest multiple of dimension alignment
+ unsigned int dimensionAlignment = d3d11::GetTextureFormatDimensionAlignment(dxgiFormat);
+ unsigned int width = mWidth + dimensionAlignment - 1 - (mWidth - 1) % dimensionAlignment;
+ unsigned int height = mHeight + dimensionAlignment - 1 - (mHeight - 1) % dimensionAlignment;
+
D3D11_TEXTURE2D_DESC desc;
- desc.Width = mWidth;
- desc.Height = mHeight;
+ desc.Width = width;
+ desc.Height = height;
desc.MipLevels = desc.ArraySize = 1;
desc.Format = dxgiFormat;
desc.SampleDesc.Count = 1;