Renderer11::copyTexture can now copy 3D textures.

TRAC #22926 Signed-off-by: Jamie Madill Signed-off-by: Nicolas Capens Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2282 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 281ef3a6
......@@ -45,6 +45,16 @@ struct Rectangle
int height;
};
struct Box
{
int x;
int y;
int z;
int width;
int height;
int depth;
};
struct RasterizerState
{
bool cullFace;
......
......@@ -152,8 +152,9 @@ class Renderer11 : public Renderer
virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, GLint zOffset, TextureStorageInterface2DArray *storage, GLint level);
bool copyTexture(ID3D11ShaderResourceView *source, const gl::Rectangle &sourceArea, unsigned int sourceWidth, unsigned int sourceHeight,
ID3D11RenderTargetView *dest, const gl::Rectangle &destArea, unsigned int destWidth, unsigned int destHeight, GLenum destFormat);
bool copyTexture(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, unsigned int sourceWidth, unsigned int sourceHeight, unsigned int sourceDepth,
ID3D11RenderTargetView *dest, const gl::Box &destArea, unsigned int destWidth, unsigned int destHeight, unsigned int destDepth,
GLenum destFormat);
virtual bool blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect,
bool blitRenderTarget, bool blitDepthStencil);
......@@ -334,6 +335,14 @@ class Renderer11 : public Renderer
ID3D11PixelShader *mCopyLum2DPS;
ID3D11PixelShader *mCopyLumAlpha2DPS;
ID3D11InputLayout *mCopy3DIL;
ID3D11VertexShader *mCopy3DVS;
ID3D11GeometryShader *mCopy3DGS;
ID3D11PixelShader *mCopyRGBA3DPS;
ID3D11PixelShader *mCopyRGB3DPS;
ID3D11PixelShader *mCopyLum3DPS;
ID3D11PixelShader *mCopyLumAlpha3DPS;
// Masked clear resources
bool mClearResourcesInitialized;
ID3D11Buffer *mClearVB;
......
......@@ -165,20 +165,24 @@ void TextureStorage11::generateMipmapLayer(RenderTarget11 *source, RenderTarget1
if (sourceSRV && destRTV)
{
gl::Rectangle sourceArea;
gl::Box sourceArea;
sourceArea.x = 0;
sourceArea.y = 0;
sourceArea.z = 0;
sourceArea.width = source->getWidth();
sourceArea.height = source->getHeight();
sourceArea.depth = source->getDepth();
gl::Rectangle destArea;
gl::Box destArea;
destArea.x = 0;
destArea.y = 0;
destArea.z = 0;
destArea.width = dest->getWidth();
destArea.height = dest->getHeight();
destArea.depth = dest->getDepth();
mRenderer->copyTexture(sourceSRV, sourceArea, source->getWidth(), source->getHeight(),
destRTV, destArea, dest->getWidth(), dest->getHeight(),
mRenderer->copyTexture(sourceSRV, sourceArea, source->getWidth(), source->getHeight(), source->getDepth(),
destRTV, destArea, dest->getWidth(), dest->getHeight(), dest->getDepth(),
GL_RGBA);
}
......
......@@ -416,6 +416,17 @@ void SetPositionTexCoordVertex(PositionTexCoordVertex* vertex, float x, float y,
vertex->v = v;
}
void SetPositionLayerTexCoord3DVertex(PositionLayerTexCoord3DVertex* vertex, float x, float y,
unsigned int layer, float u, float v, float s)
{
vertex->x = x;
vertex->y = y;
vertex->l = layer;
vertex->u = u;
vertex->v = v;
vertex->s = s;
}
void SetPositionDepthColorVertex(PositionDepthColorVertex* vertex, float x, float y, float z,
const gl::Color &color)
{
......
......@@ -55,6 +55,15 @@ struct PositionTexCoordVertex
};
void SetPositionTexCoordVertex(PositionTexCoordVertex* vertex, float x, float y, float u, float v);
struct PositionLayerTexCoord3DVertex
{
float x, y;
unsigned int l;
float u, v, s;
};
void SetPositionLayerTexCoord3DVertex(PositionLayerTexCoord3DVertex* vertex, float x, float y,
unsigned int layer, float u, float v, float s);
struct PositionDepthColorVertex
{
float x, y, z;
......
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