IP Library › Granted Patent US 12,541,907
Granted Patent B2
US 12,541,907 · App. 18/293,573 · Granted Feb 3, 2026

Graphics rendering method, apparatus, and storage medium

Inventors: Li Sun (Shenzhen, CN); Zhaoyang Yin (Shenzhen, CN); Wei Li (Shenzhen, CN); Jinxiao Liu (Shenzhen, CN)
Assignee: Honor Device Co., Ltd.
G06T15/005
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,541,907
App. No.
18/293,573
Granted
Feb 3, 2026
Kind
B2
Abstract

Embodiments of this application relate to the field of image processing technologies, and provide a graphics rendering method, an apparatus, and a storage medium. A terminal device performs graphics rendering for an application by using a target shader. The terminal device obtains a target simplified shader when the terminal device determines that the application is run in a complex scene, where the complex scene is a scene in which a quantity of instructions for running the application is greater than a first preset threshold, and computing resources of the terminal device that are occupied by the target simplified shader are fewer. The terminal device performs graphics rendering for the application in the complex scene by using the target simplified shader. It is ensured that the application of the terminal device can still be run smoothly in the complex scene.

Claims (74)

1 . A graphics rendering method, the method comprising:

performing, by a terminal device, graphics rendering for an application using a target shader;

obtaining, by the terminal device, a target simplified shader based on a plurality of prestored correspondences and the terminal device determining that the application is run in a complex scene, wherein the complex scene is a scene in which a quantity of instructions for running the application is greater than a first preset threshold, wherein computing resources of the terminal device that are occupied by the target simplified shader are fewer than computing resources of the terminal device that are occupied by the target shader, and wherein the plurality of prestored correspondences comprises a correspondence among information of a shader, hardware information of a device, and a simplified shader, and the information of the shader comprises any one of the shader or an identifier of the shader; and

performing, by the terminal device, graphics rendering for the application in the complex scene using the target simplified shader;

wherein the correspondence further comprises a load level, the load level is a quantified value corresponding to load of the terminal device, and the obtaining, by the terminal device, the target simplified shader comprises:

obtaining, by the terminal device, a quantity of draw calls in the complex scene;

obtaining, by the terminal device, a target load level based on the quantity of draw calls; and

obtaining, by the terminal device from the plurality of prestored correspondences, the target simplified shader corresponding to information of the target shader, the target load level, and hardware information of the terminal device.

2 . The method according to claim 1 , wherein the method further comprises:

simplifying, by the terminal device, the target shader based on a first preset rule, to obtain a plurality of simplified shaders, wherein the first preset rule comprises at least one of code motion, expression deletion, or syntax simplification, and the plurality of simplified shaders comprises the target simplified shader;

collecting, by the terminal device, status information that is of the terminal device and that exists when the terminal device performs graphics rendering for the application in the complex scene using the plurality of simplified shaders, wherein the status information of the terminal device comprises the load of the terminal device, power consumption of the terminal device, a temperature of the terminal device, a rendering duration, and an image quality of an image rendered by each simplified shader, and the rendering duration is a duration required for performing graphics rendering for the application in the complex scene using each simplified shader; and

obtaining, by the terminal device, a correspondence among the information of the target shader, the hardware information of the terminal device, the target load level, and the target simplified shader based on the status information.

3 . The method according to claim 2 , wherein the obtaining, by the terminal device, the correspondence among the information of the target shader, the hardware information of the terminal device, the target load level, and the target simplified shader based on the status information comprises:

obtaining, by the terminal device, a plurality of target rendering durations from the status information, wherein each target rendering duration of the plurality of target rendering durations is less than a second preset threshold;

obtaining, by the terminal device, target status information from the status information corresponding to the plurality of target rendering durations, wherein an image quality in the target status information is greater than a third preset threshold, and the target status information is status information that is of the terminal device and that exists when graphics rendering is performed for the application in the complex scene using the target simplified shader;

obtaining, by the terminal device, the target load level based on load of the terminal device in the target status information; and

establishing, by the terminal device, the correspondence among the information of the target shader, the hardware information of the terminal device, the target load level, and the target simplified shader.

4 . The method according to claim 2 , wherein the obtaining, by the terminal device, the correspondence among the information of the target shader, the hardware information of the terminal device, the target load level, and the target simplified shader based on the status information comprises:

obtaining, by the terminal device, a plurality of target image qualities from the status information, wherein each target image quality of the plurality of target image qualities is greater than a fourth preset threshold;

obtaining, by the terminal device, target status information from the status information corresponding to the plurality of target image qualities, wherein a rendering duration in the target status information is less than a fifth preset threshold, and the target status information is status information that is of the terminal device and that exists when graphics rendering is performed for the application in the complex scene using the target simplified shader;

