Removed the levels parameter from initializeSRV since it is the same as mMipLevels.

TRAC #22358 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1741 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 8204334b
......@@ -152,7 +152,7 @@ TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, SwapChain11 *swapch
mMipLevels = desc.MipLevels;
initializeSRV(desc.Format, desc.MipLevels);
initializeSRV(desc.Format);
initializeRenderTarget(desc.Format, desc.Width, desc.Height);
}
......@@ -201,7 +201,7 @@ TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, int levels, GLenum
}
}
initializeSRV(format, levels + mLodOffset);
initializeSRV(format);
initializeRenderTarget(format, width, height);
}
......@@ -306,7 +306,7 @@ void TextureStorage11_2D::initializeRenderTarget(DXGI_FORMAT format, int width,
}
}
void TextureStorage11_2D::initializeSRV(DXGI_FORMAT format, int levels)
void TextureStorage11_2D::initializeSRV(DXGI_FORMAT format)
{
ASSERT(mSRV == NULL);
......@@ -316,7 +316,7 @@ void TextureStorage11_2D::initializeSRV(DXGI_FORMAT format, int levels)
srvDesc.Format = format;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MostDetailedMip = 0;
srvDesc.Texture2D.MipLevels = (levels == 0 ? -1 : levels);
srvDesc.Texture2D.MipLevels = (mMipLevels == 0 ? -1 : mMipLevels);
ID3D11Device *device = mRenderer->getDevice();
HRESULT result = device->CreateShaderResourceView(mTexture, &srvDesc, &mSRV);
......@@ -380,7 +380,7 @@ TextureStorage11_Cube::TextureStorage11_Cube(Renderer *renderer, int levels, GLe
}
}
initializeSRV(format, levels + mLodOffset);
initializeSRV(format);
initializeRenderTarget(format, size);
}
......@@ -495,7 +495,7 @@ void TextureStorage11_Cube::initializeRenderTarget(DXGI_FORMAT format, int size)
}
}
void TextureStorage11_Cube::initializeSRV(DXGI_FORMAT format, int levels)
void TextureStorage11_Cube::initializeSRV(DXGI_FORMAT format)
{
ASSERT(mSRV == NULL);
......@@ -504,7 +504,7 @@ void TextureStorage11_Cube::initializeSRV(DXGI_FORMAT format, int levels)
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = format;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
srvDesc.TextureCube.MipLevels = (levels == 0 ? -1 : levels);
srvDesc.TextureCube.MipLevels = (mMipLevels == 0 ? -1 : mMipLevels);
srvDesc.TextureCube.MostDetailedMip = 0;
ID3D11Device *device = mRenderer->getDevice();
......
......@@ -81,7 +81,7 @@ class TextureStorage11_2D : public TextureStorage11
DISALLOW_COPY_AND_ASSIGN(TextureStorage11_2D);
void initializeRenderTarget(DXGI_FORMAT format, int width, int height);
void initializeSRV(DXGI_FORMAT format, int levels);
void initializeSRV(DXGI_FORMAT format);
ID3D11Texture2D *mTexture;
ID3D11ShaderResourceView *mSRV;
......@@ -105,7 +105,7 @@ class TextureStorage11_Cube : public TextureStorage11
DISALLOW_COPY_AND_ASSIGN(TextureStorage11_Cube);
void initializeRenderTarget(DXGI_FORMAT format, int size);
void initializeSRV(DXGI_FORMAT format, int levels);
void initializeSRV(DXGI_FORMAT format);
ID3D11Texture2D *mTexture;
ID3D11ShaderResourceView *mSRV;
......
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