Added getMaxRenderTargets() to Renderer, for a runtime-specific value for the…

Added getMaxRenderTargets() to Renderer, for a runtime-specific value for the maximum simulatenous render targets. We will report this as our maximum draw buffer and color attachment count. TRAC #22656 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@2004 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 194161c2
...@@ -181,6 +181,8 @@ class Renderer ...@@ -181,6 +181,8 @@ class Renderer
virtual GLsizei getMaxSupportedSamples() const = 0; virtual GLsizei getMaxSupportedSamples() const = 0;
virtual unsigned int getMaxRenderTargets() const = 0;
// Pixel operations // Pixel operations
virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source) = 0; virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source) = 0;
virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source) = 0; virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source) = 0;
......
...@@ -2357,6 +2357,21 @@ int Renderer11::getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requ ...@@ -2357,6 +2357,21 @@ int Renderer11::getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requ
return -1; return -1;
} }
unsigned int Renderer11::getMaxRenderTargets() const
{
switch (mFeatureLevel)
{
case D3D_FEATURE_LEVEL_11_0:
return D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; // 8
case D3D_FEATURE_LEVEL_10_1:
case D3D_FEATURE_LEVEL_10_0:
return D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; // 8
default:
UNREACHABLE();
return 1;
}
}
bool Renderer11::copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source) bool Renderer11::copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source)
{ {
if (source && dest) if (source && dest)
......
...@@ -125,6 +125,8 @@ class Renderer11 : public Renderer ...@@ -125,6 +125,8 @@ class Renderer11 : public Renderer
virtual GLsizei getMaxSupportedSamples() const; virtual GLsizei getMaxSupportedSamples() const;
int getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requested) const; int getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requested) const;
virtual unsigned int getMaxRenderTargets() const;
// Pixel operations // Pixel operations
virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source); virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source);
virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source); virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source);
......
...@@ -2408,6 +2408,12 @@ int Renderer9::getNearestSupportedSamples(D3DFORMAT format, int requested) const ...@@ -2408,6 +2408,12 @@ int Renderer9::getNearestSupportedSamples(D3DFORMAT format, int requested) const
return -1; return -1;
} }
unsigned int Renderer9::getMaxRenderTargets() const
{
// we do not support MRT in d3d9
return 1;
}
D3DFORMAT Renderer9::ConvertTextureInternalFormat(GLint internalformat) D3DFORMAT Renderer9::ConvertTextureInternalFormat(GLint internalformat)
{ {
switch (internalformat) switch (internalformat)
......
...@@ -146,6 +146,8 @@ class Renderer9 : public Renderer ...@@ -146,6 +146,8 @@ class Renderer9 : public Renderer
virtual GLsizei getMaxSupportedSamples() const; virtual GLsizei getMaxSupportedSamples() const;
int getNearestSupportedSamples(D3DFORMAT format, int requested) const; int getNearestSupportedSamples(D3DFORMAT format, int requested) const;
virtual unsigned int getMaxRenderTargets() const;
D3DFORMAT ConvertTextureInternalFormat(GLint internalformat); D3DFORMAT ConvertTextureInternalFormat(GLint internalformat);
// Pixel operations // Pixel operations
......
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