Search

CN-121982153-A - Multi-shape batch rendering method suitable for GPU without hardware batch processing capability

CN121982153ACN 121982153 ACN121982153 ACN 121982153ACN-121982153-A

Abstract

The invention provides a multi-shape batch rendering method suitable for a GPU without hardware batch processing capability, which relates to the technical field of computer graphics rendering, and comprises the steps of predefining path drawing instruction templates of various graphic primitives and text characters; traversing and analyzing all the graphics and text elements to be rendered of the current frame, uniformly converting the graphics and text elements to path instruction sequences and coordinate parameters, separating and storing the instructions and the parameters in a global array, sequencing and combining all the elements according to a rendering level to generate a global instruction stream and a global parameter stream, finally packaging the complete instruction stream and the complete parameter stream into a single drawing command, and submitting the single drawing command to a GPU (graphics processing unit) through one-time calling to complete the whole frame rendering. The method can realize unified batch processing of graphics and texts on the path level, obviously reduce the times of GPU call, and greatly improve the efficiency and fluency of interface rendering on resource-constrained devices such as intelligent watches, healthy bracelets and the like.

Inventors

  • CHENG LE
  • YU RUI
  • HUANG JINHUA
  • HU WEN

Assignees

  • 翱捷科技股份有限公司

Dates

Publication Date
20260505
Application Date
20260206

Claims (10)

  1. 1. A multi-shape batch rendering method suitable for a GPU without hardware batch processing capability, comprising: The path instruction template defining step S1, predefining path drawing instruction templates of various graphic primitives and text characters; Step S2 of analyzing, namely traversing all elements to be rendered of the current frame, wherein the elements to be rendered comprise graphic elements and text elements, converting each graphic element into a path instruction sequence and coordinate parameters according to a corresponding path drawing instruction template; a separation storage step S3, in which all path instructions obtained through conversion are sequentially stored in a global instruction array, and all corresponding coordinate parameters are stored in the same order in the global parameter array; a sequencing and merging step S4, namely distributing a rendering level for each element to be rendered, and merging path instructions and coordinate parameters corresponding to all the elements to be rendered into a final global instruction stream and parameter stream in sequence according to the sequence from low to high of the rendering level; and step S5, packaging the final global instruction stream and the parameter stream into a single drawing command, and submitting the single drawing command to the GPU for rendering.
  2. 2. The method for multi-shape batch rendering for a hardware-free batch processing GPU of claim 1, wherein in step S1, the graphics primitives include line segments, quadrilaterals, triangles, circles and semi-circles, The path drawing instruction template of the line segment is constructed as a degenerate quadrangle containing 5 instructions; The quadrilateral and the semicircular path drawing instruction templates respectively comprise 5 instructions; The triangle and the circular path drawing instruction templates respectively contain 4 instructions.
  3. 3. The multi-shape batch rendering method for a GPU with no hardware batch processing capability according to claim 1 or 2, wherein in steps S1 and S2, the path drawing instruction template and the path instruction generated by the font contour parser are each composed of a plurality of preset atomic instruction types, and the atomic instruction types at least include: Moving to an instruction for defining a start point of a path or a start point of a new sub-path; line segment to instruction, which is used to draw straight line from current point to appointed point; arc to instruction, which is used to draw arc from current point to appointed point; and path end instructions for identifying the end of a complete path or group of paths.
  4. 4. The method of claim 3, wherein in step S3, the global instruction array stores integer enumeration values corresponding to the atomic instruction types, the global parameter array sequentially stores all floating point type coordinate values associated with each instruction, wherein, Said moving to instruct associating X and Y coordinates of its target point; the line segment is related to the X coordinate and the Y coordinate of the target point of the instruction; the arc to instruction associates the X coordinate and Y coordinate of the first control point and the X coordinate and Y coordinate of the second control point.
  5. 5. The method of claim 4, wherein invoking the font contour parser to convert each text character into a sequence of path instructions in step S2 comprises: the vector outline of the character is analyzed, the straight line segment is converted into the line segment to the instruction, the curve segment is converted into the arc to the instruction, the moving to instruction is inserted at the beginning of the character path, and the path ending instruction is inserted at the end of the character path.
  6. 6. The method for multi-shape batch rendering for a hardware-free batch processing GPU according to claim 1, wherein in step S4, the rendering hierarchy is a z-order value, and the step of hierarchically ordering and merging specifically comprises: S4.1, assigning a z-order value to each graphic primitive or each independent text character; S4.2, stably sequencing all the primitives and characters to be rendered according to the z-order value from small to large; And S4.3, sequentially adding the path instruction sequence of each graphic element or character to the final global instruction stream according to the ordered sequence, and adding the coordinate parameter sequence of each graphic element or character to the final global parameter stream.
  7. 7. The method according to claim 1, wherein in step S5, the GPU is a lightweight graphics processing unit that does not support hardware-level draw call batching, vertex buffer object, and triangle rasterization, supporting only path-based 2D primitive drawing commands, the single drawing command including memory address references and data length information for the global instruction stream and the global parameter stream.
  8. 8. The multi-shape batch rendering method for a hardware-free batch processing capability GPU of claim 7, wherein the lightweight graphics processing unit is a VeriSilicon VGLite architecture GPU.
  9. 9. The multi-shape batch rendering method for a hardware-free batch-capable GPU of claim 1, wherein the method is adapted to render a data visualization interface comprising a dynamic chart and a plurality of lines of text on a smart watch or a healthy wristband.
  10. 10. A computer readable storage medium storing a computer program, which when executed by a processor implements the steps of the multi-shape batch rendering method of any one of claims 1 to 9 adapted for a hardware-free batch-capable GPU.

