Commit 9a025fd4 by Jamie Madill Committed by Commit Bot

Capture/Replay: add frontend feature to force capture limits

Some of the limits set when FrameCapture is enabled are reflected in the serialized context. In order for capture/replay tests to pass these limits may also be needed to be enforced when replaying. Add a fronten feature enable_capture_limits for this and use it in the capture replay test script. Patch authored by gert.wollny@collabora.com. Bug: angleproject:5750 Change-Id: I3d333d22fe65c12dd5aa5f263d19a2c1568541c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2790301Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent e0b9d4f7
...@@ -65,6 +65,11 @@ struct FrontendFeatures : angle::FeatureSetBase ...@@ -65,6 +65,11 @@ struct FrontendFeatures : angle::FeatureSetBase
angle::Feature allowCompressedFormats = {"allow_compressed_formats", angle::Feature allowCompressedFormats = {"allow_compressed_formats",
angle::FeatureCategory::FrontendWorkarounds, angle::FeatureCategory::FrontendWorkarounds,
"Allow compressed formats", &members}; "Allow compressed formats", &members};
angle::Feature captureLimits = {"enable_capture_limits",
angle::FeatureCategory::FrontendFeatures,
"Set the context limits like frame capturing was enabled",
&members, "http://anglebug.com/5750"};
}; };
inline FrontendFeatures::FrontendFeatures() = default; inline FrontendFeatures::FrontendFeatures() = default;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "common/angle_version.h" #include "common/angle_version.h"
#include "common/matrix_utils.h" #include "common/matrix_utils.h"
#include "common/platform.h" #include "common/platform.h"
#include "common/system_utils.h"
#include "common/utilities.h" #include "common/utilities.h"
#include "libANGLE/Buffer.h" #include "libANGLE/Buffer.h"
#include "libANGLE/Compiler.h" #include "libANGLE/Compiler.h"
...@@ -50,6 +51,7 @@ namespace gl ...@@ -50,6 +51,7 @@ namespace gl
{ {
namespace namespace
{ {
egl::ShareGroup *AllocateOrGetShareGroup(egl::Display *display, const gl::Context *shareContext) egl::ShareGroup *AllocateOrGetShareGroup(egl::Display *display, const gl::Context *shareContext)
{ {
if (shareContext) if (shareContext)
...@@ -3732,14 +3734,19 @@ void Context::initCaps() ...@@ -3732,14 +3734,19 @@ void Context::initCaps()
// If we're capturing application calls for replay, don't expose any binary formats to prevent // If we're capturing application calls for replay, don't expose any binary formats to prevent
// traces from trying to use cached results // traces from trying to use cached results
if (getFrameCapture()->enabled()) if (getFrameCapture()->enabled() || getFrontendFeatures().captureLimits.enabled)
{ {
INFO() << "Limiting binary format support count to zero while FrameCapture enabled"; INFO() << "Limit some features because "
<< (getFrameCapture()->enabled() ? "FrameCapture is enabled"
: "FrameCapture limits were forced")
<< std::endl;
INFO() << "Limiting binary format support count to zero";
mDisplay->overrideFrontendFeatures({"disable_program_binary"}, true); mDisplay->overrideFrontendFeatures({"disable_program_binary"}, true);
// Set to the most common limit per gpuinfo.org. Required for several platforms we test. // Set to the most common limit per gpuinfo.org. Required for several platforms we test.
constexpr GLint maxImageUnits = 8; constexpr GLint maxImageUnits = 8;
INFO() << "Limiting image unit count to " << maxImageUnits << " while FrameCapture enabled"; INFO() << "Limiting image unit count to " << maxImageUnits;
ANGLE_LIMIT_CAP(mState.mCaps.maxImageUnits, maxImageUnits); ANGLE_LIMIT_CAP(mState.mCaps.maxImageUnits, maxImageUnits);
// Set a large uniform buffer offset alignment that works on multiple platforms. // Set a large uniform buffer offset alignment that works on multiple platforms.
...@@ -3747,8 +3754,7 @@ void Context::initCaps() ...@@ -3747,8 +3754,7 @@ void Context::initCaps()
// Values seen during development: ARM (16), Intel (32), Qualcomm (128), Nvidia (256) // Values seen during development: ARM (16), Intel (32), Qualcomm (128), Nvidia (256)
constexpr GLint uniformBufferOffsetAlignment = 256; constexpr GLint uniformBufferOffsetAlignment = 256;
ASSERT(uniformBufferOffsetAlignment % mState.mCaps.uniformBufferOffsetAlignment == 0); ASSERT(uniformBufferOffsetAlignment % mState.mCaps.uniformBufferOffsetAlignment == 0);
INFO() << "Setting uniform buffer offset alignment to " << uniformBufferOffsetAlignment INFO() << "Setting uniform buffer offset alignment to " << uniformBufferOffsetAlignment;
<< " while FrameCapture enabled";
mState.mCaps.uniformBufferOffsetAlignment = uniformBufferOffsetAlignment; mState.mCaps.uniformBufferOffsetAlignment = uniformBufferOffsetAlignment;
INFO() << "Disabling GL_EXT_map_buffer_range and GL_OES_mapbuffer during capture, which " INFO() << "Disabling GL_EXT_map_buffer_range and GL_OES_mapbuffer during capture, which "
...@@ -3766,8 +3772,7 @@ void Context::initCaps() ...@@ -3766,8 +3772,7 @@ void Context::initCaps()
// Nvidia's Vulkan driver only supports 4 draw buffers // Nvidia's Vulkan driver only supports 4 draw buffers
constexpr GLint maxDrawBuffers = 4; constexpr GLint maxDrawBuffers = 4;
INFO() << "Limiting draw buffer count to " << maxDrawBuffers INFO() << "Limiting draw buffer count to " << maxDrawBuffers;
<< " while FrameCapture enabled";
ANGLE_LIMIT_CAP(mState.mCaps.maxDrawBuffers, maxDrawBuffers); ANGLE_LIMIT_CAP(mState.mCaps.maxDrawBuffers, maxDrawBuffers);
} }
......
...@@ -649,6 +649,7 @@ class TestBatch(): ...@@ -649,6 +649,7 @@ class TestBatch():
def RunReplay(self, replay_exe_path, child_processes_manager, tests): def RunReplay(self, replay_exe_path, child_processes_manager, tests):
env = os.environ.copy() env = os.environ.copy()
env['ANGLE_CAPTURE_ENABLED'] = '0' env['ANGLE_CAPTURE_ENABLED'] = '0'
env['ANGLE_FEATURE_OVERRIDES_ENABLED'] = 'enable_capture_limits'
returncode, output = child_processes_manager.RunSubprocess([replay_exe_path], returncode, output = child_processes_manager.RunSubprocess([replay_exe_path],
env, env,
timeout=SUBPROCESS_TIMEOUT) timeout=SUBPROCESS_TIMEOUT)
......
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