diff options
author | jmadill <jmadill@chromium.org> | 2015-09-08 08:21:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-08 15:21:51 +0000 |
commit | cf517079e421da306379c6c05a99705e66ec3240 (patch) | |
tree | 1cfa9fd9f89efb0385dc675d26aaac441038612a /gpu/command_buffer/service | |
parent | 6bbc8ce24e1f6a3e6060cd22442ffaf9b124d973 (diff) | |
download | chromium_src-cf517079e421da306379c6c05a99705e66ec3240.zip chromium_src-cf517079e421da306379c6c05a99705e66ec3240.tar.gz chromium_src-cf517079e421da306379c6c05a99705e66ec3240.tar.bz2 |
Revert of command_buffer: Implement EXT_multisample_compatibility (patchset #9 id:160001 of https://codereview.chromium.org/1231673006/ )
Reason for revert:
Breaking the EXTMultisampleCompatibilityTest.DrawAndResolve test on AMD.
EXTMultisampleCompatibilityTest.DrawAndResolve:
../../gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc:208: Failure
Value of: r
Actual: '\x80' (128)
Expected: 255u
Which is: 255
../../gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc:209: Failure
Value of: g
Actual: '\x80' (128)
Expected: 0u
Which is: 0
../../gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc:225: Failure
Value of: r
Actual: '\x80' (128)
Expected: 255u
Which is: 255
../../gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc:227: Failure
Value of: b
Actual: '\x80' (128)
Expected: 0u
Which is: 0
Original issue's description:
> command_buffer: Implement EXT_multisample_compatibility
>
> Implement EXT_multisample_compatibility OpenGL ES extension in command
> buffer.
>
> Skia needs this in order to enable and disable multisampling when
> using GL path rendering.
>
> BUG=506765
>
> Committed: https://crrev.com/e3237bbb682e52f92d5bd18dcab672677e4e3bc4
> Cr-Commit-Position: refs/heads/master@{#346847}
>
> Committed: https://crrev.com/28e57fb8caf8c0daf4be0692777aa9229cfdaa8b
> Cr-Commit-Position: refs/heads/master@{#347390}
TBR=vmiura@chromium.org,piman@chromium.org,zmo@google.com,markkilgard@gmail.com,zmo@chromium.org,sievers@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=506765, 529315
Review URL: https://codereview.chromium.org/1333493004
Cr-Commit-Position: refs/heads/master@{#347705}
Diffstat (limited to 'gpu/command_buffer/service')
7 files changed, 21 insertions, 138 deletions
diff --git a/gpu/command_buffer/service/context_state_autogen.h b/gpu/command_buffer/service/context_state_autogen.h index 7278a24..7ca2faa 100644 --- a/gpu/command_buffer/service/context_state_autogen.h +++ b/gpu/command_buffer/service/context_state_autogen.h @@ -36,10 +36,6 @@ struct EnableFlags { bool cached_rasterizer_discard; bool primitive_restart_fixed_index; bool cached_primitive_restart_fixed_index; - bool multisample_ext; - bool cached_multisample_ext; - bool sample_alpha_to_one_ext; - bool cached_sample_alpha_to_one_ext; }; GLfloat blend_color_red; @@ -173,17 +169,6 @@ inline void SetDeviceCapabilityState(GLenum cap, bool enable) { return; enable_flags.cached_primitive_restart_fixed_index = enable; break; - case GL_MULTISAMPLE_EXT: - if (enable_flags.cached_multisample_ext == enable && !ignore_cached_state) - return; - enable_flags.cached_multisample_ext = enable; - break; - case GL_SAMPLE_ALPHA_TO_ONE_EXT: - if (enable_flags.cached_sample_alpha_to_one_ext == enable && - !ignore_cached_state) - return; - enable_flags.cached_sample_alpha_to_one_ext = enable; - break; default: NOTREACHED(); return; diff --git a/gpu/command_buffer/service/context_state_impl_autogen.h b/gpu/command_buffer/service/context_state_impl_autogen.h index ce9f70f..450f0e2 100644 --- a/gpu/command_buffer/service/context_state_impl_autogen.h +++ b/gpu/command_buffer/service/context_state_impl_autogen.h @@ -34,11 +34,7 @@ ContextState::EnableFlags::EnableFlags() rasterizer_discard(false), cached_rasterizer_discard(false), primitive_restart_fixed_index(false), - cached_primitive_restart_fixed_index(false), - multisample_ext(true), - cached_multisample_ext(true), - sample_alpha_to_one_ext(false), - cached_sample_alpha_to_one_ext(false) {} + cached_primitive_restart_fixed_index(false) {} void ContextState::Initialize() { blend_color_red = 0.0f; @@ -180,19 +176,6 @@ void ContextState::InitCapabilities(const ContextState* prev_state) const { enable_flags.cached_stencil_test) { EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test); } - if (feature_info_->feature_flags().ext_multisample_compatibility) { - if (prev_state->enable_flags.cached_multisample_ext != - enable_flags.cached_multisample_ext) { - EnableDisable(GL_MULTISAMPLE_EXT, enable_flags.cached_multisample_ext); - } - } - if (feature_info_->feature_flags().ext_multisample_compatibility) { - if (prev_state->enable_flags.cached_sample_alpha_to_one_ext != - enable_flags.cached_sample_alpha_to_one_ext) { - EnableDisable(GL_SAMPLE_ALPHA_TO_ONE_EXT, - enable_flags.cached_sample_alpha_to_one_ext); - } - } if (feature_info_->IsES3Capable()) { if (prev_state->enable_flags.cached_rasterizer_discard != enable_flags.cached_rasterizer_discard) { @@ -217,13 +200,6 @@ void ContextState::InitCapabilities(const ContextState* prev_state) const { EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage); EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test); EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test); - if (feature_info_->feature_flags().ext_multisample_compatibility) { - EnableDisable(GL_MULTISAMPLE_EXT, enable_flags.cached_multisample_ext); - } - if (feature_info_->feature_flags().ext_multisample_compatibility) { - EnableDisable(GL_SAMPLE_ALPHA_TO_ONE_EXT, - enable_flags.cached_sample_alpha_to_one_ext); - } if (feature_info_->IsES3Capable()) { EnableDisable(GL_RASTERIZER_DISCARD, enable_flags.cached_rasterizer_discard); @@ -432,10 +408,6 @@ bool ContextState::GetEnabled(GLenum cap) const { return enable_flags.rasterizer_discard; case GL_PRIMITIVE_RESTART_FIXED_INDEX: return enable_flags.primitive_restart_fixed_index; - case GL_MULTISAMPLE_EXT: - return enable_flags.multisample_ext; - case GL_SAMPLE_ALPHA_TO_ONE_EXT: - return enable_flags.sample_alpha_to_one_ext; default: NOTREACHED(); return false; @@ -809,18 +781,6 @@ bool ContextState::GetStateAsGLint(GLenum pname, static_cast<GLint>(enable_flags.primitive_restart_fixed_index); } return true; - case GL_MULTISAMPLE_EXT: - *num_written = 1; - if (params) { - params[0] = static_cast<GLint>(enable_flags.multisample_ext); - } - return true; - case GL_SAMPLE_ALPHA_TO_ONE_EXT: - *num_written = 1; - if (params) { - params[0] = static_cast<GLint>(enable_flags.sample_alpha_to_one_ext); - } - return true; default: return false; } @@ -1189,18 +1149,6 @@ bool ContextState::GetStateAsGLfloat(GLenum pname, static_cast<GLfloat>(enable_flags.primitive_restart_fixed_index); } return true; - case GL_MULTISAMPLE_EXT: - *num_written = 1; - if (params) { - params[0] = static_cast<GLfloat>(enable_flags.multisample_ext); - } - return true; - case GL_SAMPLE_ALPHA_TO_ONE_EXT: - *num_written = 1; - if (params) { - params[0] = static_cast<GLfloat>(enable_flags.sample_alpha_to_one_ext); - } - return true; default: return false; } diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 49b6e85..b3c5be6 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -171,8 +171,7 @@ FeatureInfo::FeatureFlags::FeatureFlags() chromium_image_ycbcr_422(false), enable_subscribe_uniform(false), emulate_primitive_restart_fixed_index(false), - ext_render_buffer_format_bgra8888(false), - ext_multisample_compatibility(false) {} + ext_render_buffer_format_bgra8888(false) {} FeatureInfo::Workarounds::Workarounds() : #define GPU_OP(type, name) name(false), @@ -695,32 +694,26 @@ void FeatureInfo::InitializeFeatures() { } // Check for multisample support - bool ext_has_multisample = - !workarounds_.disable_chromium_framebuffer_multisample && - (extensions.Contains("GL_EXT_framebuffer_multisample") || - gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile || - (gl_version_info_->is_angle && - extensions.Contains("GL_ANGLE_framebuffer_multisample"))); - - if (ext_has_multisample) { + if (!workarounds_.disable_chromium_framebuffer_multisample) { + bool ext_has_multisample = + extensions.Contains("GL_EXT_framebuffer_multisample") || + gl_version_info_->is_es3 || + gl_version_info_->is_desktop_core_profile; + if (gl_version_info_->is_angle) { + ext_has_multisample |= + extensions.Contains("GL_ANGLE_framebuffer_multisample"); + } feature_flags_.use_core_framebuffer_multisample = gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile; - feature_flags_.chromium_framebuffer_multisample = true; - validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); - validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT); - validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT); - validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT); - validators_.render_buffer_parameter.AddValue(GL_RENDERBUFFER_SAMPLES_EXT); - AddExtensionString("GL_CHROMIUM_framebuffer_multisample"); - } - - if (ext_has_multisample && - (!gl_version_info_->is_es || - extensions.Contains("GL_EXT_multisample_compatibility"))) { - AddExtensionString("GL_EXT_multisample_compatibility"); - feature_flags_.ext_multisample_compatibility = true; - validators_.capability.AddValue(GL_MULTISAMPLE_EXT); - validators_.capability.AddValue(GL_SAMPLE_ALPHA_TO_ONE_EXT); + if (ext_has_multisample) { + feature_flags_.chromium_framebuffer_multisample = true; + validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); + validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT); + validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT); + validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT); + validators_.render_buffer_parameter.AddValue(GL_RENDERBUFFER_SAMPLES_EXT); + AddExtensionString("GL_CHROMIUM_framebuffer_multisample"); + } } if (!workarounds_.disable_multisampled_render_to_texture) { diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h index 68f928a..dae148a 100644 --- a/gpu/command_buffer/service/feature_info.h +++ b/gpu/command_buffer/service/feature_info.h @@ -84,7 +84,6 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { bool enable_subscribe_uniform; bool emulate_primitive_restart_fixed_index; bool ext_render_buffer_format_bgra8888; - bool ext_multisample_compatibility; }; struct Workarounds { diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 305fb12..b8bb7c1 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -5154,22 +5154,6 @@ bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) { return true; } return false; - case GL_MULTISAMPLE_EXT: - state_.enable_flags.multisample_ext = enabled; - if (state_.enable_flags.cached_multisample_ext != enabled || - state_.ignore_cached_state) { - state_.enable_flags.cached_multisample_ext = enabled; - return true; - } - return false; - case GL_SAMPLE_ALPHA_TO_ONE_EXT: - state_.enable_flags.sample_alpha_to_one_ext = enabled; - if (state_.enable_flags.cached_sample_alpha_to_one_ext != enabled || - state_.ignore_cached_state) { - state_.enable_flags.cached_sample_alpha_to_one_ext = enabled; - return true; - } - return false; default: NOTREACHED(); return false; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h index d934bce..dd11716 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h @@ -22,12 +22,6 @@ void GLES2DecoderTestBase::SetupInitCapabilitiesExpectations(bool es3_capable) { ExpectEnableDisable(GL_SAMPLE_COVERAGE, false); ExpectEnableDisable(GL_SCISSOR_TEST, false); ExpectEnableDisable(GL_STENCIL_TEST, false); - if (group_->feature_info()->feature_flags().ext_multisample_compatibility) { - ExpectEnableDisable(GL_MULTISAMPLE_EXT, true); - } - if (group_->feature_info()->feature_flags().ext_multisample_compatibility) { - ExpectEnableDisable(GL_SAMPLE_ALPHA_TO_ONE_EXT, false); - } if (es3_capable) { ExpectEnableDisable(GL_RASTERIZER_DISCARD, false); ExpectEnableDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX, false); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc index 352b76a..916f2aa 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc @@ -185,27 +185,6 @@ INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTestWithBlendEquationAdvanced, ::testing::Bool()); -class GLES2DecoderTestWithEXTMultisampleCompatibility - : public GLES2DecoderTest { - public: - GLES2DecoderTestWithEXTMultisampleCompatibility() {} - - void SetUp() override { - InitState init; - init.gl_version = "opengl es 3.1"; - init.has_alpha = true; - init.has_depth = true; - init.request_alpha = true; - init.request_depth = true; - init.bind_generates_resource = true; - init.extensions = "GL_EXT_multisample_compatibility "; - InitDecoder(init); - } -}; -INSTANTIATE_TEST_CASE_P(Service, - GLES2DecoderTestWithEXTMultisampleCompatibility, - ::testing::Bool()); - TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, GenDeletePaths) { static GLuint kFirstClientID = client_path_id_ + 88; static GLsizei kPathCount = 58; @@ -1018,3 +997,4 @@ TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, } // namespace gles2 } // namespace gpu + |