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
ANGLERenderTest::ANGLERenderTest(const std::string &name, const RenderTestParams &testParams)
: ANGLEPerfTest(name, testParams.suffix()),
mTestParams(testParams),
mEGLWindow(nullptr),
mEGLWindow(createEGLWindow(testParams)),
mOSWindow(nullptr)
{
}
......@@ -133,7 +133,7 @@ ANGLERenderTest::ANGLERenderTest(const std::string &name,
const std::vector<std::string> &extensionPrerequisites)
: ANGLEPerfTest(name, testParams.suffix()),
mTestParams(testParams),
mEGLWindow(nullptr),
mEGLWindow(createEGLWindow(testParams)),
mOSWindow(nullptr),
mExtensionPrerequisites(extensionPrerequisites)
{
......@@ -150,8 +150,7 @@ void ANGLERenderTest::SetUp()
ANGLEPerfTest::SetUp();
mOSWindow = CreateOSWindow();
mEGLWindow = new EGLWindow(mTestParams.majorVersion, mTestParams.minorVersion,
mTestParams.eglParameters);
ASSERT(mEGLWindow != nullptr);
mEGLWindow->setSwapInterval(0);
mPlatformMethods.overrideWorkaroundsD3D = OverrideWorkaroundsD3D;
......@@ -258,4 +257,21 @@ bool ANGLERenderTest::areExtensionPrerequisitesFulfilled() const
}
}
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
protected:
const RenderTestParams &mTestParams;
void setWebGLCompatibilityEnabled(bool webglCompatibility);
void setRobustResourceInit(bool enabled);
private:
void SetUp() override;
void TearDown() override;
......@@ -114,6 +117,8 @@ class ANGLERenderTest : public ANGLEPerfTest
bool areExtensionPrerequisitesFulfilled() const;
static EGLWindow *createEGLWindow(const RenderTestParams &testParams);
EGLWindow *mEGLWindow;
OSWindow *mOSWindow;
std::vector<std::string> mExtensionPrerequisites;
......
......@@ -33,6 +33,8 @@ struct TexturesParams final : public RenderTestParams
textureRebindFrequency = 5;
textureStateUpdateFrequency = 3;
textureMipCount = 8;
webgl = false;
}
std::string suffix() const override;
......@@ -41,6 +43,8 @@ struct TexturesParams final : public RenderTestParams
size_t textureStateUpdateFrequency;
size_t textureMipCount;
bool webgl;
// static parameters
size_t iterations;
};
......@@ -61,6 +65,11 @@ std::string TexturesParams::suffix() const
strstr << "_" << textureStateUpdateFrequency << "_state";
strstr << "_" << textureMipCount << "_mips";
if (webgl)
{
strstr << "_webgl";
}
return strstr.str();
}
......@@ -86,6 +95,8 @@ class TexturesBenchmark : public ANGLERenderTest,
TexturesBenchmark::TexturesBenchmark() : ANGLERenderTest("Textures", GetParam()), mProgram(0u)
{
setWebGLCompatibilityEnabled(GetParam().webgl);
setRobustResourceInit(GetParam().webgl);
}
void TexturesBenchmark::initializeBenchmark()
......@@ -262,24 +273,27 @@ void TexturesBenchmark::drawBenchmark()
ASSERT_GL_NO_ERROR();
}
TexturesParams D3D11Params()
TexturesParams D3D11Params(bool webglCompat)
{
TexturesParams params;
params.eglParameters = egl_platform::D3D11_NULL();
params.webgl = webglCompat;
return params;
}
TexturesParams D3D9Params()
TexturesParams D3D9Params(bool webglCompat)
{
TexturesParams params;
params.eglParameters = egl_platform::D3D9_NULL();
params.webgl = webglCompat;
return params;
}
TexturesParams OpenGLOrGLESParams()
TexturesParams OpenGLOrGLESParams(bool webglCompat)
{
TexturesParams params;
params.eglParameters = egl_platform::OPENGL_OR_GLES(true);
params.webgl = webglCompat;
return params;
}
......@@ -288,6 +302,11 @@ TEST_P(TexturesBenchmark, 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
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