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[] = { ...@@ -241,6 +241,7 @@ static const char* const kSwitchNames[] = {
switches::kDisableGpuRasterization, switches::kDisableGpuRasterization,
switches::kDisableGLExtensions, switches::kDisableGLExtensions,
switches::kDisableLogging, switches::kDisableLogging,
switches::kDisableMipmapGeneration,
switches::kDisableShaderNameHashing, switches::kDisableShaderNameHashing,
switches::kDisableSkiaRuntimeOpts, switches::kDisableSkiaRuntimeOpts,
switches::kDisableWebRtcHWEncoding, switches::kDisableWebRtcHWEncoding,
......
...@@ -7,6 +7,7 @@ include_rules = [ ...@@ -7,6 +7,7 @@ include_rules = [
"+content/public/app", "+content/public/app",
"+gpu/command_buffer/service", "+gpu/command_buffer/service",
"+gpu/config/gpu_finch_features.h", "+gpu/config/gpu_finch_features.h",
"+gpu/config/gpu_switches.h",
"+media/base", "+media/base",
"+media/fuchsia", "+media/fuchsia",
"+mojo/public", "+mojo/public",
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "fuchsia/engine/switches.h" #include "fuchsia/engine/switches.h"
#include "gpu/command_buffer/service/gpu_switches.h" #include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/config/gpu_finch_features.h" #include "gpu/config/gpu_finch_features.h"
#include "gpu/config/gpu_switches.h"
#include "media/base/key_system_names.h" #include "media/base/key_system_names.h"
#include "media/base/media_switches.h" #include "media/base/media_switches.h"
#include "net/http/http_util.h" #include "net/http/http_util.h"
...@@ -70,11 +71,6 @@ constexpr char kMixedContentAutoupgradeFeatureName[] = ...@@ -70,11 +71,6 @@ constexpr char kMixedContentAutoupgradeFeatureName[] =
constexpr char kDisableMixedContentAutoupgradeOrigin[] = constexpr char kDisableMixedContentAutoupgradeOrigin[] =
"disable-mixed-content-autoupgrade"; "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 // Returns the underlying channel if |directory| is a client endpoint for a
// |fuchsia::io::Directory| protocol. Otherwise, returns an empty channel. // |fuchsia::io::Directory| protocol. Otherwise, returns an empty channel.
zx::channel ValidateDirectoryAndTakeChannel( zx::channel ValidateDirectoryAndTakeChannel(
...@@ -160,9 +156,9 @@ bool MaybeAddCommandLineArgsFromConfig(const base::Value& config, ...@@ -160,9 +156,9 @@ bool MaybeAddCommandLineArgsFromConfig(const base::Value& config,
blink::switches::kGpuRasterizationMSAASampleCount, blink::switches::kGpuRasterizationMSAASampleCount,
blink::switches::kMinHeightForGpuRasterTile, blink::switches::kMinHeightForGpuRasterTile,
cc::switches::kEnableGpuBenchmarking, cc::switches::kEnableGpuBenchmarking,
kDisableMipmapGeneration,
switches::kDisableFeatures, switches::kDisableFeatures,
switches::kDisableGpuWatchdog, switches::kDisableGpuWatchdog,
switches::kDisableMipmapGeneration,
// TODO(crbug.com/1082821): Remove this switch from the allow-list. // TODO(crbug.com/1082821): Remove this switch from the allow-list.
switches::kEnableCastStreamingReceiver, switches::kEnableCastStreamingReceiver,
switches::kEnableFeatures, switches::kEnableFeatures,
......
...@@ -301,7 +301,6 @@ bool SharedContextState::InitializeGrContext( ...@@ -301,7 +301,6 @@ bool SharedContextState::InitializeGrContext(
// in GetCapabilities and ensuring these are also used by the // in GetCapabilities and ensuring these are also used by the
// PaintOpBufferSerializer. // PaintOpBufferSerializer.
GrContextOptions options = GetDefaultGrContextOptions(GrContextType::kGL); GrContextOptions options = GetDefaultGrContextOptions(GrContextType::kGL);
options.fSuppressMipmapSupport = workarounds.disable_mipmap_generation;
options.fDriverBugWorkarounds = options.fDriverBugWorkarounds =
GrDriverBugWorkarounds(workarounds.ToIntSet()); GrDriverBugWorkarounds(workarounds.ToIntSet());
options.fPersistentCache = cache; options.fPersistentCache = cache;
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
#include "gpu/command_buffer/service/skia_utils.h" #include "gpu/command_buffer/service/skia_utils.h"
#include "base/command_line.h"
#include "base/logging.h" #include "base/logging.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_format_utils.h"
#include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/config/gpu_switches.h"
#include "gpu/config/skia_limits.h" #include "gpu/config/skia_limits.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h" #include "third_party/skia/include/gpu/gl/GrGLTypes.h"
...@@ -86,6 +88,11 @@ GrContextOptions GetDefaultGrContextOptions(GrContextType type) { ...@@ -86,6 +88,11 @@ GrContextOptions GetDefaultGrContextOptions(GrContextType type) {
options.fInternalMultisampleCount = 0; options.fInternalMultisampleCount = 0;
if (type == GrContextType::kMetal) if (type == GrContextType::kMetal)
options.fRuntimeProgramCacheSize = 1024; options.fRuntimeProgramCacheSize = 1024;
options.fSuppressMipmapSupport =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableMipmapGeneration);
return options; return options;
} }
......
...@@ -10,6 +10,10 @@ namespace switches { ...@@ -10,6 +10,10 @@ namespace switches {
// Overrides the kEnableGpuRasterization flag. // Overrides the kEnableGpuRasterization flag.
const char kDisableGpuRasterization[] = "disable-gpu-rasterization"; 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 // Allow heuristics to determine when a layer tile should be drawn with the
// Skia GPU backend. Only valid with GPU accelerated compositing. // Skia GPU backend. Only valid with GPU accelerated compositing.
const char kEnableGpuRasterization[] = "enable-gpu-rasterization"; const char kEnableGpuRasterization[] = "enable-gpu-rasterization";
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
namespace switches { namespace switches {
GPU_EXPORT extern const char kDisableGpuRasterization[]; GPU_EXPORT extern const char kDisableGpuRasterization[];
GPU_EXPORT extern const char kDisableMipmapGeneration[];
GPU_EXPORT extern const char kEnableGpuRasterization[]; GPU_EXPORT extern const char kEnableGpuRasterization[];
GPU_EXPORT extern const char kGpuBlocklistTestGroup[]; GPU_EXPORT extern const char kGpuBlocklistTestGroup[];
GPU_EXPORT extern const char kGpuDriverBugListTestGroup[]; GPU_EXPORT extern const char kGpuDriverBugListTestGroup[];
......
...@@ -39,7 +39,6 @@ disable_half_float_for_gmb ...@@ -39,7 +39,6 @@ disable_half_float_for_gmb
disable_imagebitmap_from_video_using_gpu disable_imagebitmap_from_video_using_gpu
disable_larger_than_screen_overlays disable_larger_than_screen_overlays
disable_mediafoundation_async_h264_encoding disable_mediafoundation_async_h264_encoding
disable_mipmap_generation
disable_multisampling_color_mask_usage disable_multisampling_color_mask_usage
disable_nv12_dxgi_video disable_nv12_dxgi_video
disable_nv12_dynamic_textures 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