Moves Image & Renderer into rx namespace

TRAC #22002 Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1414 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent de8a7fff
......@@ -190,7 +190,7 @@ float Texture::getMaxAnisotropy() const
int Texture::getLodOffset()
{
TextureStorage *texture = getStorage(false);
rx::TextureStorage *texture = getStorage(false);
return texture ? texture->getLodOffset() : 0;
}
......@@ -222,7 +222,7 @@ bool Texture::isMipmapFiltered() const
}
}
void Texture::setImage(GLint unpackAlignment, const void *pixels, Image *image)
void Texture::setImage(GLint unpackAlignment, const void *pixels, rx::Image *image)
{
if (pixels != NULL)
{
......@@ -231,7 +231,7 @@ void Texture::setImage(GLint unpackAlignment, const void *pixels, Image *image)
}
}
void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, Image *image)
void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, rx::Image *image)
{
if (pixels != NULL)
{
......@@ -240,7 +240,7 @@ void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, Image *i
}
}
bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image)
bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, rx::Image *image)
{
if (pixels != NULL)
{
......@@ -251,7 +251,7 @@ bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig
return true;
}
bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image)
bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, rx::Image *image)
{
if (pixels != NULL)
{
......@@ -262,11 +262,11 @@ bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GL
return true;
}
TextureStorage *Texture::getNativeTexture()
rx::TextureStorage *Texture::getNativeTexture()
{
// ensure the underlying texture is created
TextureStorage *storage = getStorage(false);
rx::TextureStorage *storage = getStorage(false);
if (storage)
{
updateTexture();
......@@ -293,13 +293,13 @@ void Texture::resetDirty()
unsigned int Texture::getTextureSerial()
{
TextureStorage *texture = getStorage(false);
rx::TextureStorage *texture = getStorage(false);
return texture ? texture->getTextureSerial() : 0;
}
unsigned int Texture::getRenderTargetSerial(GLenum target)
{
TextureStorage *texture = getStorage(true);
rx::TextureStorage *texture = getStorage(true);
return texture ? texture->getRenderTargetSerial(target) : 0;
}
......@@ -442,7 +442,7 @@ void Texture2D::bindTexImage(egl::Surface *surface)
delete mTexStorage;
rx::SwapChain *swapchain = surface->getSwapChain(); // D3D9_REPLACE
mTexStorage = new TextureStorage2D(renderer9, swapchain);
mTexStorage = new rx::TextureStorage2D(renderer9, swapchain);
mDirtyImages = true;
mSurface = surface;
......@@ -485,7 +485,7 @@ void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei wi
if (level < levelCount())
{
Image *image = &mImageArray[level];
rx::Image *image = &mImageArray[level];
if (image->updateSurface(mTexStorage, level, xoffset, yoffset, width, height))
{
image->markClean();
......@@ -583,7 +583,7 @@ void Texture2D::storage(GLsizei levels, GLenum internalformat, GLsizei width, GL
delete mTexStorage;
assert(dynamic_cast<rx::Renderer9*>(mRenderer) != NULL); // D3D9_REPLACE
rx::Renderer9 *renderer9 = static_cast<rx::Renderer9*>(mRenderer); // D3D9_REPLACE
mTexStorage = new TextureStorage2D(renderer9, levels, internalformat, mUsage, false, width, height);
mTexStorage = new rx::TextureStorage2D(renderer9, levels, internalformat, mUsage, false, width, height);
mImmutable = true;
for (int level = 0; level < levels; level++)
......@@ -727,7 +727,7 @@ void Texture2D::createTexture()
delete mTexStorage;
assert(dynamic_cast<rx::Renderer9*>(mRenderer) != NULL); // D3D9_REPLACE
rx::Renderer9 *renderer9 = static_cast<rx::Renderer9*>(mRenderer); // D3D9_REPLACE
mTexStorage = new TextureStorage2D(renderer9, levels, internalformat, mUsage, false, width, height);
mTexStorage = new rx::TextureStorage2D(renderer9, levels, internalformat, mUsage, false, width, height);
if (mTexStorage->isManaged())
{
......@@ -750,7 +750,7 @@ void Texture2D::updateTexture()
for (int level = 0; level < levels; level++)
{
Image *image = &mImageArray[level];
rx::Image *image = &mImageArray[level];
if (image->isDirty())
{
......@@ -761,7 +761,7 @@ void Texture2D::updateTexture()
void Texture2D::convertToRenderTarget()
{
TextureStorage2D *newTexStorage = NULL;
rx::TextureStorage2D *newTexStorage = NULL;
if (mImageArray[0].getWidth() != 0 && mImageArray[0].getHeight() != 0)
{
......@@ -772,7 +772,7 @@ void Texture2D::convertToRenderTarget()
assert(dynamic_cast<rx::Renderer9*>(mRenderer) != NULL); // D3D9_REPLACE
rx::Renderer9 *renderer9 = static_cast<rx::Renderer9*>(mRenderer); // D3D9_REPLACE
newTexStorage = new TextureStorage2D(renderer9, levels, internalformat, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, true, width, height);
newTexStorage = new rx::TextureStorage2D(renderer9, levels, internalformat, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, true, width, height);
if (mTexStorage != NULL)
{
......@@ -822,7 +822,7 @@ void Texture2D::generateMipmaps()
{
for (unsigned int i = 1; i <= q; i++)
{
Image::GenerateMipmap(&mImageArray[i], &mImageArray[i - 1]);
rx::Image::GenerateMipmap(&mImageArray[i], &mImageArray[i - 1]);
}
}
}
......@@ -891,7 +891,7 @@ int Texture2D::levelCount()
return mTexStorage ? mTexStorage->levelCount() - getLodOffset() : 0;
}
TextureStorage *Texture2D::getStorage(bool renderTarget)
rx::TextureStorage *Texture2D::getStorage(bool renderTarget)
{
if (!mTexStorage || (renderTarget && !mTexStorage->isRenderTarget()))
{
......@@ -1039,7 +1039,7 @@ void TextureCubeMap::commitRect(int face, GLint level, GLint xoffset, GLint yoff
if (level < levelCount())
{
Image *image = &mImageArray[face][level];
rx::Image *image = &mImageArray[face][level];
if (image->updateSurface(mTexStorage, face, level, xoffset, yoffset, width, height))
image->markClean();
}
......@@ -1180,7 +1180,7 @@ void TextureCubeMap::createTexture()
delete mTexStorage;
assert(dynamic_cast<rx::Renderer9*>(mRenderer) != NULL); // D3D9_REPLACE
rx::Renderer9 *renderer9 = static_cast<rx::Renderer9*>(mRenderer); // D3D9_REPLACE
mTexStorage = new TextureStorageCubeMap(renderer9, levels, internalformat, mUsage, false, size);
mTexStorage = new rx::TextureStorageCubeMap(renderer9, levels, internalformat, mUsage, false, size);
if (mTexStorage->isManaged())
{
......@@ -1208,7 +1208,7 @@ void TextureCubeMap::updateTexture()
for (int level = 0; level < levels; level++)
{
Image *image = &mImageArray[face][level];
rx::Image *image = &mImageArray[face][level];
if (image->isDirty())
{
......@@ -1220,7 +1220,7 @@ void TextureCubeMap::updateTexture()
void TextureCubeMap::convertToRenderTarget()
{
TextureStorageCubeMap *newTexStorage = NULL;
rx::TextureStorageCubeMap *newTexStorage = NULL;
if (mImageArray[0][0].getWidth() != 0)
{
......@@ -1230,7 +1230,7 @@ void TextureCubeMap::convertToRenderTarget()
assert(dynamic_cast<rx::Renderer9*>(mRenderer) != NULL); // D3D9_REPLACE
rx::Renderer9 *renderer9 = static_cast<rx::Renderer9*>(mRenderer); // D3D9_REPLACE
newTexStorage = new TextureStorageCubeMap(renderer9, levels, internalformat, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, true, size);
newTexStorage = new rx::TextureStorageCubeMap(renderer9, levels, internalformat, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, true, size);
if (mTexStorage != NULL)
{
......@@ -1371,7 +1371,7 @@ void TextureCubeMap::storage(GLsizei levels, GLenum internalformat, GLsizei size
delete mTexStorage;
assert(dynamic_cast<rx::Renderer9*>(mRenderer) != NULL); // D3D9_REPLACE
rx::Renderer9 *renderer9 = static_cast<rx::Renderer9*>(mRenderer); // D3D9_REPLACE
mTexStorage = new TextureStorageCubeMap(renderer9, levels, internalformat, mUsage, false, size);
mTexStorage = new rx::TextureStorageCubeMap(renderer9, levels, internalformat, mUsage, false, size);
mImmutable = true;
for (int level = 0; level < levels; level++)
......@@ -1450,7 +1450,7 @@ void TextureCubeMap::generateMipmaps()
{
for (unsigned int i = 1; i <= q; i++)
{
Image::GenerateMipmap(&mImageArray[f][i], &mImageArray[f][i - 1]);
rx::Image::GenerateMipmap(&mImageArray[f][i], &mImageArray[f][i - 1]);
}
}
}
......@@ -1495,7 +1495,7 @@ int TextureCubeMap::levelCount()
return mTexStorage ? mTexStorage->levelCount() - getLodOffset() : 0;
}
TextureStorage *TextureCubeMap::getStorage(bool renderTarget)
rx::TextureStorage *TextureCubeMap::getStorage(bool renderTarget)
{
if (!mTexStorage || (renderTarget && !mTexStorage->isRenderTarget()))
{
......
......@@ -90,7 +90,7 @@ class Texture : public RefCountObject
virtual bool isSamplerComplete() const = 0;
TextureStorage *getNativeTexture();
rx::TextureStorage *getNativeTexture();
virtual Renderbuffer *getRenderbuffer(GLenum target) = 0;
virtual void generateMipmaps() = 0;
......@@ -107,10 +107,10 @@ class Texture : public RefCountObject
static const GLuint INCOMPLETE_TEXTURE_ID = static_cast<GLuint>(-1); // Every texture takes an id at creation time. The value is arbitrary because it is never registered with the resource manager.
protected:
void setImage(GLint unpackAlignment, const void *pixels, Image *image);
bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image);
void setCompressedImage(GLsizei imageSize, const void *pixels, Image *image);
bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image);
void setImage(GLint unpackAlignment, const void *pixels, rx::Image *image);
bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, rx::Image *image);
void setCompressedImage(GLsizei imageSize, const void *pixels, rx::Image *image);
bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, rx::Image *image);
GLint creationLevels(GLsizei width, GLsizei height) const;
GLint creationLevels(GLsizei size) const;
......@@ -135,7 +135,7 @@ class Texture : public RefCountObject
private:
DISALLOW_COPY_AND_ASSIGN(Texture);
virtual TextureStorage *getStorage(bool renderTarget) = 0;
virtual rx::TextureStorage *getStorage(bool renderTarget) = 0;
};
class Texture2D : public Texture
......@@ -185,16 +185,16 @@ class Texture2D : public Texture
virtual void createTexture();
virtual void updateTexture();
virtual void convertToRenderTarget();
virtual TextureStorage *getStorage(bool renderTarget);
virtual rx::TextureStorage *getStorage(bool renderTarget);
bool isMipmapComplete() const;
void redefineImage(GLint level, GLint internalformat, GLsizei width, GLsizei height);
void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
rx::Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
TextureStorage2D *mTexStorage;
rx::TextureStorage2D *mTexStorage;
egl::Surface *mSurface;
// A specific internal reference count is kept for colorbuffer proxy references,
......@@ -258,7 +258,7 @@ class TextureCubeMap : public Texture
virtual void createTexture();
virtual void updateTexture();
virtual void convertToRenderTarget();
virtual TextureStorage *getStorage(bool renderTarget);
virtual rx::TextureStorage *getStorage(bool renderTarget);
bool isCubeComplete() const;
bool isMipmapCubeComplete() const;
......@@ -267,9 +267,9 @@ class TextureCubeMap : public Texture
void commitRect(int faceIndex, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
void redefineImage(int faceIndex, GLint level, GLint internalformat, GLsizei width, GLsizei height);
Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS];
rx::Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS];
TextureStorageCubeMap *mTexStorage;
rx::TextureStorageCubeMap *mTexStorage;
// A specific internal reference count is kept for colorbuffer proxy references,
// because, as the renderbuffer acting as proxy will maintain a binding pointer
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// TextureSSE2.cpp: Implements SSE2-based functions of gl::Image class. It's
// TextureSSE2.cpp: Implements SSE2-based functions of rx::Image class. It's
// in a separated file for GCC, which can enable SSE usage only per-file,
// not for code blocks that use SSE2 explicitly.
......@@ -12,7 +12,7 @@
#include <intrin.h>
namespace gl
namespace rx
{
void Image::loadRGBAUByteDataSSE2(GLsizei width, GLsizei height,
......
......@@ -212,7 +212,7 @@ bool Blit::boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest)
return true;
}
bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, gl::TextureStorage2D *storage, GLint level)
bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorage2D *storage, GLint level)
{
// D3D9_REPLACE
IDirect3DSurface9 *source = framebuffer->getRenderTarget();
......@@ -235,7 +235,7 @@ bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum des
return result;
}
bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, gl::TextureStorageCubeMap *storage, GLenum target, GLint level)
bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorageCubeMap *storage, GLenum target, GLint level)
{
// D3D9_REPLACE
IDirect3DSurface9 *source = framebuffer->getRenderTarget();
......
......@@ -35,8 +35,8 @@ class Blit
// Copy from source surface to dest surface.
// sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left)
bool copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, gl::TextureStorage2D *storage, GLint level);
bool copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, gl::TextureStorageCubeMap *storage, GLenum target, GLint level);
bool copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorage2D *storage, GLint level);
bool copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorageCubeMap *storage, GLenum target, GLint level);
// Copy from source surface to dest surface.
// sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left)
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// Image.cpp: Implements the gl::Image class, which acts as the interface to
// Image.cpp: Implements the rx::Image class, which acts as the interface to
// the actual underlying surfaces of a Texture.
#include "libGLESv2/renderer/Image.h"
......@@ -19,7 +19,7 @@
#include "libGLESv2/renderer/renderer9_utils.h"
namespace gl
namespace rx
{
namespace
......@@ -67,10 +67,10 @@ struct A16B16G16R16F
static void average(A16B16G16R16F *dst, const A16B16G16R16F *src1, const A16B16G16R16F *src2)
{
dst->R = float32ToFloat16((float16ToFloat32(src1->R) + float16ToFloat32(src2->R)) * 0.5f);
dst->G = float32ToFloat16((float16ToFloat32(src1->G) + float16ToFloat32(src2->G)) * 0.5f);
dst->B = float32ToFloat16((float16ToFloat32(src1->B) + float16ToFloat32(src2->B)) * 0.5f);
dst->A = float32ToFloat16((float16ToFloat32(src1->A) + float16ToFloat32(src2->A)) * 0.5f);
dst->R = gl::float32ToFloat16((gl::float16ToFloat32(src1->R) + gl::float16ToFloat32(src2->R)) * 0.5f);
dst->G = gl::float32ToFloat16((gl::float16ToFloat32(src1->G) + gl::float16ToFloat32(src2->G)) * 0.5f);
dst->B = gl::float32ToFloat16((gl::float16ToFloat32(src1->B) + gl::float16ToFloat32(src2->B)) * 0.5f);
dst->A = gl::float32ToFloat16((gl::float16ToFloat32(src1->A) + gl::float16ToFloat32(src2->A)) * 0.5f);
}
};
......@@ -312,7 +312,7 @@ void Image::createSurface()
int levelToFetch = 0;
GLsizei requestWidth = mWidth;
GLsizei requestHeight = mHeight;
MakeValidSize(true, IsCompressed(mInternalFormat), &requestWidth, &requestHeight, &levelToFetch);
gl::MakeValidSize(true, gl::IsCompressed(mInternalFormat), &requestWidth, &requestHeight, &levelToFetch);
IDirect3DDevice9 *device = mRenderer->getDevice(); // D3D9_REPLACE
......@@ -492,12 +492,12 @@ void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height
}
GLsizei inputPitch = ComputePitch(width, mInternalFormat, unpackAlignment);
GLsizei inputPitch = gl::ComputePitch(width, mInternalFormat, unpackAlignment);
switch (mInternalFormat)
{
case GL_ALPHA8_EXT:
if (supportsSSE2())
if (gl::supportsSSE2())
{
loadAlphaDataSSE2(width, height, inputPitch, input, locked.Pitch, locked.pBits);
}
......@@ -537,7 +537,7 @@ void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height
loadRGB565Data(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_RGBA8_OES:
if (supportsSSE2())
if (gl::supportsSSE2())
{
loadRGBAUByteDataSSE2(width, height, inputPitch, input, locked.Pitch, locked.pBits);
}
......@@ -970,8 +970,8 @@ void Image::loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsi
return;
}
GLsizei inputSize = ComputeCompressedSize(width, height, mInternalFormat);
GLsizei inputPitch = ComputeCompressedPitch(width, mInternalFormat);
GLsizei inputSize = gl::ComputeCompressedSize(width, height, mInternalFormat);
GLsizei inputPitch = gl::ComputeCompressedPitch(width, mInternalFormat);
int rows = inputSize / inputPitch;
for (int i = 0; i < rows; ++i)
{
......@@ -982,7 +982,7 @@ void Image::loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsi
}
// This implements glCopyTex[Sub]Image2D for non-renderable internal texture formats and incomplete textures
void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
{
IDirect3DSurface9 *renderTarget = source->getRenderTarget();
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// Image.h: Defines the gl::Image class, which acts as the interface to
// Image.h: Defines the rx::Image class, which acts as the interface to
// the actual underlying surfaces of a Texture.
#ifndef LIBGLESV2_RENDERER_IMAGE_H_
......@@ -16,16 +16,16 @@
#include "common/debug.h"
namespace rx
namespace gl
{
class Renderer9;
class Framebuffer;
}
namespace gl
namespace rx
{
class Renderer9;
class TextureStorage2D;
class TextureStorageCubeMap;
class Framebuffer;
class Image
{
......@@ -36,7 +36,7 @@ class Image
static void GenerateMipmap(Image *dest, Image *source);
static void Image::CopyLockableSurfaces(IDirect3DSurface9 *dest, IDirect3DSurface9 *source);
bool redefine(rx::Renderer9 *renderer, GLint internalformat, GLsizei width, GLsizei height, bool forceRelease);
bool redefine(Renderer9 *renderer, GLint internalformat, GLsizei width, GLsizei height, bool forceRelease);
void markDirty() {mDirty = true;}
void markClean() {mDirty = false;}
......@@ -103,7 +103,7 @@ class Image
void loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
const void *input);
void copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
void copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source);
private:
DISALLOW_COPY_AND_ASSIGN(Image);
......@@ -121,7 +121,7 @@ class Image
bool mDirty;
rx::Renderer9 *mRenderer;
Renderer9 *mRenderer;
D3DPOOL mD3DPool; // can only be D3DPOOL_SYSTEMMEM or D3DPOOL_MANAGED since it needs to be lockable.
D3DFORMAT mD3DFormat;
......
......@@ -37,15 +37,10 @@ namespace egl
class Display;
}
namespace gl
namespace rx
{
class TextureStorage2D;
class TextureStorageCubeMap;
}
namespace rx
{
class Blit;
struct ConfigDesc
......@@ -114,11 +109,11 @@ class Renderer
virtual GLsizei getMaxSupportedSamples() const = 0;
virtual bool copyToRenderTarget(gl::TextureStorage2D *dest, gl::TextureStorage2D *source) = 0;
virtual bool copyToRenderTarget(gl::TextureStorageCubeMap *dest, gl::TextureStorageCubeMap *source) = 0;
virtual bool copyToRenderTarget(TextureStorage2D *dest, TextureStorage2D *source) = 0;
virtual bool copyToRenderTarget(TextureStorageCubeMap *dest, TextureStorageCubeMap *source) = 0;
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, gl::TextureStorage2D *storage, GLint level) = 0;
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, gl::TextureStorageCubeMap *storage, GLenum target, GLint level) = 0;
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorage2D *storage, GLint level) = 0;
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorageCubeMap *storage, GLenum target, GLint level) = 0;
protected:
egl::Display *mDisplay;
......
......@@ -515,14 +515,14 @@ int Renderer11::getMaxSupportedSamples() const
return 1;
}
bool Renderer11::copyToRenderTarget(gl::TextureStorage2D *dest, gl::TextureStorage2D *source)
bool Renderer11::copyToRenderTarget(TextureStorage2D *dest, TextureStorage2D *source)
{
// TODO
UNIMPLEMENTED();
return false;
}
bool Renderer11::copyToRenderTarget(gl::TextureStorageCubeMap *dest, gl::TextureStorageCubeMap *source)
bool Renderer11::copyToRenderTarget(TextureStorageCubeMap *dest, TextureStorageCubeMap *source)
{
// TODO
UNIMPLEMENTED();
......
......@@ -83,8 +83,8 @@ class Renderer11 : public Renderer
virtual GLsizei getMaxSupportedSamples() const;
virtual bool copyToRenderTarget(gl::TextureStorage2D *dest, gl::TextureStorage2D *source);
virtual bool copyToRenderTarget(gl::TextureStorageCubeMap *dest, gl::TextureStorageCubeMap *source);
virtual bool copyToRenderTarget(TextureStorage2D *dest, TextureStorage2D *source);
virtual bool copyToRenderTarget(TextureStorageCubeMap *dest, TextureStorageCubeMap *source);
// D3D11-renderer specific methods
ID3D11Device *getDevice() { return mDevice; }
......
......@@ -576,7 +576,7 @@ void Renderer9::setTexture(gl::SamplerType type, int index, gl::Texture *texture
if (texture)
{
gl::TextureStorage *texStorage = texture->getNativeTexture();
TextureStorage *texStorage = texture->getNativeTexture();
if (texStorage)
{
d3dTexture = texStorage->getBaseTexture();
......@@ -1059,7 +1059,7 @@ D3DFORMAT Renderer9::ConvertTextureInternalFormat(GLint internalformat)
return D3DFMT_A8R8G8B8;
}
bool Renderer9::copyToRenderTarget(gl::TextureStorage2D *dest, gl::TextureStorage2D *source)
bool Renderer9::copyToRenderTarget(TextureStorage2D *dest, TextureStorage2D *source)
{
bool result = false;
......@@ -1084,7 +1084,7 @@ bool Renderer9::copyToRenderTarget(gl::TextureStorage2D *dest, gl::TextureStorag
return result;
}
bool Renderer9::copyToRenderTarget(gl::TextureStorageCubeMap *dest, gl::TextureStorageCubeMap *source)
bool Renderer9::copyToRenderTarget(TextureStorageCubeMap *dest, TextureStorageCubeMap *source)
{
bool result = false;
......@@ -1130,13 +1130,13 @@ D3DPOOL Renderer9::getBufferPool(DWORD usage) const
}
bool Renderer9::copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset,
gl::TextureStorage2D *storage, GLint level)
TextureStorage2D *storage, GLint level)
{
return mBlit->copy(framebuffer, sourceRect, destFormat, xoffset, yoffset, storage, level);
}
bool Renderer9::copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset,
gl::TextureStorageCubeMap *storage, GLenum target, GLint level)
TextureStorageCubeMap *storage, GLenum target, GLint level)
{
return mBlit->copy(framebuffer, sourceRect, destFormat, xoffset, yoffset, storage, target, level);
}
......@@ -1180,7 +1180,7 @@ bool Renderer9::copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *s
if (SUCCEEDED(result))
{
gl::Image::CopyLockableSurfaces(surf, source);
Image::CopyLockableSurfaces(surf, source);
result = device->UpdateSurface(surf, NULL, dest, NULL);
surf->Release();
}
......
......@@ -111,11 +111,11 @@ class Renderer9 : public Renderer
D3DFORMAT ConvertTextureInternalFormat(GLint internalformat);
virtual bool copyToRenderTarget(gl::TextureStorage2D *dest, gl::TextureStorage2D *source);
virtual bool copyToRenderTarget(gl::TextureStorageCubeMap *dest, gl::TextureStorageCubeMap *source);
virtual bool copyToRenderTarget(TextureStorage2D *dest, TextureStorage2D *source);
virtual bool copyToRenderTarget(TextureStorageCubeMap *dest, TextureStorageCubeMap *source);
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, gl::TextureStorage2D *storage, GLint level);
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, gl::TextureStorageCubeMap *storage, GLenum target, GLint level);
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorage2D *storage, GLint level);
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorageCubeMap *storage, GLenum target, GLint level);
bool boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest);
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// TextureStorage.cpp: Implements the abstract gl::TextureStorage class and its concrete derived
// TextureStorage.cpp: Implements the abstract rx::TextureStorage class and its concrete derived
// classes TextureStorage2D and TextureStorageCubeMap, which act as the interface to the
// D3D-side texture.
......@@ -17,11 +17,11 @@
#include "common/debug.h"
namespace gl
namespace rx
{
unsigned int TextureStorage::mCurrentTextureSerial = 1;
TextureStorage::TextureStorage(rx::Renderer9 *renderer, DWORD usage)
TextureStorage::TextureStorage(Renderer9 *renderer, DWORD usage)
: mD3DUsage(usage),
mD3DPool(renderer->getTexturePool(usage)),
mRenderer(renderer),
......@@ -115,15 +115,15 @@ int TextureStorage::levelCount()
return getBaseTexture() ? getBaseTexture()->GetLevelCount() - getLodOffset() : 0;
}
TextureStorage2D::TextureStorage2D(rx::Renderer9 *renderer, rx::SwapChain *swapchain) : TextureStorage(renderer, D3DUSAGE_RENDERTARGET), mRenderTargetSerial(RenderbufferStorage::issueSerial())
TextureStorage2D::TextureStorage2D(Renderer9 *renderer, rx::SwapChain *swapchain) : TextureStorage(renderer, D3DUSAGE_RENDERTARGET), mRenderTargetSerial(gl::RenderbufferStorage::issueSerial())
{
IDirect3DTexture9 *surfaceTexture = swapchain->getOffscreenTexture();
mTexture = surfaceTexture;
}
TextureStorage2D::TextureStorage2D(rx::Renderer9 *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height)
TextureStorage2D::TextureStorage2D(Renderer9 *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height)
: TextureStorage(renderer, GetTextureUsage(renderer->ConvertTextureInternalFormat(internalformat), usage, forceRenderable)),
mRenderTargetSerial(RenderbufferStorage::issueSerial())
mRenderTargetSerial(gl::RenderbufferStorage::issueSerial())
{
mTexture = NULL;
// if the width or height is not positive this should be treated as an incomplete texture
......@@ -131,7 +131,7 @@ TextureStorage2D::TextureStorage2D(rx::Renderer9 *renderer, int levels, GLenum i
if (width > 0 && height > 0)
{
IDirect3DDevice9 *device = renderer->getDevice(); // D3D9_REPLACE
MakeValidSize(false, gl::IsCompressed(internalformat), &width, &height, &mLodOffset);
gl::MakeValidSize(false, gl::IsCompressed(internalformat), &width, &height, &mLodOffset);
HRESULT result = device->CreateTexture(width, height, levels ? levels + mLodOffset : 0, getUsage(),
renderer->ConvertTextureInternalFormat(internalformat), getPool(), &mTexture, NULL);
......@@ -196,9 +196,9 @@ unsigned int TextureStorage2D::getRenderTargetSerial(GLenum target) const
return mRenderTargetSerial;
}
TextureStorageCubeMap::TextureStorageCubeMap(rx::Renderer9 *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, int size)
TextureStorageCubeMap::TextureStorageCubeMap(Renderer9 *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, int size)
: TextureStorage(renderer, GetTextureUsage(renderer->ConvertTextureInternalFormat(internalformat), usage, forceRenderable)),
mFirstRenderTargetSerial(RenderbufferStorage::issueCubeSerials())
mFirstRenderTargetSerial(gl::RenderbufferStorage::issueCubeSerials())
{
mTexture = NULL;
// if the size is not positive this should be treated as an incomplete texture
......@@ -207,7 +207,7 @@ TextureStorageCubeMap::TextureStorageCubeMap(rx::Renderer9 *renderer, int levels
{
IDirect3DDevice9 *device = renderer->getDevice();
int height = size;
MakeValidSize(false, gl::IsCompressed(internalformat), &size, &height, &mLodOffset);
gl::MakeValidSize(false, gl::IsCompressed(internalformat), &size, &height, &mLodOffset);
HRESULT result = device->CreateCubeTexture(size, levels ? levels + mLodOffset : 0, getUsage(),
renderer->ConvertTextureInternalFormat(internalformat), getPool(), &mTexture, NULL);
......@@ -270,7 +270,7 @@ IDirect3DBaseTexture9 *TextureStorageCubeMap::getBaseTexture() const
unsigned int TextureStorageCubeMap::getRenderTargetSerial(GLenum target) const
{
return mFirstRenderTargetSerial + TextureCubeMap::faceIndex(target);
return mFirstRenderTargetSerial + gl::TextureCubeMap::faceIndex(target);
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// TextureStorage.h: Defines the abstract gl::TextureStorage class and its concrete derived
// TextureStorage.h: Defines the abstract rx::TextureStorage class and its concrete derived
// classes TextureStorage2D and TextureStorageCubeMap, which act as the interface to the
// D3D-side texture.
......@@ -22,10 +22,7 @@ namespace rx
class Renderer9;
class SwapChain;
class Blit;
}
namespace gl
{
class TextureStorage
{
public:
......
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