What is GrShaderCache?

1,438 views
Skip to first unread message

roy cabouly

unread,
Aug 30, 2020, 9:23:05 AM8/30/20
to Graphics-dev
Hi,
I am currently trying to understand the mechanism in chromium thats responsible for managing the shader cache.
I wanted to ask what is the GrShaderCache? What are his responsibilities? Is he related to ShaderDiskCache?

Thanks,
Roy


Kyle Charbonneau

unread,
Sep 1, 2020, 2:47:50 PM9/1/20
to roy cabouly, Graphics-dev
GrShaderCache handles caching compiled shaders for a Skia GrContext. GrShaderCache lives in the GPU process. The GrContext is used for SkiaRenderer and OOP rasterization. GrShaderCache owns an in memory MRU cache along with decisions about disk caching. ShaderDiskCache lives in the browser process and handles caching all shaders to disk. If GrShaderCache decides a shader should be cached to disk the compiled shader is sent over IPC to the browser process to ShaderDiskCache. Likewise, shaders are loaded from disk in the browser process and sent back to the GPU process over IPC.

gpu::gles2::ProgramCache plays a similar role to GrShaderCache for the legacy GLRenderer and (I think) GPU rasterization code.
Reply all
Reply to author
Forward
0 new messages