|
|
Created:
4 years, 3 months ago by yizhou.jiang Modified:
4 years ago CC:
chromium-reviews, piman+watch_chromium.org, Yang Gu Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Descriptionemulate srgb format for generateMipmap
First, do sampling for a srgb texture, converting it to a linear
texture. Then generateMipmap in rgb format, and do another sampling to
convert rgb texture to srgb one.
BUG=634519
TEST=conformance2/textures/misc/tex-srgb-mipmap.html
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Committed: https://crrev.com/da573a8ab571bb73d3539a66abbe5c2efd47d7b7
Cr-Commit-Position: refs/heads/master@{#424377}
Patch Set 1 #Patch Set 2 : srgb-generateMipmap #Patch Set 3 : srgb-generateMipmap #Patch Set 4 : srgb-generateMipmap #
Total comments: 5
Patch Set 5 : srgb-generateMipmap #Patch Set 6 : srgb-generateMipmap #
Total comments: 40
Patch Set 7 : srgb-generateMipmap #
Total comments: 4
Patch Set 8 : addressed yunchao and qiankun's feedbacks #Patch Set 9 : addressed yunchao's feedback:update webgl2_conformance_expectation.py #
Total comments: 21
Patch Set 10 : addressed piman and kbr's feedbacks (edit) #
Total comments: 9
Patch Set 11 : addressed piman's feedback #
Total comments: 6
Patch Set 12 : addressed piman's feedback #
Total comments: 7
Patch Set 13 : addressed piman, qiankun and yunchao's feedbacks #Patch Set 14 : addressed piman's feedback #Patch Set 15 : trybots issue: getLevelType #Patch Set 16 : rm feature->info #Patch Set 17 : Test trybot issue: Applying Julien's patch 2379153002 #Patch Set 18 : addressed feedbacks #
Total comments: 1
Patch Set 19 : Addressed to Julien and Zhenyao's feedback #Patch Set 20 : rebase code #Messages
Total messages: 182 (138 generated)
Description was changed from ========== srgb generateMipmap BUG= ========== to ========== srgb generateMipmap BUG= CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ==========
Description was changed from ========== srgb generateMipmap BUG= CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ========== to ========== srgb generateMipmap BUG= CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ==========
yizhou.jiang@intel.com changed reviewers: + yunchao.he@intel.com
Patchset #4 (id:60001) has been deleted
Patchset #4 (id:80001) has been deleted
Good work, Yizhou. lgtm with nits. https://codereview.chromium.org/2318313004/diff/100001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/100001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:577: glBindFramebufferEXT(GL_READ_FRAMEBUFFER, srgb_encoder_fbo_); decoder_fbo_ https://codereview.chromium.org/2318313004/diff/100001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:604: glBindTexture(GL_TEXTURE_2D, srgb_decoder_textures_[0]); bind VAO https://codereview.chromium.org/2318313004/diff/100001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:614: InitializeSRGBEncoder(decoder); remove this line https://codereview.chromium.org/2318313004/diff/100001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:624: glDisable(GL_DITHER); remove these code https://codereview.chromium.org/2318313004/diff/100001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:639: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level); This line can get the similar effect with the line NEAREST_MIPMAP_NEAREST.
Thank you for your review, yunchao. I have revised the code, PTAL.
Patchset #6 (id:140001) has been deleted
Yizhou, please see the comments inline and update your code. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6018: state_.EnableDisableFramebufferSRGB(false); Here should be true, not false. Otherwise, the srgb encoding during drawing would not work. This is the main reason why your new patchset failed. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:451: } Please remove this function above, Yizhou. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:476: error = glGetError(); please remove the debugging code. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:480: GL_UNSIGNED_BYTE, nullptr); This is not necessary, copyTexImage2D will allocate storage for texture. BTW, the format is not correct, it should be GL_RGBA, instead of GL_SRGB. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:484: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes3); please remove debug code https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:497: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes2); remove debug code https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:508: glEnable(GL_BLEND); glDisable blend https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:515: error = glGetError(); remove debug code https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:522: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes1); remove debug code https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:530: error = glGetError(); remove debug code https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:534: glClearColor(0, 0, 0, 255); It is not necessary to set clear color. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:545: */ remove debug code. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:548: glBindVertexArrayOES(srgb_converter_vao_); These two lines are not necessary, you have called them already. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:551: glBindTexture(GL_TEXTURE_2D, tex->service_id()); This is not necessary. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:552: glBindFramebufferEXT(GL_FRAMEBUFFER, srgb_encoder_fbo_); move this outside the for loop. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:559: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes2); remove debug code. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:561: glActiveTexture(GL_TEXTURE0); This is not necessary. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:563: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level); move these two lines outside the for loop. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:569: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes); remove the debug code. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.h (right): https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.h:55: GLuint srgb_encoder_program_ = 0; This code snippet is not necessary.
yizhou.jiang@intel.com changed reviewers: + qiankun.miao@intel.com
One more nits. https://codereview.chromium.org/2318313004/diff/180001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/180001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6017: } else { Please add a TODO. If the target is GL_TEXTURE_3D or GL_TEXTURE_2D_ARRAY, this change can not generate correct mipmap.
Great work! Some suggestions. Find a more meaningful title of this CL and add description on what this CL does. Also attach a bug ID. https://codereview.chromium.org/2318313004/diff/180001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/180001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6014: state_.EnableDisableFramebufferSRGB(enable_srgb); Disable Framebuffer_SRGB if enable_srgb is false. if (gl_version_info().IsAtLeastGL(4, 4)) { state_.EnableDisableFramebufferSRGB(enable_srgb); }
On 2016/09/20 06:11:09, qiankun wrote: > Great work! Some suggestions. > Find a more meaningful title of this CL and add description on what this CL > does. Also attach a bug ID. bug is here: https://bugs.chromium.org/p/chromium/issues/detail?id=634519
Description was changed from ========== srgb generateMipmap BUG= CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ========== to ========== srgb generateMipmap BUG=634519 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ==========
Description was changed from ========== srgb generateMipmap BUG=634519 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ========== to ========== First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ==========
@yunchao @qiankun Thank you for your review, the code has been updated. PTAL.
@yunchao @qiankun Thank you for your review, I have revised the code, PTAL. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6018: state_.EnableDisableFramebufferSRGB(false); On 2016/09/19 15:25:47, yunchao wrote: > Here should be true, not false. Otherwise, the srgb encoding during drawing > would not work. This is the main reason why your new patchset failed. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:451: } On 2016/09/19 15:25:48, yunchao wrote: > Please remove this function above, Yizhou. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:476: error = glGetError(); On 2016/09/19 15:25:48, yunchao wrote: > please remove the debugging code. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:480: GL_UNSIGNED_BYTE, nullptr); On 2016/09/19 15:25:48, yunchao wrote: > This is not necessary, copyTexImage2D will allocate storage for texture. > BTW, the format is not correct, it should be GL_RGBA, instead of GL_SRGB. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:484: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes3); On 2016/09/19 15:25:48, yunchao wrote: > please remove debug code Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:497: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes2); On 2016/09/19 15:25:47, yunchao wrote: > remove debug code Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:508: glEnable(GL_BLEND); On 2016/09/19 15:25:48, yunchao wrote: > glDisable blend Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:515: error = glGetError(); On 2016/09/19 15:25:48, yunchao wrote: > remove debug code Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:522: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes1); On 2016/09/19 15:25:47, yunchao wrote: > remove debug code Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:530: error = glGetError(); On 2016/09/19 15:25:47, yunchao wrote: > remove debug code Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:534: glClearColor(0, 0, 0, 255); On 2016/09/19 15:25:47, yunchao wrote: > It is not necessary to set clear color. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:545: */ On 2016/09/19 15:25:47, yunchao wrote: > remove debug code. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:548: glBindVertexArrayOES(srgb_converter_vao_); On 2016/09/19 15:25:48, yunchao wrote: > These two lines are not necessary, you have called them already. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:551: glBindTexture(GL_TEXTURE_2D, tex->service_id()); On 2016/09/19 15:25:47, yunchao wrote: > This is not necessary. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:552: glBindFramebufferEXT(GL_FRAMEBUFFER, srgb_encoder_fbo_); On 2016/09/19 15:25:48, yunchao wrote: > move this outside the for loop. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:559: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes2); On 2016/09/19 15:25:48, yunchao wrote: > remove debug code. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:561: glActiveTexture(GL_TEXTURE0); On 2016/09/19 15:25:48, yunchao wrote: > This is not necessary. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:563: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level); On 2016/09/19 15:25:48, yunchao wrote: > move these two lines outside the for loop. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:569: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bytes); On 2016/09/19 15:25:48, yunchao wrote: > remove the debug code. Done. https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.h (right): https://codereview.chromium.org/2318313004/diff/160001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.h:55: GLuint srgb_encoder_program_ = 0; On 2016/09/19 15:25:48, yunchao wrote: > This code snippet is not necessary. Done. https://codereview.chromium.org/2318313004/diff/180001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/180001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6014: state_.EnableDisableFramebufferSRGB(enable_srgb); On 2016/09/20 06:11:09, qiankun wrote: > Disable Framebuffer_SRGB if enable_srgb is false. > > if (gl_version_info().IsAtLeastGL(4, 4)) { > state_.EnableDisableFramebufferSRGB(enable_srgb); > } Done. https://codereview.chromium.org/2318313004/diff/180001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6017: } else { On 2016/09/20 06:01:57, yunchao wrote: > Please add a TODO. If the target is GL_TEXTURE_3D or GL_TEXTURE_2D_ARRAY, this > change can not generate correct mipmap. Done.
The code is much better now. Yizhou, please update the conformance test in webgl2_conformance_expectation.py.
Patchset #9 (id:220001) has been deleted
@yunchao Thank you, I have updated webgl2_conformance_expectation.py, PTAL.
yizhou.jiang@intel.com changed reviewers: + kbr@chromium.org, piman@chromium.org, zmo@chromium.org
PTAL. Thanks!
Description was changed from ========== First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ========== to ========== First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 TEST=conformance2/textures/misc/tex-srgb-mipmap.html CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ==========
On 2016/09/20 08:54:40, yizhou.jiang wrote: > PTAL. Thanks! Yizhou's first patch in Chromium project. PTAL. @kbr, @piman, @zmo.
https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6012: gl_version_info().IsAtLeastGL(4, 4)) { Is there any particular reason to cut-off at GL 4.4? Nothing in the spec really differs between 4.3 and 4.4 (or 4.2 or 4.5 really). Is this something that should be treated as a bug workaround, so that we can have more flexibility about targeting the problematic drivers? https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:337: tex->GetLevelType(target, 0, &type, &internal_format); Should this be base_level instead of 0? https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:338: const GLint mipmap_level = nit: maybe mipmap_levels, since it's a count, not an array index. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:345: GL_TEXTURE_2D, tex->service_id(), 0); Should this be base_level instead of 0? https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:348: glCopyTexImage2D(GL_TEXTURE_2D, 0, internal_format, 0, 0, width, height, 0); Do we need to make that extra copy, could we use the original texture as a source instead? By selecting GL_NEAREST as the min filter the draw would only use the base_level mip, so you're sure to only convert the relevant level, and then we could restore the min filter. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:377: glGenerateMipmapEXT(GL_TEXTURE_2D); Why this one, is it to generate the image levels on the source texture? It seems wasteful to force the driver to do the scaling blits, just to throw away the data, maybe we could just create them with glTexImage2D in the loop below just before the glFramebufferTexture2DEXT? https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:389: for (GLint level = base_level + 1; level < mipmap_level; ++level) { mipmap_level is computed as the number of levels including and above base_level. For example, if base_level is 3 and width/height (for that level) are 8, then we have: level3 = 8x8 level4 = 4x4 level5 = 2x2 level6 = 1x1 But mipmap_level will be computed as 1+log_2(8) == 4. So I think this loop should be: for (GLint level = base_level + 1; level < base_level + mipmap_level; ++level)
Thanks for this contribution Yizhou. A couple of thoughts. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6024: } else { // TODO If the target is GL_TEXTURE_3D or GL_TEXTURE_2D_ARRAY, Should be TODO(yizhao.jiang) or TODO(yizhao). Also please put comment on a new line. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:327: GLenum target) { Could you add some high-level comments for this function? If I understand correctly, the intent here is: - Copy the base level of the sRGB texture |tex| into a linear (non-sRGB) texture - Perform the glGenerateMipmap call against the linear texture - Copy each mip level of the linear texture back into the sRGB texture |tex| Is this correct? piman did a more thorough review of this code than I could, but I wonder if you are already going to the trouble of iterating down the mip levels and drawing each one, then why not just generate the mipmap directly into |tex| by, at each level: 1) Allocate |level + 1| of |tex| 2) Bind |level + 1| of |tex| to the draw framebuffer 3) Set the TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL of |tex| to |level| 4) Set |tex|'s TEXTURE_MIN_FILTER (and MAG_FILTER, while you're at it) to LINEAR (this should be done outside the loop) 5) Draw |level| of |tex|, implicitly into |level + 1| That would avoid the sRGB -> linear and linear -> sRGB conversions into textures, which are lossy. It shouldn't cause a rendering feedback loop, either, to the best of my knowledge. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:394: glDrawArrays(GL_TRIANGLES, 0, 6); What's the intent of this loop? Is it intended to do a level-by-level copy of srgb_converter_textures_[1] into "tex", with NEAREST filtering at each level?
On Tue, Sep 20, 2016 at 6:00 PM, <kbr@chromium.org> wrote: > Thanks for this contribution Yizhou. A couple of thoughts. > > > > https://codereview.chromium.org/2318313004/diff/240001/ > gpu/command_buffer/service/gles2_cmd_decoder.cc > File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): > > https://codereview.chromium.org/2318313004/diff/240001/ > gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode6024 > gpu/command_buffer/service/gles2_cmd_decoder.cc:6024: } else { // TODO > If the target is GL_TEXTURE_3D or GL_TEXTURE_2D_ARRAY, > Should be TODO(yizhao.jiang) or TODO(yizhao). Also please put comment on > a new line. > > https://codereview.chromium.org/2318313004/diff/240001/ > gpu/command_buffer/service/gles2_cmd_srgb_converter.cc > File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): > > https://codereview.chromium.org/2318313004/diff/240001/ > gpu/command_buffer/service/gles2_cmd_srgb_converter.cc#newcode327 > gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:327: GLenum > target) { > Could you add some high-level comments for this function? If I > understand correctly, the intent here is: > > - Copy the base level of the sRGB texture |tex| into a linear (non-sRGB) > texture > - Perform the glGenerateMipmap call against the linear texture > - Copy each mip level of the linear texture back into the sRGB texture > |tex| > > Is this correct? > > piman did a more thorough review of this code than I could, but I wonder > if you are already going to the trouble of iterating down the mip levels > and drawing each one, then why not just generate the mipmap directly > into |tex| by, at each level: > > 1) Allocate |level + 1| of |tex| > 2) Bind |level + 1| of |tex| to the draw framebuffer > 3) Set the TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL of |tex| to |level| > 4) Set |tex|'s TEXTURE_MIN_FILTER (and MAG_FILTER, while you're at it) > to LINEAR (this should be done outside the loop) > 5) Draw |level| of |tex|, implicitly into |level + 1| > > That would avoid the sRGB -> linear and linear -> sRGB conversions into > textures, which are lossy. It shouldn't cause a rendering feedback loop, > either, to the best of my knowledge. > I think that would be a very reasonable approach too. Agreed that the extra conversion is lossy. OTOH, some drivers apply better than box filters on mipmap generation. So I think without data to favor one or the other, I would be fine with either solution. > > https://codereview.chromium.org/2318313004/diff/240001/ > gpu/command_buffer/service/gles2_cmd_srgb_converter.cc#newcode394 > gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:394: > glDrawArrays(GL_TRIANGLES, 0, 6); > What's the intent of this loop? Is it intended to do a level-by-level > copy of srgb_converter_textures_[1] into "tex", with NEAREST filtering > at each level? > It does a copy, but with the linear->srgb conversion, hence why it needs to be done with a draw and not a simple copy. > > https://codereview.chromium.org/2318313004/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Patchset #10 (id:260001) has been deleted
Thanks for your review, code has been updated. Could you have another look? https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6012: gl_version_info().IsAtLeastGL(4, 4)) { On 2016/09/20 21:53:30, piman OOO back 2016-09-12 wrote: > Is there any particular reason to cut-off at GL 4.4? Nothing in the spec really > differs between 4.3 and 4.4 (or 4.2 or 4.5 really). Is this something that > should be treated as a bug workaround, so that we can have more flexibility > about targeting the problematic drivers? According to BlitFramebuffer and drawArrays api, when processing srgb format and opengl version under 4.4, they also have to do decoder and encoder. when version is over 4.4, these api work well without this workaround. In addition, qiankun has tested generateMipmap api on Nvidia, opengl 4.5, and it also works well without modifying the code. We suppose that mesa team is working on a patch which would fix this problem over 4.4. So I put an version condition here. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6024: } else { // TODO If the target is GL_TEXTURE_3D or GL_TEXTURE_2D_ARRAY, On 2016/09/21 01:00:14, Ken Russell wrote: > Should be TODO(yizhao.jiang) or TODO(yizhao). Also please put comment on a new > line. Done. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:337: tex->GetLevelType(target, 0, &type, &internal_format); On 2016/09/20 21:53:30, piman OOO back 2016-09-12 wrote: > Should this be base_level instead of 0? Done. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:338: const GLint mipmap_level = On 2016/09/20 21:53:30, piman OOO back 2016-09-12 wrote: > nit: maybe mipmap_levels, since it's a count, not an array index. Done. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:345: GL_TEXTURE_2D, tex->service_id(), 0); On 2016/09/20 21:53:30, piman OOO back 2016-09-12 wrote: > Should this be base_level instead of 0? Done. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:348: glCopyTexImage2D(GL_TEXTURE_2D, 0, internal_format, 0, 0, width, height, 0); On 2016/09/20 21:53:30, piman OOO back 2016-09-12 wrote: > Do we need to make that extra copy, could we use the original texture as a > source instead? By selecting GL_NEAREST as the min filter the draw would only > use the base_level mip, so you're sure to only convert the relevant level, and > then we could restore the min filter. I removed copy tex to srgb_decoder_textures_[0] https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:377: glGenerateMipmapEXT(GL_TEXTURE_2D); On 2016/09/20 21:53:30, piman OOO back 2016-09-12 wrote: > Why this one, is it to generate the image levels on the source texture? It seems > wasteful to force the driver to do the scaling blits, just to throw away the > data, maybe we could just create them with glTexImage2D in the loop below just > before the glFramebufferTexture2DEXT? Done. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:389: for (GLint level = base_level + 1; level < mipmap_level; ++level) { On 2016/09/20 21:53:30, piman OOO back 2016-09-12 wrote: > mipmap_level is computed as the number of levels including and above base_level. > For example, if base_level is 3 and width/height (for that level) are 8, then we > have: > level3 = 8x8 > level4 = 4x4 > level5 = 2x2 > level6 = 1x1 > > But mipmap_level will be computed as 1+log_2(8) == 4. > > So I think this loop should be: > for (GLint level = base_level + 1; level < base_level + mipmap_level; ++level) > Done. https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:394: glDrawArrays(GL_TRIANGLES, 0, 6); On 2016/09/21 01:00:14, Ken Russell wrote: > What's the intent of this loop? Is it intended to do a level-by-level copy of > srgb_converter_textures_[1] into "tex", with NEAREST filtering at each level? Yes. I try to sampling converter_textures_[1] to convert to srgb format, then draw mipmaps to the original "tex".
https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6012: gl_version_info().IsAtLeastGL(4, 4)) { On 2016/09/21 08:59:22, yizhou.jiang wrote: > On 2016/09/20 21:53:30, piman OOO back 2016-09-12 wrote: > > Is there any particular reason to cut-off at GL 4.4? Nothing in the spec > really > > differs between 4.3 and 4.4 (or 4.2 or 4.5 really). Is this something that > > should be treated as a bug workaround, so that we can have more flexibility > > about targeting the problematic drivers? > > According to BlitFramebuffer and drawArrays api, when processing srgb format and > opengl version under 4.4, they also have to do decoder and encoder. when version > is over 4.4, these api work well without this workaround. It seems somewhat orthogonal - the behavior of glGenerateMipmaps for sRGB (not fully specified in any case) doesn't really mention either one of glBlitFramebuffer or glDrawArrays. From the bug, it sounds like we're experiencing driver differences, and those are best handled with workaround entries, which can precisely target problematic drivers/hardware without making the code convoluted. I am ok if that workaround entry starts with targeting desktop GL before 4.4, but we can refine as we test more hardware/drivers. > In addition, qiankun has tested generateMipmap api on Nvidia, opengl 4.5, and it > also works well without modifying the code. We suppose that mesa team is working > on a patch which would fix this problem over 4.4. So I put an version condition > here. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:370: // glBindTexture(GL_TEXTURE_2D, srgb_converter_textures_[0]); nit: remove commented code. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:372: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); Because we modify the filters of the source texture, we need to restore them at the end of the function. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:387: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); Why is this needed? The following code doesn't sample from the texture, so the filters shouldn't have to be changed. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:392: for (GLint level = base_level + 1; level < base_level + mipmap_levels; ++level) { nit: 80 columns limit. Maybe run 'git cl format'?
The code generally looks good to me. I agree with piman's comments that it should be covered under a new driver bug workaround. I defer review to piman unless you'd like me to specifically re-review.
Description was changed from ========== First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 TEST=conformance2/textures/misc/tex-srgb-mipmap.html CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ========== to ========== emulate srgb format for generateMipmap First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 TEST=conformance2/textures/misc/tex-srgb-mipmap.html CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ==========
Note: I edited the issue description to put it in the preferred format. (Single summary line, then formatted paragraphs afterward.)
Thanks for your review.Code has been updated.PTAL. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:370: // glBindTexture(GL_TEXTURE_2D, srgb_converter_textures_[0]); On 2016/09/21 23:45:32, piman OOO back 2016-09-12 wrote: > nit: remove commented code. Done. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:372: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); On 2016/09/21 23:45:32, piman OOO back 2016-09-12 wrote: > Because we modify the filters of the source texture, we need to restore them at > the end of the function. Done. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:372: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); On 2016/09/21 23:45:32, piman OOO back 2016-09-12 wrote: > Because we modify the filters of the source texture, we need to restore them at > the end of the function. Done. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:387: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); On 2016/09/21 23:45:32, piman OOO back 2016-09-12 wrote: > Why is this needed? The following code doesn't sample from the texture, so the > filters shouldn't have to be changed. Done. https://codereview.chromium.org/2318313004/diff/280001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:392: for (GLint level = base_level + 1; level < base_level + mipmap_levels; ++level) { On 2016/09/21 23:45:32, piman OOO back 2016-09-12 wrote: > nit: 80 columns limit. Maybe run 'git cl format'? Done.
Patchset #11 (id:300001) has been deleted
https://codereview.chromium.org/2318313004/diff/320001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/320001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6012: workarounds().do_decoder_encoder_srgb_generatemipmap) { Did you mean !workarounds().do_decoder_encoder_srgb_generatemipmap ? https://codereview.chromium.org/2318313004/diff/320001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6013: if (workarounds().do_decoder_encoder_srgb_generatemipmap) { This is probably incorrect too... Maybe the best way to explain the intent well is to instead do: if (feature_info_->feature_flags().desktop_srgb_support) { state_.EnableDisableFramebufferSRGB(enable_srgb); }
https://codereview.chromium.org/2318313004/diff/320001/gpu/config/gpu_driver_... File gpu/config/gpu_driver_bug_list_json.cc (right): https://codereview.chromium.org/2318313004/diff/320001/gpu/config/gpu_driver_... gpu/config/gpu_driver_bug_list_json.cc:22: "version": "8.99", Please update the version number.
https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:327: GLenum target) { On 2016/09/21 01:00:14, Ken Russell wrote: > Could you add some high-level comments for this function? If I understand > correctly, the intent here is: > > - Copy the base level of the sRGB texture |tex| into a linear (non-sRGB) texture > - Perform the glGenerateMipmap call against the linear texture > - Copy each mip level of the linear texture back into the sRGB texture |tex| > > Is this correct? > > piman did a more thorough review of this code than I could, but I wonder if you > are already going to the trouble of iterating down the mip levels and drawing > each one, then why not just generate the mipmap directly into |tex| by, at each > level: > > 1) Allocate |level + 1| of |tex| > 2) Bind |level + 1| of |tex| to the draw framebuffer > 3) Set the TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL of |tex| to |level| > 4) Set |tex|'s TEXTURE_MIN_FILTER (and MAG_FILTER, while you're at it) to LINEAR > (this should be done outside the loop) > 5) Draw |level| of |tex|, implicitly into |level + 1| > > That would avoid the sRGB -> linear and linear -> sRGB conversions into > textures, which are lossy. It shouldn't cause a rendering feedback loop, either, > to the best of my knowledge. hi kbr, I'm not quite sure if I understand correctly. Did you mean to attach every mipmap levels to a draw framebuffer firstly, then using glDrawBuffers function to define draw buffers, thus we could draw all of the mipmap levels into the original texture only sampling once instead of level by level copying? And I read opengl es spec 3.0, found that in section 4.4, FRAMEBUFFER OBJECTS. It mentioned that "If the attachment sizes are not all identical, rendering will be limited to the largest area that can fit in all of the attachments (an intersection of rectangles having a lower left of (0, 0) and an upper right of (width, height) for each attachment)." So maybe we can't attach color attachments with different sizes to a framebuffer.
LGTM again with some suggestions. @piman and @kbr, could you take another look. https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6023: srgb_converter_->SRGBGenerateMipmap(this, tex, target); I'd like to name this function GenerateMipmap. That class is SRGBConverter. It is not necessary to add a SRGB prefix. https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:330: // 1) Copy the base level of the sRGB texture |tex| into a linear (non-sRGB) There is no copy anymore. Maybe "Do sampling from the base level of the sRGB texture and draw into a linear texture. During sampling, the sRGB format is converted to Linear format" https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:333: // 3) Copy each mip level of the linear texture back into the sRGB texture No copy too. Maybe "Iterate each mipmap level of the linear texture and draw back into the sRGB texture's corresponding mipmap. During drawing, the linear format is converted to sRGB format. https://codereview.chromium.org/2318313004/diff/340001/gpu/config/gpu_driver_... File gpu/config/gpu_driver_bug_list_json.cc (right): https://codereview.chromium.org/2318313004/diff/340001/gpu/config/gpu_driver_... gpu/config/gpu_driver_bug_list_json.cc:2044: "do_decoder_encoder_srgb_generatemipmap" Maybe "decode_encode_srgb_for_generatemipmap"
Thank's for your suggestion. I have revised the code, PTAL. @yunchao @piman @kbr https://codereview.chromium.org/2318313004/diff/320001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/320001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6012: workarounds().do_decoder_encoder_srgb_generatemipmap) { On 2016/09/22 19:24:59, piman OOO back 2016-09-26 wrote: > Did you mean !workarounds().do_decoder_encoder_srgb_generatemipmap ? Done. https://codereview.chromium.org/2318313004/diff/320001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6013: if (workarounds().do_decoder_encoder_srgb_generatemipmap) { On 2016/09/22 19:24:59, piman OOO back 2016-09-26 wrote: > This is probably incorrect too... Maybe the best way to explain the intent well > is to instead do: > > if (feature_info_->feature_flags().desktop_srgb_support) { > state_.EnableDisableFramebufferSRGB(enable_srgb); > } Done. https://codereview.chromium.org/2318313004/diff/320001/gpu/config/gpu_driver_... File gpu/config/gpu_driver_bug_list_json.cc (right): https://codereview.chromium.org/2318313004/diff/320001/gpu/config/gpu_driver_... gpu/config/gpu_driver_bug_list_json.cc:22: "version": "8.99", On 2016/09/23 02:26:38, qiankun wrote: > Please update the version number. Done. https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_decoder.cc:6023: srgb_converter_->SRGBGenerateMipmap(this, tex, target); On 2016/09/23 15:09:19, yunchao wrote: > I'd like to name this function GenerateMipmap. That class is SRGBConverter. It > is not necessary to add a SRGB prefix. Done. https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:330: // 1) Copy the base level of the sRGB texture |tex| into a linear (non-sRGB) On 2016/09/23 15:09:20, yunchao wrote: > There is no copy anymore. Maybe "Do sampling from the base level of the sRGB > texture and draw into a linear texture. During sampling, the sRGB format is > converted to Linear format" Done. https://codereview.chromium.org/2318313004/diff/340001/gpu/command_buffer/ser... gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:333: // 3) Copy each mip level of the linear texture back into the sRGB texture On 2016/09/23 15:09:20, yunchao wrote: > No copy too. Maybe "Iterate each mipmap level of the linear texture and draw > back into the sRGB texture's corresponding mipmap. During drawing, the linear > format is converted to sRGB format. Done.
On 2016/09/23 04:32:06, yizhou.jiang wrote: > https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... > File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): > > https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... > gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:327: GLenum target) { > On 2016/09/21 01:00:14, Ken Russell wrote: > > Could you add some high-level comments for this function? If I understand > > correctly, the intent here is: > > > > - Copy the base level of the sRGB texture |tex| into a linear (non-sRGB) > texture > > - Perform the glGenerateMipmap call against the linear texture > > - Copy each mip level of the linear texture back into the sRGB texture |tex| > > > > Is this correct? > > > > piman did a more thorough review of this code than I could, but I wonder if > you > > are already going to the trouble of iterating down the mip levels and drawing > > each one, then why not just generate the mipmap directly into |tex| by, at > each > > level: > > > > 1) Allocate |level + 1| of |tex| > > 2) Bind |level + 1| of |tex| to the draw framebuffer > > 3) Set the TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL of |tex| to |level| > > 4) Set |tex|'s TEXTURE_MIN_FILTER (and MAG_FILTER, while you're at it) to > LINEAR > > (this should be done outside the loop) > > 5) Draw |level| of |tex|, implicitly into |level + 1| > > > > That would avoid the sRGB -> linear and linear -> sRGB conversions into > > textures, which are lossy. It shouldn't cause a rendering feedback loop, > either, > > to the best of my knowledge. > > hi kbr, I'm not quite sure if I understand correctly. Did you mean to attach > every mipmap levels to a draw framebuffer firstly, then using glDrawBuffers > function to define draw buffers, thus we could draw all of the mipmap levels > into the original texture only sampling once instead of level by level copying? > And I read opengl es spec 3.0, found that in section 4.4, FRAMEBUFFER OBJECTS. > It mentioned that "If the attachment sizes are not all identical, rendering will > be limited to the largest area that can fit in all of the attachments (an > intersection of rectangles having a lower left of (0, 0) and an upper right of > (width, height) for each attachment)." So maybe we can't attach color > attachments with different sizes to a framebuffer. The suggestion is to only attach 1 level at a time, but once for every iteration of the loop - so the FBO would only have 1 attachment at a time, and you wouldn't run into the identical size issue. IOW, in pseudo-code: for (level = base; level < base + count - 1; ++level) { glFramebufferTexture2D(GL_FRAMEBUFFER, fbo, GL_TEXTURE_2D, texture, level + 1); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, level); glDrawArrays(...); } That way, at every step, you sample uniquely from |level|, and you render uniquely to |level + 1|. If the filter is LINEAR, because the destination is (roughly) half the size of the source, you get interpolation and generate a useful mip level (if the texture is pow2, the texture is sampled exactly in the middle of 4 samples, and you get exactly 4:1 mixing, i.e. the box filter). I think it's useful to explore that approach, but I don't see it as blocking, so maybe we can add a TODO/file a bug, and land this in the meantime? LGTM
On 2016/09/26 20:10:03, piman OOO back 2016-09-26 wrote: > On 2016/09/23 04:32:06, yizhou.jiang wrote: > > > https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... > > File gpu/command_buffer/service/gles2_cmd_srgb_converter.cc (right): > > > > > https://codereview.chromium.org/2318313004/diff/240001/gpu/command_buffer/ser... > > gpu/command_buffer/service/gles2_cmd_srgb_converter.cc:327: GLenum target) { > > On 2016/09/21 01:00:14, Ken Russell wrote: > > > Could you add some high-level comments for this function? If I understand > > > correctly, the intent here is: > > > > > > - Copy the base level of the sRGB texture |tex| into a linear (non-sRGB) > > texture > > > - Perform the glGenerateMipmap call against the linear texture > > > - Copy each mip level of the linear texture back into the sRGB texture |tex| > > > > > > Is this correct? > > > > > > piman did a more thorough review of this code than I could, but I wonder if > > you > > > are already going to the trouble of iterating down the mip levels and > drawing > > > each one, then why not just generate the mipmap directly into |tex| by, at > > each > > > level: > > > > > > 1) Allocate |level + 1| of |tex| > > > 2) Bind |level + 1| of |tex| to the draw framebuffer > > > 3) Set the TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL of |tex| to |level| > > > 4) Set |tex|'s TEXTURE_MIN_FILTER (and MAG_FILTER, while you're at it) to > > LINEAR > > > (this should be done outside the loop) > > > 5) Draw |level| of |tex|, implicitly into |level + 1| > > > > > > That would avoid the sRGB -> linear and linear -> sRGB conversions into > > > textures, which are lossy. It shouldn't cause a rendering feedback loop, > > either, > > > to the best of my knowledge. > > > > hi kbr, I'm not quite sure if I understand correctly. Did you mean to attach > > every mipmap levels to a draw framebuffer firstly, then using glDrawBuffers > > function to define draw buffers, thus we could draw all of the mipmap levels > > into the original texture only sampling once instead of level by level > copying? > > And I read opengl es spec 3.0, found that in section 4.4, FRAMEBUFFER OBJECTS. > > It mentioned that "If the attachment sizes are not all identical, rendering > will > > be limited to the largest area that can fit in all of the attachments (an > > intersection of rectangles having a lower left of (0, 0) and an upper right of > > (width, height) for each attachment)." So maybe we can't attach color > > attachments with different sizes to a framebuffer. > > The suggestion is to only attach 1 level at a time, but once for every iteration > of the loop - so the FBO would only have 1 attachment at a time, and you > wouldn't run into the identical size issue. > IOW, in pseudo-code: > for (level = base; level < base + count - 1; ++level) { > glFramebufferTexture2D(GL_FRAMEBUFFER, fbo, GL_TEXTURE_2D, texture, level + > 1); > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level); > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, level); > glDrawArrays(...); > } > > That way, at every step, you sample uniquely from |level|, and you render > uniquely to |level + 1|. If the filter is LINEAR, because the destination is > (roughly) half the size of the source, you get interpolation and generate a > useful mip level (if the texture is pow2, the texture is sampled exactly in the > middle of 4 samples, and you get exactly 4:1 mixing, i.e. the box filter). > > > I think it's useful to explore that approach, but I don't see it as blocking, so > maybe we can add a TODO/file a bug, and land this in the meantime? > > LGTM Thanks piman@ for explaining my intent. yizhou: thanks for this contribution. Please go ahead and land as is; I defer to piman's review.
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...) cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) chromeos_x86-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_clobber_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_optional_gpu_tests_rel on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_optional_...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...) mac_optional_gpu_tests_rel on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_optional_gpu_...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_optional_gpu_tests_rel on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_optional_gpu_...)
Patchset #17 (id:440001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
Patchset #17 (id:460001) has been deleted
Patchset #16 (id:420001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...) mac_optional_gpu_tests_rel on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_optional_gpu_...)
Patchset #16 (id:480001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_optional_gpu_tests_rel on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_optional_gpu_...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #18 (id:540001) has been deleted
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...) win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
Patchset #18 (id:560001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_optional_gpu_tests_rel on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_optional_...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #19 (id:600001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...)
Patchset #19 (id:620001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...)
Patchset #21 (id:680001) has been deleted
Patchset #20 (id:660001) has been deleted
Patchset #19 (id:640001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
@piman, I'm quite confused that the trybot reports "GpuProcess.equal_bug_workarounds_in_browser_and_gpu_process". There seems to be something wrong with workaround. But I can't figure out what's going wrong here. Could you give me some idea?
On 2016/09/29 12:03:36, yizhou.jiang wrote: > @piman, I'm quite confused that the trybot reports > "GpuProcess.equal_bug_workarounds_in_browser_and_gpu_process". > There seems to be something wrong with workaround. But I can't figure out what's > going wrong here. Could you give me some idea? The failure is caused by the workaround isn't computed on the browser side because each test is a clean run without cached GL strings; then on GPU process launch, we re-compute the workaround with GL version string, and now the workaround is there. To me the test seems buggy - it should not verify the two workaround sets are always equal, unless the test uses fake data. (also, there seems to be presubmit failures - it says you have trailing whitespaces, etc. You should not upload a CL when the presubmit check fails - instead, you should fix these warnings and upload after that)
On 2016/09/29 20:46:44, Zhenyao Mo wrote: > On 2016/09/29 12:03:36, yizhou.jiang wrote: > > @piman, I'm quite confused that the trybot reports > > "GpuProcess.equal_bug_workarounds_in_browser_and_gpu_process". > > There seems to be something wrong with workaround. But I can't figure out > what's > > going wrong here. Could you give me some idea? > > The failure is caused by the workaround isn't computed on the browser side > because each test is a clean run without cached GL strings; then on GPU process > launch, we re-compute the workaround with GL version string, and now the > workaround is there. > > To me the test seems buggy - it should not verify the two workaround sets are > always equal, unless the test uses fake data. Agreed -- https://codereview.chromium.org/2377283005/ will work around this failure, and http://crbug.com/651576 has been filed about understanding and fixing it. Once that CL lands, this one can be landed.
Hi, the failing test should work because gpu process sends the updated GpuInfo back to the browser process. So browser process will know about the gl version by the time the test check for the equality of workarounds. I cannot really explain why at the moment but if you add back "gl_version_string": ".*Mesa.*" then the test will work. I have tested it locally.
Hi, could you temporarily include the fix https://codereview.chromium.org/2379153002 in your CL and hit a CQ dry run to see if the failing test will pass. If yes please remove the fix as it is preferable to land it separately in case it causes regressions and to help with git bisect. Thx.
On 2016/09/29 23:07:26, Julien Isorce wrote: > Hi, the failing test should work because gpu process sends the updated GpuInfo > back to the browser process. So browser process will know about the gl version > by the time the test check for the equality of workarounds. > > I cannot really explain why at the moment but if you add back > "gl_version_string": ".*Mesa.*" then the test will work. I have tested it > locally. Thanks for your trying, @Julien. How to run the gpu_process_launch_tests? Seems that it is part of telemetry test, could we (non-googlers and non-committers) run this test locally?
On 2016/09/29 23:40:15, yunchao wrote: > Thanks for your trying, @Julien. How to run the gpu_process_launch_tests? Seems > that it is part of telemetry test, could we (non-googlers and non-committers) > run this test locally? No pb, just do: git cl patch 2379153002 and then run : ./content/test/gpu/run_gpu_test.py gpu_process --show-stdout --browser=exact --extra-browser-args="--no-sandbox" --browser-executable=./out/build/chrome --story-filter=equal_bug_workarounds_in_browser_and_gpu_process (change out/build/chrome to appropriate path)
Patchset #19 (id:700001) has been deleted
Patchset #18 (id:580001) has been deleted
Patchset #17 (id:520001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #18 (id:740001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
https://codereview.chromium.org/2318313004/diff/750001/gpu/config/gpu_driver_... File gpu/config/gpu_driver_bug_list_json.cc (left): https://codereview.chromium.org/2318313004/diff/750001/gpu/config/gpu_driver_... gpu/config/gpu_driver_bug_list_json.cc:2046: } Because of crbug.com/222934, you cannot rely on gl_version for macosx. For osx you can only use os version, and vendor/device ids. So you have to split your new entry into 2. First one for the general case that will apply on all os except osx. Second entry will be specific to macosx, see below for example: { "id": 191, "description": "Decode and encode before generateMipmap for srgb format textures XXX", "cr_bugs": [634519], "gl_type": "gl", "gl_version": { "op": "<", "value": "4.4" }, "exceptions": [ { "os": { "type": "macosx" } } ], "features": [ "decode_encode_srgb_for_generatemipmap" ] }, { "id": 192, "description": "Decode and encode before generateMipmap for srgb format textures XXX", "cr_bugs": [634519], "os": { "type": "macosx", "version": { "op": "<=", "value": "M.N" // should be reasonable on osx to rely roughly gl // version with os version // this is what other osx entries do in this file } }, // if needed, also rely on vendor and device ids "vendor_id": "X", "device_id": ["Y1", "Y2", "Y3"], "features": [ "decode_encode_srgb_for_generatemipmap" ] }
On 2016/10/04 13:41:25, Julien Isorce wrote: > https://codereview.chromium.org/2318313004/diff/750001/gpu/config/gpu_driver_... > File gpu/config/gpu_driver_bug_list_json.cc (left): > > https://codereview.chromium.org/2318313004/diff/750001/gpu/config/gpu_driver_... > gpu/config/gpu_driver_bug_list_json.cc:2046: } > Because of crbug.com/222934, you cannot rely on gl_version for macosx. > For osx you can only use os version, and vendor/device ids. > So you have to split your new entry into 2. First one for the > general case that will apply on all os except osx. > Second entry will be specific to macosx, see below for example: > > { > "id": 191, > "description": "Decode and encode before generateMipmap for srgb format > textures XXX", > "cr_bugs": [634519], > "gl_type": "gl", > "gl_version": { > "op": "<", > "value": "4.4" > }, > "exceptions": [ > { > "os": { > "type": "macosx" > } > } > ], > "features": [ > "decode_encode_srgb_for_generatemipmap" > ] > }, > { > "id": 192, > "description": "Decode and encode before generateMipmap for srgb format > textures XXX", > "cr_bugs": [634519], > "os": { > "type": "macosx", > "version": { > "op": "<=", > "value": "M.N" // should be reasonable on osx to rely roughly gl > // version with os version > // this is what other osx entries do in this file > } > }, > // if needed, also rely on vendor and device ids > "vendor_id": "X", > "device_id": ["Y1", "Y2", "Y3"], > "features": [ > "decode_encode_srgb_for_generatemipmap" > ] > } There is no reason to specify GL version on OSX now. Let's just assume it's 4.1 and move on. If the situation ever changes, then we can revisit (I doubt it will go beyond 4.1)
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #19 (id:770001) has been deleted
Patchset #19 (id:790001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #20 (id:830001) has been deleted
Patchset #20 (id:850001) has been deleted
The CQ bit was checked by yizhou.jiang@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/10/04 17:34:13, Zhenyao Mo wrote: > On 2016/10/04 13:41:25, Julien Isorce wrote: > > > https://codereview.chromium.org/2318313004/diff/750001/gpu/config/gpu_driver_... > > File gpu/config/gpu_driver_bug_list_json.cc (left): > > > > > https://codereview.chromium.org/2318313004/diff/750001/gpu/config/gpu_driver_... > > gpu/config/gpu_driver_bug_list_json.cc:2046: } > > Because of crbug.com/222934, you cannot rely on gl_version for macosx. > > For osx you can only use os version, and vendor/device ids. > > So you have to split your new entry into 2. First one for the > > general case that will apply on all os except osx. > > Second entry will be specific to macosx, see below for example: > > > > { > > "id": 191, > > "description": "Decode and encode before generateMipmap for srgb format > > textures XXX", > > "cr_bugs": [634519], > > "gl_type": "gl", > > "gl_version": { > > "op": "<", > > "value": "4.4" > > }, > > "exceptions": [ > > { > > "os": { > > "type": "macosx" > > } > > } > > ], > > "features": [ > > "decode_encode_srgb_for_generatemipmap" > > ] > > }, > > { > > "id": 192, > > "description": "Decode and encode before generateMipmap for srgb format > > textures XXX", > > "cr_bugs": [634519], > > "os": { > > "type": "macosx", > > "version": { > > "op": "<=", > > "value": "M.N" // should be reasonable on osx to rely roughly gl > > // version with os version > > // this is what other osx entries do in this file > > } > > }, > > // if needed, also rely on vendor and device ids > > "vendor_id": "X", > > "device_id": ["Y1", "Y2", "Y3"], > > "features": [ > > "decode_encode_srgb_for_generatemipmap" > > ] > > } > > There is no reason to specify GL version on OSX now. Let's just assume it's 4.1 > and move on. If the situation ever changes, then we can revisit (I doubt it > will go beyond 4.1) @Julien @Zhenyao Thanks a lot for your suggestion! Code has been updated, and trybots can pass now, PTAL, @piman @Zhenyao @kbr
Patchset #19 (id:810001) has been deleted
lgtm
lgtm
The CQ bit was checked by yizhou.jiang@intel.com
The patchset sent to the CQ was uploaded after l-g-t-m from yunchao.he@intel.com, piman@chromium.org Link to the patchset: https://codereview.chromium.org/2318313004/#ps870001 (title: "Addressed to Julien and Zhenyao's feedback")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_optional_gpu_tests_rel on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_optional_gpu_...)
The CQ bit was checked by yizhou.jiang@intel.com
The patchset sent to the CQ was uploaded after l-g-t-m from yunchao.he@intel.com, zmo@chromium.org, piman@chromium.org Link to the patchset: https://codereview.chromium.org/2318313004/#ps890001 (title: "Addressed to Julien and Zhenyao's feedback")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== emulate srgb format for generateMipmap First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 TEST=conformance2/textures/misc/tex-srgb-mipmap.html CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ========== to ========== emulate srgb format for generateMipmap First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 TEST=conformance2/textures/misc/tex-srgb-mipmap.html CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ==========
Message was sent while issue was closed.
Committed patchset #20 (id:890001)
Message was sent while issue was closed.
Description was changed from ========== emulate srgb format for generateMipmap First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 TEST=conformance2/textures/misc/tex-srgb-mipmap.html CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel ========== to ========== emulate srgb format for generateMipmap First, do sampling for a srgb texture, converting it to a linear texture. Then generateMipmap in rgb format, and do another sampling to convert rgb texture to srgb one. BUG=634519 TEST=conformance2/textures/misc/tex-srgb-mipmap.html CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Committed: https://crrev.com/da573a8ab571bb73d3539a66abbe5c2efd47d7b7 Cr-Commit-Position: refs/heads/master@{#424377} ==========
Message was sent while issue was closed.
Patchset 20 (id:??) landed as https://crrev.com/da573a8ab571bb73d3539a66abbe5c2efd47d7b7 Cr-Commit-Position: refs/heads/master@{#424377}
Message was sent while issue was closed.
Patchset #21 (id:910001) has been deleted |