Commit 9ca54d68 authored by Alexis Menard's avatar Alexis Menard Committed by Commit Bot

WebXR : On desktop GL make sure to use MSAA rather than CMAA when possible.

If the GPU works with MSAA we should use it. However the current code
will always fallback to CMAA on desktop GL because GL_EXT_multisampled_render_to_texture
is only available on ES profile.

While CMAA could be used by other GPUs than Intel, currently Chromium only
provides support for CMAA on Intel GPUs. This patch aligns with the behavior
of DrawingBuffer which is used to render the WebGL content.

Bug: 990923

Change-Id: Ie3a94a68a685fa0b34d573d48f6d4853d553be64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1730624Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Alexis Menard <alexis.menard@intel.com>
Auto-Submit: Alexis Menard <alexis.menard@intel.com>
Cr-Commit-Position: refs/heads/master@{#684123}
parent 4a709e7c
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "gpu/GLES2/gl2extchromium.h" #include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/shared_image_interface.h" #include "gpu/command_buffer/client/shared_image_interface.h"
#include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/common/shared_image_usage.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h" #include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h" #include "third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h"
#include "third_party/blink/renderer/platform/graphics/gpu/extensions_3d_util.h" #include "third_party/blink/renderer/platform/graphics/gpu/extensions_3d_util.h"
...@@ -213,7 +214,10 @@ bool XRWebGLDrawingBuffer::Initialize(const IntSize& size, ...@@ -213,7 +214,10 @@ bool XRWebGLDrawingBuffer::Initialize(const IntSize& size,
"GL_EXT_multisampled_render_to_texture")) { "GL_EXT_multisampled_render_to_texture")) {
anti_aliasing_mode_ = kMSAAImplicitResolve; anti_aliasing_mode_ = kMSAAImplicitResolve;
} else if (extensions_util->SupportsExtension( } else if (extensions_util->SupportsExtension(
"GL_CHROMIUM_screen_space_antialiasing")) { "GL_CHROMIUM_screen_space_antialiasing") &&
drawing_buffer_->ContextProvider()
->GetGpuFeatureInfo()
.IsWorkaroundEnabled(gpu::USE_FRAMEBUFFER_CMAA)) {
anti_aliasing_mode_ = kScreenSpaceAntialiasing; anti_aliasing_mode_ = kScreenSpaceAntialiasing;
} }
} }
......
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