A method, system, medium, and product for constructing a user interface panel.
By pre-creating and storing prefabricated instances of visual controls for the user interface panel during the game startup phase, and directly locating and configuring the panel using pre-compiled node pointer indexes, the problems of redundant loading of the user interface panel and fragmented memory allocation are solved, thereby improving the game interface response speed and user experience.
Patent Information
- Application Number
- CN202611263141.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies in game software suffer from issues such as loading redundancy, high CPU load, and fragmented memory allocation during the construction of user interface panels, leading to panel response delays and a decline in user experience.
During the game startup phase, pre-create instances of visual control prefabs with a fixed tree hierarchy and store them in an object pool. Use pre-compiled node pointer indexes to directly locate and configure the user interface panel, reducing node creation and tree structure assembly operations.
It significantly reduces panel loading latency, decreases CPU load and memory allocation frequency, improves the responsiveness and memory utilization efficiency of the user interface panel, and is suitable for mobile devices.
Smart Images

Figure CN123114575A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of game development, and in particular to a method, system, medium, and product for constructing a user interface panel. Background Technology
[0002] In the field of game software and graphical user interface development, the construction and management of user interface (UI) panels are crucial to system performance. Currently, mainstream game engines generally use a combination of "prefabs" and "node trees" to construct UI panels. Specifically, each UI panel corresponds to a prefab resource, which records a tree structure composed of multiple nodes. Nodes can mount different components to achieve functions such as image display, text rendering, and event listening. When a panel needs to be displayed, the engine dynamically loads the corresponding prefab file, parses the file content, creates node objects one by one in memory, and assembles the tree structure according to the hierarchical relationship recorded in the prefab. When the panel is closed, all the node objects it occupied are destroyed, releasing memory.
[0003] This traditional approach has the following technical drawbacks: the loading process is redundant and has huge overhead, which significantly increases CPU load, causes panel response delay, and affects user experience; node objects are repeatedly created and destroyed. During game operation, the same panel may be loaded and unloaded multiple times. Each loading requires recreating the entire node tree inside it, and each unloading requires completely destroying these nodes, making the assembly process cumbersome; the above redundant operations will directly lead to increased CPU usage and fragmented memory allocation, which in turn causes problems such as lag, overheating, and reduced battery life on mobile devices. Summary of the Invention
[0004] This application provides a method, system, medium, and product for constructing a user interface panel, which reduces panel response latency and improves user experience.
[0005] In a first aspect, this application provides a method for constructing a user interface panel, the method comprising: Construct a visual control prefab with a fixed tree-like hierarchical structure. The fixed tree-like hierarchical structure consists of outer frame nodes, mask nodes, texture nodes, and decal nodes according to a predefined parent-child relationship. Each node is a placeholder node. The access path of each node in the visual control prefab is pre-compiled and stored as a direct pointer index during construction. During the game startup phase, multiple instances of the visual control prefabs are pre-created and the node tree of each instance is fully assembled and stored in the visual control prefab object pool. The configuration file is loaded into memory. The configuration file records the configuration information of each visible part of the user interface panel in the form of key-value pairs. The configuration information includes the image resources and transformation matrix of the outer frame node, the color value and transparency of the mask node, the image resources and scaling factor of the texture node, and the decal resources and position offset of the decal node. In response to a request to display a target user interface panel, the corresponding configuration information is read from the configuration file based on the identifier of the target user interface panel, and an idle target instance is obtained from the pool of visual control prefab objects. The outer frame node, mask node, texture node, and decal node are directly located using the pre-compiled node pointer index in the target instance. The configuration information is then written into the display attributes of the corresponding nodes. The configured target instance is then mounted under the root node of the game scene to complete the display of the target user interface panel.
[0006] By adopting the above technical solution, fully assembled visual control prefab instances are pre-created and stored in an object pool during the game startup phase. When displaying the panel, idle instances are directly obtained, eliminating the need for prefab file parsing, node creation, and tree structure assembly, significantly reducing CPU load and memory allocation. Utilizing pre-compiled node pointer indexes, outer frame, mask, texture, and decal nodes can be directly located without node path searching or tree traversal, reducing configuration information writing operations to constant time complexity and significantly improving panel loading response speed. Configuration files independently store the visual parameters of each panel; the same set of visual control prefab instances can present diverse panel appearances through different configuration information, reducing the number of prefab resources and enabling hot-updating of display effects.
[0007] In some embodiments, the step of pre-creating multiple instances of the visual control prefabs and fully assembling the node tree of each instance, and storing them in a visual control prefab object pool, specifically includes: Obtain the hardware performance parameters of the currently running device, including available memory size, number of CPU cores, and GPU rendering capability level. Calculate the total capacity of the visual control prefab object pool based on the hardware performance parameters. Based on the visual complexity level of the user interface panel, the pool of visual control prefab objects is divided into multiple sub-pools. Each sub-pool corresponds to a predefined node usage mode. The node usage mode is determined based on the set of nodes that are actually enabled among the outer frame node, mask node, texture node, and decal node. For each sub-pool, based on the usage frequency statistics of various user interface panels in the historical game operation data, the demand probability of each node usage mode in the current game session is predicted, and the initial number of instances in each sub-pool is determined according to the product of the demand probability and the total capacity. Based on the initial number of instances in each sub-pool, a corresponding number of instances are pre-created, the node tree of each instance is assembled, the internal node pointer index is initialized, and the instances are stored in the corresponding sub-pool.
[0008] By adopting the above technical solution, the total capacity of the visual control prefab object pool is dynamically calculated based on the hardware parameters of the current device, such as available memory, number of CPU cores, and GPU rendering capabilities. This ensures that the pool size matches the device performance, preventing memory overload on low-end devices and maximizing resource utilization on high-end devices. The object pool is divided into multiple sub-pools according to the visual complexity of the panels, avoiding resource waste or attribute conflicts caused by panels of different complexities sharing the same type of instance, thus improving reuse efficiency and memory utilization. Based on the usage frequency of various panels in historical operational data, the demand probability of each node's usage pattern in the current session is predicted, and the initial number of instances in each sub-pool is allocated proportionally. This ensures that the instance distribution in the pool closely matches actual operational needs, reducing the overhead of dynamic expansion due to insufficient instance creation or memory waste caused by instance redundancy.
[0009] In some embodiments, loading the configuration file into memory includes: The configuration file is divided into a static configuration layer and a dynamic configuration layer. The static configuration layer records the basic visual resource identifiers shared by all user interface panels, while the dynamic configuration layer records the differentiated configuration information of each user interface panel according to the panel identifier. During the game startup phase, only the static configuration layer is loaded into memory and a static resource index table is established. When the first user interface panel is displayed for the first time, the dynamic configuration layer sub-blocks corresponding to the first user interface panel are loaded into the memory cache from external storage as needed. The first user interface panel can be any user interface panel. A differential compression algorithm is used to encode and store the configuration sub-blocks of each panel in the dynamic configuration layer. When the configuration of the second user interface panel needs to be updated, only the differential data of the panel configuration sub-blocks corresponding to the second user interface panel is transmitted and decoded. The second user interface panel can be any user interface panel. Establish a configuration prefetch queue, predict the next possible user interface panel to open based on the game scene migration probability, and preload the dynamic configuration layer sub-blocks of the possible user interface panels into the memory cache during idle time.
[0010] The above technical solution divides the configuration file into a static configuration layer and a dynamic configuration layer. Only the static configuration layer is loaded at game startup, while the dynamic configuration layer is loaded on demand, significantly reducing initial memory overhead and speeding up game startup. A differential compression algorithm is used to encode and store the configuration sub-blocks of each panel in the dynamic configuration layer. When updating a panel configuration, only the difference data is transmitted, rather than the entire configuration file, greatly reducing network bandwidth consumption and update latency, making it suitable for hot update scenarios. Based on the probability of game scene transitions, the next panel that may open is predicted, and its dynamic configuration layer sub-blocks are pre-loaded into the memory cache during idle time, ensuring configuration data is ready in advance and avoiding loading stutters when users switch panels, thus improving the smoothness of interaction.
[0011] In some embodiments, the step of directly locating the outer frame node, mask node, texture node, and decal node using the pre-compiled node pointer index in the target instance, and writing the configuration information into the display attributes of the corresponding nodes, specifically includes: The configuration information is parsed, and the attribute dependencies between the outer frame node, mask node, texture node, and decal node are extracted to construct a node attribute dependency graph. The attribute dependencies include the display area of the texture node depending on the clipping boundary of the outer frame node, the anchor point position of the decal node depending on the transformation matrix of the outer frame node, and the shape range of the mask node depending on the size of the outer frame node. Based on the node attribute dependency graph, the outer frame node, mask node, texture node, and decal node are divided into multiple writing levels, and the node attribute writing operations of different writing levels in the target instance are assigned to different worker threads for parallel execution. During the parallel writing process, lock-free memory access is performed on each node directly using the pre-compiled node pointer index in the target instance, and the write completion counter is updated through atomic operations. When all write level operations are completed, a combined completion event is triggered to notify the subsequent panel mounting steps.
[0012] By employing the above technical solution, a node attribute dependency graph is constructed by parsing configuration information, clarifying the attribute constraints between the outer frame, mask, texture, and decal nodes. This ensures that the attribute writing order conforms to the dependency logic, avoiding display errors caused by out-of-order writing. Based on the attribute dependency graph, nodes are divided into multiple writing levels, and attribute writing operations at different levels are distributed to different worker threads for parallel execution, fully utilizing multi-core CPU resources and significantly shortening the time consumed in the panel configuration stage. Pre-compiled node pointer indices are used for direct memory access to each node without the need for locking; the write completion counter is updated through atomic operations, triggering a combined completion event only once after all levels are completed, ensuring thread safety and avoiding performance losses caused by lock contention.
[0013] In some embodiments, mounting the configured target instance to the root node of the game scene includes: A render batch merging node is pre-created under the root node of the game scene. The render batch merging node maintains a dynamic rendering list to collect rendering instructions for all texture nodes and decal nodes in the user interface panel to be displayed. When the target instance is configured and ready to be mounted, the rendering data of the target instance as the outer frame node, mask node, texture node, and decal node is extracted as rendering instructions and inserted into the dynamic rendering list of the rendering batch merging node. The rendering batch merging node sorts and merges the rendering instructions in the dynamic rendering list according to the texture resource identifier, and merges the drawing calls of texture nodes and decal nodes that use the same image resources into a single GPU drawing call. When the target instance is unloaded, the corresponding rendering instruction is removed from the dynamic rendering list of the rendering batch merging node, and the incremental reordering of the rendering list is triggered to adjust the rendering order of the removed rendering instruction within a preset range.
[0014] By employing the above technical solution, rendering instructions for all texture and decal nodes in the panel are collected through a rendering batch merging node. These instructions are then sorted and merged according to texture resource identifiers. This merges multiple node draw calls using the same image resource into a single GPU draw call, significantly reducing the number of draw calls and improving rendering efficiency. When a panel is unloaded, only the corresponding rendering instructions are removed from the dynamic rendering list, triggering incremental reordering—adjusting only the rendering order of the removed instructions within a preset range, without needing to reorder the entire list, greatly reducing the computational cost during panel unloading. The rendering list updates in real-time with panel mounting and unmounting, and the merging strategy takes effect immediately. This adapts to changes in UI panels during game operation, eliminating the need to pre-generate static rendering batches and maintaining consistency between rendering optimization and UI dynamism.
[0015] In some embodiments, sorting and merging rendering instructions in the dynamic rendering list according to texture resource identifiers via the rendering batch merging node includes: Before each frame starts rendering, obtain the texture resource identifiers of all rendering instructions in the current dynamic rendering list, calculate the number of rendering instructions corresponding to each texture resource identifier, and construct a texture-instruction mapping table. Based on the node depth value of the rendering instruction, multiple rendering instructions under the same texture resource identifier are sorted by depth, so that when merging the drawing calls, the rendering instructions are drawn in order of increasing depth value to ensure the correct layer occlusion relationship. Rendering instructions that use the same texture resource identifier and are arranged consecutively after depth sorting are merged into a single GPU draw call. During the merging process, the vertex data and texture coordinate data of all related instructions are concatenated into a vertex buffer and submitted to the GPU. For rendering instructions that use different texture resource identifiers and have alternating occlusion relationships, insert explicit rendering state switching instructions during the merging process to avoid incorrect texture binding.
[0016] Using the above technical solution, before merging textures, rendering instructions under the same texture are sorted by node depth value. This ensures that the merged draw calls are executed in ascending order of depth, thereby reducing the number of draw calls while accurately restoring the original layer occlusion relationship of the UI panel. Rendering instructions using the same texture resource identifier and arranged consecutively after depth sorting are merged into a single GPU draw call, and vertex data and texture coordinate data are concatenated into a vertex buffer and submitted at once. This significantly reduces the number of times the CPU submits draw commands to the GPU, lowering rendering overhead. For rendering instructions using different texture identifiers and having alternating occlusion relationships, rendering state switching instructions are explicitly inserted during the merging process. This ensures that the GPU rebinds the correct texture resource when switching textures, preventing texture corruption or display abnormalities caused by merging optimization.
[0017] In some embodiments, sorting and merging rendering instructions in the dynamic rendering list according to texture resource identifiers via the rendering batch merging node includes: Before each frame of rendering begins, the expected lifespan of all currently displayed user interface panels is obtained. The expected lifespan is predicted based on the historical display duration statistical model of the panels or the current scene migration path. The rendering instructions corresponding to the panels whose expected lifespan is lower than a preset duration threshold are marked as transient instructions, and the rendering instructions corresponding to the panels whose expected lifespan is higher than or equal to the duration threshold are marked as persistent instructions. Based on the markers of the transient and persistent instructions, the dynamic rendering list is divided into transient and persistent regions. The rendering instructions in the persistent region are statically sorted according to the texture resource identifier and the order remains unchanged. The rendering instructions in the transient region are dynamically sorted according to the texture resource identifier. During each frame rendering, only the rendering instructions in the transient region are re-sorted and merged. At the boundary between the transient region and the persistent region, a rendering state retention instruction is inserted so that when switching between different regions, the GPU does not need to rebind the currently active texture resources and rendering pipeline states. When the number of rendering instructions in the transient region exceeds a preset merging complexity threshold, the transient region is divided into multiple sub-blocks. Each sub-block is sorted and merged independently, and explicit rendering synchronization instructions are inserted between the sub-blocks to avoid frame rendering timeouts caused by excessively long single merging operations.
[0018] Using the above technical solution, rendering instructions are marked as transient or normal based on the expected lifespan of the panel. The permanent region is statically ordered and remains unchanged, while only the transient region is dynamically reordered each frame. This significantly reduces the number of instructions that need to be sorted per frame, lowering CPU sorting time. Rendering state preservation instructions are inserted at the boundary between the transient and permanent regions, eliminating the need for the GPU to rebind texture resources and pipeline states during region switching, reducing rendering state switching overhead. When the number of transient region instructions exceeds a threshold, it is divided into multiple independent sub-blocks for parallel processing. Rendering synchronization instructions are inserted between sub-blocks to avoid excessively long single merging operations that could cause frame rendering timeouts, ensuring frame rate stability.
[0019] In a second aspect, embodiments of this application provide a computer system including a memory, a processor, and a computer program stored in the memory; the processor executes the computer program to implement the steps of the method described in any possible implementation of the first aspect.
[0020] Thirdly, embodiments of this application provide a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the method described in any possible implementation of the first aspect.
[0021] Fourthly, embodiments of this application provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the method described in any possible implementation of the first aspect.
[0022] It is understood that the computer system provided in the second aspect, the storage medium provided in the third aspect, and the computer program product provided in the fourth aspect are all used to execute the method provided in this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.
[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. During the game startup phase, multiple complete visual control prefab instances are pre-created and stored in an object pool. When the panel is displayed, the pre-assembled instances are directly retrieved from the pool, without any node creation or tree structure assembly operations. This completely avoids the CPU-intensive operations caused by prefab file parsing and dynamic node generation, significantly reduces panel loading latency, and reduces runtime memory allocation frequency, alleviating memory fragmentation issues. 2. During configuration, the target node is located directly by pointer, eliminating the need for traversal or string matching, thus reducing the time complexity of attribute writing operations. This significantly speeds up the configuration process before the panel is displayed, especially in scenarios with frequent panel switching. 3. When displaying the panel, the corresponding image resources, transformation matrices, color values, and other parameters are read from the configuration file and dynamically written into the node attributes of the prefab instance. This allows the same set of prefab instances to present multiple appearances through different configurations, greatly reducing the number of prefab resources and the size of the game package; it also facilitates dynamic modification of configurations at runtime without reloading or rebuilding any prefabs. 4. When a panel is unloaded, the prefab instance is returned to the pool for reuse by subsequent panels, rather than being destroyed as a node. This avoids memory jitter and GC pressure caused by frequent node creation / destruction. On low-end mobile devices, it can support smooth switching of more UI panels with less memory. 5. During game startup, the creation, assembly, and pooling of visual control prefabs are completed in one go. Subsequent initial displays of any panel no longer require waiting for prefab loading and parsing. Simultaneously, the configuration file can be loaded into memory upon startup and remain resident; when switching panels, only the configuration file needs to be read and the prefab instance properties modified. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating the method for constructing the user interface panel in an embodiment of this application; Figure 2 This is a schematic diagram illustrating the process of mounting the target instance to the root node of the game scene in this embodiment of the application; Figure 3 This is a schematic diagram of an exemplary hardware structure of a computer system in an embodiment of this application. Detailed Implementation
[0025] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0026] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0027] The following is combined Figure 1 The method of the embodiments of this application will be described below.
[0028] Please see Figure 1 This is a flowchart illustrating the method for constructing the user interface panel in an embodiment of this application. Figure 1 As shown, the method includes the following steps: S101. Construct a visual control prefab with a fixed tree-like hierarchical structure. The fixed tree-like hierarchical structure consists of outer frame nodes, mask nodes, texture nodes, and decal nodes according to a predefined parent-child relationship. Each node is a placeholder node. The access path of each node in the visual control prefab is pre-compiled and stored as a direct pointer index during construction. S102. During the game startup phase, multiple instances of the visual control prefab are pre-created and the node tree of each instance is fully assembled and stored in the visual control prefab object pool. S103. Load the configuration file into memory. The configuration file records the configuration information of each visible part of the user interface panel in the form of key-value pairs. The configuration information includes the image resources and transformation matrix of the outer frame node, the color value and transparency of the mask node, the image resources and scaling factor of the texture node, and the decal resources and position offset of the decal node. S104. In response to the request to display the target user interface panel, read the corresponding configuration information from the configuration file according to the identifier of the target user interface panel, and obtain an idle target instance from the visual control prefab object pool. S105. Using the pre-compiled node pointer index in the target instance, directly locate the outer frame node, mask node, texture node, and decal node, and write the configuration information into the display attributes of the corresponding nodes respectively. Then, mount the configured target instance to the root node of the game scene to complete the display of the target user interface panel.
[0029] The visual control prefab differs from traditional prefabs in that its tree-like hierarchical structure is fixed and cannot be dynamically expanded. It consists of only four predefined types of nodes arranged in a parent-child relationship: the outer frame node, the mask node, the texture node, and the decal node. The outer frame node is the root node, with the mask, texture, and decal nodes acting as its children, or even deeper levels of children. The specific hierarchy can be pre-defined by the engine (e.g., the outer frame node contains the mask node, which in turn contains the texture and decal nodes). These four nodes are placeholder nodes; they do not contain any specific display resources (such as image files, color values, scaling parameters, etc.) but only provide interfaces for display attributes. Crucially, during the construction of this visual control prefab, the system pre-compiles the access paths of each node and stores the memory address or index of each node as a direct pointer. This means that at runtime, instead of recursively searching for a node by its name or matching strings to locate it, a node can be accessed directly through pre-compiled pointer indices in constant time (O(1)). This design lays the foundation for efficient property writing later. This four-layer abstraction (outer frame, mask, texture, decal) is the smallest complete base set, capable of covering the visual requirements of all UI panels.
[0030] During game startup (i.e., game initialization), multiple instances of the aforementioned visual control prefabs are pre-created. Each instance has a fixed tree hierarchy, with the corresponding node tree fully created in memory, completing the allocation of node objects and the assembly of parent-child relationships. All nodes within each instance are initialized according to pre-compiled pointer indices and can be accessed directly through pointers. These fully assembled instances are stored in a visual control prefab object pool. The management mechanism of the visual control prefab object pool can be first-in-first-out, last-in-first-out, or other conventional pooling strategies. Its capacity (i.e., the number of pre-created instances) can be statically configured or dynamically adjusted according to the hardware performance of the target device (such as memory size and CPU capability). By pre-creating and assembling, frequent disk reads and parsing of prefab files and dynamic assembly of node trees during game execution are avoided.
[0031] A separate configuration file is loaded into memory and kept resident. This configuration file uses a structured format (such as JSON, XML, or binary key-value pairs), which records all configuration information for the visible parts of each user interface panel in key-value pairs. Specifically, for each panel, the configuration information includes at least: the image resource identifier (such as image file path, atlas ID) and transformation matrix (used to control position, scaling, rotation, etc.) for the outer frame node; the color value (RGBA) and transparency for the mask node; the image resource identifier and scaling factor for the texture node; and the decal resource identifier and position offset for the decal node. The configuration file can be organized as follows: panel identifier (such as panel name or ID) as the key, and a corresponding set of configuration parameters as the value. This file can be distributed with the resource package during game installation or can be hot-updated over the network at runtime. Because the configuration file is independent of the visual control prefabs, complete decoupling of templates and data is achieved. This separation allows the same template to present completely different appearances through different configuration files, and modifying the configuration file does not require recompiling or replacing any prefab resources.
[0032] When the game logic requires displaying a target user interface panel (such as a login screen or settings screen), the system triggers a display request. In response to this request, the system searches for and reads the corresponding configuration information from the configuration file based on the identifier of the target panel (such as a string ID). An idle visual control prefab instance is obtained from the visual control prefab object pool. Idle means that the instance is not currently used by any panel, and although its node tree exists, its display attributes may still retain the old configuration from the last use. The object pool can use a simple marking method to manage the busy / idle status of each instance and select an idle instance to return according to a predetermined strategy (such as cyclic allocation, least-used priority, etc.). It is worth noting that this step does not involve any node creation or tree structure assembly; it only reads configuration data and obtains existing instances. This is fundamentally different from the traditional solution, which requires dynamically loading prefab files and creating node trees every time a panel is displayed. After obtaining the target instance, the system uses the pre-compiled node pointer index in the instance to directly locate the outer frame node, mask node, texture node, and decal node in O(1) time complexity. Since the pointer index is initialized during instantiation, there is no need to traverse or search by node name. Then, the read configuration information is written into the display properties of the corresponding nodes. For example: the outer frame image resource in the configuration is set to the image component of the outer frame node; the transformation matrix is applied to the transformation property of this node; the color and transparency of the mask node are assigned to its material or rendering component; the image resource and scaling factor of the texture node are set to the corresponding properties of the texture node; and the decal resource and position offset of the decal node are set to the display properties of the decal node. Since each node property was originally a placeholder (without concrete resources), writing it completes the personalized configuration of the visible part of the panel. This process only involves modifying properties in memory and does not involve disk I / O or node creation. The configured target instance (i.e., the node tree with correct display properties) is mounted to the root node of the game scene, making it part of the scene and thus displayed. At this point, the display process of the target user interface panel is complete. When the panel is no longer needed (e.g., when the user closes the panel), the corresponding unloading process can be executed: the target instance is removed from the scene root node, its display properties are cleared or reset to a placeholder state, and then the instance is returned to the visual control prefab object pool for reuse by other panels later. The unloading process does not destroy the instance itself or any of its internal nodes; only the usage rights are revoked.
[0033] In some embodiments, the step of pre-creating multiple instances of the visual control prefabs and fully assembling the node tree of each instance, and storing them in a visual control prefab object pool, specifically includes: Obtain the hardware performance parameters of the currently running device, including available memory size, number of CPU cores, and GPU rendering capability level. Calculate the total capacity of the visual control prefab object pool based on the hardware performance parameters. Based on the visual complexity level of the user interface panel, the pool of visual control prefab objects is divided into multiple sub-pools. Each sub-pool corresponds to a predefined node usage mode. The node usage mode is determined based on the set of nodes that are actually enabled among the outer frame node, mask node, texture node, and decal node. For each sub-pool, based on the usage frequency statistics of various user interface panels in the historical game operation data, the demand probability of each node usage mode in the current game session is predicted, and the initial number of instances in each sub-pool is determined according to the product of the demand probability and the total capacity. Based on the initial number of instances in each sub-pool, a corresponding number of instances are pre-created, the node tree of each instance is assembled, the internal node pointer index is initialized, and the instances are stored in the corresponding sub-pool.
[0034] During game startup or the first run after installation, the system obtains the hardware performance parameters of the currently running device. These parameters include at least: Available memory size: This refers to the amount of memory the system can allocate to the game process, usually measured in megabytes (MB) or gigabytes (GB). The larger the available memory, the more prefab instances the object pool can hold; conversely, the pool size needs to be limited to avoid memory overflow. Number of CPU cores: This includes the number of large cores (performance cores) and small cores (efficiency cores). The more cores, the more tasks the system can process in parallel, and the larger the object pool can be, as the initial assembly of instances and subsequent parallel writing can benefit from multi-core concurrency. GPU rendering capability level: This can be evaluated through device model, GPU manufacturer and driver version, or through runtime rendering tests (such as frame buffer size, supported texture compression formats, etc.) to determine a level (e.g., low, medium, high). GPU capability affects the complexity of panel rendering and the acceptable number of nodes, indirectly affecting the reasonable capacity of the object pool. Based on the above hardware parameters, the system uses a pre-defined calculation model (e.g., empirical formulas or lookup tables) to determine the total capacity of the visual control prefab object pool. An exemplary calculation formula is: Total capacity = base_capacity × (mem_factor × mem_weight + cpu_factor × cpu_weight + gpu_factor × gpu_weight), where base_capacity is the base capacity (which can be set according to the expected complexity of the game's UI panel), mem_factor, cpu_factor, and gpu_factor are normalization factors that map memory size, CPU core count, and GPU level to the range of 0 to 1, respectively, and mem_weight, cpu_weight, and gpu_weight are the weight coefficients of each factor, which can be optimized based on actual testing. This calculation results in a smaller pool capacity on low-end devices (avoiding memory pressure) and a larger pool capacity on high-end devices (fully utilizing hardware resources and reducing the overhead of dynamic expansion).
[0035] Not all UI panels require all four node layers (outer frame, mask, texture, and decal). For example, a simple pop-up panel might only need an outer frame and texture (button text), without a mask and decal; while a character details panel might require all four layers. Therefore, this embodiment divides the object pool into multiple sub-pools based on the visual complexity level of the user interface panel. Each sub-pool corresponds to a predefined node usage mode, which is uniquely determined by the set of nodes actually enabled among the outer frame node, mask node, texture node, and decal node. Specifically, the node usage mode can be represented by a four-bit binary mask, where each bit represents whether a node layer is enabled. For example: Mode A (mask 1001): only the outer frame and decal are enabled; Mode B (mask 1110): the outer frame, mask, and texture are enabled, but decals are not enabled; Mode C (mask 1111): all four node layers are enabled. Each sub-pool specifically stores visual control prefab instances with the same node usage mode. The advantages of doing this are: avoiding resource waste: if a panel only needs an outer frame and texture, but is obtained from a full-featured instance that includes a mask and decals, it will result in two unused node layers in memory, wasting memory and subsequent attribute modification time; reducing attribute conflicts: the internal node layout of instances is different between different modes, and mixing them may lead to writing invalid nodes or logical errors.
[0036] During gameplay, the game collects user behavior data, including the frequency of each UI panel being opened and the duration of each display. This data can be statistically analyzed by game session or by time window to form historical game operation data. Using this data, the system can predict the demand probability of various node usage modes in the current game session. For example, assuming that according to historical statistics, panels corresponding to mode A (outer frame + decals) (such as notification prompts) account for 30% of all panel openings, panels corresponding to mode B (outer frame + mask + texture) (such as regular pop-ups) account for 50%, and panels corresponding to mode C (all four layers) (such as character development interfaces) account for 20%, then the demand probabilities of each node usage mode are 0.3, 0.5, and 0.2, respectively. The initial number of instances in each sub-pool is determined by multiplying the demand probability of each mode by the total capacity. That is: initial number of instances in sub-pool i = round(total capacity × demand probability of mode i), where round is a rounding function (rounding up, rounding down, or rounding to the nearest integer can be selected according to the actual situation to ensure that the total number does not exceed the total capacity). If the summation is slightly less than the total capacity, the surplus can be allocated to the sub-pool with the highest demand probability; if it is slightly more, it is deducted from the sub-pool with the lowest demand probability. In this way, the distribution of instances in the object pool matches the actual UI usage habits, ensuring that there are enough instances available for allocation in high-frequency modes, while avoiding the waste of memory by pre-creating too many instances for low-frequency modes.
[0037] Based on the initial number of instances in each sub-pool, a corresponding number of visual control prefab instances are pre-created. For each instance, the following operations are performed: (1) Node tree assembly: Build a node tree according to the node usage mode corresponding to the sub-pool. Since the node set for each mode is predefined, the assembly process is to create a corresponding number of node objects and establish parent-child relationships. For example, for mode A (outer frame only + decal), the created node tree only has outer frame nodes and decal nodes (decal nodes are child nodes of the outer frame), and no mask and texture nodes are created. (2) Internal node pointer index initialization: During the assembly process, a direct pointer index is generated for each node in the instance and stored in the instance's internal table for quick node location. The pointer index generation method is consistent with the pre-compilation method of the visual control prefab, that is, recording the memory address or relative offset of each node. (3) Storage in sub-pool: Push the assembled and pointer index initialized instances into the corresponding sub-pool and mark them as idle. When a target UI panel needs to be displayed, the system first determines the node usage mode to which it belongs based on the visual complexity of the panel (this information can be pre-recorded in the configuration file or inferred from the panel identifier), and then obtains an idle instance from the corresponding sub-pool. If there are no idle instances in the corresponding sub-pool (i.e., all instances are in use), the system can adopt a dynamic scaling strategy (creating a new instance and adding it to the sub-pool) or wait for an instance to be returned before allocating it.
[0038] In some embodiments, loading the configuration file into memory includes: The configuration file is divided into a static configuration layer and a dynamic configuration layer. The static configuration layer records the basic visual resource identifiers shared by all user interface panels, while the dynamic configuration layer records the differentiated configuration information of each user interface panel according to the panel identifier. During the game startup phase, only the static configuration layer is loaded into memory and a static resource index table is established. When the first user interface panel is displayed for the first time, the dynamic configuration layer sub-blocks corresponding to the first user interface panel are loaded into the memory cache from external storage as needed. The first user interface panel can be any user interface panel. A differential compression algorithm is used to encode and store the configuration sub-blocks of each panel in the dynamic configuration layer. When the configuration of the second user interface panel needs to be updated, only the differential data of the panel configuration sub-blocks corresponding to the second user interface panel is transmitted and decoded. The second user interface panel can be any user interface panel. Establish a configuration prefetch queue, predict the next possible user interface panel to open based on the game scene migration probability, and preload the dynamic configuration layer sub-blocks of the possible user interface panels into the memory cache during idle time.
[0039] In traditional solutions, the configuration information (image resources, position, color, etc.) of each UI panel is usually bound to its prefab file, or the configuration of all panels is stored in a single large file. This results in the need to load all configurations at startup, leading to high memory consumption and inconvenient updates. To address this issue, this application first logically layers the configuration file into a static configuration layer and a dynamic configuration layer. The static configuration layer records basic visual resource identifiers shared by all user interface panels. For example, the default background image used by all buttons in the game, the border style used uniformly by all pop-ups, and the global font color. This information is shared by all panels and does not change with different panels. The content of the static configuration layer typically does not change during game execution. The dynamic configuration layer records differentiated configuration information for each user interface panel according to panel identifiers (such as panel ID or name). The differentiated configuration information of each panel is stored independently as a sub-block, which specifically includes parameters such as the panel's outer frame node image resources, mask color, texture resources, and decal resources (consistent with the configuration information content described in the independent claims). The sub-blocks of the dynamic configuration layer are independent of each other and can be loaded, updated, or unloaded individually.
[0040] During game startup, the system loads only the static configuration layer into memory and establishes a static resource index table. This table is used for quick location of globally shared resources, such as directly locating the corresponding image file handle or memory address using a resource identifier. Since the static configuration layer typically contains very little data (only shared resource identifiers), the memory overhead and loading time at startup are very low. For the dynamic configuration layer, the system does not load it all at once. Instead, it uses an on-demand loading strategy: when a user interface panel (called the first user interface panel, which can be any panel) is first displayed, the system loads the corresponding dynamic configuration layer sub-block from external storage (such as disk, ROM, or resource packs) into the memory cache. After loading, the sub-block is cached in memory for direct use when the same panel is displayed again, without needing to be reloaded. For example, after the game starts, if the user first opens the login screen, the system loads the dynamic configuration sub-block for the login screen; then, if the user enters the character development screen, the system loads the dynamic configuration sub-block for the character development screen. Panels that are never opened will never have their configuration sub-blocks loaded, thus avoiding memory waste. On-demand loading can be implemented in conjunction with a cache management mechanism: when the memory cache reaches a certain threshold, strategies such as LRU (Least Recently Used) are used to evict panel configuration sub-blocks that have not been used for a long time, thereby freeing up memory.
[0041] In the long-term operation of a game, the configuration of the UI panel may need to be adjusted frequently (e.g., changing skins for holiday events, correcting texture errors, A / B testing different styles). Traditional solutions often require redistributing the entire configuration file or replacing the entire prefab resource, resulting in high bandwidth consumption and update latency. This application's embodiment uses a differential compression algorithm to encode and store the configuration sub-blocks of each panel in the dynamic configuration layer. Specifically, each panel configuration sub-block does not store complete configuration data, but rather saves difference data relative to a base version. The base version can be the initial configuration that comes with the game during installation, or the complete configuration after the last update. When it is necessary to update the configuration of a certain user interface panel (called the second user interface panel, which can be any panel), the server only transmits the difference data (i.e., the changed parts) of that panel configuration sub-block. After receiving the difference data, the client decodes and merges it with the current panel configuration sub-block in memory (if cached) or the base version to obtain a new complete configuration sub-block, and updates it in the memory cache. The differential compression algorithm can use common binary differential algorithms (such as bsdiff, xdelta) or structured differential methods based on JSON Patch, depending on the format of the configuration file. By using differential transmission, network traffic can be reduced to one-tenth or even less of the full configuration, significantly improving update speed. Furthermore, since the content of the static configuration layer rarely changes, its updates can be handled individually (e.g., by version number verification, with a complete replacement if necessary), or processed using the same differential compression method.
[0042] While on-demand loading saves memory, it can cause brief stutters when users quickly switch panels, requiring a wait for configuration loading upon first opening. To further optimize the user experience, this application establishes a configuration prefetch queue. The basic principle of the configuration prefetch queue is to predict the next likely user interface panel to open based on the game scene transition probability. The game scene transition probability can be obtained in the following ways: based on preset game flow logic (e.g., a reward panel is likely to open after completing a level; a product list panel is likely to open after clicking the "Shop" button); based on historical operation statistics (the behavior patterns of the same player in different game sessions, or aggregate statistics of all players); using lightweight prediction models such as Markov chains to calculate the transition probability based on the current scene and recent operation sequence. When the system is idle (e.g., when CPU load is low, network is idle, or no panel switching occurs), it proactively preloads the dynamic configuration layer sub-blocks corresponding to panels with high predicted probabilities from external storage into the memory cache. After loading, the configuration data of the panel is ready in the cache. When the user actually opens the panel, the configuration information in memory can be read directly without waiting for disk I / O, thus achieving instant response. Managing the prefetch queue requires consideration of priority and concurrency limits: a prefetch queue of finite size can be maintained, sorted by predicted probability, and preloaded sequentially, while avoiding excessive concurrent preloading tasks that could impact main thread performance. Preloaded but ultimately unused panel configuration sub-blocks can be periodically cleaned up by a cache eviction mechanism.
[0043] In some embodiments, the step of directly locating the outer frame node, mask node, texture node, and decal node using the pre-compiled node pointer index in the target instance, and writing the configuration information into the display attributes of the corresponding nodes, specifically includes: The configuration information is parsed, and the attribute dependencies between the outer frame node, mask node, texture node, and decal node are extracted to construct a node attribute dependency graph. The attribute dependencies include the display area of the texture node depending on the clipping boundary of the outer frame node, the anchor point position of the decal node depending on the transformation matrix of the outer frame node, and the shape range of the mask node depending on the size of the outer frame node. Based on the node attribute dependency graph, the outer frame node, mask node, texture node, and decal node are divided into multiple writing levels, and the node attribute writing operations of different writing levels in the target instance are assigned to different worker threads for parallel execution. During the parallel writing process, lock-free memory access is performed on each node directly using the pre-compiled node pointer index in the target instance, and the write completion counter is updated through atomic operations. When all write level operations are completed, a combined completion event is triggered to notify the subsequent panel mounting steps.
[0044] Before writing the configuration information to each node, the configuration information read from the configuration file is parsed. The configuration information includes the attribute parameters of the outer frame node, mask node, texture node, and decal node (such as image resources, transformation matrix, color value, scaling factor, position offset, etc.). However, the attributes of these nodes are not independent of each other, but are interdependent. In the visual effect of a UI panel, the attribute dependencies between nodes include at least the following: (1) The display area of the texture node depends on the clipping boundary of the outer frame node: The texture node (such as the icon on the button) usually needs to be restricted within the range of the outer frame node, and the part that exceeds the limit should be clipped. Therefore, the final display area of the texture node is determined by the clipping boundary of the outer frame node. If the image and scaling information of the texture node are written first, and then the clipping boundary of the outer frame node is modified, the effective display area of the texture node may be incorrect and needs to be recalculated. (2) The anchor point position of the decal node depends on the transformation matrix of the outer frame node: The position of the decal node (such as the decorative corner mark) is usually positioned relative to the outer frame node. The transformation matrix (including translation, rotation, and scaling) of the outer frame node directly affects the final world coordinates of the decal node. Therefore, the position offset of the decal node can only be correctly calculated and applied after the transformation matrix of the outer frame node is determined. (3) The shape range of the mask node depends on the size of the outer frame node: The mask node is used to achieve effects such as circular headshots and gradient masks. Its shape range (such as rectangular area and circular radius) usually needs to match the size of the outer frame node. If the size of the outer frame node changes, the shape range of the mask node also needs to be adjusted accordingly. In order to correctly handle these dependencies, a node attribute dependency graph is first constructed. This dependency graph is a directed acyclic graph (DAG), where nodes: represent the attribute fields of each node (such as "outer frame.transformation matrix", "texture.display area", "decal.anchor point position", etc.); directed edges: represent the dependency relationship between attributes, that is, the dependent attribute must be written before the dependent attribute. For example: "texture.display area" ← "outer frame.clipping boundary", "decal.anchor point position" ← "outer frame.transformation matrix", "mask.shape range" ← "outer frame.size". In addition, other indirect dependencies may exist, such as the scaling factor of a texture node depending on the size of the outer frame node (maintaining proportions), but these can be extended in specific implementations. The system automatically generates a dependency graph by parsing predefined or dynamically identified dependencies in the configuration information.
[0045] After constructing the dependency graph, the system divides the attribute writing operations of the outer frame nodes, mask nodes, texture nodes, and decal nodes into multiple writing levels according to the topological order in the graph. Attribute writing operations within the same level have no dependencies on each other, so they can be safely executed in parallel; operations at different levels must be executed sequentially according to their dependencies. For example, based on the above dependencies, it can be divided into: Level 1: Writing basic attributes such as the clipping boundary, transformation matrix, and size of the outer frame node (because other nodes depend on these attributes). Level 2: Writing the display area of the texture node (dependent on the outer frame clipping boundary), the anchor point position of the decal node (dependent on the outer frame transformation matrix), and the shape range of the mask node (dependent on the outer frame size). These operations all depend on the results of Level 1, but have no cross-dependencies on each other, so they can be executed in parallel. To fully utilize the computing power of modern multi-core CPUs, the system distributes attribute writing operations at different writing levels to different worker threads for parallel execution. Specifically: the first-level write operations can be executed on the main thread or a separate worker thread; the individual write tasks (textures, decals, masks) in the second level are submitted to idle worker threads in the thread pool for concurrent execution. Multiple independent write operations within the same level can proceed simultaneously without locking, as they are independent of each other. For different levels, a synchronization mechanism ensures the order between levels (e.g., the second level begins only after the first level is completed).
[0046] During parallel writing, each worker thread needs to efficiently access node attributes in the target instance. Since node pointer indices (direct memory addresses or offsets) have been pre-compiled for each visual control prefab instance, worker threads can directly access memory through these indices without using mutex locks. This is because different threads are writing attribute fields of different nodes (e.g., one thread writes a texture node, another writes a decal node), eliminating data contention. If different attribute fields within the same node are written by multiple threads (an extreme case), the hierarchical partitioning in this solution avoids this situation; all attribute writes for the same node are completed by a single thread within the same hierarchy. Therefore, this embodiment achieves lock-free memory access, eliminating the performance overhead caused by lock waiting.
[0047] To coordinate the completion progress of each level and notify subsequent panel mounting steps, the system maintains a write completion counter. The initial value of the counter is set to the number of write tasks to be executed at the current level. After each task is completed, the worker thread decrements the counter value through atomic operations (such as fetch_and_decrement). When the counter value reaches zero, it indicates that all write operations at the current level have been completed. If there is a next level, the write tasks for the next level are woken up or submitted, and the counter is reinitialized. If all write operations at all levels have been completed (i.e., the final level counter reaches zero), a combined completion event is triggered. This event is a lightweight callback or signal used to notify subsequent operations: "All node attributes of the target instance have been correctly configured, and the mounting step can be executed." The combined completion event can be implemented using condition variables, semaphores, or task continuation-based methods, depending on the game engine's thread model. In this way, while ensuring the correct order of attribute writing, write operations are parallelized to the greatest extent, and completion notifications are passed to the next stage in an event-driven manner, avoiding busy waiting or polling by the main thread.
[0048] Figure 2 This is a schematic diagram illustrating the process of mounting the target instance to the root node of the game scene in this embodiment of the application, as shown below. Figure 2 As shown, mounting the configured target instance to the root node of the game scene includes the following steps: S201. A rendering batch merging node is pre-created under the root node of the game scene. The rendering batch merging node maintains a dynamic rendering list to collect rendering instructions for all texture nodes and decal nodes in the user interface panel to be displayed. S202. When the target instance is configured and ready to be mounted, the rendering data of the target instance as the outer frame node, mask node, texture node, and decal node is extracted as rendering instructions and inserted into the dynamic rendering list of the rendering batch merging node. S203. The rendering batch merging node sorts and merges the rendering instructions in the dynamic rendering list according to the texture resource identifier, and merges the drawing calls of texture nodes and decal nodes that use the same image resources into one GPU drawing call. S204. When the target instance is unloaded, the corresponding rendering instruction is removed from the dynamic rendering list of the rendering batch merging node, and the incremental reordering of the rendering list is triggered to adjust the rendering order of the removed rendering instruction within a preset range.
[0049] During the game scene initialization phase (e.g., at startup or when the UI root node is first created), a special node called the render batch merge node is pre-created under the game scene's root node. This node does not carry any specific display content but is a logical management node that maintains a dynamic rendering list. The dynamic rendering list is used to collect rendering instructions from texture nodes and decal nodes in all currently displayed user interface panels. Each rendering instruction contains at least the following information: texture resource identifier (e.g., image resource ID or texture handle), node depth value (used to determine layer occlusion order), vertex data, texture coordinate data, transformation matrix, etc. The render batch merge node exists independently of specific UI panels; it persists throughout the entire game runtime and is responsible for the unified management of rendering for all UI panels displayed using this method. After configuring the target instance (i.e., the visual control prefab instance) (writing the properties in the configuration file to each node), the instance has the correct display properties and is ready to be mounted to the scene for display. At this point, the system does not directly add the instance's node tree to the scene's normal rendering pipeline but first extracts its rendering instructions. The specific operation is as follows: Traverse the outer frame nodes, mask nodes, texture nodes, and decal nodes in the target instance. For texture nodes and decal nodes (because these two types of nodes are responsible for the actual image drawing; outer frame and mask nodes may also contain rendering content, but in this solution, the effects of the outer frame and mask have already been indirectly achieved through textures and decals or used as an auxiliary; to simplify the merging, the drawing calls of texture and decal nodes are mainly merged), extract their current rendering data and generate one or more rendering instructions. Each rendering instruction includes: texture resource identifier (e.g., the path of the image file used by the node or its ID in the atlas); node depth value (i.e., the rendering order of the node in the UI tree; nodes with smaller depth values are drawn first, at the bottom layer; nodes with larger depth values are drawn later, at the top layer); vertex data (the position coordinates of the four vertices of the node's rectangle); texture coordinates (UV coordinates); other rendering states (blending mode, color overlay, etc.). After generating the rendering instruction, the system inserts the instruction into the dynamic rendering list maintained by the rendering batch merging node. Rendering instructions for multiple panels are appended to the same list, forming a global instruction set to be rendered.
[0050] Before the rendering phase of each frame begins (or at an appropriate time after changes to the dynamic rendering list), the render batch merging node performs sorting and merging operations on the rendering instructions in the dynamic rendering list. Sorting: First, all rendering instructions are grouped according to their texture resource identifiers (instructions with the same texture are grouped together); then, within the same group, they are sorted by node depth values from smallest to largest to ensure that the merged draw calls correctly reproduce the occlusion relationships of layers (thinner depth instructions are drawn first, and deeper depth instructions are drawn later). Merging: For rendering instructions with the same texture resource identifier and consecutively arranged after depth sorting, they are merged into a single GPU draw call. The specific merging method is as follows: the vertex data and texture coordinate data carried by each of the original multiple instructions are concatenated into a large vertex buffer, and then submitted to the GPU for drawing all at once. Because the textures are the same and drawn consecutively, the GPU does not need to switch textures; it only needs one draw call to complete the work that would otherwise require multiple draw calls. Through this merging, for example, 10 button icons using the same image that originally required 10 draw calls can be merged into only 1, significantly reducing the number of draw calls and substantially lowering the overhead of CPU submitting draw commands and GPU state switching overhead.
[0051] When a user interface panel is no longer needed and is uninstalled (e.g., when a user closes a pop-up or switches scenes), the system needs to remove the rendering instructions corresponding to that panel from the dynamic rendering list of the rendering batch merging node to avoid rendering a panel that no longer exists. Specifically, based on the index or identifier recorded during insertion, the system locates the position of all rendering instructions for that panel in the dynamic rendering list and deletes them. After deletion, the length of the dynamic rendering list shortens, and "gaps" may appear in the originally continuous instruction sequence. To maintain the correctness of subsequent rendering and merging efficiency, this embodiment triggers incremental reordering. Unlike completely reordering the entire list, incremental reordering only adjusts the rendering order of the removed rendering instructions within a preset range. The preset range can be set to: from the first K instructions to the last K instructions (e.g., K=5 or 10), or, based on the linked list structure, only the affected adjacent nodes are relinked. Since the dynamic rendering list is originally ordered by texture and depth, removing a small number of instructions usually only affects the local order of its neighboring areas. Therefore, only local adjustments are needed to restore order, without having to perform a full sort of the entire list in O(n log n), saving significant computational resources. After incremental rearrangement is complete, the dynamically rendered list is restored to an ordered state, and subsequent sorting and merging operations can continue to be performed based on this list.
[0052] In some embodiments, sorting and merging rendering instructions in the dynamic rendering list according to texture resource identifiers via the rendering batch merging node includes: Before each frame starts rendering, obtain the texture resource identifiers of all rendering instructions in the current dynamic rendering list, calculate the number of rendering instructions corresponding to each texture resource identifier, and construct a texture-instruction mapping table. Based on the node depth value of the rendering instruction, multiple rendering instructions under the same texture resource identifier are sorted by depth, so that when merging the drawing calls, the rendering instructions are drawn in order of increasing depth value to ensure the correct layer occlusion relationship. Rendering instructions that use the same texture resource identifier and are arranged consecutively after depth sorting are merged into a single GPU draw call. During the merging process, the vertex data and texture coordinate data of all related instructions are concatenated into a vertex buffer and submitted to the GPU. For rendering instructions that use different texture resource identifiers and have alternating occlusion relationships, insert explicit rendering state switching instructions during the merging process to avoid incorrect texture binding.
[0053] Before rendering begins for each frame (i.e., before actual GPU drawing), the render batch merging node first retrieves all rendering instructions in the current dynamic rendering list. Each rendering instruction corresponds to a texture node or decal node in a UI panel, carrying the texture resource identifier used by that node (e.g., texture object pointer, image file hash, or atlas ID). To efficiently group and process instructions, the system iterates through all instructions in the dynamic rendering list, counts the number of rendering instructions corresponding to each different texture resource identifier, and constructs a texture-instruction mapping table. This mapping table can be a hash table (HashMap) or a dictionary structure, where the key is the texture resource identifier and the value is the list of rendering instructions belonging to that texture (or the index range of these instructions in the dynamic rendering list). The time complexity of constructing the mapping table is O(N), where N is the total number of instructions in the dynamic rendering list. The mapping table not only records the instruction set corresponding to each texture but can also include the number of instructions in that set, providing a data basis for subsequent merging decisions. After obtaining the rendering instruction list corresponding to each texture, the system sorts multiple rendering instructions under the same texture resource identifier according to their node depth value. Node depth values reflect the rendering order of the node in the UI tree: smaller depth values indicate that the node is visually closer to the "bottom layer" (drawn first); larger depth values indicate that the node is closer to the "top layer" (drawn later). Correct layer occlusion requires the bottom layer to be drawn first, and the top layer to be drawn later; otherwise, the top layer content may be covered by the bottom layer, or incorrect semi-transparent blending results may occur. The instruction list corresponding to each texture is sorted in ascending order of node depth values. The sorting algorithm can be quicksort or mergesort. Since the number of instructions corresponding to each texture is usually small, the sorting overhead is controllable. After sorting, instructions for the same texture are arranged from bottom to top, preparing for subsequent merging. It should be noted that instructions between different textures do not need global depth sorting because drawing calls for different textures inevitably involve texture switching (i.e., different GPU rendering states). Even if the depths are interleaved, state switching is still needed to ensure correctness. Depth sorting within the same texture ensures that primitives are drawn in the correct order when merging drawing calls, avoiding occlusion errors within the same texture.
[0054] After depth sorting, rendering instructions under the same texture resource identifier are arranged in ascending order of depth value. At this point, the system merges consecutively arranged portions of these instructions into a single GPU draw call. "Consecutively arranged" means that in the final order of the dynamic rendering list (after sorting), multiple instructions belonging to the same texture are adjacent to each other, without any instructions from other textures inserted in between. The specific merging operation is as follows: A new vertex buffer is created, large enough to hold all vertex data and texture coordinate data from these instructions; the list of instructions to be merged is traversed, and the vertex position coordinates (usually the coordinates of the four vertices of a rectangle, which can be pre-converted to world or screen coordinates) and texture coordinates (UV) from each instruction are appended sequentially to the vertex buffer, while recording the starting index and quantity of each primitive (e.g., using triangle stripes or index buffers); a unified texture resource identifier (i.e., the texture shared by these instructions) and other common rendering states (blending mode, sampler settings, etc.) are set for the merged draw call; all merged data is submitted to the GPU for rendering at once. Through this merging, the operation that originally required multiple DrawCalls is reduced to a single operation. For example, a UI panel with 20 button icons using the same texture image would originally require 20 DrawCalls, but after merging, only 1 is needed. This significantly reduces the overhead of the CPU submitting drawing commands to the GPU, as well as the GPU's overhead when switching textures and rendering states. If instructions under the same texture are depth-ordered but not consecutive (separated by instructions from other textures), they cannot be merged into a single draw call because the texture must be switched to draw the other instructions in between. In this case, the system will still draw them separately in the original order, but will attempt to create more merging opportunities in subsequent frames by adjusting the order of instruction insertion (such as inserting instructions from the same texture in a group).
[0055] In complex UI scenarios, rendering instructions for different textures may overlap in depth order. For example, texture A may have instruction depth values of 1 and 4, while texture B may have instruction depth values of 2 and 3. Simply grouping and drawing each texture separately can lead to incorrect occlusion relationships (e.g., texture A, which should be covered by texture B, is drawn later and covers B). To ensure the correct drawing order, the rendering must be performed according to the global depth values, even if this means frequent texture switching. However, different textures correspond to different GPU rendering states (mainly texture binding). During the drawing process, whenever a texture changes, the GPU must rebind the new texture resource, which in itself incurs overhead. But for correctness, state switching is necessary. The processing method in this embodiment is as follows: during the merging process, when encountering rendering instructions that use different texture resource identifiers and have alternating occlusion relationships (i.e., overlapping global depth values), the system will not forcibly merge the instructions of different textures, but will insert explicit rendering state switching instructions at the location where texture switching is required. These switching instructions are not actual drawing commands, but GPU state setting commands, used to notify the GPU to change the currently active texture resource. In its implementation, the system can first perform a global stable sorting of all instructions (regardless of texture) based on node depth values when generating the final rendering command list (e.g., using a stable sorting algorithm or a full sort based on depth values). Then, it sequentially traverses the sorted instruction list, inserting a "bind texture" state instruction between the current instruction and the previous instruction whenever the texture resource identifier of the current instruction differs from the previous instruction. This ensures that the final drawing order strictly follows depth order while correctly switching states at texture changes. This approach guarantees correct occlusion relationships between different textures (lower layers are drawn first, upper layers are drawn later) and avoids display anomalies caused by incorrect texture binding (e.g., using an image of texture A to draw a primitive that should be texture B). Although texture switching incurs a small overhead, it is necessary and acceptable compared to incorrect rendering results. Moreover, since most UI panels tend to use the same atlas (textures), the actual switching frequency is not high.
[0056] In some embodiments, sorting and merging rendering instructions in the dynamic rendering list according to texture resource identifiers via the rendering batch merging node includes: Before each frame of rendering begins, the expected lifespan of all currently displayed user interface panels is obtained. The expected lifespan is predicted based on the historical display duration statistical model of the panels or the current scene migration path. The rendering instructions corresponding to the panels whose expected lifespan is lower than a preset duration threshold are marked as transient instructions, and the rendering instructions corresponding to the panels whose expected lifespan is higher than or equal to the duration threshold are marked as persistent instructions. Based on the markers of the transient and persistent instructions, the dynamic rendering list is divided into transient and persistent regions. The rendering instructions in the persistent region are statically sorted according to the texture resource identifier and the order remains unchanged. The rendering instructions in the transient region are dynamically sorted according to the texture resource identifier. During each frame rendering, only the rendering instructions in the transient region are re-sorted and merged. At the boundary between the transient region and the persistent region, a rendering state retention instruction is inserted so that when switching between different regions, the GPU does not need to rebind the currently active texture resources and rendering pipeline states. When the number of rendering instructions in the transient region exceeds a preset merging complexity threshold, the transient region is divided into multiple sub-blocks. Each sub-block is sorted and merged independently, and explicit rendering synchronization instructions are inserted between the sub-blocks to avoid frame rendering timeouts caused by excessively long single merging operations.
[0057] Before each frame begins rendering, the rendering batch merging node first obtains the expected lifespan of the user interface panels corresponding to all rendering instructions in the current dynamic rendering list. The expected lifespan refers to the length of time (in milliseconds or frames) that the panel is expected to remain displayed on the screen from the current moment. This expected value can be obtained in the following ways: (1) Based on the historical display duration statistical model of the panel: The system records the average duration of each panel from opening to closing in the historical game session. For example, a "damage number floating text" panel has an average lifespan of 0.5 seconds, a "health bar" panel has an average lifespan of 10 seconds, and a "main menu" panel may exist for a long time. The expected lifespan of the panel in the current session can be predicted by moving average or exponential smoothing algorithms. (2) Based on the current scene migration path prediction: Based on the current scene state of the game and the user operation path, predict the next possible scene switch or panel closing event. For example, in the story dialogue scene, the expected lifespan of the dialog box panel is short (waiting for the player to click the next sentence); in the battle scene, the expected lifespan of the skill button panel is long (the whole battle). Scene transition probability models (such as Markov chains or rule-based state machines) can provide the probability of a panel being closed over time, thus estimating its survival time. After obtaining the expected survival time, the system compares it to a preset duration threshold (e.g., 2 seconds or 60 frames): if the expected survival time is lower than the threshold, all rendering commands corresponding to that panel are marked as transient commands. Transient commands represent UI elements that appear briefly and disappear soon, such as pop-up notifications, damage numbers, and temporary effects. If the expected survival time is higher than or equal to the threshold, they are marked as persistent commands. Persistent commands represent UI elements that are displayed stably for a long time, such as the main interface background, health bar, minimap, and chat window. The marking operation can be implemented by adding a boolean field or enumeration type to the rendering command structure. Based on the above markings, the rendering batch merging node logically divides the dynamic rendering list into two consecutive regions: a transient region and a persistent region. The division can be done by concentrating persistent commands at the beginning (or end) of the list and transient commands at the other, or by maintaining two independent sub-lists. For ease of management, persistent instructions are typically placed at the beginning of the list, and transient instructions at the end, or two separate containers can be used. Persistent Region: Rendering instructions within this region are statically sorted according to texture resource identifiers. This sorting occurs once when the persistent region is first built (e.g., grouped by texture, and sorted by depth within each group), and the order remains unchanged thereafter. Since the persistent panel does not appear or disappear frequently, its set of rendering instructions is relatively stable and does not require reordering every frame, thus saving significant CPU time. A one-time reordering is triggered only when the persistent panel is first loaded or occasionally unloaded. Transient Region: Rendering instructions within this region are dynamically sorted according to texture resource identifiers. This sorting and merging operation is re-performed before rendering each frame.Because transient panels frequently appear, disappear, and overlap, their set of rendering instructions may change every frame (new transient instructions are added, and old transient instructions are removed). Dynamic sorting ensures that instructions within transient regions are always correctly merged according to the latest depth and texture relationships. Through this partitioning, the number of instructions that need to be sorted each frame is reduced from the total number of instructions P to the number of transient regions Q (usually Q is much smaller than P), significantly reducing sorting overhead.
[0058] Because rendering instructions for resident and transient regions are executed consecutively during drawing (e.g., drawing all resident instructions first, then all transient instructions, or vice versa), a switch in texture resources and the rendering pipeline may occur at the boundary between the two regions. For example, if the last instruction in the resident region uses texture A and the first instruction in the transient region uses texture B, drawing directly would require the GPU to perform a texture unbinding and rebinding operation, which incurs overhead. To avoid unnecessary state switching, this embodiment inserts a rendering state preservation instruction at the boundary between the transient and resident regions. The purpose of the state preservation instruction is to notify the GPU that the currently active texture resources and rendering pipeline states (such as blending modes, samplers, and shader programs) remain unchanged before and after the boundary, and no rebinding is required. Specifically, when generating the final list of drawing commands, check whether the texture resource identifiers before and after the boundary are the same. If they are the same, insert a "no operation" or "state continuation" instruction, or simply make the instructions consecutive without inserting any state switching. If they are different, a state switching is still required, but it can be optimized to switch only once at the boundary, instead of switching for every instruction. The state-preserving instruction in this application is actually an optimization marker used to guide the renderer to reuse the state of the previous region as much as possible. A more common approach is to treat resident regions and transient regions as two large batches, minimizing state switching within each region through sorting and merging; between regions, if the last and first textures of two regions are the same, they are merged for rendering; otherwise, only one state switch occurs, which is an acceptable overhead. This application emphasizes "inserting rendering state-preserving instructions" to explicitly tell the GPU that rebinding is unnecessary, which can reduce redundant API calls in some low-level graphics APIs (such as through command buffers).
[0059] When the number of rendering instructions in a transient region is too large (e.g., dozens of brief particle effects, floating text, etc. appear simultaneously), the operation of sorting and merging this region in each frame may consume a lot of time, even exceeding the frame budget (e.g., 16.6ms / frame), resulting in dropped frames. To balance the benefits of merging optimization with the cost of sorting, this application introduces a merging complexity threshold. The system presets a merging complexity threshold (e.g., 200 instructions or 1ms execution time). Before rendering begins each frame, the number of rendering instructions in the transient region is checked. If the number exceeds the threshold, the transient region is further divided into multiple sub-blocks. The division method can be based on uniform division based on the number of instructions (e.g., 50 instructions per sub-block), natural grouping based on texture resource identifiers (placing instructions of the same texture in the same sub-block as much as possible), or interval division based on depth values (grouping instructions with similar depths together). Each sub-block performs internal sorting and merging operations independently: that is, the instructions in each sub-block are sorted according to texture identifier and depth value, and consecutive instructions of the same texture are merged to generate their own drawing call sequences. Because sub-blocks are independent, the system can distribute the processing tasks of different sub-blocks to different worker threads for parallel execution (multi-threaded sorting and merging), thereby accelerating the overall processing time. More importantly, explicit rendering synchronization instructions are inserted between sub-blocks when submitting for rendering, ensuring that the GPU finishes rendering one sub-block before starting to render the next. The synchronization instruction can be a fence or an event to prevent rendering order disruptions caused by parallel submissions. By dividing the system into sub-blocks, what would otherwise be a large sorting and merging operation is broken down into multiple smaller operations, reducing the processing time of each sub-block and avoiding frame rendering timeouts caused by excessively long single operations. Simultaneously, due to the insertion of synchronization instructions between sub-blocks, the rendering order is maintained correctly (typically arranged according to the overall depth value order).
[0060] The above describes the method for constructing the user interface panel in the embodiments of this application. The computer system in the embodiments of this application will be described in detail below in conjunction with the above method for constructing the user interface panel.
[0061] Please see Figure 3 This is a schematic diagram of an exemplary hardware structure of a computer system in an embodiment of this application.
[0062] In some embodiments, the computer system 300 includes a computer device, which may be a terminal device. The computer device includes a processor 301, a memory 302, a sensor module 303, a communication module 304, an input device 305, and an output device 306 connected via a system bus. The processor 301 of the computer device provides computing and control capabilities. The memory 302 of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database is used to store data.
[0063] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0064] In some embodiments of this application, a computer-readable storage medium is provided, including instructions that, when executed on the computer system 300, cause the computer system 300 to perform the method for constructing a user interface panel according to the embodiments of this application.
[0065] In some embodiments of this application, a computer program product is also provided, which, when run on a computer system 300, causes the computer system 300 to execute the user interface panel construction method of the embodiments of this application.
[0066] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0067] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0068] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method of constructing a user interface panel, characterized by, The application relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a target user interface panel. The application relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a target user interface panel. The application relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a target user interface panel. The application relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a target user interface panel. The application relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a target user interface panel. The application relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a target user interface panel.
2. The method of claim 1, wherein, The application relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a targetuser interface panel. The application relates to a visual control prefabricated body with a fixed tree-shapedhierarchy, and a method for displaying a target user interface panel. The application relates to a visual controlprefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a target user interfacepanel. The application relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, anda method for displaying a target user interface panel. The application relates to a visual control prefabricatedbody with a fixed tree-shaped hierarchy, and a method for displaying a target user interface panel.
3. The method of claim 1, wherein, Theapplication relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, and a methodfor displaying a target user interface panel. Theapplication relates to a visual control prefabricated body witha fixed tree-shaped hierarchy, and a method for displaying a target user interface panel. Theapplication relates a visual control prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying atarget user interface panel. Theapplication relates to a visual control prefabricated body with a fixed tree- shaped hierarchy, and a method for displaying a target user interface panel. Theapplication relates to a visualcontrol prefabricated body with a fixed tree-shaped hierarchy, and a method for displaying a target userinterface panel. Theapplication relates to a visual control prefabricated body with a fixed tree-shaped hierarchy,and a method for displaying a target user interface panel. Theapplication relates to a visual control prefabricate body with a fixed tree-shaped hierarchy, and a method for displaying a target user interface panel. In the application, the visual control prefabricated body with a fixed tree-shaped hierarchy is constructed, the fixed tree-shaped hierarchy is composed of an outer frame node, a mask node, a texture node and a decal node in a predefined parent-child relationship, and each node is a placeholder node, and an access path of each node in the visual control prefabricated body is precompiled and stored as a direct pointer index during construction. In a game starting stage, a plurality of instances of the visual control prefabricated body are pre-created, and a node tree of each instance is completely assembled, and the instances are stored in a visual control prefabricated body object pool. A configuration file is loaded into a memory, the configuration file records configuration information of a visual part of each user interface panel in a key-value pair form, and the configuration information comprises picture resources and a transformation matrix of the outer frame node, color values and transparency of the mask node, picture resources and a scaling factor of the texture node, and decal resources and a position offset of the decal node. In response to a request of displaying a target user interface panel, corresponding configuration information is read from the configuration file according to an identification of the target user interface panel, and a target instance is obtained from the visual control prefabricated body object pool. The target instance is mounted to a root node of a game scene after the configuration information is written into display attributes of corresponding nodes of the target instance, and the display of the target user interface panel is completed. The pre-creation of the plurality of instances of the visual control prefabricated body and the complete assembly of the node tree of each instance are specifically as follows. Hardware performance parameters of a current running device are obtained, the hardware performance parameters comprise available memory size, CPU core number, GPU rendering capability level, and the total capacity of the visual control prefabricated body object pool is calculated according to the hardware performance parameters. The visual control prefabricated body object pool is divided into a plurality of sub-pools according to visual complexity levels of user interface panels, each sub-pool corresponds to a predefined node usage mode, and the node usage mode is determined according to a node set actually enabled in the outer frame node, the mask node, the texture node and the decal node. For each sub-pool, demand probabilities of each node usage mode in a current game session are predicted according to usage frequency statistics of various user interface panels in historical game running data, and an initial instance number of each sub-pool is determined according to a product of the demand probability and the total capacity. A corresponding number of instances are pre-created according to the initial instance number of each sub-pool, the node tree of each instance is assembled, and initialization of internal node pointer indexes is completed, and the instances are stored in the corresponding sub-pool. The configuration file is divided into a static configuration layer and a dynamic configuration layer, the static configuration layer records basic visual resource identifications commonly used by all user interface panels, and the dynamic configuration layer records differentiated configuration information of each user interface panel according to a panel identification. Theapplication relates to a visual control prefabricated body with a fixed tree-shaped hierarchy, anda method fordisplaying a target user interface panel. Only load the static configuration layer into memory at the game startup stage, and establish a static resource index table, load the dynamic configuration layer sub-block corresponding to the first user interface panel from external storage into memory cache on demand when the first user interface panel is first displayed, and the first user interface panel is any one user interface panel; Use a difference compression algorithm to encode and store each panel configuration sub-block of the dynamic configuration layer, and when it is necessary to update the configuration of a second user interface panel, only transmit and decode the difference data of the panel configuration sub-block corresponding to the second user interface panel, and the second user interface panel is any one user interface panel; A configuration prefetch queue is established, the next possible opened user interface panel is predicted according to the game scene migration probability, and the dynamic configuration layer sub-block of the possible opened user interface panel is preloaded into the memory cache when idle.
4. The method of claim 1, wherein, The target instance is directly located to the frame node, mask node, texture node and decal node by using the pre-compiled node pointer index in the target instance, and the configuration information is written into the display attribute of the corresponding node, specifically including: The configuration information is parsed, the attribute dependency relationship between the frame node, mask node, texture node and decal node is extracted, and a node attribute dependency graph is constructed, and the attribute dependency relationship includes that the display area of the texture node depends on the clipping boundary of the frame node, the anchor position of the decal node depends on the transformation matrix of the frame node, and the shape range of the mask node depends on the size of the frame node; According to the node attribute dependency graph, the frame node, mask node, texture node and decal node are divided into multiple write levels, and the node attribute write operations of different write levels in the target instance are distributed to different work threads and executed in parallel; In the parallel write process, the nodes are directly accessed without lock memory by using the pre-compiled node pointer index in the target instance, and the write completion counter is updated through atomic operation, and when all write level operations are completed, a combination completion event is triggered to notify the subsequent panel mounting step.
5. The method of claim 1, wherein, The target instance is mounted under the root node of the game scene after the configuration is completed, including: A rendering batch merging node is created in advance under the root node of the game scene, and the dynamic rendering list is maintained in the rendering batch merging node, which is used to collect the rendering instructions of the texture nodes and decal nodes in all user interface panels to be displayed; When the target instance configuration is completed and ready to be mounted, the rendering data of the frame node, mask node, texture node and decal node of the target instance are extracted as rendering instructions and inserted into the dynamic rendering list of the rendering batch merging node; The rendering instructions in the dynamic rendering list are sorted and merged according to the texture resource identifier through the rendering batch merging node, and the drawing calls of the texture nodes and decal nodes using the same picture resource are merged into one GPU drawing call. When the target instance is unloaded, the corresponding rendering instruction is removed from the dynamic rendering list of the rendering batch merging node, and an incremental rearrangement of the rendering list is triggered, and the rendering order of the removed rendering instruction within a preset range is adjusted.
6. The method of claim 5, wherein, The sorting and merging of the rendering instructions in the dynamic rendering list by the rendering batch merging node according to the texture resource identifier comprises: Before starting rendering of each frame, the texture resource identifiers of all rendering instructions in the current dynamic rendering list are obtained, and the number of rendering instructions corresponding to each texture resource identifier is calculated to construct a texture-instruction mapping table; According to the node depth value of the rendering instruction, the multiple rendering instructions under the same texture resource identifier are depth-ordered, so that when the rendering instructions are drawn in the combined drawing call, the rendering instructions are drawn in the order of the depth value from small to large, to ensure the correct layer occlusion relationship; The rendering instructions using the same texture resource identifier and arranged continuously after depth ordering are merged into one GPU drawing call, and the vertex data and texture coordinate data of all related instructions are spliced into a vertex buffer to be submitted to the GPU during the merging; For rendering instructions using different texture resource identifiers and having an alternating occlusion relationship, an explicit rendering state switching instruction is inserted during the merging process to avoid incorrect texture binding.
7. The method of claim 5, wherein, The sorting and merging of the rendering instructions in the dynamic rendering list by the rendering batch merging nodes according to the texture resource identifier comprises: Before starting rendering of each frame, the expected survival duration of all user interface panels currently displayed is obtained, and the expected survival duration is obtained according to a historical display duration statistical model of the panels or a current scene migration path prediction; rendering instructions corresponding to panels with an expected survival duration lower than a preset duration threshold are marked as transient instructions, and rendering instructions corresponding to panels with an expected survival duration higher than or equal to the duration threshold are marked as permanent instructions; According to the markings of the transient instructions and the permanent instructions, the dynamic rendering list is divided into a transient area and a permanent area, the rendering instructions in the permanent area are statically sorted according to the texture resource identifier and the order is kept unchanged, and the rendering instructions in the transient area are dynamically sorted according to the texture resource identifier, and only the rendering instructions in the transient area are re-executed for sorting and merging operations during rendering of each frame; At the boundary between the transient area and the permanent area, a rendering state maintaining instruction is inserted, so that the GPU does not need to re-bind the currently activated texture resource and rendering pipeline state when switching between different areas; When the number of rendering instructions in the transient area exceeds a preset merging complexity threshold, the transient area is divided into multiple sub-blocks, each of which is independently sorted and merged, and an explicit rendering synchronization instruction is inserted between the sub-blocks to avoid frame rendering timeout caused by too long single merging operation.
8. A computer system comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program comprises instructions that, when executed by the processor, cause the processor to perform the method of any one of claims 1 to 7. The processor executes the computer program to implement the steps of the method of any one of claims 1-7.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-7.
10. A computer program product comprising a computer program, characterized in that, The computer programs are executed by the processor to implement the steps of the method of any one of claims 1- 7.