obtaining, by the terminal device, the target load level based on load of the terminal device in the target status information; and

establishing, by the terminal device, the correspondence among the information of the target shader, the hardware information of the terminal device, the target load level, and the target simplified shader.

5 . The method according claim 1 , wherein the method further comprises:

receiving, by the terminal device, the plurality of prestored correspondences from another device.

6 . A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed by a processor, a terminal device is enabled to:

perform graphics rendering for an application using a target shader;

obtain a target simplified shader based on a plurality of prestored correspondences and the terminal device determining that the application is run in a complex scene, wherein the complex scene is a scene in which a quantity of instructions for running the application is greater than a first preset threshold, wherein computing resources of the terminal device that are occupied by the target simplified shader are fewer than computing resources of the terminal device that are occupied by the target shader, and wherein the plurality of prestored correspondences comprises a correspondence among information of a shader, hardware information of a device, and a simplified shader, and the information of the shader comprises any one of the shader or an identifier of the shader; and

perform graphics rendering for the application in the complex scene using the target simplified shader;

wherein the correspondence further comprises a load level, the load level is a quantified value corresponding to load of the terminal device, and the obtaining the target simplified shader comprises:

obtaining a quantity of draw calls in the complex scene;

obtaining a target load level based on the quantity of draw calls; and

obtaining, from the plurality of prestored correspondences, the target simplified shader corresponding to information of the target shader, the target load level, and hardware information of the terminal device.

7 . The computer-readable storage medium according to claim 6 , wherein when the instructions are executed by the processor, the terminal device is further enabled to:

simplify the target shader based on a first preset rule, to obtain a plurality of simplified shaders, wherein the first preset rule comprises at least one of code motion, expression deletion, or syntax simplification, and the plurality of simplified shaders comprises the target simplified shader;

collect status information that is of the electronic device and that exists when the electronic device performs graphics rendering for the application in the complex scene using the plurality of simplified shaders, wherein the status information of the electronic device comprises the load of the electronic device, power consumption of the electronic device, a temperature of the electronic device, a rendering duration, and an image quality of an image rendered by each simplified shader, and the rendering duration is a duration required for performing graphics rendering for the application in the complex scene using each simplified shader; and

obtain a correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader based on the status information.

8 . The computer-readable storage medium according to claim 7 , wherein the obtaining the correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader based on the status information comprises:

obtaining a plurality of target rendering durations from the status information, wherein each target rendering duration of the plurality of target rendering durations is less than a second preset threshold;

obtaining target status information from the status information corresponding to the plurality of target rendering durations, wherein an image quality in the target status information is greater than a third preset threshold, and the target status information is status information that is of the electronic device and that exists when graphics rendering is performed for the application in the complex scene using the target simplified shader;

obtaining the target load level based on load of the electronic device in the target status information; and

establishing the correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader.

9 . The computer-readable storage medium according to claim 7 , wherein the obtaining the correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader based on the status information comprises:

obtaining a plurality of target image qualities from the status information, wherein each target image quality of the plurality of target image qualities is greater than a fourth preset threshold;

obtaining target status information from the status information corresponding to the plurality of target image qualities, wherein a rendering duration in the target status information is less than a fifth preset threshold, and the target status information is status information that is of the electronic device and that exists when graphics rendering is performed for the application in the complex scene using the target simplified shader;

obtaining the target load level based on load of the electronic device in the target status information; and

establishing the correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader.

10 . The computer-readable storage medium according to claim 6 , wherein when the instructions are executed by the processor, the terminal device is further enabled to:

receive the plurality of prestored correspondences from another device.

11 . An electronic device, comprising:

a memory configured to store a computer program; and

a processor, wherein when the computer program is executed by the processor, the electronic device is enabled to:

perform graphics rendering for an application using a target shader;

obtain a target simplified shader based on a plurality of prestored correspondences and the terminal device determining that the application is run in a complex scene, wherein the complex scene is a scene in which a quantity of instructions for running the application is greater than a first preset threshold, wherein computing resources of the terminal device that are occupied by the target simplified shader are fewer than computing resources of the terminal device that are occupied by the target shader, and wherein the plurality of prestored correspondences comprises a correspondence among information of a shader, hardware information of a device, and a simplified shader, and the information of the shader comprises any one of the shader or an identifier of the shader; and

perform graphics rendering for the application in the complex scene using the target simplified shader;

wherein the correspondence further comprises a load level, the load level is a quantified value corresponding to load of the electronic device, and the obtaining the target simplified shader comprises:

obtaining a quantity of draw calls in the complex scene;

obtaining a target load level based on the quantity of draw calls; and

