Commit fd8e0e6b by apatrick@chromium.org

Add adapter LUID to EGL vendor string.

This is so Chrome can create another D3D device on the same adapter that can share resources with ANGLE's D3D device. Review URL: https://codereview.appspot.com/9225046 git-svn-id: https://angleproject.googlecode.com/svn/trunk@2210 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0ca4a82c
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 2209
#define BUILD_REVISION 2210
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -319,6 +319,7 @@ bool Display::initialize()
}
initExtensionString();
initVendorString();
static const TCHAR windowName[] = TEXT("AngleHiddenWindow");
static const TCHAR className[] = TEXT("STATIC");
......@@ -1244,6 +1245,27 @@ const char *Display::getExtensionString() const
return mExtensionString.c_str();
}
void Display::initVendorString()
{
mVendorString = "Google Inc.";
if (mD3d9Ex)
{
LUID adapterLuid = {0};
mD3d9Ex->GetAdapterLUID(mAdapter, &adapterLuid);
char adapterLuidString[64];
sprintf_s(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08x%08x)", adapterLuid.HighPart, adapterLuid.LowPart);
mVendorString += adapterLuidString;
}
}
const char *Display::getVendorString() const
{
return mVendorString.c_str();
}
bool Display::shareHandleSupported() const
{
// PIX doesn't seem to support using share handles, so disable them.
......
......@@ -102,6 +102,7 @@ class Display
bool isD3d9ExDevice() const { return mD3d9Ex != NULL; }
const char *getExtensionString() const;
const char *getVendorString() const;
bool shareHandleSupported() const;
virtual IDirect3DVertexShader9 *createVertexShader(const DWORD *function, size_t length);
......@@ -163,6 +164,9 @@ class Display
void initExtensionString();
std::string mExtensionString;
void initVendorString();
std::string mVendorString;
typedef HRESULT (WINAPI *D3DCompileFunc)(LPCVOID pSrcData,
SIZE_T SrcDataSize,
LPCSTR pSourceName,
......
......@@ -178,9 +178,9 @@ const char *__stdcall eglQueryString(EGLDisplay dpy, EGLint name)
case EGL_CLIENT_APIS:
return success("OpenGL_ES");
case EGL_EXTENSIONS:
return display->getExtensionString();
return success(display->getExtensionString());
case EGL_VENDOR:
return success("Google Inc.");
return success(display->getVendorString());
case EGL_VERSION:
return success("1.4 (ANGLE " VERSION_STRING ")");
}
......
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