From 71ee3647e2a1aa84f8a72ff13cfcfa24a2471fe9 Mon Sep 17 00:00:00 2001 From: "enne@chromium.org" Date: Thu, 14 Oct 2010 18:08:00 +0000 Subject: Use packed depth/stencil format if available. WebGL context creation attributes are requests, not requirements. The command buffer needs to be more conservative in its format choices. As separate stencil buffers are not generally supported, pick packed buffers if possible. BUG=58966 TEST=https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/context-attributes-alpha-depth-stencil-antialias.html Review URL: http://codereview.chromium.org/3746001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62584 0039d316-1c4b-4281-b951-d872f2087c98 --- gpu/command_buffer/service/gles2_cmd_decoder.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gpu') diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 99a159f..6859c85 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1791,7 +1791,8 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, } else { LOG(INFO) << "GL_OES_packed_depth_stencil not supported."; } - if (attrib_parser.depth_size_ > 0 && depth24_stencil8_supported) { + if ((attrib_parser.depth_size_ > 0 || attrib_parser.stencil_size_ > 0) && + depth24_stencil8_supported) { offscreen_target_depth_format_ = GL_DEPTH24_STENCIL8; offscreen_target_stencil_format_ = 0; } else { @@ -1817,7 +1818,8 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, LOG(INFO) << "GL_EXT_packed_depth_stencil not supported."; } - if (attrib_parser.depth_size_ > 0 && depth24_stencil8_supported) { + if ((attrib_parser.depth_size_ > 0 || attrib_parser.stencil_size_ > 0) && + depth24_stencil8_supported) { offscreen_target_depth_format_ = GL_DEPTH24_STENCIL8; offscreen_target_stencil_format_ = 0; } else { -- cgit v1.1