obtaining from the plurality of prestored correspondences the target simplified shader corresponding to information of the target shader, the target load level, and hardware information of the electronic device.

12 . The electronic device according to claim 11 , wherein when the computer program is executed by the processor, the electronic device is further enabled to:

simplify the target shader based on a first preset rule, to obtain a plurality of simplified shaders, wherein the first preset rule comprises at least one of code motion, expression deletion, or syntax simplification, and the plurality of simplified shaders comprises the target simplified shader;

collect status information that is of the electronic device and that exists when the electronic device performs graphics rendering for the application in the complex scene using the plurality of simplified shaders, wherein the status information of the electronic device comprises the load of the electronic device, power consumption of the electronic device, a temperature of the electronic device, a rendering duration, and an image quality of an image rendered by each simplified shader, and the rendering duration is a duration required for performing graphics rendering for the application in the complex scene using each simplified shader; and

obtain a correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader based on the status information.

13 . The electronic device according to claim 12 , wherein the obtaining the correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader based on the status information comprises:

obtaining a plurality of target rendering durations from the status information, wherein each target rendering duration of the plurality of target rendering durations is less than a second preset threshold;

obtaining target status information from the status information corresponding to the plurality of target rendering durations, wherein an image quality in the target status information is greater than a third preset threshold, and the target status information is status information that is of the electronic device and that exists when graphics rendering is performed for the application in the complex scene using the target simplified shader;

obtaining the target load level based on load of the electronic device in the target status information; and

establishing the correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader.

14 . The electronic device according to claim 12 , wherein the obtaining the correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader based on the status information comprises:

obtaining a plurality of target image qualities from the status information, wherein each target image quality of the plurality of target image qualities is greater than a fourth preset threshold;

obtaining target status information from the status information corresponding to the plurality of target image qualities, wherein a rendering duration in the target status information is less than a fifth preset threshold, and the target status information is status information that is of the electronic device and that exists when graphics rendering is performed for the application in the complex scene using the target simplified shader;

obtaining the target load level based on load of the electronic device in the target status information; and

establishing the correspondence among the information of the target shader, the hardware information of the electronic device, the target load level, and the target simplified shader.

15 . The electronic device according to claim 11 , wherein when the computer program is executed by the processor, the electronic device is further enabled to:

receive the plurality of prestored correspondences from another device.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 30, 2024
From: SUN, LI; YIN, ZHAOYANG; LI, WEI; LIU, JINXIAO
To: HONOR DEVICE CO., LTD.
Reel/Frame 066300/0056 →
Priority Claims (1)
CN 202110977666.2 · Aug 24, 2021 · national
Continuity (1)
Related Publication 20240338880A1 · Oct 10, 2024
References Cited (21)
US 10002591B2 · Heo et al. · 2018 [cited by applicant]
US 20130127858A1 · Leroy et al. · 2013 [cited by applicant]
US 20150005714A1 · Mehta · 2015 [cited by examiner]
US 20200082491A1 · Harris · 2020 [cited by applicant]
US 20200379815A1 · Banerjee et al. · 2020 [cited by applicant]
US 20200380734A1 · Valient · 2020 [cited by examiner]
US 20210042991A1 · Wei · 2021 [cited by examiner]
US 20220254089A1 · Bao et al. · 2022 [cited by applicant]
CN 106560880A · 2017 [cited by applicant]
CN 108765534A · 2018 [cited by applicant]
CN 109285211A · 2019 [cited by applicant]
CN 109389663A · 2019 [cited by applicant]
CN 111179150A · 2020 [cited by applicant]
CN 111417978A · 2020 [cited by applicant]
CN 112099884A · 2020 [cited by applicant]
CN 114443189A · 2022 [cited by applicant]
WO 2018050003A1 · 2018 [cited by applicant]
Pellacini, Fabio, “User-Configurable Automatic Shader Simplification,” Computer Graphics.SIGGRAPH 2000 Conference Proceedings, pp. 445-452 (Jul. 1, 2005). [cited by applicant]
Song et al., “An Adaptive Method for Shader Simplification,” 2011 International Conference on Virtual Reality and Visualization, pp. 46-51 (Nov. 4, 2011). [cited by applicant]
Sitthi-Amorn et al., “Genetic Programming for Shader Simplification,” 2011 SIGGRAPH Asia Conference, 11 pages (Dec. 12, 2011). [cited by applicant]
Aaltonen, Sebastian, “Optimizing GPU occupancy and resource usage with large thread groups,” Retrieved from the internet, URL: https://gpuopen.com/learn/optimizing-gpu-occupancy-resource-usage-large-thread-groups/ (May … [cited by applicant]