Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Issue 894093004: The Shader class now support deferred shader compiling. (Closed)

Created:
5 years, 10 months ago by David Yen
Modified:
5 years, 10 months ago
CC:
chromium-reviews, piman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

The Shader class now support deferred shader compiling. In preperation for deferring the shader compiles within the gles2 command decoder, I have added additional shader states which contains all the information we need to support deferred shader compiling. Once RequestCompile() is called, when DoCompile() is called it will compile the last shader set when RequestCompile() was called. RequestCompile() must be called before DoCompile(), or it is assumed the user did not call glCompileShader and the shader will continually be invalid. Additionally, the |signature_source_| has been renamed to a more descriptive |last_compiled_source_|. The |last_compiled_source_| corresponds to the last shader set during either RequestCompile(). This string should be used as the key for any shader caches before linking. R=kbr@chromium.org, vmiura@chromium.org BUG=450690 TEST=gpu_unittests && trybots Committed: https://crrev.com/ef47e29f950b03afa9a3ec81282480476138a20f Cr-Commit-Position: refs/heads/master@{#314817}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Made RequestCompile() mandatory when using shader compiler #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -38 lines) Patch
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 1 chunk +4 lines, -0 lines 1 comment Download
M gpu/command_buffer/service/memory_program_cache.cc View 2 chunks +8 lines, -8 lines 0 comments Download
M gpu/command_buffer/service/memory_program_cache_unittest.cc View 8 chunks +15 lines, -15 lines 0 comments Download
M gpu/command_buffer/service/program_manager.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M gpu/command_buffer/service/shader_manager.h View 5 chunks +20 lines, -4 lines 0 comments Download
M gpu/command_buffer/service/shader_manager.cc View 1 4 chunks +19 lines, -4 lines 2 comments Download
M gpu/command_buffer/service/shader_manager_unittest.cc View 1 2 chunks +17 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/test_helper.cc View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (2 generated)
David Yen
5 years, 10 months ago (2015-02-04 18:16:36 UTC) #1
vmiura
lgtm https://codereview.chromium.org/894093004/diff/1/gpu/command_buffer/service/shader_manager.cc File gpu/command_buffer/service/shader_manager.cc (right): https://codereview.chromium.org/894093004/diff/1/gpu/command_buffer/service/shader_manager.cc#newcode52 gpu/command_buffer/service/shader_manager.cc:52: // the time of the compile request is ...
5 years, 10 months ago (2015-02-04 21:18:56 UTC) #2
David Yen
On 2015/02/04 21:18:56, vmiura wrote: > lgtm > > https://codereview.chromium.org/894093004/diff/1/gpu/command_buffer/service/shader_manager.cc > File gpu/command_buffer/service/shader_manager.cc (right): > ...
5 years, 10 months ago (2015-02-04 22:05:40 UTC) #4
David Yen
https://codereview.chromium.org/894093004/diff/1/gpu/command_buffer/service/shader_manager.cc File gpu/command_buffer/service/shader_manager.cc (right): https://codereview.chromium.org/894093004/diff/1/gpu/command_buffer/service/shader_manager.cc#newcode52 gpu/command_buffer/service/shader_manager.cc:52: // the time of the compile request is the ...
5 years, 10 months ago (2015-02-04 22:05:49 UTC) #5
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/894093004/diff/20001/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/894093004/diff/20001/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode7092 gpu/command_buffer/service/gles2_cmd_decoder.cc:7092: // requested. Eventually this should be deffered to the ...
5 years, 10 months ago (2015-02-04 22:59:59 UTC) #6
David Yen
https://codereview.chromium.org/894093004/diff/20001/gpu/command_buffer/service/shader_manager.cc File gpu/command_buffer/service/shader_manager.cc (right): https://codereview.chromium.org/894093004/diff/20001/gpu/command_buffer/service/shader_manager.cc#newcode48 gpu/command_buffer/service/shader_manager.cc:48: return; On 2015/02/04 22:59:59, Ken Russell wrote: > The ...
5 years, 10 months ago (2015-02-05 00:09:02 UTC) #7
Ken Russell (switch to Gerrit)
On 2015/02/05 00:09:02, David Yen wrote: > https://codereview.chromium.org/894093004/diff/20001/gpu/command_buffer/service/shader_manager.cc > File gpu/command_buffer/service/shader_manager.cc (right): > > https://codereview.chromium.org/894093004/diff/20001/gpu/command_buffer/service/shader_manager.cc#newcode48 ...
5 years, 10 months ago (2015-02-05 02:11:46 UTC) #8
vmiura
> I'm not sure how you're going to manage the asynchronous compilations. Assuming > there's ...
5 years, 10 months ago (2015-02-05 03:17:04 UTC) #9
vmiura
lgtm
5 years, 10 months ago (2015-02-05 03:19:52 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/894093004/20001
5 years, 10 months ago (2015-02-05 15:48:34 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-02-05 15:52:02 UTC) #13
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/ef47e29f950b03afa9a3ec81282480476138a20f Cr-Commit-Position: refs/heads/master@{#314817}
5 years, 10 months ago (2015-02-05 15:53:21 UTC) #14
Ken Russell (switch to Gerrit)
5 years, 10 months ago (2015-02-06 02:04:04 UTC) #15
Message was sent while issue was closed.
On 2015/02/05 03:17:04, vmiura wrote:
> > I'm not sure how you're going to manage the asynchronous compilations.
> Assuming
> > there's a worker thread, then for situation (3) there will need to be
> > synchronization between the offline compilation, and the attempt to set new
> > source on the shader object.
> 
> There is no plan for asynchronous compilation I think, just deferring
> glCompileShader() until it's results are needed either in a
glGetShaderInfoLog()
> or a glLinkProgram() that doesn't hit the in-memory cache.  Within that, the
> tracking David is going looks good.

OK, I misunderstood. I thought the command buffer was already deferring shader
compiles until they were needed.


> As far as asynchronously compiling shaders, that is something we may want to
> look into at some point.  I suspect it would be a mixed bag in terms of:
>  - Drivers not compiling on separate threads in a non-blocking manner.
>  - Drivers deferring some of the compilation until a program is used in Draws.

Yes, I agree it's problematic for those reasons.

Powered by Google App Engine
This is Rietveld 408576698