Commit bb3f1802 by Geoff Lang

Remove swap interval queries from Renderer.

BUG=angle:658 Change-Id: I7cd9cf3693c06c46ec6a4054e8fe1586f399273c Reviewed-on: https://chromium-review.googlesource.com/239903Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 784cc8f6
......@@ -118,8 +118,6 @@ class Renderer
// TODO(jmadill): needed by egl::Display, probably should be removed
virtual int getMajorShaderModel() const = 0;
virtual int getMinSwapInterval() const = 0;
virtual int getMaxSwapInterval() const = 0;
private:
DISALLOW_COPY_AND_ASSIGN(Renderer);
......
......@@ -365,8 +365,8 @@ void SurfaceD3D::setSwapInterval(EGLint interval)
}
mSwapInterval = interval;
mSwapInterval = std::max(mSwapInterval, mRenderer->getMinSwapInterval());
mSwapInterval = std::min(mSwapInterval, mRenderer->getMaxSwapInterval());
mSwapInterval = std::max(mSwapInterval, mConfig->minSwapInterval);
mSwapInterval = std::min(mSwapInterval, mConfig->maxSwapInterval);
mSwapIntervalDirty = true;
}
......
......@@ -2157,16 +2157,6 @@ std::string Renderer11::getShaderModelSuffix() const
}
}
int Renderer11::getMinSwapInterval() const
{
return 0;
}
int Renderer11::getMaxSwapInterval() const
{
return 4;
}
gl::Error Renderer11::copyImage2D(const gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
const gl::Offset &destOffset, TextureStorage *storage, GLint level)
{
......
......@@ -114,8 +114,6 @@ class Renderer11 : public RendererD3D
virtual int getMajorShaderModel() const;
int getMinorShaderModel() const override;
std::string getShaderModelSuffix() const override;
virtual int getMinSwapInterval() const;
virtual int getMaxSwapInterval() const;
// Pixel operations
virtual gl::Error copyImage2D(const gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
......
......@@ -256,35 +256,6 @@ EGLint Renderer9::initialize()
mD3d9->GetAdapterIdentifier(mAdapter, 0, &mAdapterIdentifier);
}
mMinSwapInterval = 4;
mMaxSwapInterval = 0;
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE)
{
mMinSwapInterval = std::min(mMinSwapInterval, 0);
mMaxSwapInterval = std::max(mMaxSwapInterval, 0);
}
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_ONE)
{
mMinSwapInterval = std::min(mMinSwapInterval, 1);
mMaxSwapInterval = std::max(mMaxSwapInterval, 1);
}
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_TWO)
{
mMinSwapInterval = std::min(mMinSwapInterval, 2);
mMaxSwapInterval = std::max(mMaxSwapInterval, 2);
}
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_THREE)
{
mMinSwapInterval = std::min(mMinSwapInterval, 3);
mMaxSwapInterval = std::max(mMaxSwapInterval, 3);
}
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_FOUR)
{
mMinSwapInterval = std::min(mMinSwapInterval, 4);
mMaxSwapInterval = std::max(mMaxSwapInterval, 4);
}
static const TCHAR windowName[] = TEXT("AngleHiddenWindow");
static const TCHAR className[] = TEXT("STATIC");
......@@ -434,6 +405,36 @@ egl::ConfigSet Renderer9::generateConfigs() const
D3DDISPLAYMODE currentDisplayMode;
mD3d9->GetAdapterDisplayMode(mAdapter, &currentDisplayMode);
// Determine the min and max swap intervals
int minSwapInterval = 4;
int maxSwapInterval = 0;
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE)
{
minSwapInterval = std::min(minSwapInterval, 0);
maxSwapInterval = std::max(maxSwapInterval, 0);
}
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_ONE)
{
minSwapInterval = std::min(minSwapInterval, 1);
maxSwapInterval = std::max(maxSwapInterval, 1);
}
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_TWO)
{
minSwapInterval = std::min(minSwapInterval, 2);
maxSwapInterval = std::max(maxSwapInterval, 2);
}
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_THREE)
{
minSwapInterval = std::min(minSwapInterval, 3);
maxSwapInterval = std::max(maxSwapInterval, 3);
}
if (mDeviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_FOUR)
{
minSwapInterval = std::min(minSwapInterval, 4);
maxSwapInterval = std::max(maxSwapInterval, 4);
}
egl::ConfigSet configs;
for (size_t formatIndex = 0; formatIndex < ArraySize(colorBufferFormats); formatIndex++)
{
......@@ -474,8 +475,8 @@ egl::ConfigSet Renderer9::generateConfigs() const
config.maxPBufferWidth = rendererCaps.max2DTextureSize;
config.maxPBufferHeight = rendererCaps.max2DTextureSize;
config.maxPBufferPixels = rendererCaps.max2DTextureSize * rendererCaps.max2DTextureSize;
config.maxSwapInterval = mMaxSwapInterval;
config.minSwapInterval = mMinSwapInterval;
config.maxSwapInterval = maxSwapInterval;
config.minSwapInterval = minSwapInterval;
config.nativeRenderable = EGL_FALSE;
config.nativeVisualID = 0;
config.nativeVisualType = EGL_NONE;
......@@ -2470,16 +2471,6 @@ DWORD Renderer9::getCapsDeclTypes() const
return mDeviceCaps.DeclTypes;
}
int Renderer9::getMinSwapInterval() const
{
return mMinSwapInterval;
}
int Renderer9::getMaxSwapInterval() const
{
return mMaxSwapInterval;
}
D3DPOOL Renderer9::getBufferPool(DWORD usage) const
{
if (mD3d9Ex != NULL)
......
......@@ -123,8 +123,6 @@ class Renderer9 : public RendererD3D
std::string getShaderModelSuffix() const override;
DWORD getCapsDeclTypes() const;
virtual int getMinSwapInterval() const;
virtual int getMaxSwapInterval() const;
// Pixel operations
virtual gl::Error copyImage2D(const gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
......@@ -258,8 +256,6 @@ class Renderer9 : public RendererD3D
GLsizei mRepeatDraw;
bool mSceneStarted;
int mMinSwapInterval;
int mMaxSwapInterval;
bool mVertexTextureSupport;
......
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