Commit 7bd13082 by Geoff Lang

Set seamless cubemap filtering in StateManagerGL.

Cubemap filtering is supposed to be seamless for ES3+ contexts. Fixes 298 failures in dEQP-GLES3.functional.texture, mostly in dEQP-GLES3.functional.texture.filtering and dEQP-GLES3.functional.texture.shadow. BUG=angleproject:986 BUG=angleproject:1149 Change-Id: I6054365086bb3b9d9b085c260f88e2c43eb75bfe Reviewed-on: https://chromium-review.googlesource.com/296966Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 98233372
...@@ -91,6 +91,7 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren ...@@ -91,6 +91,7 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren
mClearColor(0.0f, 0.0f, 0.0f, 0.0f), mClearColor(0.0f, 0.0f, 0.0f, 0.0f),
mClearDepth(1.0f), mClearDepth(1.0f),
mClearStencil(0), mClearStencil(0),
mTextureCubemapSeamlessEnabled(false),
mLocalDirtyBits() mLocalDirtyBits()
{ {
ASSERT(mFunctions); ASSERT(mFunctions);
...@@ -504,6 +505,9 @@ gl::Error StateManagerGL::setGenericDrawState(const gl::Data &data) ...@@ -504,6 +505,9 @@ gl::Error StateManagerGL::setGenericDrawState(const gl::Data &data)
const FramebufferGL *framebufferGL = GetImplAs<FramebufferGL>(framebuffer); const FramebufferGL *framebufferGL = GetImplAs<FramebufferGL>(framebuffer);
bindFramebuffer(GL_DRAW_FRAMEBUFFER, framebufferGL->getFramebufferID()); bindFramebuffer(GL_DRAW_FRAMEBUFFER, framebufferGL->getFramebufferID());
// Seamless cubemaps are required for ES3 and higher contexts.
setTextureCubemapSeamlessEnabled(data.clientVersion >= 3);
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
...@@ -1241,4 +1245,21 @@ void StateManagerGL::syncState(const gl::State &state, const gl::State::DirtyBit ...@@ -1241,4 +1245,21 @@ void StateManagerGL::syncState(const gl::State &state, const gl::State::DirtyBit
mLocalDirtyBits.reset(); mLocalDirtyBits.reset();
} }
} }
void StateManagerGL::setTextureCubemapSeamlessEnabled(bool enabled)
{
if (mTextureCubemapSeamlessEnabled != enabled)
{
mTextureCubemapSeamlessEnabled = enabled;
if (mTextureCubemapSeamlessEnabled)
{
mFunctions->enable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
}
else
{
mFunctions->disable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
}
}
}
} }
...@@ -126,6 +126,8 @@ class StateManagerGL final : angle::NonCopyable ...@@ -126,6 +126,8 @@ class StateManagerGL final : angle::NonCopyable
private: private:
gl::Error setGenericDrawState(const gl::Data &data); gl::Error setGenericDrawState(const gl::Data &data);
void setTextureCubemapSeamlessEnabled(bool enabled);
const FunctionsGL *mFunctions; const FunctionsGL *mFunctions;
GLuint mProgram; GLuint mProgram;
...@@ -213,6 +215,8 @@ class StateManagerGL final : angle::NonCopyable ...@@ -213,6 +215,8 @@ class StateManagerGL final : angle::NonCopyable
float mClearDepth; float mClearDepth;
GLint mClearStencil; GLint mClearStencil;
bool mTextureCubemapSeamlessEnabled;
gl::State::DirtyBits mLocalDirtyBits; gl::State::DirtyBits mLocalDirtyBits;
}; };
......
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