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
std::string RenderTestParams::story() const
{
return "";
return (surfaceType == SurfaceType::Offscreen ? "_offscreen" : "");
}
std::string RenderTestParams::backendAndStory() const
......
......@@ -104,6 +104,12 @@ class ANGLEPerfTest : public testing::Test, angle::NonCopyable
bool mRunning;
};
enum class SurfaceType
{
Window,
Offscreen,
};
struct RenderTestParams : public angle::PlatformParameters
{
virtual ~RenderTestParams() {}
......@@ -116,6 +122,7 @@ struct RenderTestParams : public angle::PlatformParameters
EGLint windowHeight = 64;
unsigned int iterationsPerStep = 0;
bool trackGpuTime = false;
SurfaceType surfaceType = SurfaceType::Window;
};
class ANGLERenderTest : public ANGLEPerfTest
......@@ -190,8 +197,8 @@ namespace params
template <typename ParamsT>
ParamsT Offscreen(const ParamsT &input)
{
ParamsT output = input;
output.offscreen = true;
ParamsT output = input;
output.surfaceType = SurfaceType::Offscreen;
return output;
}
......
......@@ -205,7 +205,7 @@ void main()
// Set the viewport
glViewport(0, 0, getWindow()->getWidth(), getWindow()->getHeight());
if (params.offscreen)
if (params.surfaceType == SurfaceType::Offscreen)
{
CreateColorFBO(getWindow()->getWidth(), getWindow()->getHeight(), &mFBOTexture, &mFBO);
}
......
......@@ -26,7 +26,6 @@ DrawCallPerfParams::DrawCallPerfParams()
#endif
runTimeSeconds = 10.0;
numTris = 1;
offscreen = false;
}
DrawCallPerfParams::~DrawCallPerfParams() = default;
......@@ -37,10 +36,5 @@ std::string DrawCallPerfParams::story() const
strstr << RenderTestParams::story();
if (offscreen)
{
strstr << "_offscreen";
}
return strstr.str();
}
......@@ -25,7 +25,6 @@ struct DrawCallPerfParams : public RenderTestParams
double runTimeSeconds;
int numTris;
bool offscreen;
};
namespace params
......
......@@ -148,7 +148,7 @@ void DrawElementsPerfBenchmark::initializeBenchmark()
// Set the viewport
glViewport(0, 0, getWindow()->getWidth(), getWindow()->getHeight());
if (params.offscreen)
if (params.surfaceType == SurfaceType::Offscreen)
{
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