Description

Multi-shape batch rendering method suitable for GPU without hardware batch processing capability Technical Field The invention relates to the technical field of computer graphics rendering, in particular to a multi-shape batch rendering method suitable for a GPU without hardware batch processing capability. Background Currently, highly customized lightweight 2D Graphics Processing Units (GPUs), such as VGLite of VeriSilicon, are commonly employed for low-power, small-sized smart wearable devices. Such GPU designs are intended to provide underlying graphics acceleration functions within extremely compact power consumption and area budgets, with the architecture typically having core features that support only path-based 2D primitive drawing commands, that do not include hardware rasterizers for triangle mesh processing, nor do they support standard features in modern graphics APIs such as Vertex Buffer Objects (VBOs), and more importantly, that do not provide any form of hardware-level draw call batch (draw call batching) mechanism by their hardware instruction sets and driver interfaces. Meanwhile, the main frequency of the on-chip video memory and the whole CPU of the device are limited. Under the above hardware constraints, conventional UI rendering flows face significant efficiency bottlenecks. Specifically, the application needs to define each basic graphical element (e.g., a line segment, a circle, or a triangle) in the interface individually as a rendering path, and initiate a separate GPU rendering call for each path. For text rendering, the situation is further complicated by the fact that the system font engine typically needs to rasterize each character individually into a bitmap or into a path and then initiate an independent rendering operation for each character or its corresponding bitmap tile. Thus, in a complex interface containing a simple chart and multiple lines of text, the number of draw calls for a single frame may easily reach tens or even hundreds. On a general computing platform (such as a desktop or a high-performance mobile platform), a lower-layer graphics library (such as Skia of Android) can effectively batch a large number of paths or text drawing requests by utilizing the hardware characteristics of a more powerful GPU or in a software mode, so that the communication overhead between a CPU and the GPU is greatly reduced. However, for the aforementioned lightweight wearable device GPU that only supports basic path drawing, such advanced batch processing capabilities are completely absent at the hardware and underlying drive level. The problems are that the CPU needs to frequently execute preparation work such as path construction, state switching (such as fonts and colors), command submission and the like, the calculation load is heavy, the GPU spends a great deal of time on receiving and analyzing frequent and finely divided command streams instead of focusing on actual pixel drawing work, the final result is low rendering frame rate and interface response delay, the system power consumption and bandwidth resources which are stressed are severely consumed, and the application scene requirements with higher requirements on the flow smoothness such as health monitoring dynamic dashboards, real-time data reports and the like are difficult to meet. The existing high-performance graphics rendering technology (such as a rendering pipeline based on OpenGL ES or a Unity and other game engines) is seriously dependent on triangle primitive rendering or standard texture text rendering pipeline, and the bottom implementation of the high-performance graphics rendering technology is completely incompatible with the GPU hardware architecture of the wearable device only supporting path drawing, and cannot be directly transplanted and operated. More importantly, in the prior art scheme, an effective method for performing single submission rendering on a GPU platform with limited resources and limited functions is not disclosed how to unify the isopiguanization elements such as line segments, circles and triangles with vector text characters on a path representation level and further integrate and encode the isopiguanization elements into a single instruction stream according to a visual hierarchy. Therefore, a general technical scheme capable of adapting to a GPU without hardware batch processing capability and realizing efficient fusion rendering of graphics and text is needed in the art. Disclosure of Invention Aiming at the defects in the prior art, the invention provides a multi-shape batch rendering method suitable for a GPU without hardware batch processing capability. According to the multi-shape batch rendering method suitable for the GPU without hardware batch processing capability, the scheme is as follows: in a first aspect, a multi-shape batch rendering method suitable for a hardware-free batch processing capability GPU is provided, the method comprising: The path instruction temp