# US 2025/0328985 A1 · Pre-processing system and method thereof

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0328985 A1
- Document ID: US20250328985A1
- Status: Published application
- Kind: A1
- Application number: 18/651,765
- Filed: 2024-05-01
- Published: 2025-10-23
- Earliest claimed: 2024-04-22
- Assignees: MediaTek Singapore Pte. Ltd.
- Applicants: MediaTek Singapore Pte. Ltd.
- Inventors: Zhi-Ming JIANG; Peng-Hui LIU; Qian Dong
- Web page: https://patentgrep.com/patent/US20250328985A1

## CPC

- G06T 1/60: Memory management
- G06F 12/0875: with dedicated cache, e.g. instruction or stack
- G06T 1/20: Processor architectures; Processor configuration, e.g. pipelining
- G06F 2212/455: Image or video data
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

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.

## Claims

### Claim 1

A pre-processing system for pre-compiling a shader, comprising:
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, for generating an output file which comprises a text file, a binary file and a describer associated with the shader, wherein the shader is used to render a plurality of pages for an APP (application program); and
an installing module, for storing 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.

### Claim 2 (depends on 1)

The pre-processing system according to claim 1, wherein the text file is a SKSL (Skia's shading language) text file, and the binary file includes a plurality of shader binary codes.

### Claim 3 (depends on 1)

The pre-processing system according to claim 1, wherein the generating module comprising:
a text generating unit, for generating the text file, and providing the text file to the installing module; and
a compiling unit, for compiling the text file to obtain the binary file, and providing the binary file to the installing module.

### Claim 4 (depends on 1)

The pre-processing system according to claim 1, wherein the generating module comprising:
a statistic unit, for generating the describer which is written into a header of each of the text file and the binary file.

### Claim 5 (depends on 4)

The pre-processing system according to claim 4, wherein the describer at least includes a frequency of usage of the shader, and a hardware information of a GPU (graphics processing unit), a driver version, and a version of an Android system corresponding to the binary file.

### Claim 6 (depends on 1)

The pre-processing system according to claim 1, wherein the installing module comprising:
a selecting unit, for selecting the binary file or the text file to be stored into the scan file path of the first persistent cache and/or the second persistent cache based on the describer.

### Claim 7 (depends on 6)

The pre-processing system according to claim 6, wherein the installing module further comprising:
an environment creating unit, for providing rendering contexts for the shader when the text file is selected to be stored into the scan file path;
a pre-compiling unit, for performing pre-compiling on the text file; and
a binary getting unit, for capturing a set of compiled binary codes from a GPU to form the binary file.

### Claim 8 (depends on 1)

The pre-processing system according to claim 1, further comprising:
a file cache, for recording a list of cache-entries, wherein the text file and the binary file are read from the scan file path and stored into the file cache;
wherein the list of cache-entries records a matching relationship between a plurality of shader descriptions and a plurality of shader files, used for a fast lookup in a memory.

### Claim 9 (depends on 1)

The pre-processing system according to claim 1, wherein the generating module operates in a debug mode or a capture mode of an early development stage of the APP, when the APP is activated for the first time or when a page is firstly used by the APP and causes a change of graphics drawing.

### Claim 10 (depends on 1)

The pre-processing system according to claim 1, wherein the installing module operates when the APP is installed to a local device or when the APP is activated for the first time.

### Claim 11

A pre-processing method for pre-compiling a shader, comprising:
generating an output file which comprises a text file, a binary file and a describer associated with the shader, wherein the shader is used to render a plurality of pages for an APP (application program); and
storing the text file and the binary file into a scan file path of a first persistent cache and/or a second persistent cache based on the describer;
wherein the first persistent cache is disposed in a render engine of surface-flinger, and the second persistent cache is disposed in a HWUI (Hardware Accelerated Rendering Engine for UI).

### Claim 12 (depends on 11)

The pre-processing method according to claim 11, wherein the text file is a SKSL (Skia's shading language) text file, and the binary file includes a plurality of shader binary codes.

### Claim 13 (depends on 11)

The pre-processing method according to claim 11, wherein the step of generating the text file and the binary file comprising:
generating the text file by a text generating unit and providing the text file; and
compiling the text file to obtain the binary file by a compiling unit and providing the binary file.

### Claim 14 (depends on 11)

The pre-processing method according to claim 11, wherein the step of generating the describer comprising:
generating the describer by a statistic unit;
wherein the describer is written into a header of each of the text file and the binary file.

### Claim 15 (depends on 14)

The pre-processing method according to claim 14, wherein the describer at least includes a frequency of usage of the shader, a hardware information of a GPU (graphics processing unit), a driver version, and an Android version corresponding to the binary file.

### Claim 16 (depends on 11)

The pre-processing method according to claim 11, wherein the step of storing the text file and the binary file into the scan file path comprising:
selecting the binary file or the text file to be stored into the scan file path of the first persistent cache and/or the second persistent cache based on the describer.

### Claim 17 (depends on 16)

The pre-processing method according to claim 16, wherein when the text file is selected to be stored into the scan file path, and the pre-processing method further comprising:
providing rendering contexts for the shader;
performing pre-compiling on the text file; and
capturing a set of compiled binary codes from a GPU to form the binary file.

### Claim 18 (depends on 11)

The pre-processing method according to claim 11, further comprising:
reading the text file and the binary file from the scan file path;
storing the text file and the binary file into a file cache, wherein the file cache is used to record a list of cache-entries; and
looking up the list of cache-entries with a matching relationship between a plurality of shader descriptions and a plurality of shader files.

### Claim 19 (depends on 11)

The pre-processing method according to claim 11, wherein the step of generating the text file, the binary file and the describer is performed in a debug mode or a capture mode of an early development stage of the APP, when the APP is activated for the first time, or when a page is firstly used by the APP and causes a change of drawing.

### Claim 20 (depends on 11)

The pre-processing method according to claim 11, wherein the step of storing the text file and the binary file into a scan file path is performed when the APP is installed to a local device, or when the APP is activated for the first time.
