Image processing method, device, equipment, storage medium and program product

By executing geometric and pixel type prefetching instructions and sampling instructions in image processing in parallel, the image processing pipeline is optimized, and the problem of long image display time is solved, and faster image display speed and higher efficiency are achieved.

CN117314727BActive Publication Date: 2025-08-12GLENFLY TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311318217.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-11
Publication Date
2025-08-12
Estimated Expiration
2043-10-11

AI Technical Summary

Technical Problem

In traditional technology, the image display time is long during image rendering. The reason is that the image processing instructions need to wait for the previous instruction to be fully processed before the next instruction can be started, resulting in inefficiency.

Method used

By executing different types of prefetch instructions and sampling instructions in parallel, including prefetch instructions and sampling instructions of geometric types and pixel types, the image processing pipeline is optimized and the waiting time is reduced.

Benefits of technology

It speeds up the image display speed, shortens the time required for image display, and improves image display efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117314727B_ABST
    Figure CN117314727B_ABST
Patent Text Reader

Abstract

The present application relates to an image processing method, apparatus, computer device, storage medium, and computer program product. The method comprises: determining a first target image to be displayed and a second target image to be displayed; obtaining a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each including geometric type prefetch instructions and sampling instructions, as well as pixel type prefetch instructions and sampling instructions; determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions, and executing the plurality of first processing instructions and the plurality of second processing instructions based on the target execution order to sequentially display the first target image to be displayed and the second target image to be displayed. The use of the method accelerates the image display speed, shortens the time required for image display, and improves the image display efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer image processing, and in particular to an image processing method, apparatus, computer equipment, storage medium, and computer program product. Background Art

[0002] Real-time rendering on a GPU (Graphics Processing Unit) is inseparable from the graphics pipeline. Developers generally divide the GPU graphics pipeline into four major parts: application, geometry processing, rasterization, and pixel processing. These four parts have their own pipeline structures. The shaders required for geometry processing before rasterization can be collectively referred to as geometry processing shaders or front-end shaders; the shaders required for pixel processing after rasterization can be collectively referred to as pixel shaders or back-end shaders. Geometry processing shaders can include vertex shaders, subdivision control shaders, subdivision compute shaders, geometry shaders, etc.

[0003] With the rapid development of GPU image rendering technology, the processing instructions that enable images to be displayed are becoming more and more complex, resulting in an increasing number of TS# (shader resource and sampler registers) required by shaders in image rendering.

[0004] In conventional technology, the execution speed of sampling instructions is accelerated simply by setting a buffer area to store resource information corresponding to the TS# required by the shader.

[0005] However, since the processing instructions that need to be executed during the image display process only obtain data through one buffer area, it is necessary to wait until the processing instructions in one image are completely processed before the processing instructions of the next image can be started, which is relatively time-consuming. Summary of the Invention

[0006] Based on this, it is necessary to provide an image processing method, device, computer equipment, computer-readable storage medium and computer program product that can speed up image display, shorten the time required for image display and improve image display efficiency in response to the above technical problems.

[0007] In a first aspect, the present application provides an image processing method. The method comprises:

[0008] In the case where it is detected that there is an image to be displayed, determining a first target image to be displayed and a second target image to be displayed;

[0009] Acquire a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each include a geometric type prefetch instruction and a sampling instruction, and a pixel type prefetch instruction and a sampling instruction;

[0010] determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; executing prefetch instructions and sampling instructions of different types in the target execution order in parallel;

[0011] Based on the target execution order, a plurality of first processing instructions and a plurality of second processing instructions are executed to sequentially display a first target image to be displayed and a second target image to be displayed.

[0012] In one embodiment, executing the plurality of first processing instructions and the plurality of second processing instructions based on the target execution order to sequentially display the first target image to be displayed and the second target image to be displayed includes:

[0013] executing a plurality of first processing instructions based on the target execution order to sequentially obtain first geometric texture data and first pixel texture data for the first target to-be-displayed image;

[0014] displaying the first target image to be displayed according to the first geometric texture data and the first pixel texture data;

[0015] executing a plurality of second processing instructions to sequentially obtain second geometric texture data and second pixel texture data for the second target image to be displayed;

[0016] The second target image to be displayed is displayed based on the second geometric texture data and the second pixel texture data.

[0017] In one embodiment, the plurality of first processing instructions include a first geometry prefetch instruction, a first geometry sampling instruction, a first pixel prefetch instruction, and a first pixel sampling instruction; and executing the plurality of first processing instructions based on the target execution order to sequentially obtain first geometry texture data and first pixel texture data for the first target image to be displayed includes:

[0018] Based on the first geometry prefetch instruction, determining whether corresponding geometry data exists in a geometry cache;

[0019] If the corresponding geometric data does not exist in the geometry cache, the corresponding geometric data is obtained from the second cache and written into the geometry cache;

[0020] When corresponding geometric data exists in the geometry cache, triggering execution of the first geometry sampling instruction and the first pixel prefetch instruction;

[0021] Obtaining first geometric texture data based on the first geometric sampling instruction;

[0022] Based on the first pixel prefetch instruction, determining whether corresponding pixel data exists in a pixel cache;

[0023] When the corresponding pixel data does not exist in the pixel cache, the corresponding pixel data is obtained from the second cache and written into the pixel cache;

[0024] If corresponding pixel data exists in the pixel cache and the first geometry sampling instruction is executed, triggering execution of the first pixel sampling instruction and triggering execution of a geometry prefetch instruction for a next image to be displayed;

[0025] Based on the first pixel sampling instruction, first pixel texture data is obtained.

[0026] In one embodiment, the method further comprises:

[0027] Get the currently running application;

[0028] Based on the application, determining a ratio of a geometry buffer area to a pixel buffer area in the first buffer area;

[0029] Based on the ratio of the geometry buffer area to the pixel buffer area in the first buffer area, the sizes of the geometry buffer area and the pixel buffer area are adjusted.

[0030] In one embodiment, obtaining first geometric texture data based on the first geometric sampling instruction includes:

[0031] Based on the first geometry sampling instruction, acquiring corresponding geometry data;

[0032] Performing texture sampling processing according to the geometric data to obtain first preliminary geometric texture data after texture sampling processing;

[0033] Texture filtering is performed on the first preliminary geometric texture data to obtain first geometric texture data.

[0034] In one embodiment, performing texture sampling processing according to the geometric data to obtain first preliminary geometric texture data after texture sampling processing includes:

