2 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
7 // Image11.h: Defines the rx::Image11 class, which acts as the interface to
8 // the actual underlying resources of a Texture
10 #ifndef LIBGLESV2_RENDERER_IMAGE11_H_
11 #define LIBGLESV2_RENDERER_IMAGE11_H_
13 #include "libGLESv2/renderer/Image.h"
15 #include "common/debug.h"
26 class TextureStorageInterface2D;
27 class TextureStorageInterfaceCube;
29 class Image11 : public Image
35 static Image11 *makeImage11(Image *img);
37 static void generateMipmap(GLuint clientVersion, Image11 *dest, Image11 *src);
39 virtual bool isDirty() const;
41 virtual bool copyToStorage(TextureStorageInterface2D *storage, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
42 virtual bool copyToStorage(TextureStorageInterfaceCube *storage, int face, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
43 virtual bool copyToStorage(TextureStorageInterface3D *storage, int level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
44 virtual bool copyToStorage(TextureStorageInterface2DArray *storage, int level, GLint xoffset, GLint yoffset, GLint arrayLayer, GLsizei width, GLsizei height);
46 virtual bool redefine(Renderer *renderer, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, bool forceRelease);
48 DXGI_FORMAT getDXGIFormat() const;
50 virtual void loadData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
51 GLint unpackAlignment, GLenum type, const void *input);
52 virtual void loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
55 virtual void copy(GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source);
58 HRESULT map(D3D11_MAP mapType, D3D11_MAPPED_SUBRESOURCE *map);
62 DISALLOW_COPY_AND_ASSIGN(Image11);
64 ID3D11Resource *getStagingTexture();
65 unsigned int getStagingSubresource();
66 void createStagingTexture();
68 Renderer11 *mRenderer;
70 DXGI_FORMAT mDXGIFormat;
71 ID3D11Resource *mStagingTexture;
72 unsigned int mStagingSubresource;
77 #endif // LIBGLESV2_RENDERER_IMAGE11_H_