|
|
Chromium Code Reviews|
Created:
3 years, 5 months ago by Zhenyao Mo Modified:
3 years, 5 months ago Reviewers:
Ken Russell (switch to Gerrit) CC:
chromium-reviews, piman+watch_chromium.org, Kai Ninomiya Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix a bug in shader/program relationship.
A program can have two shaders attached in ES2/3. However, a linked program's
shaders may not be the current attached shaders to that program. Consider the
following sequence.
1) attach Shader1 and Shader2 to Program
2) link Program, succeed
3) detach Shader1 and Shader2 from Program
4) attach Shader3 and Shader4 to program
So after step 3, no shaders are attached to program. After step 4, Shader3 and
Shader4 are attached to Program, not Shader1 and Shader2. However, if we want
to use shaders to access information from Program, we still need to use Shader1
and Shader2.
BUG=735784
TEST=conformance2/uniforms/query-uniform-blocks-after-shader-detach.html
R=kbr@chromium.org
NOTRY=true
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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
Review-Url: https://codereview.chromium.org/2958763003
Cr-Commit-Position: refs/heads/master@{#482477}
Committed: https://chromium.googlesource.com/chromium/src/+/8e4a133d94d88ad3fcf2705fb45f16ab72b58092
Patch Set 1 #Patch Set 2 : Fix a bug in shader/program relationship. #
Total comments: 5
Patch Set 3 : comments #
Messages
Total messages: 22 (14 generated)
Description was changed from ========== Fix a bug in shader/program relationship. A program can have two shaders attached in ES2/3. However, a linked program's shaders may not be the current attached shaders to that program. Consider the following sequence. 1) attach Shader1 and Shader2 to Program 2) link Program, succeed 3) detach Shader1 and Shader2 from Program 4) attach Shader3 and Shader4 to program So after step 3, no shaders are attached to program. After step 4, Shader3 and Shader4 are attached to Program, not Shader1 and Shader2. However, if we want to use shaders to access information from Program, we still need to use Shader1 and Shader2. BUG=735784 TEST=conformance2/uniforms/query-uniform-blocks-after-shader-detach.html R=kbr@chromium.org ========== to ========== Fix a bug in shader/program relationship. A program can have two shaders attached in ES2/3. However, a linked program's shaders may not be the current attached shaders to that program. Consider the following sequence. 1) attach Shader1 and Shader2 to Program 2) link Program, succeed 3) detach Shader1 and Shader2 from Program 4) attach Shader3 and Shader4 to program So after step 3, no shaders are attached to program. After step 4, Shader3 and Shader4 are attached to Program, not Shader1 and Shader2. However, if we want to use shaders to access information from Program, we still need to use Shader1 and Shader2. BUG=735784 TEST=conformance2/uniforms/query-uniform-blocks-after-shader-detach.html R=kbr@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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 ==========
The CQ bit was checked by zmo@chromium.org 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...
This is the CL. I'll ping you for review when bots are green.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_headless_rel on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Great work, Mo. Thanks for picking this up. It looks good overall but please do tell me when the trybots are green.
The CQ bit was checked by zmo@chromium.org 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...
kbr: Ready for review (The original CL got a bug. Basically any use of shaders before link should be attached_shaders_, any use of shaders after link should be shaders_from_last_successful_link_).
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/2958763003/diff/20001/gpu/command_buffer/serv... File gpu/command_buffer/service/program_manager.cc (right): https://codereview.chromium.org/2958763003/diff/20001/gpu/command_buffer/serv... gpu/command_buffer/service/program_manager.cc:1156: Shader* vertex_shader = attached_shaders_[0].get(); Here and in several more places, there are some methods which are called before or during program linking, and that's why attached_shaders_ is used instead of shaders_from_last_successful_link_. This is a little subtle; is it worth adding a comment like: // This is called before program linking, so refer to attached_shaders_. at each of these sites? https://codereview.chromium.org/2958763003/diff/20001/gpu/command_buffer/serv... gpu/command_buffer/service/program_manager.cc:1191: attached_shaders_[ShaderTypeToIndex(GL_FRAGMENT_SHADER)].get(); Same here. https://codereview.chromium.org/2958763003/diff/20001/gpu/command_buffer/serv... gpu/command_buffer/service/program_manager.cc:1520: for (auto shader : attached_shaders_) { Same here. https://codereview.chromium.org/2958763003/diff/20001/gpu/command_buffer/serv... gpu/command_buffer/service/program_manager.cc:1533: for (auto shader : attached_shaders_) { Same here. https://codereview.chromium.org/2958763003/diff/20001/gpu/command_buffer/serv... gpu/command_buffer/service/program_manager.cc:1546: for (auto shader : attached_shaders_) { Same here. There are more places, too.
Description was changed from ========== Fix a bug in shader/program relationship. A program can have two shaders attached in ES2/3. However, a linked program's shaders may not be the current attached shaders to that program. Consider the following sequence. 1) attach Shader1 and Shader2 to Program 2) link Program, succeed 3) detach Shader1 and Shader2 from Program 4) attach Shader3 and Shader4 to program So after step 3, no shaders are attached to program. After step 4, Shader3 and Shader4 are attached to Program, not Shader1 and Shader2. However, if we want to use shaders to access information from Program, we still need to use Shader1 and Shader2. BUG=735784 TEST=conformance2/uniforms/query-uniform-blocks-after-shader-detach.html R=kbr@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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 ========== Fix a bug in shader/program relationship. A program can have two shaders attached in ES2/3. However, a linked program's shaders may not be the current attached shaders to that program. Consider the following sequence. 1) attach Shader1 and Shader2 to Program 2) link Program, succeed 3) detach Shader1 and Shader2 from Program 4) attach Shader3 and Shader4 to program So after step 3, no shaders are attached to program. After step 4, Shader3 and Shader4 are attached to Program, not Shader1 and Shader2. However, if we want to use shaders to access information from Program, we still need to use Shader1 and Shader2. BUG=735784 TEST=conformance2/uniforms/query-uniform-blocks-after-shader-detach.html R=kbr@chromium.org NOTRY=true CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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 ==========
Added comments per kbr review Landing with NOTRY=true because patchset2 already passed all bots and patchset3 only adds a few comments.
The CQ bit was checked by zmo@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from kbr@chromium.org Link to the patchset: https://codereview.chromium.org/2958763003/#ps40001 (title: "comments")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1498521537036890,
"parent_rev": "c8eea79006640a377dd1e71bcf7c9dfaa551607f", "commit_rev":
"8e4a133d94d88ad3fcf2705fb45f16ab72b58092"}
Message was sent while issue was closed.
Description was changed from ========== Fix a bug in shader/program relationship. A program can have two shaders attached in ES2/3. However, a linked program's shaders may not be the current attached shaders to that program. Consider the following sequence. 1) attach Shader1 and Shader2 to Program 2) link Program, succeed 3) detach Shader1 and Shader2 from Program 4) attach Shader3 and Shader4 to program So after step 3, no shaders are attached to program. After step 4, Shader3 and Shader4 are attached to Program, not Shader1 and Shader2. However, if we want to use shaders to access information from Program, we still need to use Shader1 and Shader2. BUG=735784 TEST=conformance2/uniforms/query-uniform-blocks-after-shader-detach.html R=kbr@chromium.org NOTRY=true CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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 ========== Fix a bug in shader/program relationship. A program can have two shaders attached in ES2/3. However, a linked program's shaders may not be the current attached shaders to that program. Consider the following sequence. 1) attach Shader1 and Shader2 to Program 2) link Program, succeed 3) detach Shader1 and Shader2 from Program 4) attach Shader3 and Shader4 to program So after step 3, no shaders are attached to program. After step 4, Shader3 and Shader4 are attached to Program, not Shader1 and Shader2. However, if we want to use shaders to access information from Program, we still need to use Shader1 and Shader2. BUG=735784 TEST=conformance2/uniforms/query-uniform-blocks-after-shader-detach.html R=kbr@chromium.org NOTRY=true CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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 Review-Url: https://codereview.chromium.org/2958763003 Cr-Commit-Position: refs/heads/master@{#482477} Committed: https://chromium.googlesource.com/chromium/src/+/8e4a133d94d88ad3fcf2705fb45f... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/8e4a133d94d88ad3fcf2705fb45f...
Message was sent while issue was closed.
lgtm again after the fact. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
