Commit 6c762d08 by jbauman@chromium.org

Disable getting share handles when PIX is enabled.

PIX doesn't seem to work with share handles, so disable them when we detect that pix is enabled. BUG= TEST= Review URL: https://codereview.appspot.com/5625048 git-svn-id: https://angleproject.googlecode.com/svn/trunk@982 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent cb37afdb
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 981 #define BUILD_REVISION 982
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -1131,7 +1131,6 @@ D3DPRESENT_PARAMETERS Display::getDefaultPresentParameters() ...@@ -1131,7 +1131,6 @@ D3DPRESENT_PARAMETERS Display::getDefaultPresentParameters()
void Display::initExtensionString() void Display::initExtensionString()
{ {
HMODULE swiftShader = GetModuleHandle(TEXT("swiftshader_d3d9.dll")); HMODULE swiftShader = GetModuleHandle(TEXT("swiftshader_d3d9.dll"));
bool isd3d9ex = isD3d9ExDevice();
mExtensionString = ""; mExtensionString = "";
...@@ -1139,7 +1138,7 @@ void Display::initExtensionString() ...@@ -1139,7 +1138,7 @@ void Display::initExtensionString()
mExtensionString += "EGL_EXT_create_context_robustness "; mExtensionString += "EGL_EXT_create_context_robustness ";
// ANGLE-specific extensions // ANGLE-specific extensions
if (isd3d9ex) if (shareHandleSupported())
{ {
mExtensionString += "EGL_ANGLE_d3d_share_handle_client_buffer "; mExtensionString += "EGL_ANGLE_d3d_share_handle_client_buffer ";
} }
...@@ -1151,7 +1150,7 @@ void Display::initExtensionString() ...@@ -1151,7 +1150,7 @@ void Display::initExtensionString()
mExtensionString += "EGL_ANGLE_software_display "; mExtensionString += "EGL_ANGLE_software_display ";
} }
if (isd3d9ex) if (shareHandleSupported())
{ {
mExtensionString += "EGL_ANGLE_surface_d3d_texture_2d_share_handle "; mExtensionString += "EGL_ANGLE_surface_d3d_texture_2d_share_handle ";
} }
...@@ -1170,6 +1169,12 @@ const char *Display::getExtensionString() const ...@@ -1170,6 +1169,12 @@ const char *Display::getExtensionString() const
return mExtensionString.c_str(); return mExtensionString.c_str();
} }
bool Display::shareHandleSupported() const
{
// PIX doesn't seem to support using share handles, so disable them.
return isD3d9ExDevice() && !gl::perfActive();
}
// Only Direct3D 10 ready devices support all the necessary vertex texture formats. // Only Direct3D 10 ready devices support all the necessary vertex texture formats.
// We test this using D3D9 by checking support for the R16F format. // We test this using D3D9 by checking support for the R16F format.
bool Display::getVertexTextureSupport() const bool Display::getVertexTextureSupport() const
......
...@@ -86,8 +86,9 @@ class Display ...@@ -86,8 +86,9 @@ class Display
virtual void notifyDeviceLost(); virtual void notifyDeviceLost();
bool isDeviceLost(); bool isDeviceLost();
bool isD3d9ExDevice() { return mD3d9Ex != NULL; } bool isD3d9ExDevice() const { return mD3d9Ex != NULL; }
const char *getExtensionString() const; const char *getExtensionString() const;
bool shareHandleSupported() const;
private: private:
DISALLOW_COPY_AND_ASSIGN(Display); DISALLOW_COPY_AND_ASSIGN(Display);
......
...@@ -253,7 +253,7 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight) ...@@ -253,7 +253,7 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
result = device->CreateAdditionalSwapChain(&presentParameters, &mSwapChain); result = device->CreateAdditionalSwapChain(&presentParameters, &mSwapChain);
} else { } else {
HANDLE *pShareHandle = NULL; HANDLE *pShareHandle = NULL;
if (mDisplay->isD3d9ExDevice()) { if (mDisplay->shareHandleSupported()) {
pShareHandle = &mShareHandle; pShareHandle = &mShareHandle;
} }
......
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