Commit c8c102b5 by Jamie Madill

Add a helper method to return the native format backing a GL texture type.

TRAC #23844 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
parent 8cc7d975
......@@ -265,6 +265,7 @@ class Renderer
GLenum destinationFormat, GLenum sourcePixelsType, const gl::Box &destArea) = 0;
virtual bool getLUID(LUID *adapterLuid) const = 0;
virtual GLint getNativeTextureFormat(GLint internalFormat) const = 0;
protected:
bool initializeCompiler();
......
......@@ -3338,6 +3338,12 @@ bool Renderer11::getLUID(LUID *adapterLuid) const
return true;
}
GLint Renderer11::getNativeTextureFormat(GLint internalFormat) const
{
int clientVersion = getCurrentClientVersion();
return d3d11_gl::GetInternalFormat(gl_d3d11::GetTexFormat(internalFormat, clientVersion), clientVersion);
}
Renderer11::MultisampleSupportInfo Renderer11::getMultisampleSupportInfo(DXGI_FORMAT format)
{
MultisampleSupportInfo supportInfo = { 0 };
......
......@@ -217,6 +217,7 @@ class Renderer11 : public Renderer
void setOneTimeRenderTarget(ID3D11RenderTargetView *renderTargetView);
virtual bool getLUID(LUID *adapterLuid) const;
virtual GLint getNativeTextureFormat(GLint internalFormat) const;
private:
DISALLOW_COPY_AND_ASSIGN(Renderer11);
......
......@@ -3329,4 +3329,9 @@ bool Renderer9::getLUID(LUID *adapterLuid) const
return false;
}
GLint Renderer9::getNativeTextureFormat(GLint internalFormat) const
{
return d3d9_gl::GetInternalFormat(gl_d3d9::GetTextureFormat(internalFormat, this));
}
}
......@@ -227,6 +227,7 @@ class Renderer9 : public Renderer
D3DPOOL getTexturePool(DWORD usage) const;
virtual bool getLUID(LUID *adapterLuid) const;
virtual GLint getNativeTextureFormat(GLint internalFormat) const;
private:
DISALLOW_COPY_AND_ASSIGN(Renderer9);
......
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