Eliminated D3DADAPTER_IDENTIFIER9 uses.

TRAC #21963 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1356 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 024786d7
...@@ -2056,8 +2056,7 @@ void Context::applyState(GLenum drawMode) ...@@ -2056,8 +2056,7 @@ void Context::applyState(GLenum drawMode)
GLint alwaysFront = !isTriangleMode(drawMode); GLint alwaysFront = !isTriangleMode(drawMode);
programBinary->setUniform1iv(pointsOrLines, 1, &alwaysFront); programBinary->setUniform1iv(pointsOrLines, 1, &alwaysFront);
D3DADAPTER_IDENTIFIER9 *identifier = mRenderer->getAdapterIdentifier(); bool zeroColorMaskAllowed = mRenderer->getAdapterVendor() != VENDOR_ID_AMD;
bool zeroColorMaskAllowed = identifier->VendorId != 0x1002;
// Apparently some ATI cards have a bug where a draw with a zero color // Apparently some ATI cards have a bug where a draw with a zero color
// write mask can cause later draws to have incorrect results. Instead, // write mask can cause later draws to have incorrect results. Instead,
// set a nonzero color write mask but modify the blend state so that no // set a nonzero color write mask but modify the blend state so that no
...@@ -3893,10 +3892,8 @@ const char *Context::getExtensionString() const ...@@ -3893,10 +3892,8 @@ const char *Context::getExtensionString() const
void Context::initRendererString() void Context::initRendererString()
{ {
D3DADAPTER_IDENTIFIER9 *identifier = mRenderer->getAdapterIdentifier();
mRendererString = "ANGLE ("; mRendererString = "ANGLE (";
mRendererString += identifier->Description; mRendererString += mRenderer->getAdapterDescription();
mRendererString += ")"; mRendererString += ")";
} }
......
...@@ -1746,9 +1746,8 @@ bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length) ...@@ -1746,9 +1746,8 @@ bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length)
const D3DCAPS9 *binaryIdentifier = (const D3DCAPS9*) ptr; const D3DCAPS9 *binaryIdentifier = (const D3DCAPS9*) ptr;
ptr += sizeof(GUID); ptr += sizeof(GUID);
// D3D9_REPLACE GUID identifier = mRenderer->getAdapterIdentifier();
D3DADAPTER_IDENTIFIER9 *currentIdentifier = mRenderer->getAdapterIdentifier(); if (memcmp(&identifier, binaryIdentifier, sizeof(GUID)) != 0)
if (memcmp(&currentIdentifier->DeviceIdentifier, binaryIdentifier, sizeof(GUID)) != 0)
{ {
infoLog.append("Invalid program binary."); infoLog.append("Invalid program binary.");
return false; return false;
...@@ -1853,8 +1852,7 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length) ...@@ -1853,8 +1852,7 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
stream.write(vertexShaderSize); stream.write(vertexShaderSize);
// D3D9_REPLACE GUID identifier = mRenderer->getAdapterIdentifier();
D3DADAPTER_IDENTIFIER9 *identifier = mRenderer->getAdapterIdentifier();
GLsizei streamLength = stream.length(); GLsizei streamLength = stream.length();
const void *streamData = stream.data(); const void *streamData = stream.data();
...@@ -1877,7 +1875,7 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length) ...@@ -1877,7 +1875,7 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)
memcpy(ptr, streamData, streamLength); memcpy(ptr, streamData, streamLength);
ptr += streamLength; ptr += streamLength;
memcpy(ptr, &identifier->DeviceIdentifier, sizeof(GUID)); memcpy(ptr, &identifier, sizeof(GUID));
ptr += sizeof(GUID); ptr += sizeof(GUID);
result = mPixelExecutable->GetFunction(ptr, &pixelShaderSize); result = mPixelExecutable->GetFunction(ptr, &pixelShaderSize);
......
...@@ -683,6 +683,21 @@ bool Renderer::resetDevice() ...@@ -683,6 +683,21 @@ bool Renderer::resetDevice()
return true; return true;
} }
DWORD Renderer::getAdapterVendor() const
{
return mAdapterIdentifier.VendorId;
}
const char *Renderer::getAdapterDescription() const
{
return mAdapterIdentifier.Description;
}
GUID Renderer::getAdapterIdentifier() const
{
return mAdapterIdentifier.DeviceIdentifier;
}
void Renderer::getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray) void Renderer::getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray)
{ {
for (int multiSampleIndex = 0; multiSampleIndex <= D3DMULTISAMPLE_16_SAMPLES; multiSampleIndex++) for (int multiSampleIndex = 0; multiSampleIndex <= D3DMULTISAMPLE_16_SAMPLES; multiSampleIndex++)
......
...@@ -102,7 +102,9 @@ class Renderer ...@@ -102,7 +102,9 @@ class Renderer
// Renderer capabilities // Renderer capabilities
virtual IDirect3DDevice9 *getDevice() {return mDevice;}; // D3D9_REPLACE virtual IDirect3DDevice9 *getDevice() {return mDevice;}; // D3D9_REPLACE
virtual D3DADAPTER_IDENTIFIER9 *getAdapterIdentifier() {return &mAdapterIdentifier;}; // D3D9_REPLACE virtual DWORD getAdapterVendor() const;
virtual const char *getAdapterDescription() const;
virtual GUID getAdapterIdentifier() const;
virtual bool isD3d9ExDevice() const { return mD3d9Ex != NULL; } // D3D9_REMOVE virtual bool isD3d9ExDevice() const { return mD3d9Ex != NULL; } // D3D9_REMOVE
virtual bool getDXT1TextureSupport(); virtual bool getDXT1TextureSupport();
......
...@@ -209,8 +209,7 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn ...@@ -209,8 +209,7 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn
// //
// Some non-switchable AMD GPUs / drivers do not respect the source rectangle to Present. Therefore, when the vendor ID // Some non-switchable AMD GPUs / drivers do not respect the source rectangle to Present. Therefore, when the vendor ID
// is not Intel, the back buffer width must be exactly the same width as the window or horizontal scaling will occur. // is not Intel, the back buffer width must be exactly the same width as the window or horizontal scaling will occur.
D3DADAPTER_IDENTIFIER9* adapterIdentifier = mRenderer->getAdapterIdentifier(); if (mRenderer->getAdapterVendor() == VENDOR_ID_INTEL)
if (adapterIdentifier->VendorId == VENDOR_ID_INTEL)
{ {
presentParameters.BackBufferWidth = (presentParameters.BackBufferWidth + 63) / 64 * 64; presentParameters.BackBufferWidth = (presentParameters.BackBufferWidth + 63) / 64 * 64;
} }
......
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