[0035] Determining whether corresponding preset texture data exists in a texture class buffer area according to the geometric data and the first geometric sampling instruction;

[0036] In the case that the texture cache does not contain corresponding preset texture data, writing the corresponding preset texture data in the second cache into the texture cache;

[0037] The corresponding preset texture data obtained from the texture class buffer area is used as the first preliminary geometric texture data.

[0038] In one embodiment, determining the first target image to be displayed and the second target image to be displayed includes:

[0039] A display order of a plurality of images to be displayed is obtained, and the image to be displayed ranked first in the display order is used as a first target image to be displayed, and the image to be displayed ranked second in the display order is used as a second target image to be displayed.

[0040] In a second aspect, the present application further provides an image processing device. The device comprises:

[0041] a target image to be displayed determining module, configured to determine a first target image to be displayed and a second target image to be displayed when detecting the existence of an image to be displayed;

[0042] Multiple instruction acquisition modules, used to acquire multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed; the multiple first processing instructions and the multiple second processing instructions each include geometric type prefetch instructions and sampling instructions, and pixel type prefetch instructions and sampling instructions;

[0043] a target execution order determination module, configured to determine a target execution order for a plurality of first processing instructions and a plurality of second processing instructions; wherein prefetch instructions and sampling instructions of different types in the target execution order are executed in parallel;

[0044] The to-be-displayed image display module is configured to sequentially display a first target to-be-displayed image and a second target to-be-displayed image based on the target execution order.

[0045] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

[0046] In the case where it is detected that there is an image to be displayed, determining a first target image to be displayed and a second target image to be displayed;

[0047] Acquire a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each include a geometric type prefetch instruction and a sampling instruction, and a pixel type prefetch instruction and a sampling instruction;

[0048] determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; executing prefetch instructions and sampling instructions of different types in the target execution order in parallel;

[0049] Based on the target execution order, a plurality of first processing instructions and a plurality of second processing instructions are executed to sequentially display a first target image to be displayed and a second target image to be displayed.

[0050] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0051] In the case where it is detected that there is an image to be displayed, determining a first target image to be displayed and a second target image to be displayed;

[0052] Acquire a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each include a geometric type prefetch instruction and a sampling instruction, and a pixel type prefetch instruction and a sampling instruction;

[0053] determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; executing prefetch instructions and sampling instructions of different types in the target execution order in parallel;

[0054] Based on the target execution order, a plurality of first processing instructions and a plurality of second processing instructions are executed to sequentially display a first target image to be displayed and a second target image to be displayed.

[0055] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0056] In the case where it is detected that there is an image to be displayed, determining a first target image to be displayed and a second target image to be displayed;

[0057] Acquire a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each include a geometric type prefetch instruction and a sampling instruction, and a pixel type prefetch instruction and a sampling instruction;

[0058] determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; executing prefetch instructions and sampling instructions of different types in the target execution order in parallel;

[0059] Based on the target execution order, a plurality of first processing instructions and a plurality of second processing instructions are executed to sequentially display a first target image to be displayed and a second target image to be displayed.

[0060] The above-mentioned image processing method, apparatus, computer equipment, storage medium and computer program product, when detecting the existence of an image to be displayed, determine a first target image to be displayed and a second target image to be displayed; obtain multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed; the multiple first processing instructions and the multiple second processing instructions all include geometric type prefetch instructions and sampling instructions, as well as pixel type prefetch instructions and sampling instructions; determine the target execution order for the multiple first processing instructions and the multiple second processing instructions, and execute the multiple first processing instructions and the multiple second processing instructions based on the target execution order to display the first target image to be displayed and the second target image to be displayed in sequence. The present method realizes the parallel execution of different types of prefetch instructions and sampling instructions in the multiple first processing instructions and the multiple second processing instructions, thereby accelerating the image display speed, shortening the time required for image display, and improving the image display efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A schematic diagram of a pipeline showing two images of instructions to be executed in conventional technology;

[0062] Figure 2 1 is a flow chart of an image processing method according to an embodiment;

[0063] Figure 3 1 is a schematic diagram of a process for obtaining geometric and pixel texture data in one embodiment;

[0064] Figure 4 is a structural block diagram of image processing in one embodiment;

[0065] Figure 5 A schematic diagram of a pipeline showing instructions to be executed for two target images in one embodiment;

[0066] Figure 6 is a flowchart of an image processing method in another embodiment;

[0067] Figure 7 is a structural block diagram of an image processing device in one embodiment;

[0068] Figure 8 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0070] With the rapid development of GPU image rendering technology, the sampling instructions that enable images to be displayed are becoming more and more complex, resulting in an increasing number of TS# (shader resource and sampler registers) required by shaders in image rendering.

[0071] In traditional technology, the execution speed of sampling instructions is accelerated by setting a cache area to store the resource information corresponding to the TS# required by the shader. The display of an image requires the execution of multiple processing instructions, including geometric prefetch instructions, geometric sampling instructions, pixel prefetch instructions, and pixel sampling instructions. Among them, in an image, the execution order of multiple processing instructions is geometric prefetch instructions, geometric sampling instructions, pixel prefetch instructions, and pixel sampling instructions, and the previous instruction must be completed before pointing to the next instruction. Specifically, if Figure 1 FIG. 1 is a schematic diagram showing a pipeline of instructions to be executed by two images in conventional technology.

[0072] Then, in the conventional technology, it is necessary to wait until the processing instructions of one image are completely processed before the processing instructions of the next image can be started. This method results in a relatively long time required for image display.

[0073] In order to solve this problem, the image processing method of this embodiment is proposed, such as Figure 2 As shown, an image processing method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, including the following steps:

[0074] Step 202 : When it is detected that there is an image to be displayed, a first target image to be displayed and a second target image to be displayed are determined.

[0075] The terminal may include but is not limited to various personal computers, laptops, smart phones, tablet computers, etc. The server may be implemented as an independent server or a server cluster consisting of multiple servers.

[0076] The image to be displayed is an image that needs to be displayed on the display interface of the terminal. The first target image to be displayed and the second target image to be displayed are both images that will be displayed on the display interface of the terminal. The display order of the first target image to be displayed is higher than the display order of the second target image to be displayed.

[0077] In specific practice, when the terminal detects that there are images to be displayed, the corresponding first target image to be displayed and the second target image to be displayed can be acquired according to the detection order in which the terminal detects the images.

[0078] Step 204, obtain multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed; the multiple first processing instructions and the multiple second processing instructions both include geometric type prefetch instructions and sampling instructions, and pixel type prefetch instructions and sampling instructions.

