Remove is_desktop_core_profile from GLVersionInfo.
Now Chrome runs on Native GLES or ANGLE, so it's never true. TEST=bots Bug: 347368403 Change-Id: I6739bd89b1a9facc975985fcfbfa18d39a2f5b34 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5634390 Commit-Queue: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org> Auto-Submit: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Cr-Commit-Position: refs/heads/main@{#1316030}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
bbd1c1bd64
commit
fadb61567c
components/viz/service/display_embedder
gpu/command_buffer
build_cmd_buffer_lib.py
service
context_state_impl_autogen.hcontext_state_test_helpers_autogen.hfeature_info.ccfeature_info_unittest.ccgles2_cmd_copy_texture_chromium.ccgles2_cmd_decoder.ccgles2_cmd_decoder_autogen.hgles2_cmd_decoder_unittest_base.ccgles2_cmd_decoder_unittest_context_state.ccgles2_external_framebuffer_unittest.cctest_helper.cctest_helper.htexture_manager_unittest.cc
tests
ui/gl
@ -30,7 +30,6 @@
|
||||
#include "ui/gl/gl_features.h"
|
||||
#include "ui/gl/gl_implementation.h"
|
||||
#include "ui/gl/gl_surface.h"
|
||||
#include "ui/gl/gl_version_info.h"
|
||||
|
||||
namespace viz {
|
||||
|
||||
@ -137,20 +136,12 @@ SkiaOutputDeviceGL::SkiaOutputDeviceGL(
|
||||
DCHECK(context_state_->context());
|
||||
|
||||
GrDirectContext* gr_context = context_state_->gr_context();
|
||||
gl::CurrentGL* current_gl = context_state_->context()->GetCurrentGL();
|
||||
|
||||
// Get alpha bits from the default frame buffer.
|
||||
int alpha_bits = 0;
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
|
||||
gr_context->resetContext(kRenderTarget_GrGLBackendState);
|
||||
const auto* version = current_gl->Version.get();
|
||||
if (version->is_desktop_core_profile) {
|
||||
glGetFramebufferAttachmentParameterivEXT(
|
||||
GL_FRAMEBUFFER, GL_BACK_LEFT, GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
|
||||
&alpha_bits);
|
||||
} else {
|
||||
glGetIntegerv(GL_ALPHA_BITS, &alpha_bits);
|
||||
}
|
||||
glGetIntegerv(GL_ALPHA_BITS, &alpha_bits);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
auto color_type = kRGBA_8888_SkColorType;
|
||||
|
@ -424,7 +424,6 @@ _STATE_INFO = {
|
||||
'type': 'GLenum',
|
||||
'enum': 'GL_GENERATE_MIPMAP_HINT',
|
||||
'default': 'GL_DONT_CARE',
|
||||
'gl_version_flag': '!is_desktop_core_profile'
|
||||
},
|
||||
{
|
||||
'name': 'hint_fragment_shader_derivative',
|
||||
|
@ -254,10 +254,8 @@ void ContextState::InitState(const ContextState* prev_state) const {
|
||||
api()->glDepthRangeFn(z_near, z_far);
|
||||
if ((front_face != prev_state->front_face))
|
||||
api()->glFrontFaceFn(front_face);
|
||||
if (!feature_info_->gl_version_info().is_desktop_core_profile) {
|
||||
if (prev_state->hint_generate_mipmap != hint_generate_mipmap) {
|
||||
api()->glHintFn(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap);
|
||||
}
|
||||
if (prev_state->hint_generate_mipmap != hint_generate_mipmap) {
|
||||
api()->glHintFn(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap);
|
||||
}
|
||||
if (feature_info_->feature_flags().oes_standard_derivatives) {
|
||||
if (prev_state->hint_fragment_shader_derivative !=
|
||||
@ -336,9 +334,7 @@ void ContextState::InitState(const ContextState* prev_state) const {
|
||||
api()->glDepthMaskFn(cached_depth_mask);
|
||||
api()->glDepthRangeFn(z_near, z_far);
|
||||
api()->glFrontFaceFn(front_face);
|
||||
if (!feature_info_->gl_version_info().is_desktop_core_profile) {
|
||||
api()->glHintFn(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap);
|
||||
}
|
||||
api()->glHintFn(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap);
|
||||
if (feature_info_->feature_flags().oes_standard_derivatives) {
|
||||
api()->glHintFn(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES,
|
||||
hint_fragment_shader_derivative);
|
||||
|
@ -62,11 +62,9 @@ void ContextStateTestHelpers::SetupInitStateExpectations(
|
||||
EXPECT_CALL(*gl, DepthMask(true)).Times(1).RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl, DepthRange(0.0f, 1.0f)).Times(1).RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl, FrontFace(GL_CCW)).Times(1).RetiresOnSaturation();
|
||||
if (!feature_info->gl_version_info().is_desktop_core_profile) {
|
||||
EXPECT_CALL(*gl, Hint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
}
|
||||
EXPECT_CALL(*gl, Hint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
if (feature_info->feature_flags().oes_standard_derivatives) {
|
||||
EXPECT_CALL(*gl, Hint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, GL_DONT_CARE))
|
||||
.Times(1)
|
||||
|
@ -448,7 +448,7 @@ void FeatureInfo::EnableANGLEInstancedArrayIfPossible(
|
||||
if (gfx::HasExtension(extensions, "GL_ANGLE_instanced_arrays") ||
|
||||
(gfx::HasExtension(extensions, "GL_ARB_instanced_arrays") &&
|
||||
gfx::HasExtension(extensions, "GL_ARB_draw_instanced")) ||
|
||||
gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile) {
|
||||
gl_version_info_->is_es3) {
|
||||
AddExtensionString("GL_ANGLE_instanced_arrays");
|
||||
feature_flags_.angle_instanced_arrays = true;
|
||||
validators_.vertex_attribute.AddValue(
|
||||
@ -463,8 +463,7 @@ void FeatureInfo::EnableWEBGLMultiDrawIfPossible(
|
||||
if (!is_passthrough_cmd_decoder_ ||
|
||||
gfx::HasExtension(extensions, "GL_ANGLE_multi_draw")) {
|
||||
if (gfx::HasExtension(extensions, "GL_ANGLE_instanced_arrays") ||
|
||||
feature_flags_.angle_instanced_arrays || gl_version_info_->is_es3 ||
|
||||
gl_version_info_->is_desktop_core_profile) {
|
||||
feature_flags_.angle_instanced_arrays || gl_version_info_->is_es3) {
|
||||
feature_flags_.webgl_multi_draw = true;
|
||||
AddExtensionString("GL_WEBGL_multi_draw");
|
||||
|
||||
@ -492,7 +491,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
// Really it's part of core OpenGL 2.1 and up, but let's assume the
|
||||
// extension is still advertised.
|
||||
bool has_pixel_buffers =
|
||||
gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile ||
|
||||
gl_version_info_->is_es3 ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_pixel_buffer_object") ||
|
||||
gfx::HasExtension(extensions, "GL_NV_pixel_buffer_object");
|
||||
|
||||
@ -726,8 +725,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
if (!workarounds_.disable_depth_texture &&
|
||||
(gfx::HasExtension(extensions, "GL_ARB_depth_texture") ||
|
||||
gfx::HasExtension(extensions, "GL_OES_depth_texture") ||
|
||||
gfx::HasExtension(extensions, "GL_ANGLE_depth_texture") ||
|
||||
gl_version_info_->is_desktop_core_profile)) {
|
||||
gfx::HasExtension(extensions, "GL_ANGLE_depth_texture"))) {
|
||||
// Note that we don't expose depth_texture extenion on top of ES3 if
|
||||
// the depth_texture extension isn't exposed by the ES3 driver.
|
||||
// This is because depth textures are filterable under linear mode in
|
||||
@ -752,7 +750,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
GLenum depth_stencil_texture_format = GL_NONE;
|
||||
if (gfx::HasExtension(extensions, "GL_EXT_packed_depth_stencil") ||
|
||||
gfx::HasExtension(extensions, "GL_OES_packed_depth_stencil") ||
|
||||
gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile) {
|
||||
gl_version_info_->is_es3) {
|
||||
AddExtensionString("GL_OES_packed_depth_stencil");
|
||||
feature_flags_.packed_depth24_stencil8 = true;
|
||||
if (enable_depth_texture) {
|
||||
@ -782,7 +780,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
}
|
||||
}
|
||||
|
||||
if (gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile ||
|
||||
if (gl_version_info_->is_es3 ||
|
||||
gfx::HasExtension(extensions, "GL_OES_vertex_array_object") ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_vertex_array_object") ||
|
||||
gfx::HasExtension(extensions, "GL_APPLE_vertex_array_object")) {
|
||||
@ -1066,7 +1064,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
|
||||
// Check if we should allow GL_OES_texture_npot
|
||||
if (!disallowed_features_.npot_support &&
|
||||
(gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile ||
|
||||
(gl_version_info_->is_es3 ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_texture_non_power_of_two") ||
|
||||
gfx::HasExtension(extensions, "GL_OES_texture_npot"))) {
|
||||
AddExtensionString("GL_OES_texture_npot");
|
||||
@ -1081,7 +1079,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
gfx::HasExtension(extensions, "GL_ARB_framebuffer_object") ||
|
||||
(gfx::HasExtension(extensions, "GL_EXT_framebuffer_multisample") &&
|
||||
gfx::HasExtension(extensions, "GL_EXT_framebuffer_blit")) ||
|
||||
gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile;
|
||||
gl_version_info_->is_es3;
|
||||
if (gl_version_info_->is_angle || gl_version_info_->is_swiftshader) {
|
||||
ext_has_multisample |=
|
||||
gfx::HasExtension(extensions, "GL_ANGLE_framebuffer_multisample");
|
||||
@ -1225,8 +1223,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
// they should use ordinary non-power-of-two textures. However, for unit
|
||||
// testing purposes we expose it on all supported platforms.
|
||||
if (gfx::HasExtension(extensions, "GL_ARB_texture_rectangle") ||
|
||||
gfx::HasExtension(extensions, "GL_ANGLE_texture_rectangle") ||
|
||||
gl_version_info_->is_desktop_core_profile) {
|
||||
gfx::HasExtension(extensions, "GL_ANGLE_texture_rectangle")) {
|
||||
AddExtensionString("GL_ARB_texture_rectangle");
|
||||
feature_flags_.arb_texture_rectangle = true;
|
||||
// Rectangle textures are used as samplers via glBindTexture, framebuffer
|
||||
@ -1303,8 +1300,6 @@ void FeatureInfo::InitializeFeatures() {
|
||||
bool have_arb_occlusion_query2 =
|
||||
gfx::HasExtension(extensions, "GL_ARB_occlusion_query2");
|
||||
bool have_arb_occlusion_query =
|
||||
(gl_version_info_->is_desktop_core_profile &&
|
||||
gl_version_info_->IsAtLeastGL(1, 5)) ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_occlusion_query");
|
||||
|
||||
if (have_occlusion_query || have_ext_occlusion_query_boolean ||
|
||||
@ -1326,7 +1321,6 @@ void FeatureInfo::InitializeFeatures() {
|
||||
EnableANGLEInstancedArrayIfPossible(extensions);
|
||||
|
||||
bool have_es2_draw_buffers_vendor_agnostic =
|
||||
gl_version_info_->is_desktop_core_profile ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_draw_buffers") ||
|
||||
gfx::HasExtension(extensions, "GL_EXT_draw_buffers");
|
||||
bool can_emulate_es2_draw_buffers_on_es3_nv =
|
||||
@ -1403,7 +1397,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
bool ui_gl_fence_works = gl::GLFence::IsSupported();
|
||||
|
||||
feature_flags_.map_buffer_range =
|
||||
gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile ||
|
||||
gl_version_info_->is_es3 ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_map_buffer_range") ||
|
||||
gfx::HasExtension(extensions, "GL_EXT_map_buffer_range");
|
||||
|
||||
@ -1462,7 +1456,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
}
|
||||
}
|
||||
|
||||
if ((gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile ||
|
||||
if ((gl_version_info_->is_es3 ||
|
||||
gfx::HasExtension(extensions, "GL_EXT_texture_rg") ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_texture_rg")) &&
|
||||
IsGL_REDSupportedOnFBOs()) {
|
||||
@ -1495,8 +1489,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
|
||||
const bool is_texture_norm16_supported_for_webgl2_or_es3 =
|
||||
IsWebGL2OrES3OrHigherContext() &&
|
||||
(gl_version_info_->is_desktop_core_profile ||
|
||||
(gl_version_info_->IsAtLeastGL(2, 1) &&
|
||||
((gl_version_info_->IsAtLeastGL(2, 1) &&
|
||||
gfx::HasExtension(extensions, "GL_ARB_texture_rg")) ||
|
||||
gfx::HasExtension(extensions, "GL_EXT_texture_norm16"));
|
||||
const bool is_texture_norm16_supported_for_angle_es2 =
|
||||
@ -1689,9 +1682,7 @@ void FeatureInfo::InitializeFeatures() {
|
||||
#else
|
||||
if ((!is_passthrough_cmd_decoder_ &&
|
||||
((gl_version_info_->IsAtLeastGLES(3, 2) &&
|
||||
gfx::HasExtension(extensions, "GL_EXT_base_instance")) ||
|
||||
(gl_version_info_->is_desktop_core_profile &&
|
||||
gl_version_info_->IsAtLeastGL(4, 2)))) ||
|
||||
gfx::HasExtension(extensions, "GL_EXT_base_instance")))) ||
|
||||
gfx::HasExtension(extensions, "GL_ANGLE_base_vertex_base_instance")) {
|
||||
#endif
|
||||
// TODO(shrekshao): change condition to the following after workaround for
|
||||
@ -1853,8 +1844,7 @@ void FeatureInfo::InitializeFloatAndHalfFloatFeatures(
|
||||
enable_ext_color_buffer_half_float = true;
|
||||
}
|
||||
|
||||
if (gfx::HasExtension(extensions, "GL_ARB_texture_float") ||
|
||||
gl_version_info_->is_desktop_core_profile) {
|
||||
if (gfx::HasExtension(extensions, "GL_ARB_texture_float")) {
|
||||
enable_texture_float = true;
|
||||
enable_texture_float_linear = true;
|
||||
enable_texture_half_float = true;
|
||||
|
@ -1380,28 +1380,6 @@ TEST_P(FeatureInfoTest, InitializeGLES3_occlusion_query_boolean) {
|
||||
EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);
|
||||
}
|
||||
|
||||
TEST_P(FeatureInfoTest, InitializeGL33_occlusion_query2) {
|
||||
SetupInitExpectationsWithGLVersion("", "", "3.3");
|
||||
if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {
|
||||
EXPECT_TRUE(gfx::HasExtension(info_->extensions(),
|
||||
"GL_EXT_occlusion_query_boolean"));
|
||||
}
|
||||
EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);
|
||||
EXPECT_TRUE(info_->feature_flags(
|
||||
).use_arb_occlusion_query2_for_occlusion_query_boolean);
|
||||
}
|
||||
|
||||
TEST_P(FeatureInfoTest, InitializeGL43_occlusion_query2) {
|
||||
SetupInitExpectationsWithGLVersion("", "", "4.3");
|
||||
if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {
|
||||
EXPECT_TRUE(gfx::HasExtension(info_->extensions(),
|
||||
"GL_EXT_occlusion_query_boolean"));
|
||||
}
|
||||
EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);
|
||||
EXPECT_FALSE(info_->feature_flags(
|
||||
).use_arb_occlusion_query2_for_occlusion_query_boolean);
|
||||
}
|
||||
|
||||
TEST_P(FeatureInfoTest, InitializeOES_vertex_array_object) {
|
||||
SetupInitExpectations("GL_OES_vertex_array_object");
|
||||
EXPECT_TRUE(
|
||||
|
@ -1246,9 +1246,7 @@ void CopyTextureResourceManagerImpl::DoCopyTextureInternal(
|
||||
if (vertex_array_object_id_) {
|
||||
glBindVertexArrayOES(vertex_array_object_id_);
|
||||
} else {
|
||||
if (!gl_version_info.is_desktop_core_profile) {
|
||||
decoder->ClearAllAttributes();
|
||||
}
|
||||
decoder->ClearAllAttributes();
|
||||
glEnableVertexAttribArray(kVertexPositionAttrib);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, buffer_id_);
|
||||
glVertexAttribPointer(kVertexPositionAttrib, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
@ -3225,23 +3225,9 @@ gpu::ContextResult GLES2DecoderImpl::Initialize(
|
||||
GLint depth_bits = 0;
|
||||
GLint stencil_bits = 0;
|
||||
|
||||
bool default_fb = (GetBackbufferServiceId() == 0);
|
||||
|
||||
if (gl_version_info().is_desktop_core_profile) {
|
||||
api()->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, default_fb ? GL_BACK_LEFT : GL_COLOR_ATTACHMENT0,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, &alpha_bits);
|
||||
api()->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, default_fb ? GL_DEPTH : GL_DEPTH_ATTACHMENT,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, &depth_bits);
|
||||
api()->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, default_fb ? GL_STENCIL : GL_STENCIL_ATTACHMENT,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, &stencil_bits);
|
||||
} else {
|
||||
api()->glGetIntegervFn(GL_ALPHA_BITS, &alpha_bits);
|
||||
api()->glGetIntegervFn(GL_DEPTH_BITS, &depth_bits);
|
||||
api()->glGetIntegervFn(GL_STENCIL_BITS, &stencil_bits);
|
||||
}
|
||||
api()->glGetIntegervFn(GL_ALPHA_BITS, &alpha_bits);
|
||||
api()->glGetIntegervFn(GL_DEPTH_BITS, &depth_bits);
|
||||
api()->glGetIntegervFn(GL_STENCIL_BITS, &stencil_bits);
|
||||
|
||||
back_buffer_color_format_ = alpha_bits > 0 ? GL_RGBA : GL_RGB;
|
||||
back_buffer_has_depth_ = depth_bits > 0;
|
||||
@ -3264,10 +3250,6 @@ gpu::ContextResult GLES2DecoderImpl::Initialize(
|
||||
if (!gl_version_info().BehavesLikeGLES()) {
|
||||
api()->glEnableFn(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||
api()->glEnableFn(GL_POINT_SPRITE);
|
||||
} else if (gl_version_info().is_desktop_core_profile) {
|
||||
// The desktop core profile changed how program point size mode is
|
||||
// enabled.
|
||||
api()->glEnableFn(GL_PROGRAM_POINT_SIZE);
|
||||
}
|
||||
|
||||
// ES3 requires seamless cubemap. ES2 does not.
|
||||
@ -6273,18 +6255,7 @@ bool GLES2DecoderImpl::GetHelper(
|
||||
if (framebuffer) {
|
||||
if (framebuffer->HasAlphaMRT() &&
|
||||
framebuffer->HasSameInternalFormatsMRT()) {
|
||||
if (gl_version_info().is_desktop_core_profile) {
|
||||
for (uint32_t i = 0; i < group_->max_draw_buffers(); i++) {
|
||||
if (framebuffer->HasColorAttachment(i)) {
|
||||
api()->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, &v);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
api()->glGetIntegervFn(GL_ALPHA_BITS, &v);
|
||||
}
|
||||
api()->glGetIntegervFn(GL_ALPHA_BITS, &v);
|
||||
}
|
||||
} else {
|
||||
v = (ClientExposedBackBufferHasAlpha() ? 8 : 0);
|
||||
@ -6296,20 +6267,7 @@ bool GLES2DecoderImpl::GetHelper(
|
||||
*num_written = 1;
|
||||
if (params) {
|
||||
GLint v = 0;
|
||||
if (gl_version_info().is_desktop_core_profile) {
|
||||
Framebuffer* framebuffer = GetBoundDrawFramebuffer();
|
||||
if (framebuffer) {
|
||||
if (framebuffer->HasDepthAttachment()) {
|
||||
api()->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, &v);
|
||||
}
|
||||
} else {
|
||||
v = (back_buffer_has_depth_ ? 24 : 0);
|
||||
}
|
||||
} else {
|
||||
api()->glGetIntegervFn(GL_DEPTH_BITS, &v);
|
||||
}
|
||||
api()->glGetIntegervFn(GL_DEPTH_BITS, &v);
|
||||
params[0] = BoundFramebufferHasDepthAttachment() ? v : 0;
|
||||
}
|
||||
return true;
|
||||
@ -6319,37 +6277,7 @@ bool GLES2DecoderImpl::GetHelper(
|
||||
*num_written = 1;
|
||||
if (params) {
|
||||
GLint v = 0;
|
||||
if (gl_version_info().is_desktop_core_profile) {
|
||||
Framebuffer* framebuffer = GetBoundDrawFramebuffer();
|
||||
if (framebuffer) {
|
||||
if (framebuffer->HasSameInternalFormatsMRT()) {
|
||||
GLenum framebuffer_enum = 0;
|
||||
switch (pname) {
|
||||
case GL_RED_BITS:
|
||||
framebuffer_enum = GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE;
|
||||
break;
|
||||
case GL_GREEN_BITS:
|
||||
framebuffer_enum = GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE;
|
||||
break;
|
||||
case GL_BLUE_BITS:
|
||||
framebuffer_enum = GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE;
|
||||
break;
|
||||
}
|
||||
for (uint32_t i = 0; i < group_->max_draw_buffers(); i++) {
|
||||
if (framebuffer->HasColorAttachment(i)) {
|
||||
api()->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i,
|
||||
framebuffer_enum, &v);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
v = 8;
|
||||
}
|
||||
} else {
|
||||
api()->glGetIntegervFn(pname, &v);
|
||||
}
|
||||
api()->glGetIntegervFn(pname, &v);
|
||||
params[0] = v;
|
||||
}
|
||||
return true;
|
||||
@ -6357,20 +6285,7 @@ bool GLES2DecoderImpl::GetHelper(
|
||||
*num_written = 1;
|
||||
if (params) {
|
||||
GLint v = 0;
|
||||
if (gl_version_info().is_desktop_core_profile) {
|
||||
Framebuffer* framebuffer = GetBoundDrawFramebuffer();
|
||||
if (framebuffer) {
|
||||
if (framebuffer->HasStencilAttachment()) {
|
||||
api()->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, &v);
|
||||
}
|
||||
} else {
|
||||
v = (back_buffer_has_stencil_ ? 8 : 0);
|
||||
}
|
||||
} else {
|
||||
api()->glGetIntegervFn(GL_STENCIL_BITS, &v);
|
||||
}
|
||||
api()->glGetIntegervFn(GL_STENCIL_BITS, &v);
|
||||
params[0] = BoundFramebufferHasStencilAttachment() ? v : 0;
|
||||
}
|
||||
return true;
|
||||
@ -6712,10 +6627,6 @@ GLenum GLES2DecoderImpl::AdjustGetPname(GLenum pname) {
|
||||
features().use_img_for_multisampled_render_to_texture) {
|
||||
return GL_MAX_SAMPLES_IMG;
|
||||
}
|
||||
if (GL_ALIASED_POINT_SIZE_RANGE == pname &&
|
||||
gl_version_info().is_desktop_core_profile) {
|
||||
return GL_POINT_SIZE_RANGE;
|
||||
}
|
||||
return pname;
|
||||
}
|
||||
|
||||
|
@ -2200,9 +2200,7 @@ error::Error GLES2DecoderImpl::HandleHint(uint32_t immediate_data_size,
|
||||
case GL_GENERATE_MIPMAP_HINT:
|
||||
if (state_.hint_generate_mipmap != mode) {
|
||||
state_.hint_generate_mipmap = mode;
|
||||
if (!feature_info_->gl_version_info().is_desktop_core_profile) {
|
||||
api()->glHintFn(target, mode);
|
||||
}
|
||||
api()->glHintFn(target, mode);
|
||||
}
|
||||
break;
|
||||
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
|
||||
|
@ -350,33 +350,15 @@ ContextResult GLES2DecoderTestBase::MaybeInitDecoderWithWorkarounds(
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
|
||||
if (group_->feature_info()->gl_version_info().is_desktop_core_profile) {
|
||||
EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
|
||||
GL_FRAMEBUFFER, GL_BACK_LEFT,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, _))
|
||||
.WillOnce(SetArgPointee<3>(normalized_init.has_alpha ? 8 : 0))
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
|
||||
GL_FRAMEBUFFER, GL_DEPTH,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, _))
|
||||
.WillOnce(SetArgPointee<3>(normalized_init.has_depth ? 24 : 0))
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
|
||||
GL_FRAMEBUFFER, GL_STENCIL,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, _))
|
||||
.WillOnce(SetArgPointee<3>(normalized_init.has_stencil ? 8 : 0))
|
||||
.RetiresOnSaturation();
|
||||
} else {
|
||||
EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
|
||||
.WillOnce(SetArgPointee<1>(normalized_init.has_alpha ? 8 : 0))
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
|
||||
.WillOnce(SetArgPointee<1>(normalized_init.has_depth ? 24 : 0))
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
|
||||
.WillOnce(SetArgPointee<1>(normalized_init.has_stencil ? 8 : 0))
|
||||
.RetiresOnSaturation();
|
||||
}
|
||||
EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
|
||||
.WillOnce(SetArgPointee<1>(normalized_init.has_alpha ? 8 : 0))
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
|
||||
.WillOnce(SetArgPointee<1>(normalized_init.has_depth ? 24 : 0))
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
|
||||
.WillOnce(SetArgPointee<1>(normalized_init.has_stencil ? 8 : 0))
|
||||
.RetiresOnSaturation();
|
||||
|
||||
if (!group_->feature_info()->gl_version_info().BehavesLikeGLES()) {
|
||||
EXPECT_CALL(*gl_, Enable(GL_VERTEX_PROGRAM_POINT_SIZE))
|
||||
@ -386,12 +368,6 @@ ContextResult GLES2DecoderTestBase::MaybeInitDecoderWithWorkarounds(
|
||||
EXPECT_CALL(*gl_, Enable(GL_POINT_SPRITE))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
} else if (group_->feature_info()
|
||||
->gl_version_info()
|
||||
.is_desktop_core_profile) {
|
||||
EXPECT_CALL(*gl_, Enable(GL_PROGRAM_POINT_SIZE))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
}
|
||||
|
||||
if (group_->feature_info()->gl_version_info().IsAtLeastGL(3, 2)) {
|
||||
|
@ -557,20 +557,6 @@ TEST_P(GLES3DecoderTest, ES3PixelStoreiWithPixelUnpackBuffer) {
|
||||
DoBindBuffer(GL_PIXEL_UNPACK_BUFFER, client_buffer_id_, kServiceBufferId);
|
||||
}
|
||||
|
||||
TEST_P(GLES2DecoderManualInitTest, MipmapHintOnCoreProfile) {
|
||||
// On a core profile, glHint(GL_GENERATE_MIPMAP_HINT) should be a noop
|
||||
InitState init;
|
||||
init.gl_version = "3.2";
|
||||
InitDecoder(init);
|
||||
|
||||
cmds::Hint cmd;
|
||||
cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
|
||||
|
||||
EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_NICEST)).Times(0);
|
||||
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
||||
EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
||||
}
|
||||
|
||||
TEST_P(GLES2DecoderManualInitTest, MipmapHintOnCompatibilityProfile) {
|
||||
// On a compatibility profile, glHint(GL_GENERATE_MIPMAP_HINT) should be go
|
||||
// through
|
||||
|
@ -264,23 +264,9 @@ TEST_P(GLES2ExternalFrameBufferTest, Test) {
|
||||
GLint stencil_bits = 0;
|
||||
GLint alpha_bits = 0;
|
||||
|
||||
if (context_state_->feature_info()
|
||||
->gl_version_info()
|
||||
.is_desktop_core_profile) {
|
||||
api->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, &alpha_bits);
|
||||
api->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, &depth_bits);
|
||||
api->glGetFramebufferAttachmentParameterivEXTFn(
|
||||
GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
|
||||
GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, &stencil_bits);
|
||||
} else {
|
||||
api->glGetIntegervFn(GL_ALPHA_BITS, &alpha_bits);
|
||||
api->glGetIntegervFn(GL_DEPTH_BITS, &depth_bits);
|
||||
api->glGetIntegervFn(GL_STENCIL_BITS, &stencil_bits);
|
||||
}
|
||||
api->glGetIntegervFn(GL_ALPHA_BITS, &alpha_bits);
|
||||
api->glGetIntegervFn(GL_DEPTH_BITS, &depth_bits);
|
||||
api->glGetIntegervFn(GL_STENCIL_BITS, &stencil_bits);
|
||||
|
||||
// If we requested depth, expect it to be there.
|
||||
if (params.need_depth)
|
||||
|
@ -205,7 +205,6 @@ void TestHelper::SetupTextureManagerInitExpectations(
|
||||
::gl::MockGLInterface* gl,
|
||||
bool is_es3_enabled,
|
||||
bool is_es3_capable,
|
||||
bool is_desktop_core_profile,
|
||||
const gfx::ExtensionSet& extensions,
|
||||
bool use_default_textures) {
|
||||
InSequence sequence;
|
||||
@ -231,7 +230,6 @@ void TestHelper::SetupTextureManagerInitExpectations(
|
||||
bool ext_image_external =
|
||||
gfx::HasExtension(extensions, "GL_OES_EGL_image_external");
|
||||
bool arb_texture_rectangle =
|
||||
is_desktop_core_profile ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_texture_rectangle");
|
||||
|
||||
if (ext_image_external) {
|
||||
@ -283,7 +281,6 @@ void TestHelper::SetupTextureDestructionExpectations(
|
||||
void TestHelper::SetupTextureManagerDestructionExpectations(
|
||||
::gl::MockGLInterface* gl,
|
||||
bool is_es3_enabled,
|
||||
bool is_desktop_core_profile,
|
||||
const gfx::ExtensionSet& extensions,
|
||||
bool use_default_textures) {
|
||||
SetupTextureDestructionExpectations(gl, GL_TEXTURE_2D, use_default_textures);
|
||||
@ -300,14 +297,13 @@ void TestHelper::SetupTextureManagerDestructionExpectations(
|
||||
bool ext_image_external =
|
||||
gfx::HasExtension(extensions, "GL_OES_EGL_image_external");
|
||||
bool arb_texture_rectangle =
|
||||
is_desktop_core_profile ||
|
||||
gfx::HasExtension(extensions, "GL_ARB_texture_rectangle");
|
||||
|
||||
if (ext_image_external) {
|
||||
SetupTextureDestructionExpectations(
|
||||
gl, GL_TEXTURE_EXTERNAL_OES, use_default_textures);
|
||||
}
|
||||
if (arb_texture_rectangle || is_desktop_core_profile) {
|
||||
if (arb_texture_rectangle) {
|
||||
SetupTextureDestructionExpectations(
|
||||
gl, GL_TEXTURE_RECTANGLE_ARB, use_default_textures);
|
||||
}
|
||||
@ -341,7 +337,7 @@ void TestHelper::SetupContextGroupInitExpectations(
|
||||
gfx::HasExtension(extension_set, "GL_EXT_framebuffer_multisample") ||
|
||||
gfx::HasExtension(extension_set,
|
||||
"GL_EXT_multisampled_render_to_texture") ||
|
||||
gl_info.is_es3 || gl_info.is_desktop_core_profile) {
|
||||
gl_info.is_es3) {
|
||||
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _))
|
||||
.WillOnce(SetArgPointee<1>(kMaxSamples))
|
||||
.RetiresOnSaturation();
|
||||
@ -354,8 +350,7 @@ void TestHelper::SetupContextGroupInitExpectations(
|
||||
|
||||
if (enable_es3 ||
|
||||
(!enable_es3 &&
|
||||
(gl_info.is_desktop_core_profile ||
|
||||
gfx::HasExtension(extension_set, "GL_EXT_draw_buffers") ||
|
||||
(gfx::HasExtension(extension_set, "GL_EXT_draw_buffers") ||
|
||||
gfx::HasExtension(extension_set, "GL_ARB_draw_buffers") ||
|
||||
(gl_info.is_es3 &&
|
||||
gfx::HasExtension(extension_set, "GL_NV_draw_buffers"))))) {
|
||||
@ -411,8 +406,7 @@ void TestHelper::SetupContextGroupInitExpectations(
|
||||
.WillOnce(SetArgPointee<1>(kMaxArrayTextureLayers))
|
||||
.RetiresOnSaturation();
|
||||
}
|
||||
if (gfx::HasExtension(extension_set, "GL_ARB_texture_rectangle") ||
|
||||
gl_info.is_desktop_core_profile) {
|
||||
if (gfx::HasExtension(extension_set, "GL_ARB_texture_rectangle")) {
|
||||
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, _))
|
||||
.WillOnce(SetArgPointee<1>(kMaxRectangleTextureSize))
|
||||
.RetiresOnSaturation();
|
||||
@ -424,7 +418,7 @@ void TestHelper::SetupContextGroupInitExpectations(
|
||||
.WillOnce(SetArgPointee<1>(kMaxVertexTextureImageUnits))
|
||||
.RetiresOnSaturation();
|
||||
|
||||
if (gl_info.is_es || gl_info.is_desktop_core_profile) {
|
||||
if (gl_info.is_es) {
|
||||
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, _))
|
||||
.WillOnce(SetArgPointee<1>(kMaxFragmentUniformVectors))
|
||||
.RetiresOnSaturation();
|
||||
@ -465,7 +459,6 @@ void TestHelper::SetupContextGroupInitExpectations(
|
||||
|
||||
bool use_default_textures = bind_generates_resource;
|
||||
SetupTextureManagerInitExpectations(gl, enable_es3, gl_info.is_es3_capable,
|
||||
gl_info.is_desktop_core_profile,
|
||||
extension_set, use_default_textures);
|
||||
}
|
||||
|
||||
@ -522,7 +515,7 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
||||
.WillOnce(Return(reinterpret_cast<const uint8_t*>(gl_renderer)))
|
||||
.RetiresOnSaturation();
|
||||
|
||||
if (gl_info.is_es3 || gl_info.is_desktop_core_profile ||
|
||||
if (gl_info.is_es3 ||
|
||||
gfx::HasExtension(extension_set, "GL_ARB_pixel_buffer_object") ||
|
||||
gfx::HasExtension(extension_set, "GL_NV_pixel_buffer_object")) {
|
||||
EXPECT_CALL(*gl, GetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, _))
|
||||
@ -530,8 +523,7 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
||||
.RetiresOnSaturation();
|
||||
}
|
||||
|
||||
if ((gfx::HasExtension(extension_set, "GL_ARB_texture_float") ||
|
||||
gl_info.is_desktop_core_profile) ||
|
||||
if (gfx::HasExtension(extension_set, "GL_ARB_texture_float") ||
|
||||
(gl_info.is_es3 &&
|
||||
gfx::HasExtension(extension_set, "GL_OES_texture_float") &&
|
||||
gfx::HasExtension(extension_set, "GL_EXT_color_buffer_float"))) {
|
||||
@ -663,8 +655,7 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
||||
|
||||
if (enable_es3 ||
|
||||
(!enable_es3 &&
|
||||
(gl_info.is_desktop_core_profile ||
|
||||
gfx::HasExtension(extension_set, "GL_EXT_draw_buffers") ||
|
||||
(gfx::HasExtension(extension_set, "GL_EXT_draw_buffers") ||
|
||||
gfx::HasExtension(extension_set, "GL_ARB_draw_buffers") ||
|
||||
(gl_info.is_es3 &&
|
||||
gfx::HasExtension(extension_set, "GL_NV_draw_buffers"))))) {
|
||||
@ -680,8 +671,7 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
||||
// skipped universally on macOS, and by default (with a Finch
|
||||
// kill-switch) on Android.
|
||||
#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID)
|
||||
if (gl_info.is_es3 || gl_info.is_desktop_core_profile ||
|
||||
gfx::HasExtension(extension_set, "GL_EXT_texture_rg") ||
|
||||
if (gl_info.is_es3 || gfx::HasExtension(extension_set, "GL_EXT_texture_rg") ||
|
||||
(gfx::HasExtension(extension_set, "GL_ARB_texture_rg"))) {
|
||||
#if DCHECK_IS_ON()
|
||||
EXPECT_CALL(*gl, GetError())
|
||||
|
@ -121,13 +121,11 @@ class TestHelper {
|
||||
::gl::MockGLInterface* gl,
|
||||
bool is_es3_enabled,
|
||||
bool is_es3_capable,
|
||||
bool is_desktop_core_profile,
|
||||
const gfx::ExtensionSet& extensions,
|
||||
bool use_default_textures);
|
||||
static void SetupTextureManagerDestructionExpectations(
|
||||
::gl::MockGLInterface* gl,
|
||||
bool is_es3_enabled,
|
||||
bool is_desktop_core_profile,
|
||||
const gfx::ExtensionSet& extensions,
|
||||
bool use_default_textures);
|
||||
|
||||
|
@ -84,8 +84,8 @@ class TextureManagerTest : public GpuServiceTest {
|
||||
kMaxRectangleTextureSize, kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
kUseDefaultTextures, nullptr, &discardable_manager_));
|
||||
SetupFeatureInfo("", "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
|
||||
TestHelper::SetupTextureManagerInitExpectations(
|
||||
gl_.get(), false, false, false, {}, kUseDefaultTextures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), false, false, {},
|
||||
kUseDefaultTextures);
|
||||
manager_->Initialize();
|
||||
error_state_.reset(new ::testing::StrictMock<MockErrorState>());
|
||||
}
|
||||
@ -208,9 +208,9 @@ TEST_F(TextureManagerTest, SetParameter) {
|
||||
|
||||
TEST_F(TextureManagerTest, UseDefaultTexturesTrue) {
|
||||
bool use_default_textures = true;
|
||||
TestHelper::SetupTextureManagerInitExpectations(
|
||||
gl_.get(), false, false, false, {"GL_ANGLE_texture_usage"},
|
||||
use_default_textures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), false, false,
|
||||
{"GL_ANGLE_texture_usage"},
|
||||
use_default_textures);
|
||||
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
|
||||
kMaxCubeMapTextureSize, kMaxRectangleTextureSize,
|
||||
kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
@ -228,9 +228,9 @@ TEST_F(TextureManagerTest, UseDefaultTexturesTrue) {
|
||||
|
||||
TEST_F(TextureManagerTest, UseDefaultTexturesFalse) {
|
||||
bool use_default_textures = false;
|
||||
TestHelper::SetupTextureManagerInitExpectations(
|
||||
gl_.get(), false, false, false, {"GL_ANGLE_texture_usage"},
|
||||
use_default_textures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), false, false,
|
||||
{"GL_ANGLE_texture_usage"},
|
||||
use_default_textures);
|
||||
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
|
||||
kMaxCubeMapTextureSize, kMaxRectangleTextureSize,
|
||||
kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
@ -249,8 +249,8 @@ TEST_F(TextureManagerTest, UseDefaultTexturesFalse) {
|
||||
TEST_F(TextureManagerTest, UseDefaultTexturesTrueES3) {
|
||||
bool use_default_textures = true;
|
||||
SetupFeatureInfo("", "OpenGL ES 3.0", CONTEXT_TYPE_OPENGLES3);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), true, true, false,
|
||||
{}, use_default_textures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), true, true, {},
|
||||
use_default_textures);
|
||||
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
|
||||
kMaxCubeMapTextureSize, kMaxRectangleTextureSize,
|
||||
kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
@ -267,8 +267,8 @@ TEST_F(TextureManagerTest, UseDefaultTexturesTrueES3) {
|
||||
TEST_F(TextureManagerTest, UseDefaultTexturesFalseES3) {
|
||||
bool use_default_textures = false;
|
||||
SetupFeatureInfo("", "OpenGL ES 3.0", CONTEXT_TYPE_OPENGLES3);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), true, true, false,
|
||||
{}, use_default_textures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), true, true, {},
|
||||
use_default_textures);
|
||||
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
|
||||
kMaxCubeMapTextureSize, kMaxRectangleTextureSize,
|
||||
kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
@ -284,8 +284,7 @@ TEST_F(TextureManagerTest, UseDefaultTexturesFalseES3) {
|
||||
|
||||
TEST_F(TextureManagerTest, TextureUsageExt) {
|
||||
TestHelper::SetupTextureManagerInitExpectations(
|
||||
gl_.get(), false, false, false, {"GL_ANGLE_texture_usage"},
|
||||
kUseDefaultTextures);
|
||||
gl_.get(), false, false, {"GL_ANGLE_texture_usage"}, kUseDefaultTextures);
|
||||
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
|
||||
kMaxCubeMapTextureSize, kMaxRectangleTextureSize,
|
||||
kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
@ -310,8 +309,8 @@ TEST_F(TextureManagerTest, TextureUsageExt) {
|
||||
TEST_F(TextureManagerTest, Destroy) {
|
||||
const GLuint kClient1Id = 1;
|
||||
const GLuint kService1Id = 11;
|
||||
TestHelper::SetupTextureManagerInitExpectations(
|
||||
gl_.get(), false, false, false, {}, kUseDefaultTextures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), false, false, {},
|
||||
kUseDefaultTextures);
|
||||
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
|
||||
kMaxCubeMapTextureSize, kMaxRectangleTextureSize,
|
||||
kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
@ -325,8 +324,8 @@ TEST_F(TextureManagerTest, Destroy) {
|
||||
EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kService1Id)))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
TestHelper::SetupTextureManagerDestructionExpectations(
|
||||
gl_.get(), false, false, {}, kUseDefaultTextures);
|
||||
TestHelper::SetupTextureManagerDestructionExpectations(gl_.get(), false, {},
|
||||
kUseDefaultTextures);
|
||||
manager.Destroy();
|
||||
// Check that resources got freed.
|
||||
texture = manager.GetTexture(kClient1Id);
|
||||
@ -488,8 +487,8 @@ TEST_F(TextureManagerTest, AlphaLuminanceCompatibilityProfile) {
|
||||
const GLuint kServiceId = 11;
|
||||
|
||||
SetupFeatureInfo("", "2.1", CONTEXT_TYPE_OPENGLES2);
|
||||
TestHelper::SetupTextureManagerInitExpectations(
|
||||
gl_.get(), false, false, false, {}, kUseDefaultTextures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), false, false, {},
|
||||
kUseDefaultTextures);
|
||||
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
|
||||
kMaxCubeMapTextureSize, kMaxRectangleTextureSize,
|
||||
kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
@ -524,103 +523,6 @@ TEST_F(TextureManagerTest, AlphaLuminanceCompatibilityProfile) {
|
||||
manager.RemoveTexture(kClientId);
|
||||
}
|
||||
|
||||
TEST_F(TextureManagerTest, AlphaLuminanceCoreProfileEmulation) {
|
||||
const GLuint kClientId = 1;
|
||||
const GLuint kServiceId = 11;
|
||||
|
||||
SetupFeatureInfo("", "4.2", CONTEXT_TYPE_OPENGLES3);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), true, true, true,
|
||||
{}, kUseDefaultTextures);
|
||||
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
|
||||
kMaxCubeMapTextureSize, kMaxRectangleTextureSize,
|
||||
kMax3DTextureSize, kMaxArrayTextureLayers,
|
||||
kUseDefaultTextures, nullptr, &discardable_manager_);
|
||||
manager.Initialize();
|
||||
|
||||
// Create a texture.
|
||||
manager.CreateTexture(kClientId, kServiceId);
|
||||
scoped_refptr<TextureRef> texture_ref(manager.GetTexture(kClientId));
|
||||
manager.SetTarget(texture_ref.get(), GL_TEXTURE_2D);
|
||||
|
||||
Texture* texture = texture_ref->texture();
|
||||
|
||||
// GL_ALPHA emulation
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_NONE))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_NONE))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_NONE))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
|
||||
manager.SetLevelInfo(texture_ref.get(), GL_TEXTURE_2D, 0, GL_ALPHA, 1, 1, 1,
|
||||
0, GL_ALPHA, GL_UNSIGNED_BYTE, gfx::Rect(1, 1));
|
||||
texture->ApplyFormatWorkarounds(feature_info_.get());
|
||||
|
||||
// GL_LUMINANCE emulation
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_RED))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ONE))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
|
||||
manager.SetLevelInfo(texture_ref.get(), GL_TEXTURE_2D, 0, GL_LUMINANCE, 1, 1,
|
||||
1, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, gfx::Rect(1, 1));
|
||||
texture->ApplyFormatWorkarounds(feature_info_.get());
|
||||
|
||||
// GL_LUMINANCE_ALPHA emulation
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_RED))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A,
|
||||
GL_GREEN))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
|
||||
manager.SetLevelInfo(texture_ref.get(), GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA,
|
||||
1, 1, 1, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, gfx::Rect(1, 1));
|
||||
texture->ApplyFormatWorkarounds(feature_info_.get());
|
||||
|
||||
// Ensure explicitly setting swizzles while using emulated settings properly
|
||||
// swizzles the swizzle.
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R,
|
||||
GL_GREEN))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A,
|
||||
GL_RED))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
|
||||
manager.SetParameteri("TexParameteri", error_state_.get(), texture_ref.get(),
|
||||
GL_TEXTURE_SWIZZLE_R, GL_ALPHA);
|
||||
manager.SetParameteri("TexParameteri", error_state_.get(), texture_ref.get(),
|
||||
GL_TEXTURE_SWIZZLE_A, GL_GREEN);
|
||||
|
||||
EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kServiceId)))
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
manager.RemoveTexture(kClientId);
|
||||
}
|
||||
|
||||
class TextureTestBase : public GpuServiceTest {
|
||||
public:
|
||||
static const GLint kMaxTextureSize = 32;
|
||||
@ -2117,11 +2019,11 @@ class SharedTextureTest : public GpuServiceTest {
|
||||
TextureManagerTest::kMaxArrayTextureLayers, kUseDefaultTextures,
|
||||
nullptr, &discardable_manager_));
|
||||
SetupFeatureInfo("", "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
|
||||
TestHelper::SetupTextureManagerInitExpectations(
|
||||
gl_.get(), false, false, false, {}, kUseDefaultTextures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), false, false, {},
|
||||
kUseDefaultTextures);
|
||||
texture_manager1_->Initialize();
|
||||
TestHelper::SetupTextureManagerInitExpectations(
|
||||
gl_.get(), false, false, false, {}, kUseDefaultTextures);
|
||||
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), false, false, {},
|
||||
kUseDefaultTextures);
|
||||
texture_manager2_->Initialize();
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "ui/gfx/extension_set.h"
|
||||
#include "ui/gl/gl_context.h"
|
||||
#include "ui/gl/gl_version_info.h"
|
||||
|
||||
namespace gpu {
|
||||
|
||||
@ -45,14 +44,6 @@ class GLClearFramebufferTest : public testing::TestWithParam<bool> {
|
||||
}
|
||||
}
|
||||
|
||||
bool IsApplicable() {
|
||||
// The workaround doesn't use VAOs which would cause a failure on a core
|
||||
// context and the hardware for each the workaround is necessary has a buggy
|
||||
// VAO implementation. So we skip testing the workaround on core profiles.
|
||||
return !GetParam() ||
|
||||
!gl_.context()->GetVersionInfo()->is_desktop_core_profile;
|
||||
}
|
||||
|
||||
void InitDraw();
|
||||
void SetDrawColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
|
||||
void SetDrawDepth(GLfloat depth);
|
||||
@ -118,10 +109,6 @@ INSTANTIATE_TEST_SUITE_P(GLClearFramebufferTestWithParam,
|
||||
::testing::Values(true, false));
|
||||
|
||||
TEST_P(GLClearFramebufferTest, ClearColor) {
|
||||
if (!IsApplicable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
glClearColor(1.0f, 0.5f, 0.25f, 0.5f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
@ -132,10 +119,6 @@ TEST_P(GLClearFramebufferTest, ClearColor) {
|
||||
}
|
||||
|
||||
TEST_P(GLClearFramebufferTest, ClearColorWithMask) {
|
||||
if (!IsApplicable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
@ -149,10 +132,6 @@ TEST_P(GLClearFramebufferTest, ClearColorWithMask) {
|
||||
// crbug.com/434094
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
TEST_P(GLClearFramebufferTest, ClearColorWithScissor) {
|
||||
if (!IsApplicable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO(jonahr): Test fails on Linux with ANGLE/passthrough
|
||||
// (crbug.com/1099770)
|
||||
gpu::GPUTestBotConfig bot_config;
|
||||
@ -181,9 +160,6 @@ TEST_P(GLClearFramebufferTest, ClearColorWithScissor) {
|
||||
#endif
|
||||
|
||||
TEST_P(GLClearFramebufferTest, ClearDepthStencil) {
|
||||
if (!IsApplicable()) {
|
||||
return;
|
||||
}
|
||||
// TODO(kainino): https://crbug.com/782317
|
||||
if (GPUTestBotConfig::CurrentConfigMatches("Intel")) {
|
||||
return;
|
||||
@ -242,7 +218,7 @@ TEST_P(GLClearFramebufferTest, SeparateFramebufferClear) {
|
||||
gfx::ExtensionSet extensions = gfx::MakeExtensionSet(extension_string);
|
||||
bool has_separate_framebuffer =
|
||||
gfx::HasExtension(extensions, "GL_CHROMIUM_framebuffer_multisample");
|
||||
if (!IsApplicable() || !has_separate_framebuffer) {
|
||||
if (!has_separate_framebuffer) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,6 @@ bool GLFence::IsSupported() {
|
||||
|
||||
return g_current_gl_driver->ext.b_GL_ARB_sync ||
|
||||
g_current_gl_version->is_es3 ||
|
||||
g_current_gl_version->is_desktop_core_profile ||
|
||||
(display && display->ext->b_EGL_KHR_fence_sync) ||
|
||||
#if BUILDFLAG(IS_APPLE)
|
||||
g_current_gl_driver->ext.b_GL_APPLE_fence ||
|
||||
@ -68,8 +67,7 @@ std::unique_ptr<GLFence> GLFence::Create() {
|
||||
return fence;
|
||||
}
|
||||
|
||||
if (g_current_gl_driver->ext.b_GL_ARB_sync || g_current_gl_version->is_es3 ||
|
||||
g_current_gl_version->is_desktop_core_profile) {
|
||||
if (g_current_gl_driver->ext.b_GL_ARB_sync || g_current_gl_version->is_es3) {
|
||||
// Prefer ARB_sync which supports server-side wait.
|
||||
fence = std::make_unique<GLFenceARB>();
|
||||
DCHECK(fence);
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include "base/check_op.h"
|
||||
#include "ui/gl/gl_context.h"
|
||||
#include "ui/gl/gl_version_info.h"
|
||||
#include "ui/gl/scoped_binders.h"
|
||||
|
||||
namespace gl {
|
||||
@ -96,9 +95,4 @@ void GLHelper::DrawQuad(GLuint vertex_buffer) {
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
}
|
||||
|
||||
// static
|
||||
bool GLHelper::ShouldTestsUseVAOs() {
|
||||
return GLContext::GetCurrent()->GetVersionInfo()->is_desktop_core_profile;
|
||||
}
|
||||
|
||||
} // namespace gl
|
||||
|
@ -34,10 +34,6 @@ class GL_EXPORT GLHelper {
|
||||
|
||||
// Draws a quad to the currently bound frame buffer.
|
||||
static void DrawQuad(GLuint vertex_buffer);
|
||||
|
||||
// When using the desktop core profile we have to bind a VAO before
|
||||
// calling glVertexAttribPointer.
|
||||
static bool ShouldTestsUseVAOs();
|
||||
};
|
||||
|
||||
} // namespace gl
|
||||
|
@ -17,13 +17,6 @@
|
||||
|
||||
namespace {
|
||||
|
||||
bool DesktopCoreCommonCheck(
|
||||
bool is_es, unsigned major_version, unsigned minor_version) {
|
||||
return (!is_es &&
|
||||
((major_version == 3 && minor_version >= 2) ||
|
||||
major_version > 3));
|
||||
}
|
||||
|
||||
static bool disable_es3_for_testing = false;
|
||||
|
||||
} // namespace
|
||||
@ -72,9 +65,6 @@ void GLVersionInfo::Initialize(const char* version_str,
|
||||
if (is_angle && driver_vendor == "ANGLE")
|
||||
ExtractDriverVendorANGLE(renderer_str);
|
||||
}
|
||||
is_desktop_core_profile =
|
||||
DesktopCoreCommonCheck(is_es, major_version, minor_version) &&
|
||||
!gfx::HasExtension(extensions, "GL_ARB_compatibility");
|
||||
is_es3_capable = IsES3Capable(extensions);
|
||||
|
||||
// Post-fixup in case the user requested disabling ES3 capability
|
||||
|
@ -36,9 +36,7 @@ struct GL_EXPORT GLVersionInfo {
|
||||
(major_version == major && minor_version >= minor));
|
||||
}
|
||||
|
||||
bool BehavesLikeGLES() const {
|
||||
return is_es || is_desktop_core_profile;
|
||||
}
|
||||
bool BehavesLikeGLES() const { return is_es; }
|
||||
|
||||
bool SupportsFixedType() const {
|
||||
return is_es || IsAtLeastGL(4, 1);
|
||||
@ -59,7 +57,7 @@ struct GL_EXPORT GLVersionInfo {
|
||||
// We need to emulate GL_ALPHA and GL_LUMINANCE and GL_LUMINANCE_ALPHA
|
||||
// texture formats on core profile and ES3, except for ANGLE and Swiftshader.
|
||||
bool NeedsLuminanceAlphaEmulation() const {
|
||||
return !is_angle && !is_swiftshader && (is_es3 || is_desktop_core_profile);
|
||||
return !is_angle && !is_swiftshader && is_es3;
|
||||
}
|
||||
|
||||
bool is_es = false;
|
||||
@ -74,7 +72,6 @@ struct GL_EXPORT GLVersionInfo {
|
||||
unsigned minor_version = 0;
|
||||
bool is_es2 = false;
|
||||
bool is_es3 = false;
|
||||
bool is_desktop_core_profile = false;
|
||||
bool is_es3_capable = false;
|
||||
std::string driver_vendor;
|
||||
std::string driver_version;
|
||||
|
Reference in New Issue
Block a user