Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: gpu/command_buffer/service/framebuffer_manager.cc

Issue 2031263002: gpu: Allow framebuffers with mixed samples if the hw supports it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/framebuffer_manager.cc
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
index c353136440281758735d8c74fec7a33b9c84b9af..54a931cdcdc35dc07f3d6f3eb6b53071b90e0de2 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -579,6 +579,11 @@ GLenum Framebuffer::IsPossiblyComplete(const FeatureInfo* feature_info) const {
GLsizei width = -1;
GLsizei height = -1;
GLsizei samples = -1;
+ const bool kSamplesMustMatch =
+ feature_info->context_type() == CONTEXT_TYPE_WEBGL1 ||
+ feature_info->context_type() == CONTEXT_TYPE_WEBGL2 ||
+ !feature_info->feature_flags().chromium_framebuffer_mixed_samples;
+
for (AttachmentMap::const_iterator it = attachments_.begin();
it != attachments_.end(); ++it) {
GLenum attachment_type = it->first;
@@ -603,13 +608,16 @@ GLenum Framebuffer::IsPossiblyComplete(const FeatureInfo* feature_info) const {
// behaviors across platforms.
return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT;
}
- if (samples < 0) {
- samples = attachment->samples();
- } else if (attachment->samples() != samples) {
- // It's possible that the specified samples isn't the actual samples a
- // GL implementation uses, but we always return INCOMPLETE_MULTISAMPLE
- // here to ensure consistent behaviors across platforms.
- return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
+
+ if (kSamplesMustMatch) {
+ if (samples < 0) {
+ samples = attachment->samples();
+ } else if (attachment->samples() != samples) {
+ // It's possible that the specified samples isn't the actual samples a
+ // GL implementation uses, but we always return INCOMPLETE_MULTISAMPLE
+ // here to ensure consistent behaviors across platforms.
+ return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
+ }
}
if (!attachment->CanRenderTo(feature_info)) {
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
« no previous file with comments | « no previous file | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698