[0079] The plurality of first processing instructions may be processing instructions required to display a first target image to be displayed. The plurality of second processing instructions may be processing instructions required to display a second target image to be displayed. The plurality of first processing instructions and the plurality of second processing instructions may each include geometric prefetch instructions and sampling instructions, as well as pixel prefetch instructions and sampling instructions. For the first target image to be displayed, the geometric prefetch instructions and sampling instructions are used to obtain geometric data for the first target image to be displayed; the pixel prefetch instructions and sampling instructions are used to obtain pixel data for the first target image to be displayed.

[0080] Exemplarily, when a first target image to be displayed and a second target image to be displayed are determined, a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed are acquired.

[0081] Step 206 : determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; in the target execution order, prefetch instructions and sampling instructions of different types are executed in parallel.

[0082] For the first target image to be displayed, the execution order of prefetch instructions of the same type is higher than the execution order of sampling instructions, and the execution order of geometric type sampling instructions is higher than the execution order of pixel type sampling instructions.

[0083] The target execution order is an execution order obtained based on the plurality of first processing instructions and the plurality of second processing instructions. The target execution order may include the parallel execution of prefetch instructions and sampling instructions of different types. Specifically, the target execution order may include the parallel execution of geometry-type sampling instructions and pixel-type prefetch instructions for the same image.

[0084] In specific practice, the terminal may include a processor. When the processor recognizes that there is an image to be displayed, it determines a first target image to be displayed and a second target image to be displayed, obtains multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed, and determines the target execution order based on the multiple first processing instructions and the multiple second processing instructions. Specifically, the first processing instruction includes an image identifier and instruction identifiers of different first processing instructions. The image identifier can be used to distinguish the image currently to be displayed. The instruction identifier can be used to identify the type of data that the instruction needs to obtain.

[0085] Exemplarily, when a plurality of first processing instructions for a first target image to be displayed and a plurality of second processing instructions for a second target image to be displayed are acquired, a target execution order is determined based on the plurality of first processing instructions and the plurality of second processing instructions.

[0086] Step 208 : executing the plurality of first processing instructions and the plurality of second processing instructions based on the target execution order, so as to sequentially display the first target image to be displayed and the second target image to be displayed.

[0087] The first target image to be displayed is displayed on the display interface of the terminal before the second target image to be displayed, that is, after the first target image to be displayed is completely displayed, the second target image to be displayed is triggered to be displayed.

[0088] In the above-mentioned image processing method, when it is detected that there is an image to be displayed, a first target image to be displayed and a second target image to be displayed are determined; multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed are obtained; the multiple first processing instructions and the multiple second processing instructions all include geometric type prefetch instructions and sampling instructions, as well as pixel type prefetch instructions and sampling instructions; a target execution order for the multiple first processing instructions and the multiple second processing instructions is determined, so as to execute the multiple first processing instructions and the multiple second processing instructions based on the target execution order, so as to display the first target image to be displayed and the second target image to be displayed in sequence. This method realizes the parallel execution of different types of prefetch instructions and sampling instructions in the multiple first processing instructions and the multiple second processing instructions, thereby accelerating the image display speed, shortening the time required for image display, and improving the image display efficiency.

[0089] In one embodiment, step 202 includes:

[0090] A display order of a plurality of images to be displayed is obtained, and the image to be displayed ranked first in the display order is used as a first target image to be displayed, and the image to be displayed ranked second in the display order is used as a second target image to be displayed.

[0091] The image to be displayed is an image detected by the terminal and required to be displayed on the display interface. The display order of the multiple images to be displayed can be determined based on the detection order of the images detected by the terminal. The first target image to be displayed can be the image to be displayed that is ranked first in the display order. The second target image to be displayed can be the image to be displayed that is ranked second in the display order.

[0092] In specific practice, the processor in the terminal can detect whether there is an image that needs to be displayed on the display interface. When it is detected that there is an image that needs to be displayed on the display interface, it is determined that there is an image to be displayed, and the image information of the image to be displayed is obtained to determine the display order of multiple images to be displayed.

[0093] For example, the display order of multiple images to be displayed can be obtained, and based on the display order of the multiple images to be displayed, the image to be displayed that ranks first in the display order is used as the first target image to be displayed, and the image to be displayed that ranks second in the display order is used as the second target image to be displayed. In specific practice, the display order of the multiple images to be displayed can be determined based on the detection order of the images by the processor in the terminal, thereby determining the first target image to be displayed and the second target image to be displayed.

[0094] In the above embodiment, the first target image to be displayed and the second target image to be displayed are determined based on the display order of multiple images to be displayed, which is more in line with actual image display requirements and realizes that the display order of the first target image to be displayed is earlier than that of the second target image to be displayed.

[0095] In one embodiment, step 208 includes:

[0096] Step 2082: Execute a plurality of first processing instructions based on the target execution order to sequentially obtain first geometric texture data and first pixel texture data for the first target image to be displayed.

[0097] The plurality of first processing instructions include geometric prefetch instructions and sampling instructions, and pixel prefetch instructions and sampling instructions. Specifically, the geometric prefetch instructions and sampling instructions can acquire first geometric texture data for a first target image to be displayed; and the pixel prefetch instructions and sampling instructions can acquire first pixel texture data for the first target image to be displayed.

[0098] Step 2084: Display the first target image to be displayed according to the first geometric texture data and the first pixel texture data.

[0099] In practice, the image display rendering process includes geometry processing, rasterization, and pixel processing. Taking the first target image to be displayed as an example, the geometry processing process involves obtaining first geometric texture data for the first target image to be displayed through geometry-type prefetch and sampling instructions. After obtaining the first geometric texture data, rasterization is performed, followed by the acquisition of first pixel texture data to display the first target image to be displayed.

[0100] Step 2086: execute multiple second processing instructions to sequentially obtain second geometric texture data and second pixel texture data for the second target image to be displayed.

[0101] The plurality of second processing instructions may include a geometry-type prefetch instruction and a sampling instruction, and a pixel-type prefetch instruction and a sampling instruction. Specifically, the geometry-type prefetch instruction and the sampling instruction may acquire second geometry texture data for the second target image to be displayed; and the pixel-type prefetch instruction and the sampling instruction may acquire second pixel texture data for the second target image to be displayed.

[0102] Step 2088: Display the second target image to be displayed based on the second geometric texture data and the second pixel texture data.

[0103] Specifically, the display process of the second target image to be displayed may refer to the display process of the first target image to be displayed, and the present invention will not repeat it here.

