Move Sharehandle support query to renderer

Trac #21727 git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1330 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 621ce053
......@@ -669,6 +669,7 @@ void Display::freeEventQuery(IDirect3DQuery9* query)
void Display::initExtensionString()
{
HMODULE swiftShader = GetModuleHandle(TEXT("swiftshader_d3d9.dll"));
bool shareHandleSupported = mRenderer->getShareHandleSupport();
mExtensionString = "";
......@@ -676,7 +677,7 @@ void Display::initExtensionString()
mExtensionString += "EGL_EXT_create_context_robustness ";
// ANGLE-specific extensions
if (shareHandleSupported())
if (shareHandleSupported)
{
mExtensionString += "EGL_ANGLE_d3d_share_handle_client_buffer ";
}
......@@ -688,7 +689,7 @@ void Display::initExtensionString()
mExtensionString += "EGL_ANGLE_software_display ";
}
if (shareHandleSupported())
if (shareHandleSupported)
{
mExtensionString += "EGL_ANGLE_surface_d3d_texture_2d_share_handle ";
}
......@@ -707,13 +708,6 @@ const char *Display::getExtensionString() const
return mExtensionString.c_str();
}
bool Display::shareHandleSupported() const
{
// PIX doesn't seem to support using share handles, so disable them.
// D3D9_REPLACE
return mRenderer->isD3d9ExDevice() && !gl::perfActive();
}
IDirect3DVertexShader9 *Display::createVertexShader(const DWORD *function, size_t length)
{
return mVertexShaderCache.create(function, length);
......
......@@ -66,7 +66,6 @@ class Display
virtual void notifyDeviceLost();
const char *getExtensionString() const;
bool shareHandleSupported() const;
virtual IDirect3DVertexShader9 *createVertexShader(const DWORD *function, size_t length);
virtual IDirect3DPixelShader9 *createPixelShader(const DWORD *function, size_t length);
......
......@@ -204,7 +204,7 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
mShareHandle = NULL;
HANDLE *pShareHandle = NULL;
if (!mWindow && mDisplay->shareHandleSupported())
if (!mWindow && renderer->getShareHandleSupport())
{
pShareHandle = &mShareHandle;
}
......
......@@ -573,6 +573,12 @@ bool Renderer::getInstancingSupport() const
return mDeviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0);
}
bool Renderer::getShareHandleSupport() const
{
// PIX doesn't seem to support using share handles, so disable them.
// D3D9_REPLACE
return isD3d9ExDevice() && !gl::perfActive();
}
D3DPOOL Renderer::getBufferPool(DWORD usage) const
{
......
......@@ -95,6 +95,7 @@ class Renderer
virtual bool getOcclusionQuerySupport() const;
virtual bool getInstancingSupport() const;
virtual float getTextureFilterAnisotropySupport() const;
virtual bool getShareHandleSupport() const;
virtual D3DPOOL getBufferPool(DWORD usage) const;
virtual D3DPOOL getTexturePool(DWORD usage) const;
......
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