Implemented glCopyTex[Sub]Image for non-renderable formats.

TRAC #13792 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@461 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 73a5db67
...@@ -413,14 +413,8 @@ IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const ...@@ -413,14 +413,8 @@ IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const
return error(GL_OUT_OF_MEMORY, (IDirect3DTexture9*)NULL); return error(GL_OUT_OF_MEMORY, (IDirect3DTexture9*)NULL);
} }
RECT d3dSourceRect;
d3dSourceRect.left = sourceRect.left;
d3dSourceRect.right = sourceRect.right;
d3dSourceRect.top = sourceRect.top;
d3dSourceRect.bottom = sourceRect.bottom;
display->endScene(); display->endScene();
result = device->StretchRect(surface, &d3dSourceRect, textureSurface, NULL, D3DTEXF_NONE); result = device->StretchRect(surface, &sourceRect, textureSurface, NULL, D3DTEXF_NONE);
textureSurface->Release(); textureSurface->Release();
......
...@@ -63,6 +63,7 @@ class Texture : public RefCountObject ...@@ -63,6 +63,7 @@ class Texture : public RefCountObject
virtual bool isComplete() const = 0; virtual bool isComplete() const = 0;
virtual bool isCompressed() const = 0; virtual bool isCompressed() const = 0;
bool isFloatingPoint() const; bool isFloatingPoint() const;
bool isRenderableFormat() const;
D3DFORMAT getD3DFormat() const; D3DFORMAT getD3DFormat() const;
IDirect3DBaseTexture9 *getTexture(); IDirect3DBaseTexture9 *getTexture();
...@@ -120,6 +121,7 @@ class Texture : public RefCountObject ...@@ -120,6 +121,7 @@ class Texture : public RefCountObject
bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img); bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img);
void setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img); void setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img);
bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img); bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img);
void copyNonRenderable(Image *image, GLenum internalFormat, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget);
void needRenderTarget(); void needRenderTarget();
...@@ -136,6 +138,7 @@ class Texture : public RefCountObject ...@@ -136,6 +138,7 @@ class Texture : public RefCountObject
void dropTexture(); void dropTexture();
void pushTexture(IDirect3DBaseTexture9 *newTexture, bool renderable); void pushTexture(IDirect3DBaseTexture9 *newTexture, bool renderable);
void createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *img);
Blit *getBlitter(); Blit *getBlitter();
...@@ -149,6 +152,8 @@ class Texture : public RefCountObject ...@@ -149,6 +152,8 @@ class Texture : public RefCountObject
GLenum mWrapT; GLenum mWrapT;
GLenum mType; GLenum mType;
bool mDirtyMetaData;
private: private:
DISALLOW_COPY_AND_ASSIGN(Texture); DISALLOW_COPY_AND_ASSIGN(Texture);
...@@ -194,14 +199,10 @@ class Texture : public RefCountObject ...@@ -194,14 +199,10 @@ class Texture : public RefCountObject
void loadBGRAImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, void loadBGRAImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
size_t inputPitch, const void *input, size_t outputPitch, void *output) const; size_t inputPitch, const void *input, size_t outputPitch, void *output) const;
void createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *img);
IDirect3DBaseTexture9 *mBaseTexture; // This is a weak pointer. The derived class is assumed to own a strong pointer. IDirect3DBaseTexture9 *mBaseTexture; // This is a weak pointer. The derived class is assumed to own a strong pointer.
bool mDirty; bool mDirty;
bool mDirtyMetaData;
bool mIsRenderable; bool mIsRenderable;
}; };
class Texture2D : public Texture class Texture2D : public Texture
......
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