[0104] In one embodiment, reference Figure 3 , shows a schematic flow diagram of obtaining geometric and pixel texture data in one embodiment. The plurality of first processing instructions include a first geometric prefetch instruction, a first geometric sampling instruction, a first pixel prefetch instruction, and a first pixel sampling instruction; step 2082 includes:

[0105] Step 302: Based on the first geometry prefetch instruction, determine whether corresponding geometry data exists in the geometry class cache.

[0106] The plurality of first processing instructions for the first target image to be displayed may include a first geometry prefetch instruction, a first geometry sampling instruction, a first pixel prefetch instruction, and a first pixel sampling instruction. The first geometry prefetch instruction may include identification information of geometry data to be acquired. The geometry class buffer may be used to cache geometry data.

[0107] The geometry data may be the geometry processing resource data recorded in the TS# (shader resource and sampler) register corresponding to the geometry processing shader. The geometry data may include resource and sampler description information corresponding to the geometry processing shader. The resource and sampler description information corresponding to the geometry processing shader includes identification information for identifying the corresponding geometry data. The resource and sampler description information may be used to describe the characteristics and address information of the objects to be sampled.

[0108] In specific practice, it is possible to determine whether the geometry class cache contains all the geometry data required by the first geometry prefetch instruction through a corresponding hit miss test based on the identification information of the geometry data required to be obtained in the first geometry prefetch instruction.

[0109] Step 304: If the corresponding geometric data does not exist in the geometry class cache, the corresponding geometric data is obtained from the second cache and written into the geometry class cache.

[0110] In specific practice, the terminal may include a first cache area and a second cache area. The first cache area is composed of a geometry cache area and a pixel cache area. The second cache area may be used to store geometry processing resource data recorded by TS# (shaderresource and sampler) corresponding to the geometry processing shader, so that when the geometry cache area in the first cache area does not contain all the geometry data required by the first geometry prefetch instruction, the corresponding geometry data can be obtained from the second cache area.

[0111] Exemplarily, when the corresponding geometric data does not exist in the geometry class cache, the corresponding geometric data is obtained from the second cache and written into the geometry class cache.

[0112] Step 306 : When corresponding geometric data exists in the geometry class buffer, trigger execution of the first geometry sampling instruction and the first pixel prefetch instruction.

[0113] Among them, the terminal may include a controller, and the controller is used to identify whether the first geometric prefetch instruction has been executed. The sign of the completion of the execution of the first geometric prefetch instruction is that it is detected that all the geometric data required by the first geometric prefetch instruction exist in the geometric cache. Specifically, based on the first geometric prefetch instruction, it is determined whether the geometric cache has all the geometric data required by the first geometric prefetch instruction. If the geometric cache has all the geometric data required by the first geometric prefetch instruction, the corresponding first geometric prefetch instruction is executed; if the geometric cache does not have all the geometric data required by the first geometric prefetch instruction, the corresponding geometric data is obtained from the second cache and written into the geometric cache, so that the geometric cache has all the geometric data required by the first geometric prefetch instruction, and it is determined that the corresponding first geometric prefetch instruction is executed.

[0114] Specifically, when corresponding geometric data exists in the geometry cache, that is, after the first geometry prefetch instruction is executed, the execution of the first geometry sampling instruction and the first pixel prefetch instruction is triggered. Specifically, the execution priority of the first geometry prefetch instruction is higher than the execution priority of the first geometry sampling instruction; and the execution priority of the first pixel prefetch instruction is higher than the execution priority of the first pixel sampling instruction.

[0115] Step 308: Obtain first geometric texture data based on the first geometric sampling instruction.

[0116] Exemplarily, corresponding geometric data is acquired based on the first geometric sampling instruction, and first geometric texture data for a first target image to be displayed is acquired based on the corresponding geometric data.

[0117] Step 310: Based on the first pixel prefetch instruction, determine whether corresponding pixel data exists in the pixel cache.

[0118] The first pixel prefetch instruction may include identification information of pixel data to be obtained. The pixel cache area may be used to cache pixel data.

[0119] The pixel data may be pixel processing resource data recorded by the TS# (shader resource and sampler) corresponding to the pixel shader. The pixel data may include resource and sampler description information corresponding to the pixel shader. The resource and sampler description information corresponding to the pixel shader includes identification information for identifying the corresponding pixel data.

[0120] In specific practice, it is possible to determine whether the pixel cache area contains all the pixel data required by the first pixel prefetch instruction through a corresponding hit miss test based on the identification information of the pixel data to be obtained in the first pixel prefetch instruction.

[0121] Step 312: If the corresponding pixel data does not exist in the pixel-type buffer area, obtain the corresponding pixel data from the second buffer area and write it into the pixel-type buffer area.

[0122] The first buffer may include a pixel-type buffer. The second buffer may also be used to store pixel processing resource data recorded by TS# (shader resource and sampler) corresponding to the pixel shader, so that if the corresponding pixel data does not exist in the pixel-type buffer in the first buffer, the corresponding pixel data can be obtained from the second buffer.

[0123] Step 314 , when the corresponding pixel data exists in the pixel cache and the first geometry sampling instruction is executed, trigger the execution of the first pixel sampling instruction and trigger the execution of the geometry prefetch instruction of the next image to be displayed.

[0124] Among them, the sign of the completion of the execution of the first pixel prefetch instruction is to detect that all the pixel data required by the first pixel prefetch instruction exists in the pixel class buffer area. Specifically, based on the first pixel prefetch instruction, it is determined whether all the pixel data required by the first pixel prefetch instruction exists in the pixel class buffer area. If all the pixel data required by the first pixel prefetch instruction exists in the pixel class buffer area, the corresponding first pixel prefetch instruction is executed; if all the pixel data required by the first pixel prefetch instruction does not exist in the pixel class buffer area, the corresponding pixel data is obtained from the second buffer area and written into the pixel class buffer area, so that the corresponding pixel data exists in the pixel class buffer area, and it is determined that the corresponding first pixel prefetch instruction is executed.

[0125] The first geometry sampling instruction execution completion flag is to obtain the first geometry texture data.

[0126] When the first pixel prefetch instruction is executed and the first geometry sampling instruction is executed, the execution of the first pixel sampling instruction and the execution of the geometry prefetch instruction of the next image to be displayed may be triggered.

[0127] The next image to be displayed after the first target image to be displayed is the second target image to be displayed. The plurality of second processing instructions for the second target image to be displayed may include a second geometry prefetch instruction, a second geometry sampling instruction, a second pixel prefetch instruction, and a second pixel sampling instruction.

