Commit c801e359 by Geoff Lang Committed by Commit Bot

Add configurations of the TexturePerf benchmark that use robust init.

BUG=angleproject:2188 Change-Id: Ia23b54044a85435c761478bceeb9aac961fac0d1 Reviewed-on: https://chromium-review.googlesource.com/783230Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 7f738d4e
...@@ -123,7 +123,7 @@ std::string RenderTestParams::suffix() const ...@@ -123,7 +123,7 @@ std::string RenderTestParams::suffix() const
ANGLERenderTest::ANGLERenderTest(const std::string &name, const RenderTestParams &testParams) ANGLERenderTest::ANGLERenderTest(const std::string &name, const RenderTestParams &testParams)
: ANGLEPerfTest(name, testParams.suffix()), : ANGLEPerfTest(name, testParams.suffix()),
mTestParams(testParams), mTestParams(testParams),
mEGLWindow(nullptr), mEGLWindow(createEGLWindow(testParams)),
mOSWindow(nullptr) mOSWindow(nullptr)
{ {
} }
...@@ -133,7 +133,7 @@ ANGLERenderTest::ANGLERenderTest(const std::string &name, ...@@ -133,7 +133,7 @@ ANGLERenderTest::ANGLERenderTest(const std::string &name,
const std::vector<std::string> &extensionPrerequisites) const std::vector<std::string> &extensionPrerequisites)
: ANGLEPerfTest(name, testParams.suffix()), : ANGLEPerfTest(name, testParams.suffix()),
mTestParams(testParams), mTestParams(testParams),
mEGLWindow(nullptr), mEGLWindow(createEGLWindow(testParams)),
mOSWindow(nullptr), mOSWindow(nullptr),
mExtensionPrerequisites(extensionPrerequisites) mExtensionPrerequisites(extensionPrerequisites)
{ {
...@@ -150,8 +150,7 @@ void ANGLERenderTest::SetUp() ...@@ -150,8 +150,7 @@ void ANGLERenderTest::SetUp()
ANGLEPerfTest::SetUp(); ANGLEPerfTest::SetUp();
mOSWindow = CreateOSWindow(); mOSWindow = CreateOSWindow();
mEGLWindow = new EGLWindow(mTestParams.majorVersion, mTestParams.minorVersion, ASSERT(mEGLWindow != nullptr);
mTestParams.eglParameters);
mEGLWindow->setSwapInterval(0); mEGLWindow->setSwapInterval(0);
mPlatformMethods.overrideWorkaroundsD3D = OverrideWorkaroundsD3D; mPlatformMethods.overrideWorkaroundsD3D = OverrideWorkaroundsD3D;
...@@ -258,4 +257,21 @@ bool ANGLERenderTest::areExtensionPrerequisitesFulfilled() const ...@@ -258,4 +257,21 @@ bool ANGLERenderTest::areExtensionPrerequisitesFulfilled() const
} }
} }
return true; return true;
} }
\ No newline at end of file
void ANGLERenderTest::setWebGLCompatibilityEnabled(bool webglCompatibility)
{
mEGLWindow->setWebGLCompatibilityEnabled(webglCompatibility);
}
void ANGLERenderTest::setRobustResourceInit(bool enabled)
{
mEGLWindow->setRobustResourceInit(enabled);
}
// static
EGLWindow *ANGLERenderTest::createEGLWindow(const RenderTestParams &testParams)
{
return new EGLWindow(testParams.majorVersion, testParams.minorVersion,
testParams.eglParameters);
}
...@@ -105,6 +105,9 @@ class ANGLERenderTest : public ANGLEPerfTest ...@@ -105,6 +105,9 @@ class ANGLERenderTest : public ANGLEPerfTest
protected: protected:
const RenderTestParams &mTestParams; const RenderTestParams &mTestParams;
void setWebGLCompatibilityEnabled(bool webglCompatibility);
void setRobustResourceInit(bool enabled);
private: private:
void SetUp() override; void SetUp() override;
void TearDown() override; void TearDown() override;
...@@ -114,6 +117,8 @@ class ANGLERenderTest : public ANGLEPerfTest ...@@ -114,6 +117,8 @@ class ANGLERenderTest : public ANGLEPerfTest
bool areExtensionPrerequisitesFulfilled() const; bool areExtensionPrerequisitesFulfilled() const;
static EGLWindow *createEGLWindow(const RenderTestParams &testParams);
EGLWindow *mEGLWindow; EGLWindow *mEGLWindow;
OSWindow *mOSWindow; OSWindow *mOSWindow;
std::vector<std::string> mExtensionPrerequisites; std::vector<std::string> mExtensionPrerequisites;
......
...@@ -33,6 +33,8 @@ struct TexturesParams final : public RenderTestParams ...@@ -33,6 +33,8 @@ struct TexturesParams final : public RenderTestParams
textureRebindFrequency = 5; textureRebindFrequency = 5;
textureStateUpdateFrequency = 3; textureStateUpdateFrequency = 3;
textureMipCount = 8; textureMipCount = 8;
webgl = false;
} }
std::string suffix() const override; std::string suffix() const override;
...@@ -41,6 +43,8 @@ struct TexturesParams final : public RenderTestParams ...@@ -41,6 +43,8 @@ struct TexturesParams final : public RenderTestParams
size_t textureStateUpdateFrequency; size_t textureStateUpdateFrequency;
size_t textureMipCount; size_t textureMipCount;
bool webgl;
// static parameters // static parameters
size_t iterations; size_t iterations;
}; };
...@@ -61,6 +65,11 @@ std::string TexturesParams::suffix() const ...@@ -61,6 +65,11 @@ std::string TexturesParams::suffix() const
strstr << "_" << textureStateUpdateFrequency << "_state"; strstr << "_" << textureStateUpdateFrequency << "_state";
strstr << "_" << textureMipCount << "_mips"; strstr << "_" << textureMipCount << "_mips";
if (webgl)
{
strstr << "_webgl";
}
return strstr.str(); return strstr.str();
} }
...@@ -86,6 +95,8 @@ class TexturesBenchmark : public ANGLERenderTest, ...@@ -86,6 +95,8 @@ class TexturesBenchmark : public ANGLERenderTest,
TexturesBenchmark::TexturesBenchmark() : ANGLERenderTest("Textures", GetParam()), mProgram(0u) TexturesBenchmark::TexturesBenchmark() : ANGLERenderTest("Textures", GetParam()), mProgram(0u)
{ {
setWebGLCompatibilityEnabled(GetParam().webgl);
setRobustResourceInit(GetParam().webgl);
} }
void TexturesBenchmark::initializeBenchmark() void TexturesBenchmark::initializeBenchmark()
...@@ -262,24 +273,27 @@ void TexturesBenchmark::drawBenchmark() ...@@ -262,24 +273,27 @@ void TexturesBenchmark::drawBenchmark()
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
} }
TexturesParams D3D11Params() TexturesParams D3D11Params(bool webglCompat)
{ {
TexturesParams params; TexturesParams params;
params.eglParameters = egl_platform::D3D11_NULL(); params.eglParameters = egl_platform::D3D11_NULL();
params.webgl = webglCompat;
return params; return params;
} }
TexturesParams D3D9Params() TexturesParams D3D9Params(bool webglCompat)
{ {
TexturesParams params; TexturesParams params;
params.eglParameters = egl_platform::D3D9_NULL(); params.eglParameters = egl_platform::D3D9_NULL();
params.webgl = webglCompat;
return params; return params;
} }
TexturesParams OpenGLOrGLESParams() TexturesParams OpenGLOrGLESParams(bool webglCompat)
{ {
TexturesParams params; TexturesParams params;
params.eglParameters = egl_platform::OPENGL_OR_GLES(true); params.eglParameters = egl_platform::OPENGL_OR_GLES(true);
params.webgl = webglCompat;
return params; return params;
} }
...@@ -288,6 +302,11 @@ TEST_P(TexturesBenchmark, Run) ...@@ -288,6 +302,11 @@ TEST_P(TexturesBenchmark, Run)
run(); run();
} }
ANGLE_INSTANTIATE_TEST(TexturesBenchmark, D3D11Params(), D3D9Params(), OpenGLOrGLESParams()); ANGLE_INSTANTIATE_TEST(TexturesBenchmark,
D3D11Params(false),
D3D11Params(true),
D3D9Params(true),
OpenGLOrGLESParams(false),
OpenGLOrGLESParams(true));
} // namespace angle } // namespace angle
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