Used the MANAGED pool for non-renderable textures on XP.

TRAC #14743 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@874 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 33b609f5
......@@ -976,6 +976,23 @@ D3DPOOL Display::getBufferPool(DWORD usage) const
return D3DPOOL_DEFAULT;
}
D3DPOOL Display::getTexturePool(bool renderable) const
{
if (mD3d9Ex != NULL)
{
return D3DPOOL_DEFAULT;
}
else
{
if (!renderable)
{
return D3DPOOL_MANAGED;
}
}
return D3DPOOL_DEFAULT;
}
bool Display::getEventQuerySupport()
{
IDirect3DQuery9 *query;
......
......@@ -75,6 +75,7 @@ class Display
virtual bool getVertexTextureSupport() const;
virtual bool getNonPower2TextureSupport() const;
virtual D3DPOOL getBufferPool(DWORD usage) const;
virtual D3DPOOL getTexturePool(bool renderable) const;
virtual void notifyDeviceLost();
bool isDeviceLost();
......
......@@ -1564,10 +1564,11 @@ TextureStorage2D::TextureStorage2D(IDirect3DTexture9 *surfaceTexture) : TextureS
TextureStorage2D::TextureStorage2D(int levels, D3DFORMAT format, int width, int height, bool renderable) : TextureStorage(renderable), mRenderTargetSerial(RenderbufferStorage::issueSerial())
{
IDirect3DDevice9 *device = getDevice();
egl::Display *display = getDisplay();
IDirect3DDevice9 *device = display->getDevice();
mTexture = NULL;
HRESULT result = device->CreateTexture(width, height, levels, renderable ? D3DUSAGE_RENDERTARGET : 0, format, D3DPOOL_DEFAULT, &mTexture, NULL);
HRESULT result = device->CreateTexture(width, height, levels, renderable ? D3DUSAGE_RENDERTARGET : 0, format, display->getTexturePool(renderable), &mTexture, NULL);
if (FAILED(result))
{
......@@ -2177,10 +2178,11 @@ TextureStorage *Texture2D::getStorage() const
TextureStorageCubeMap::TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderable) : TextureStorage(renderable), mFirstRenderTargetSerial(RenderbufferStorage::issueCubeSerials())
{
IDirect3DDevice9 *device = getDevice();
egl::Display *display = getDisplay();
IDirect3DDevice9 *device = display->getDevice();
mTexture = NULL;
HRESULT result = device->CreateCubeTexture(size, levels, renderable ? D3DUSAGE_RENDERTARGET : 0, format, D3DPOOL_DEFAULT, &mTexture, NULL);
HRESULT result = device->CreateCubeTexture(size, levels, renderable ? D3DUSAGE_RENDERTARGET : 0, format, display->getTexturePool(renderable), &mTexture, NULL);
if (FAILED(result))
{
......
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