[0128] Specifically, the execution order of multiple first processing instructions and multiple second processing instructions in the target execution order may be to execute the first geometric prefetch instruction, and after the first geometric prefetch instruction is executed, trigger the execution of the first geometric sampling instruction and the first pixel prefetch instruction; after the first geometric sampling instruction and the first pixel prefetch instruction are executed, trigger the execution of the first pixel sampling instruction and the second geometric prefetch instruction; after the first pixel sampling instruction and the second geometric prefetch instruction are executed, trigger the execution of the second geometric sampling instruction and the second pixel prefetch instruction; after the second geometric sampling instruction and the second pixel prefetch instruction are executed, trigger the execution of the second pixel sampling instruction and the geometric prefetch instruction of the next image to be displayed.

[0129] Step 316: Obtain first pixel texture data based on the first pixel sampling instruction.

[0130] Exemplarily, based on the first pixel sampling instruction, corresponding pixel data is acquired, and based on the corresponding pixel data, first pixel texture data for the first target image to be displayed is acquired.

[0131] In the above embodiment, the delay in acquiring geometric data or pixel data is reduced by prefetching instructions; by setting different types of cache areas, the parallel execution of the first geometric sampling instruction and the first pixel prefetch instruction is triggered, and the parallel execution of the first pixel sampling instruction and the geometric prefetch instruction of the next image is triggered, thereby speeding up the image display speed, shortening the time required for image display, and improving the image display efficiency.

[0132] In one embodiment, the method further comprises:

[0133] Get the currently running application;

[0134] Based on the application, determining a ratio of a geometry buffer area to a pixel buffer area in the first buffer area;

[0135] Based on the ratio of the geometry buffer area to the pixel buffer area in the first buffer area, the sizes of the geometry buffer area and the pixel buffer area are adjusted.

[0136] The processor in the terminal may identify the currently running application and determine the ratio of the geometry cache area to the pixel cache area in the first cache area based on the application.

[0137] In actual practice, different applications may require different amounts of geometric data and pixel data for the images to be displayed. For example, for different types of applications, or for the same application, such as different stages of a game, the GPU driver can adjust the ratio of the geometric cache area and the pixel cache area in the first cache area after identifying the application, so that the cached amount of cached geometric data or pixel data increases, making it more convenient to obtain geometric data or pixel data. Therefore, the ratio of the geometric cache area and the pixel cache area in the first cache area can be divided based on the application characteristics of the application.

[0138] In specific practice, a correspondence between multiple groups of applications and preset ratios of geometric cache areas and pixel cache areas in the first cache area can be set, so as to adjust the size of geometric cache areas and pixel cache areas in the first cache area based on the application.

[0139] In the above embodiment, based on the application, the ratio of the geometric cache area and the pixel cache area in the first cache area is determined; based on the ratio of the geometric cache area and the pixel cache area in the first cache area, the sizes of the geometric cache area and the pixel cache area are adjusted, thereby realizing real-time adjustment of the size of the corresponding type of cache area to better fit the distribution of geometric data and pixel data of the image that needs to be displayed by the actual use of the application.

[0140] In one embodiment, step 308 includes:

[0141] Step 3082: Acquire corresponding geometric data based on the first geometric sampling instruction.

[0142] The geometry data may include resource description information and sampling description information corresponding to the geometry processing shader. The sampling description information may be a sampling method corresponding to the sampling instruction.

[0143] In practice, the resource description information may be used to describe the feature information and address information of the object to be sampled. The sampling method corresponding to the sampling instruction may include but is not limited to point sampling or surface sampling.

[0144] Step 3084: Perform texture sampling processing based on the geometric data to obtain first preliminary geometric texture data after texture sampling processing.

[0145] Step 3086: Perform texture filtering on the first preliminary geometric texture data to obtain first geometric texture data.

[0146] Exemplarily, based on the first geometry sampling instruction, corresponding geometry data is obtained from the geometry class buffer area, and texture sampling processing is performed according to the geometry data to obtain first preliminary geometry texture data.

[0147] In specific practice, based on the geometric data, preset texture data corresponding to the geometric data is obtained from the geometric class cache area to obtain the first preliminary geometric texture data. In order to make the texture data in the first preliminary geometric texture data more consistent with the texture of the image actually to be displayed, it is necessary to perform texture filtering processing on the first preliminary geometric texture data to obtain the first geometric texture data.

[0148] In the above embodiment, corresponding geometric data is acquired based on the first geometric sampling instruction, texture sampling processing is performed based on the geometric data to obtain first preliminary geometric texture data after texture sampling processing, and texture filtering processing is performed on the first preliminary geometric texture data to obtain first geometric texture data. By performing texture filtering processing on the first preliminary geometric texture data to obtain the first geometric texture data, the texture data is made to more closely match the texture of the image actually to be displayed.

[0149] In one embodiment, the process of obtaining the first pixel texture data can be based on a first pixel sampling instruction, obtaining corresponding pixel data from a pixel class buffer area, performing texture sampling processing based on the pixel data to obtain first preliminary pixel texture data, and performing texture filtering processing on the first preliminary pixel texture data to obtain first pixel texture data.

[0150] Specifically, the specific operation of obtaining the first pixel texture data can refer to the process of obtaining the first geometric texture data in steps 3082 to 3086, and the present invention will not repeat them here.

[0151] In one embodiment, step 3084 includes:

[0152] Determining whether corresponding preset texture data exists in a texture class buffer area according to the geometric data and the first geometric sampling instruction;

[0153] In the case that the texture cache does not contain corresponding preset texture data, writing the corresponding preset texture data in the second cache into the texture cache;

[0154] The corresponding preset texture data obtained from the texture class buffer area is used as the first preliminary geometric texture data.

[0155] The second buffer area may also be used to store preset texture data corresponding to the geometric data and preset texture data corresponding to the pixel data.

[0156] Exemplarily, the process of obtaining the first preliminary geometric texture data is to write the corresponding preset texture data of the second cache area into the texture class cache area when there is no corresponding preset texture data in the texture class cache area; and use the corresponding preset texture data obtained from the texture class cache area as the first preliminary geometric texture data.

[0157] In specific practice, the required texture data and the location information of the required texture data are determined based on the geometric data and the first geometric sampling instruction, so as to determine whether the texture class cache area has corresponding preset texture data based on the required texture data and the location information of the required texture data.

