Shader Pre-Compilation Cache for High-Refresh Rendering
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The high refresh rates in mobile devices with Android platforms lead to time constraints in shader compilation, causing rendering delays and frame drops due to the time-consuming nature of shader compilation processes.
Innovation Solution
A pre-processing system and method that involves pre-compiling shaders using a generating module to create output files, which are then stored in persistent caches for quick retrieval during rendering, reducing the need for real-time compilation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If shader compilation is performed during rendering, then visual effects can be generated, but rendering time is blocked and frame drops occur
Solution Approach 1:
The patent applies preliminary action by pre-compiling shaders before they are actually needed for rendering. The system intercepts shader compilation requests, compiles the shaders in advance, and stores the compiled results in a cache. This allows the rendering process to directly use pre-compiled shaders without being blocked by compilation operations, thereby ensuring rendering continuity while eliminating compilation time delays.
2Speed
If high refresh rate is implemented, then screen smoothness is improved, but rendering time per frame is reduced to 8.3ms or less
Solution Approach 1:
To support high refresh rates with limited rendering time per frame, the patent uses preliminary action by pre-compiling shaders before the tight rendering deadline. The pre-compilation process occurs outside the critical rendering path, so when high refresh rate rendering needs to complete within 8.3ms or less, the shaders are already compiled and ready for immediate use, eliminating compilation time from the per-frame budget.
Solution Approach 2:
The patent extracts the shader compilation operation from the rendering process itself. By separating compilation from rendering and performing compilation in advance, the system removes the time-consuming compilation step from the critical rendering path. This extraction allows the rendering process to focus solely on generating visual output within the constrained time window required for high refresh rates.
3Reliability
If shader code is compiled to executable instructions, then desired visual effects are achieved, but compilation process becomes a bottleneck
Solution Approach 1:
The patent resolves the bottleneck by applying preliminary action - compiling shaders in advance before they are needed for rendering. The system intercepts compilation requests, performs the compilation operation beforehand, and stores results in cache. This ensures that high-quality visual effects are achieved through proper shader compilation while preventing compilation from becoming a bottleneck in the rendering pipeline, as compiled shaders are readily available for immediate use.
Data Source
AI summary
A pre-processing system for pre-compiling a shader, includes the following elements. A first persistent cache, disposed in a render engine of surface-flinger. A second persistent cache, disposed in a HWUI (Hardware Accelerated Rendering Engine for UI). A generating module, used to generate a text file, a binary file and a describer associated with the shader, and the shader is used to render a plurality of pages for an application program (APP). An installing module, used to store the text file and the binary file into a scan file path of the first persistent cache and/or the second persistent cache based on the describer.


