Commit 95dcf55b authored by kylechar's avatar kylechar Committed by Commit Bot

Fix disable mipmap generation plumbing

The GPU workaround wasn't being passed to Skia when running with Vulkan.
In general, GPU workarounds aren't implemented for Vulkan so remove the
GPU workaround and add a real flag. Set the GrContextOption based on the
flag from GetDefaultGrContextOptions() so it's picked up everywhere.

Bug: 1138979
Change-Id: I469a7b38517e62f0577673ac1b8c1430fee9f55a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2502952Reviewed-by: default avatarWez <wez@chromium.org>
Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821344}
parent ba288888
......@@ -241,6 +241,7 @@ static const char* const kSwitchNames[] = {
switches::kDisableGpuRasterization,
switches::kDisableGLExtensions,
switches::kDisableLogging,
switches::kDisableMipmapGeneration,
switches::kDisableShaderNameHashing,
switches::kDisableSkiaRuntimeOpts,
switches::kDisableWebRtcHWEncoding,
......
......@@ -7,6 +7,7 @@ include_rules = [
"+content/public/app",
"+gpu/command_buffer/service",
"+gpu/config/gpu_finch_features.h",
"+gpu/config/gpu_switches.h",
"+media/base",
"+media/fuchsia",
"+mojo/public",
......
......@@ -50,6 +50,7 @@
#include "fuchsia/engine/switches.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/config/gpu_finch_features.h"
#include "gpu/config/gpu_switches.h"
#include "media/base/key_system_names.h"
#include "media/base/media_switches.h"
#include "net/http/http_util.h"
......@@ -70,11 +71,6 @@ constexpr char kMixedContentAutoupgradeFeatureName[] =
constexpr char kDisableMixedContentAutoupgradeOrigin[] =
"disable-mixed-content-autoupgrade";
// This flag is auto generated for a GPU workaround with the same name in
// gpu/config/gpu_workaround_list.txt. There is no string to reference so it's
// defined here.
constexpr char kDisableMipmapGeneration[] = "disable_mipmap_generation";
// Returns the underlying channel if |directory| is a client endpoint for a
// |fuchsia::io::Directory| protocol. Otherwise, returns an empty channel.
zx::channel ValidateDirectoryAndTakeChannel(
......@@ -160,9 +156,9 @@ bool MaybeAddCommandLineArgsFromConfig(const base::Value& config,
blink::switches::kGpuRasterizationMSAASampleCount,
blink::switches::kMinHeightForGpuRasterTile,
cc::switches::kEnableGpuBenchmarking,
kDisableMipmapGeneration,
switches::kDisableFeatures,
switches::kDisableGpuWatchdog,
switches::kDisableMipmapGeneration,
// TODO(crbug.com/1082821): Remove this switch from the allow-list.
switches::kEnableCastStreamingReceiver,
switches::kEnableFeatures,
......
......@@ -301,7 +301,6 @@ bool SharedContextState::InitializeGrContext(
// in GetCapabilities and ensuring these are also used by the
// PaintOpBufferSerializer.
GrContextOptions options = GetDefaultGrContextOptions(GrContextType::kGL);
options.fSuppressMipmapSupport = workarounds.disable_mipmap_generation;
options.fDriverBugWorkarounds =
GrDriverBugWorkarounds(workarounds.ToIntSet());
options.fPersistentCache = cache;
......
......@@ -4,11 +4,13 @@
#include "gpu/command_buffer/service/skia_utils.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "components/viz/common/resources/resource_format_utils.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/config/gpu_switches.h"
#include "gpu/config/skia_limits.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"
......@@ -86,6 +88,11 @@ GrContextOptions GetDefaultGrContextOptions(GrContextType type) {
options.fInternalMultisampleCount = 0;
if (type == GrContextType::kMetal)
options.fRuntimeProgramCacheSize = 1024;
options.fSuppressMipmapSupport =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableMipmapGeneration);
return options;
}
......
......@@ -10,6 +10,10 @@ namespace switches {
// Overrides the kEnableGpuRasterization flag.
const char kDisableGpuRasterization[] = "disable-gpu-rasterization";
// Disables mipmap generation in Skia. Used a workaround for select low memory
// devices, see https://crbug.com/1138979 for details.
const char kDisableMipmapGeneration[] = "disable-mipmap-generation";
// Allow heuristics to determine when a layer tile should be drawn with the
// Skia GPU backend. Only valid with GPU accelerated compositing.
const char kEnableGpuRasterization[] = "enable-gpu-rasterization";
......
......@@ -10,6 +10,7 @@
namespace switches {
GPU_EXPORT extern const char kDisableGpuRasterization[];
GPU_EXPORT extern const char kDisableMipmapGeneration[];
GPU_EXPORT extern const char kEnableGpuRasterization[];
GPU_EXPORT extern const char kGpuBlocklistTestGroup[];
GPU_EXPORT extern const char kGpuDriverBugListTestGroup[];
......
......@@ -39,7 +39,6 @@ disable_half_float_for_gmb
disable_imagebitmap_from_video_using_gpu
disable_larger_than_screen_overlays
disable_mediafoundation_async_h264_encoding
disable_mipmap_generation
disable_multisampling_color_mask_usage
disable_nv12_dxgi_video
disable_nv12_dynamic_textures
......
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