[0158] Specifically, the process of obtaining the first preliminary pixel texture data may refer to the process of obtaining the first preliminary geometric texture data, which will not be repeated herein.

[0159] In the above embodiment, based on the geometric data and the first geometric sampling instruction, it is determined whether the texture class cache area has corresponding preset texture data. If the texture class cache area does not have corresponding preset texture data, the corresponding preset texture data of the second cache area is written into the texture class cache area to facilitate the subsequent acquisition of the corresponding preset texture data from the texture class cache area.

[0160] To better understand the image processing process, let's take an example to illustrate. Figure 4 , shows a structural block diagram of image processing in one embodiment, including:

[0161] The execution unit 402 is used to obtain the currently running application; based on the application, determine the ratio of the geometry buffer area and the pixel buffer area in the first buffer area; based on the ratio of the geometry buffer area and the pixel buffer area in the first buffer area, adjust the size of the geometry buffer area and the pixel buffer area; when detecting the existence of an image to be displayed, determine a first target image to be displayed and a second target image to be displayed; obtain multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed, and determine the target execution order of the processing instructions, and execute the multiple first processing instructions and the multiple second processing instructions based on the target execution order.

[0162] The first barrier detector 404 is used to monitor whether the geometric prefetch instruction of the image is executed. After monitoring that the geometric prefetch instruction of the image is executed, the geometric prefetch instruction is fed back to the execution unit 402 so that the execution unit 402 sends a corresponding geometric sampling instruction.

[0163] The second barrier detector 406 is used to monitor whether the pixel prefetch instruction of the image is executed. After monitoring that the pixel prefetch instruction of the image is executed, the pixel prefetch instruction is fed back to the execution unit 402 so that the execution unit 402 sends a corresponding pixel sampling instruction.

[0164] The first hit test 408 is used to determine whether corresponding geometry data exists in the geometry class buffer.

[0165] The second hit test 410 is used to determine whether corresponding pixel data exists in the pixel cache.

[0166] The first buffer area 412 ( Figure 4 ) includes a geometry class buffer 4122 and a pixel class buffer 4124.

[0167] The geometry class buffer 4122 is used to store a portion of geometry data and obtain the geometry data from the second buffer.

[0168] The pixel type buffer area 4124 is used to store a portion of pixel data and obtain pixel data from the second buffer area.

[0169] The second buffer area 414 is used to store geometric data, pixel data and corresponding preset texture data.

[0170] The texture sampling module 416 is used to identify whether the geometric data or pixel data has corresponding preset texture data in the texture cache.

[0171] The texture cache 418 is used to store geometric data, pixel data and corresponding preset texture data.

[0172] The texture filtering processing module 420 is used to perform filtering processing on the acquired preset texture data.

[0173] In specific practice, the execution unit 402 in the terminal may be a processor, and the first boundary detector and the second boundary detector may be controllers.

[0174] To better understand the image processing process, let's take an example to illustrate. Figure 5 , showing a schematic diagram of a pipeline for executing instructions for displaying two target images in one embodiment, including:

[0175] The first geometric prefetch instruction, the first geometric sampling instruction, the first pixel prefetch instruction, and the first pixel sampling instruction are processing instructions for the first target image to be displayed. The second geometric prefetch instruction, the second geometric sampling instruction, the second pixel prefetch instruction, and the second pixel sampling instruction are processing instructions for the second target image to be displayed. The next image to be displayed is the image to be displayed after the second target image to be displayed is displayed.

[0176] The target execution order may be to execute the first geometric prefetch instruction, and after the first geometric prefetch instruction is executed, trigger the execution of the first geometric sampling instruction and the first pixel prefetch instruction; after the first geometric sampling instruction and the first pixel prefetch instruction are executed, trigger the execution of the first pixel sampling instruction and the second geometric prefetch instruction; after the first pixel sampling instruction and the second geometric prefetch instruction are executed, trigger the execution of the second geometric sampling instruction and the second pixel prefetch instruction; after the second geometric sampling instruction and the second pixel prefetch instruction are executed, trigger the execution of the second pixel sampling instruction and the geometric prefetch instruction of the next image to be displayed.

[0177] In practice, for the same image, prefetch instructions of the same type have higher priority than sampling instructions, and geometric sampling instructions have higher priority than pixel sampling instructions. Furthermore, prefetch instructions generally take less time to execute than sampling instructions.

[0178] To better understand the image processing process, let's take an example to illustrate. Figure 6 , which shows a flow chart of an image processing method in one embodiment, including:

[0179] Step 602, when it is detected that there are images to be displayed, obtain the display order of multiple images to be displayed, and use the image to be displayed ranked first in the display order as the first target image to be displayed, and the image to be displayed ranked second in the display order as the second target image to be displayed.

[0180] Step 604: Acquire a plurality of first processing instructions for a first target image to be displayed and a plurality of second processing instructions for a second target image to be displayed.

[0181] Step 606 : Determine a target execution order for the plurality of first processing instructions and the plurality of second processing instructions.

[0182] Step 608: Based on the target execution order, execute the first geometry prefetch instruction to determine whether there is corresponding geometry data in the geometry cache; if there is no corresponding geometry data in the geometry cache, obtain the corresponding geometry data from the second cache and write it into the geometry cache.

[0183] Step 610 , triggering execution of a first geometry sampling instruction and a first pixel prefetch instruction when corresponding geometry data exists in the geometry class buffer;

[0184] Step 612: Obtain first geometric texture data based on the first geometric sampling instruction.

[0185] Step 614, based on the first pixel prefetch instruction, determine whether there is corresponding pixel data in the pixel class cache; if there is no corresponding pixel data in the pixel class cache, obtain the corresponding pixel data from the second cache and write it into the pixel class cache.

[0186] Step 616 : If the corresponding pixel data exists in the pixel cache and the first geometry sampling instruction is executed, trigger the execution of the first pixel sampling instruction and trigger the execution of the geometry prefetch instruction of the next image to be displayed.

[0187] Step 618: Based on the first pixel sampling instruction, obtain first pixel texture data to display the first target image to be displayed.

[0188] In this embodiment, when the existence of an image to be displayed is detected, a first target image to be displayed and a second target image to be displayed are determined; multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed are obtained; the multiple first processing instructions and the multiple second processing instructions all include geometric type prefetch instructions and sampling instructions, as well as pixel type prefetch instructions and sampling instructions; a target execution order for the multiple first processing instructions and the multiple second processing instructions is determined, and based on the target execution order, the multiple first processing instructions and the multiple second processing instructions are executed to sequentially display the first target image to be displayed and the second target image to be displayed. This method is used to implement the parallel execution of different types of prefetch instructions and sampling instructions in the multiple first processing instructions and the multiple second processing instructions, thereby accelerating the image display speed, shortening the time required for image display, and improving the image display efficiency.

