Commit 4e577a2a by Jamie Madill Committed by Commit Bot

Perf Tests: Make "offscreen" a common test param.

This will let us use it in the trace perf tests. Bug: angleproject:4845 Change-Id: I6188a0765c6f482bb38842faa4c58209c70b0153 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2300206Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 9b9472c3
...@@ -416,7 +416,7 @@ std::string RenderTestParams::backend() const ...@@ -416,7 +416,7 @@ std::string RenderTestParams::backend() const
std::string RenderTestParams::story() const std::string RenderTestParams::story() const
{ {
return ""; return (surfaceType == SurfaceType::Offscreen ? "_offscreen" : "");
} }
std::string RenderTestParams::backendAndStory() const std::string RenderTestParams::backendAndStory() const
......
...@@ -104,6 +104,12 @@ class ANGLEPerfTest : public testing::Test, angle::NonCopyable ...@@ -104,6 +104,12 @@ class ANGLEPerfTest : public testing::Test, angle::NonCopyable
bool mRunning; bool mRunning;
}; };
enum class SurfaceType
{
Window,
Offscreen,
};
struct RenderTestParams : public angle::PlatformParameters struct RenderTestParams : public angle::PlatformParameters
{ {
virtual ~RenderTestParams() {} virtual ~RenderTestParams() {}
...@@ -116,6 +122,7 @@ struct RenderTestParams : public angle::PlatformParameters ...@@ -116,6 +122,7 @@ struct RenderTestParams : public angle::PlatformParameters
EGLint windowHeight = 64; EGLint windowHeight = 64;
unsigned int iterationsPerStep = 0; unsigned int iterationsPerStep = 0;
bool trackGpuTime = false; bool trackGpuTime = false;
SurfaceType surfaceType = SurfaceType::Window;
}; };
class ANGLERenderTest : public ANGLEPerfTest class ANGLERenderTest : public ANGLEPerfTest
...@@ -190,8 +197,8 @@ namespace params ...@@ -190,8 +197,8 @@ namespace params
template <typename ParamsT> template <typename ParamsT>
ParamsT Offscreen(const ParamsT &input) ParamsT Offscreen(const ParamsT &input)
{ {
ParamsT output = input; ParamsT output = input;
output.offscreen = true; output.surfaceType = SurfaceType::Offscreen;
return output; return output;
} }
......
...@@ -205,7 +205,7 @@ void main() ...@@ -205,7 +205,7 @@ void main()
// Set the viewport // Set the viewport
glViewport(0, 0, getWindow()->getWidth(), getWindow()->getHeight()); glViewport(0, 0, getWindow()->getWidth(), getWindow()->getHeight());
if (params.offscreen) if (params.surfaceType == SurfaceType::Offscreen)
{ {
CreateColorFBO(getWindow()->getWidth(), getWindow()->getHeight(), &mFBOTexture, &mFBO); CreateColorFBO(getWindow()->getWidth(), getWindow()->getHeight(), &mFBOTexture, &mFBO);
} }
......
...@@ -26,7 +26,6 @@ DrawCallPerfParams::DrawCallPerfParams() ...@@ -26,7 +26,6 @@ DrawCallPerfParams::DrawCallPerfParams()
#endif #endif
runTimeSeconds = 10.0; runTimeSeconds = 10.0;
numTris = 1; numTris = 1;
offscreen = false;
} }
DrawCallPerfParams::~DrawCallPerfParams() = default; DrawCallPerfParams::~DrawCallPerfParams() = default;
...@@ -37,10 +36,5 @@ std::string DrawCallPerfParams::story() const ...@@ -37,10 +36,5 @@ std::string DrawCallPerfParams::story() const
strstr << RenderTestParams::story(); strstr << RenderTestParams::story();
if (offscreen)
{
strstr << "_offscreen";
}
return strstr.str(); return strstr.str();
} }
...@@ -25,7 +25,6 @@ struct DrawCallPerfParams : public RenderTestParams ...@@ -25,7 +25,6 @@ struct DrawCallPerfParams : public RenderTestParams
double runTimeSeconds; double runTimeSeconds;
int numTris; int numTris;
bool offscreen;
}; };
namespace params namespace params
......
...@@ -148,7 +148,7 @@ void DrawElementsPerfBenchmark::initializeBenchmark() ...@@ -148,7 +148,7 @@ void DrawElementsPerfBenchmark::initializeBenchmark()
// Set the viewport // Set the viewport
glViewport(0, 0, getWindow()->getWidth(), getWindow()->getHeight()); glViewport(0, 0, getWindow()->getWidth(), getWindow()->getHeight());
if (params.offscreen) if (params.surfaceType == SurfaceType::Offscreen)
{ {
CreateColorFBO(getWindow()->getWidth(), getWindow()->getHeight(), &mTexture, &mFBO); CreateColorFBO(getWindow()->getWidth(), getWindow()->getHeight(), &mTexture, &mFBO);
} }
......
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