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 ...@@ -45,6 +45,16 @@ struct Rectangle
int height; int height;
}; };
struct Box
{
int x;
int y;
int z;
int width;
int height;
int depth;
};
struct RasterizerState struct RasterizerState
{ {
bool cullFace; bool cullFace;
......
...@@ -152,8 +152,9 @@ class Renderer11 : public Renderer ...@@ -152,8 +152,9 @@ class Renderer11 : public Renderer
virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, GLint zOffset, TextureStorageInterface2DArray *storage, GLint level); GLint xoffset, GLint yoffset, GLint zOffset, TextureStorageInterface2DArray *storage, GLint level);
bool copyTexture(ID3D11ShaderResourceView *source, const gl::Rectangle &sourceArea, unsigned int sourceWidth, unsigned int sourceHeight, bool copyTexture(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, unsigned int sourceWidth, unsigned int sourceHeight, unsigned int sourceDepth,
ID3D11RenderTargetView *dest, const gl::Rectangle &destArea, unsigned int destWidth, unsigned int destHeight, GLenum destFormat); 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, virtual bool blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect,
bool blitRenderTarget, bool blitDepthStencil); bool blitRenderTarget, bool blitDepthStencil);
...@@ -334,6 +335,14 @@ class Renderer11 : public Renderer ...@@ -334,6 +335,14 @@ class Renderer11 : public Renderer
ID3D11PixelShader *mCopyLum2DPS; ID3D11PixelShader *mCopyLum2DPS;
ID3D11PixelShader *mCopyLumAlpha2DPS; ID3D11PixelShader *mCopyLumAlpha2DPS;
ID3D11InputLayout *mCopy3DIL;
ID3D11VertexShader *mCopy3DVS;
ID3D11GeometryShader *mCopy3DGS;
ID3D11PixelShader *mCopyRGBA3DPS;
ID3D11PixelShader *mCopyRGB3DPS;
ID3D11PixelShader *mCopyLum3DPS;
ID3D11PixelShader *mCopyLumAlpha3DPS;
// Masked clear resources // Masked clear resources
bool mClearResourcesInitialized; bool mClearResourcesInitialized;
ID3D11Buffer *mClearVB; ID3D11Buffer *mClearVB;
......
...@@ -165,20 +165,24 @@ void TextureStorage11::generateMipmapLayer(RenderTarget11 *source, RenderTarget1 ...@@ -165,20 +165,24 @@ void TextureStorage11::generateMipmapLayer(RenderTarget11 *source, RenderTarget1
if (sourceSRV && destRTV) if (sourceSRV && destRTV)
{ {
gl::Rectangle sourceArea; gl::Box sourceArea;
sourceArea.x = 0; sourceArea.x = 0;
sourceArea.y = 0; sourceArea.y = 0;
sourceArea.z = 0;
sourceArea.width = source->getWidth(); sourceArea.width = source->getWidth();
sourceArea.height = source->getHeight(); sourceArea.height = source->getHeight();
sourceArea.depth = source->getDepth();
gl::Rectangle destArea; gl::Box destArea;
destArea.x = 0; destArea.x = 0;
destArea.y = 0; destArea.y = 0;
destArea.z = 0;
destArea.width = dest->getWidth(); destArea.width = dest->getWidth();
destArea.height = dest->getHeight(); destArea.height = dest->getHeight();
destArea.depth = dest->getDepth();
mRenderer->copyTexture(sourceSRV, sourceArea, source->getWidth(), source->getHeight(), mRenderer->copyTexture(sourceSRV, sourceArea, source->getWidth(), source->getHeight(), source->getDepth(),
destRTV, destArea, dest->getWidth(), dest->getHeight(), destRTV, destArea, dest->getWidth(), dest->getHeight(), dest->getDepth(),
GL_RGBA); GL_RGBA);
} }
......
...@@ -416,6 +416,17 @@ void SetPositionTexCoordVertex(PositionTexCoordVertex* vertex, float x, float y, ...@@ -416,6 +416,17 @@ void SetPositionTexCoordVertex(PositionTexCoordVertex* vertex, float x, float y,
vertex->v = v; 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, void SetPositionDepthColorVertex(PositionDepthColorVertex* vertex, float x, float y, float z,
const gl::Color &color) const gl::Color &color)
{ {
......
...@@ -55,6 +55,15 @@ struct PositionTexCoordVertex ...@@ -55,6 +55,15 @@ struct PositionTexCoordVertex
}; };
void SetPositionTexCoordVertex(PositionTexCoordVertex* vertex, float x, float y, float u, float v); 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 struct PositionDepthColorVertex
{ {
float x, y, z; 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