[0189] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0190] Based on the same inventive concept, embodiments of the present application also provide an image processing device for implementing the aforementioned image processing method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more of the following image processing device embodiments can be found in the above-described limitations on the image processing method and will not be further elaborated here.

[0191] In one embodiment, Figure 7 As shown, an image processing device is provided, comprising: a target image to be displayed determination module 702, a plurality of instruction acquisition modules 704, a target execution order determination module 706 and a to-be-displayed image display module 708, wherein:

[0192] The target image to be displayed determining module 702 is configured to determine a first target image to be displayed and a second target image to be displayed when detecting that there is an image to be displayed.

[0193] Multiple instruction acquisition modules 704 are used to acquire multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed; the multiple first processing instructions and the multiple second processing instructions both include geometric type prefetch instructions and sampling instructions, as well as pixel type prefetch instructions and sampling instructions.

[0194] The target execution order determining module 706 is configured to determine a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; in the target execution order, prefetch instructions and sampling instructions of different types are executed in parallel.

[0195] The to-be-displayed image display module 708 is configured to sequentially display a first target to-be-displayed image and a second target to-be-displayed image based on the target execution order.

[0196] In some embodiments, the to-be-displayed image display module 708 includes:

[0197] a first geometric and pixel texture data acquisition submodule, configured to execute a plurality of first processing instructions based on the target execution order, so as to sequentially acquire first geometric texture data and first pixel texture data for the first target image to be displayed;

[0198] a first target image to be displayed display submodule, configured to display the first target image to be displayed according to the first geometric texture data and the first pixel texture data;

[0199] a second geometric and pixel texture data acquisition submodule, configured to execute a plurality of second processing instructions to sequentially acquire second geometric texture data and second pixel texture data for the second target image to be displayed;

[0200] The second target image to be displayed display submodule is configured to display the second target image to be displayed based on the second geometric texture data and the second pixel texture data.

[0201] In some embodiments, the plurality of first processing instructions include a first geometry prefetch instruction, a first geometry sampling instruction, a first pixel prefetch instruction, and a first pixel sampling instruction; and the first geometry and pixel texture data acquisition submodule includes:

[0202] a geometry data determining unit, configured to determine whether corresponding geometry data exists in a geometry class cache based on the first geometry prefetch instruction;

[0203] a geometry data acquisition unit, configured to acquire corresponding geometry data from a second buffer area and write the corresponding geometry data into the geometry buffer area if the corresponding geometry data does not exist in the geometry buffer area;

[0204] a first instruction triggering unit, configured to trigger execution of the first geometry sampling instruction and the first pixel prefetch instruction when corresponding geometry data exists in the geometry class buffer;

[0205] A first geometric texture data acquisition unit, configured to acquire first geometric texture data based on the first geometric sampling instruction;

[0206] a pixel data determining unit, configured to determine whether corresponding pixel data exists in a pixel cache based on the first pixel prefetch instruction;

[0207] a pixel data acquisition unit, configured to acquire corresponding pixel data from a second buffer area and write the data into the pixel buffer area if the corresponding pixel data does not exist in the pixel buffer area;

[0208] a second instruction triggering unit, configured to trigger execution of the first pixel sampling instruction and trigger execution of a geometric prefetch instruction for a next image to be displayed when corresponding pixel data exists in the pixel cache and execution of the first geometric sampling instruction is completed;

[0209] The first pixel texture data acquisition unit is configured to acquire first pixel texture data based on the first pixel sampling instruction.

[0210] In some embodiments, the first geometric texture data acquisition unit includes:

[0211] a geometric data acquisition subunit, configured to acquire corresponding geometric data based on the first geometric sampling instruction;

[0212] A preliminary geometric texture data acquisition subunit is used to perform texture sampling processing according to the geometric data to obtain first preliminary geometric texture data after texture sampling processing;

[0213] The first geometric texture data acquisition subunit is configured to perform texture filtering on the first preliminary geometric texture data to obtain first geometric texture data.

[0214] In some embodiments, the preliminary geometric texture data acquisition subunit is specifically configured to determine whether corresponding preset texture data exists in the texture class buffer according to the geometric data and the first geometric sampling instruction;

[0215] In the case that the texture cache does not contain corresponding preset texture data, writing the corresponding preset texture data in the second cache into the texture cache;

[0216] The corresponding preset texture data obtained from the texture class buffer area is used as the first preliminary geometric texture data.

[0217] In some embodiments, the target image to be displayed determination module 702 includes:

[0218] The target to-be-displayed image determination submodule is used to obtain the display order of multiple to-be-displayed images, and use the to-be-displayed image ranked first in the display order as the first target to-be-displayed image, and use the to-be-displayed image ranked second in the display order as the second target to-be-displayed image.

[0219] Each module in the above-mentioned image processing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0220] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store geometric data, pixel data and corresponding preset texture data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an image processing method is implemented.

[0221] The display unit of the computer device is used to produce a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, a keypad, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse.

[0222] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0223] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0224] In the case where it is detected that there is an image to be displayed, determining a first target image to be displayed and a second target image to be displayed;

[0225] Acquire a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each include a geometric type prefetch instruction and a sampling instruction, and a pixel type prefetch instruction and a sampling instruction;

[0226] determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; executing prefetch instructions and sampling instructions of different types in the target execution order in parallel;

[0227] Based on the target execution order, a plurality of first processing instructions and a plurality of second processing instructions are executed to sequentially display a first target image to be displayed and a second target image to be displayed.

[0228] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0229] In the case where it is detected that there is an image to be displayed, determining a first target image to be displayed and a second target image to be displayed;

[0230] Acquire a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each include a geometric type prefetch instruction and a sampling instruction, and a pixel type prefetch instruction and a sampling instruction;

[0231] determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; executing prefetch instructions and sampling instructions of different types in the target execution order in parallel;

[0232] Based on the target execution order, a plurality of first processing instructions and a plurality of second processing instructions are executed to sequentially display a first target image to be displayed and a second target image to be displayed.

[0233] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0234] In the case where it is detected that there is an image to be displayed, determining a first target image to be displayed and a second target image to be displayed;

[0235] Acquire a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each include a geometric type prefetch instruction and a sampling instruction, and a pixel type prefetch instruction and a sampling instruction;

