Eliminates getD3DTexture, instead returning the texture storage object.

TRAC #21910 Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1372 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0f195ada
......@@ -438,18 +438,17 @@ bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GL
return true;
}
// D3D9_REPLACE
IDirect3DBaseTexture9 *Texture::getD3DTexture()
TextureStorage *Texture::getNativeTexture()
{
// ensure the underlying texture is created
if (getStorage(false) == NULL)
TextureStorage *storage = getStorage(false);
if (storage)
{
return NULL;
updateTexture();
}
updateTexture();
return getBaseTexture();
return storage;
}
bool Texture::hasDirtyParameters() const
......
......@@ -86,7 +86,7 @@ class Texture : public RefCountObject
virtual bool isSamplerComplete() const = 0;
IDirect3DBaseTexture9 *getD3DTexture(); // D3D9_REPLACE
TextureStorage *getNativeTexture();
virtual Renderbuffer *getRenderbuffer(GLenum target) = 0;
virtual void generateMipmaps() = 0;
......
......@@ -10,6 +10,7 @@
#include "common/debug.h"
#include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/Renderer9.h"
#include "libGLESv2/renderer/TextureStorage.h"
#include "libEGL/Config.h"
#include "libEGL/Display.h"
......@@ -553,8 +554,12 @@ void Renderer9::setTexture(gl::SamplerType type, int index, gl::Texture *texture
if (texture)
{
d3dTexture = texture->getD3DTexture();
// If we get NULL back from getTexture here, something went wrong
gl::TextureStorage *texStorage = texture->getNativeTexture();
if (texStorage)
{
d3dTexture = texStorage->getBaseTexture();
}
// If we get NULL back from getBaseTexture here, something went wrong
// in the texture class and we're unexpectedly missing the d3d texture
ASSERT(d3dTexture != NULL);
}
......
......@@ -41,6 +41,7 @@ class TextureStorage
D3DPOOL getPool() const;
DWORD getUsage() const;
unsigned int getTextureSerial() const;
virtual IDirect3DBaseTexture9 *getBaseTexture() const = 0;
virtual unsigned int getRenderTargetSerial(GLenum target) const = 0;
int getLodOffset() const;
......@@ -68,7 +69,7 @@ class TextureStorage2D : public TextureStorage
virtual ~TextureStorage2D();
IDirect3DSurface9 *getSurfaceLevel(int level, bool dirty);
IDirect3DBaseTexture9 *getBaseTexture() const;
virtual IDirect3DBaseTexture9 *getBaseTexture() const;
virtual unsigned int getRenderTargetSerial(GLenum target) const;
......@@ -87,7 +88,7 @@ class TextureStorageCubeMap : public TextureStorage
virtual ~TextureStorageCubeMap();
IDirect3DSurface9 *getCubeMapSurface(GLenum faceTarget, int level, bool dirty);
IDirect3DBaseTexture9 *getBaseTexture() const;
virtual IDirect3DBaseTexture9 *getBaseTexture() const;
virtual unsigned int getRenderTargetSerial(GLenum target) const;
......
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