[0236] determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; executing prefetch instructions and sampling instructions of different types in the target execution order in parallel;

[0237] Based on the target execution order, a plurality of first processing instructions and a plurality of second processing instructions are executed to sequentially display a first target image to be displayed and a second target image to be displayed.

[0238] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0239] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0240] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0241] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. An image processing method, characterized in that: The method comprises: In the case where it is detected that there is an image to be displayed, determining a first target image to be displayed and a second target image to be displayed; Acquire a plurality of first processing instructions for the first target image to be displayed and a plurality of second processing instructions for the second target image to be displayed; the plurality of first processing instructions and the plurality of second processing instructions each include a geometric type prefetch instruction and a sampling instruction, and a pixel type prefetch instruction and a sampling instruction; determining a target execution order for the plurality of first processing instructions and the plurality of second processing instructions; executing prefetch instructions and sampling instructions of different types in the target execution order in parallel; executing a plurality of first processing instructions based on the target execution order to sequentially obtain first geometric texture data and first pixel texture data for the first target to-be-displayed image; displaying the first target image to be displayed according to the first geometric texture data and the first pixel texture data; executing a plurality of second processing instructions to sequentially obtain second geometric texture data and second pixel texture data for the second target image to be displayed; displaying the second target image to be displayed based on the second geometric texture data and the second pixel texture data; The plurality of first processing instructions include a first geometry prefetch instruction, a first geometry sampling instruction, a first pixel prefetch instruction, and a first pixel sampling instruction; and the process of executing the plurality of first processing instructions based on the target execution order to sequentially obtain first geometric texture data and first pixel texture data for the first target to-be-displayed image includes: Based on the first geometry prefetch instruction, determining whether corresponding geometry data exists in a geometry cache; If the corresponding geometric data does not exist in the geometry cache, the corresponding geometric data is obtained from the second cache and written into the geometry cache; When corresponding geometric data exists in the geometry cache, triggering execution of the first geometry sampling instruction and the first pixel prefetch instruction; Based on the first geometry sampling instruction, obtaining first geometry texture data; Based on the first pixel prefetch instruction, determining whether corresponding pixel data exists in a pixel cache; When the corresponding pixel data does not exist in the pixel cache, the corresponding pixel data is obtained from the second cache and written into the pixel cache; If corresponding pixel data exists in the pixel cache and the first geometry sampling instruction is executed, triggering execution of the first pixel sampling instruction and triggering execution of a geometry prefetch instruction for a next image to be displayed; Based on the first pixel sampling instruction, first pixel texture data is obtained.

2. The method according to claim 1, characterized in that The method further comprises: Get the currently running application; Based on the application, determining a ratio of a geometry buffer area to a pixel buffer area in the first buffer area; Based on the ratio of the geometry buffer area to the pixel buffer area in the first buffer area, the sizes of the geometry buffer area and the pixel buffer area are adjusted.

3. The method according to claim 1, characterized in that The acquiring first geometric texture data based on the first geometric sampling instruction includes: Based on the first geometry sampling instruction, acquiring corresponding geometry data; Performing texture sampling processing according to the geometric data to obtain first preliminary geometric texture data after texture sampling processing; Texture filtering is performed on the first preliminary geometric texture data to obtain first geometric texture data.

4. The method according to claim 3, characterized in that The step of performing texture sampling processing according to the geometric data to obtain first preliminary geometric texture data after the texture sampling processing includes: Determining whether corresponding preset texture data exists in a texture class buffer area according to the geometric data and the first geometric sampling instruction; In the case that the texture cache does not contain corresponding preset texture data, writing the corresponding preset texture data in the second cache into the texture cache; The corresponding preset texture data obtained from the texture class buffer area is used as the first preliminary geometric texture data.

5. The method according to claim 1, wherein The determining of the first target image to be displayed and the second target image to be displayed includes: A display order of a plurality of images to be displayed is obtained, and the image to be displayed that ranks first in the display order is used as a first target image to be displayed, and the image to be displayed that ranks second in the display order is used as a second target image to be displayed.

6. An image processing device, characterized in that The device comprises: a target image to be displayed determining module, configured to determine a first target image to be displayed and a second target image to be displayed when detecting the existence of an image to be displayed; Multiple instruction acquisition modules, configured to acquire multiple first processing instructions for the first target image to be displayed and multiple second processing instructions for the second target image to be displayed; the multiple first processing instructions and the multiple second processing instructions each include geometric type prefetch instructions and sampling instructions, and pixel type prefetch instructions and sampling instructions; a target execution order determination module, configured to determine a target execution order for a plurality of first processing instructions and a plurality of second processing instructions; wherein prefetch instructions and sampling instructions of different types in the target execution order are executed in parallel; a to-be-displayed image display module, configured to execute, based on the target execution order, a plurality of first processing instructions to sequentially obtain first geometric texture data and first pixel texture data for the first target to-be-displayed image; and display the first target to-be-displayed image based on the first geometric texture data and the first pixel texture data; and execute a plurality of second processing instructions to sequentially obtain second geometric texture data and second pixel texture data for the second target to-be-displayed image; and display the second target to-be-displayed image based on the second geometric texture data and the second pixel texture data. The plurality of first processing instructions include a first geometry prefetch instruction, a first geometry sampling instruction, a first pixel prefetch instruction, and a first pixel sampling instruction; the process of executing the plurality of first processing instructions based on the target execution order to sequentially obtain first geometry texture data and first pixel texture data for the first target image to be displayed includes: determining whether corresponding geometry data exists in a geometry cache based on the first geometry prefetch instruction; if the corresponding geometry data does not exist in the geometry cache, obtaining the corresponding geometry data from a second cache and writing the data into the geometry cache; if the corresponding geometry data exists in the geometry cache, triggering execution of the first geometry sampling instruction and the first pixel prefetch instruction; obtaining first geometry texture data based on the first geometry sampling instruction; determining whether corresponding pixel data exists in a pixel cache based on the first pixel prefetch instruction; if the corresponding pixel data does not exist in the pixel cache, obtaining the corresponding pixel data from the second cache and writing the data into the pixel cache; if the corresponding pixel data exists in the pixel cache and the first geometry sampling instruction is executed, triggering execution of the first pixel sampling instruction and triggering execution of a geometry prefetch instruction for a next image to be displayed; obtaining first pixel texture data based on the first pixel sampling instruction.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Image rendering method and device, computer equipment and storage medium

    CN112381918A