Game rendering resource compiling method, game picture rendering method and related device
By collecting and pre-compiling pipeline state objects in the game scene in advance, the game stuttering problem caused by the time spent on PSO generation and compilation was solved, achieving efficient game rendering performance and a smooth experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU KULUO SHUJIE TECH CO LTD
- Filing Date
- 2025-08-19
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, the generation and compilation process of pipeline state objects (PSO) is time-consuming, causing game stuttering, especially in complex scenes and large-scale rendering tasks, which affects the game experience. Furthermore, existing pre-compilation solutions suffer from long compilation times, inability to be reused across platforms, and insufficient dynamic adjustment.
Pre-collect pipeline state compilation requests for different game scenarios, generate and store pipeline state objects, pre-compile them using a pre-compiled object manifest file, generate game rendering cache resources, and ensure that the game directly uses the pre-compiled PSO resources at runtime, reducing compilation latency.
By preprocessing the PSO compilation, game stuttering is reduced, rendering efficiency and game experience are improved, and smooth operation is ensured in complex scenes and large-scale rendering tasks.
Smart Images

Figure CN121222067B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of game development technology, and in particular to a method for compiling game rendering resources, a method for rendering game screens, and related apparatus. Background Technology
[0002] In image rendering technologies, the application programming interface (API) provides a Pipeline State Object (PSO) mechanism to reduce the overhead of hardware changes to the rendering state. The principle of the PSO mechanism is to merge the shader program and rendering state required for a single rendering into a single Pipeline State Object (PSO). The graphics API handles the dependencies and redundancies between various hardware states, provides the optimal set of states and setting methods, which is called compilation, and then uniformly hands over the setting of the rendering state to the hardware.
[0003] In practical applications, the generation and compilation of pipeline state objects is time-consuming. If this process is performed during game runtime, it can lead to noticeable stuttering, significantly impacting the gaming experience. This issue is particularly pronounced in complex scenes and large-scale rendering tasks, making it a problem that urgently needs to be addressed. Summary of the Invention
[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method for compiling game rendering resources, a method for rendering game graphics, and related apparatus, which helps to achieve efficient game graphics rendering.
[0005] The game rendering resource compilation method according to the first aspect of this application includes:
[0006] Obtain compilation requests for multiple pipeline states corresponding to the target game;
[0007] For each pipeline state compilation request, pipeline state metadata corresponding to the target game in different game scenarios is extracted;
[0008] Obtain pipeline state objects generated based on the metadata of each pipeline state, and generate a pre-compiled object manifest file based on each pipeline state object; wherein, each pipeline state object is stored in the pre-compiled object manifest file;
[0009] The precompiled object manifest file is traversed to precompile each pipeline state object stored in the precompiled object manifest file, generating game rendering cache resources corresponding to each pipeline state object.
[0010] According to some embodiments of this application, obtaining pipeline state objects generated based on the pipeline state metadata of each pipeline state, and generating a pre-compiled object manifest file based on each pipeline state object, includes:
[0011] Obtain pipeline status objects generated based on the metadata of each pipeline status, and generate a list of precompiled objects based on each pipeline status object;
[0012] Based on the precompiled object list, a precompiled object manifest file in a cross-platform compatible format is generated.
[0013] According to some embodiments of this application, the precompiled object list is configured with corresponding shader variant files, and the step of generating the precompiled object manifest file in a cross-platform compatible format based on the precompiled object list includes:
[0014] Obtain the current shader variant information and update the shader variant file based on the current shader variant information;
[0015] Based on the updated list of precompiled objects and the shader variant file, a binding verification is performed to generate the precompiled object manifest file in a cross-platform compatible format.
[0016] According to some embodiments of this application, after obtaining the current shader variant information and updating the shader variant file based on the current shader variant information, the method further includes:
[0017] Based on the updated shader variant file, a pipeline state variant file is formed;
[0018] Based on the pipeline status variant file, the corresponding pipeline status objects are updated to obtain the updated pipeline status objects.
[0019] According to some embodiments of this application, obtaining pipeline state objects generated based on the pipeline state metadata of each pipeline state, and generating a pre-compiled object manifest file based on each pipeline state object, includes:
[0020] The target game package is constructed based on the pre-compiled object manifest file to obtain the target game package.
[0021] The step of traversing the precompiled object manifest file to precompile each pipeline state object stored in the precompiled object manifest file and generate game rendering cache resources corresponding to each pipeline state object includes:
[0022] Load the target game package to perform an initial launch operation on the target game;
[0023] During the execution of the initial startup operation, the precompiled object manifest file is traversed to identify multiple pipeline state objects;
[0024] For each pipeline state object, pre-compile to generate the game rendering cache resource corresponding to each pipeline state object.
[0025] According to some embodiments of this application, after pre-compiling for each pipeline state object to generate the game rendering cache resource corresponding to each pipeline state object, the method further includes:
[0026] Obtain the compilation environment information corresponding to the pre-compilation of each pipeline state object;
[0027] Based on the game rendering cache resources and the compilation environment information, a local cache directory is generated.
[0028] According to some embodiments of this application, after generating the local cache directory based on the game rendering cache resources and the compilation environment information, the method further includes:
[0029] Load the target game package to perform subsequent launch operations on the target game;
[0030] During the subsequent startup process, obtain the current game environment information;
[0031] The current game environment information is compared with the compilation environment information stored in the local cache directory to obtain the environment determination result;
[0032] In response to the environment determination result indicating that the game environment has not changed, the target game package continues to be loaded based on the game rendering cache resources;
[0033] In response to the environment determination result reflecting a change in the game environment, each pipeline state object is recompiled to update the game rendering cache resources corresponding to each pipeline state object, and the target game package is loaded again based on the updated game rendering cache resources.
[0034] The game screen rendering method according to the second aspect of this application includes:
[0035] Load a plurality of game rendering cache resources generated by the game rendering resource compilation method according to any one of the first aspects of the embodiments of this application;
[0036] Obtain the rendering instructions for the target game in the current frame;
[0037] Select a target rendering cache resource from among the multiple game rendering cache resources according to the rendering instructions;
[0038] The target rendering cache resource is bound to the rendering pipeline of the preset rendering engine, and the rendering operation is performed through the rendering pipeline to obtain the target game screen.
[0039] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the game rendering resource compilation method as described in any one of the embodiments of the first aspect, or the game screen rendering method as described in the embodiments of the second aspect.
[0040] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program that is executed by a processor to implement the game rendering resource compilation method as described in any one of the first aspect embodiments, or the game screen rendering method as described in the second aspect embodiments.
[0041] The game rendering resource compilation method, game screen rendering method, and related apparatus according to the embodiments of this application have at least the following beneficial effects:
[0042] This application proposes a method for compiling game rendering resources, which optimizes runtime rendering performance by pre-processing the compilation of pipeline state objects. First, the method involves obtaining multiple pipeline state compilation requests corresponding to the target game. These requests are collected during game development and testing, covering the rendering requirements of the game in different scenarios. By analyzing these requests, pipeline state metadata corresponding to the target game in different game scenarios can be extracted. This metadata includes shader hashes, rendering states, vertex layout information, and gameplay-related tags, which are key information for generating pipeline state objects. Next, pipeline state objects are generated based on this pipeline state metadata and stored in a pre-compiled object manifest file. This step is the core of the entire method because it advances the runtime compilation work to the game release or update stage. The generation of the pre-compiled object manifest file ensures that these pre-compiled pipeline state objects can be directly used during game runtime without the need for time-consuming runtime compilation operations. Finally, by traversing the pre-compiled object manifest file, each pipeline state object stored therein is pre-compiled to generate corresponding game rendering cache resources. These cached resources can be directly accessed by the rendering engine during game runtime, significantly reducing stuttering caused by PSO compilation. Through this method, the embodiments of this application can quickly load the pre-compiled PSO cache at startup, ensuring efficient rendering operations during runtime and improving overall game performance and user experience. In summary, the method of this application effectively solves the stuttering problem caused by the time-consuming compilation process of the PSO mechanism in practical applications by pre-compiling pipeline state objects and generating cached resources. This not only improves the rendering efficiency of the game but also ensures smooth operation in complex scenes and large-scale rendering tasks, providing players with a higher quality gaming experience.
[0043] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0044] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0045] Figure 1 A flowchart illustrating a game rendering resource compilation method provided in this application embodiment;
[0046] Figure 2 Another flowchart illustrating the game rendering resource compilation method provided in this application embodiment;
[0047] Figure 3Another flowchart illustrating the game rendering resource compilation method provided in this application embodiment;
[0048] Figure 4 Another flowchart illustrating the game rendering resource compilation method provided in this application embodiment;
[0049] Figure 5 Another flowchart illustrating the game rendering resource compilation method provided in this application embodiment;
[0050] Figure 6 Another flowchart illustrating the game rendering resource compilation method provided in this application embodiment;
[0051] Figure 7 Another flowchart illustrating the game rendering resource compilation method provided in this application embodiment;
[0052] Figure 8 This is a schematic flowchart of a game screen rendering method provided in an embodiment of this application;
[0053] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0054] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0055] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0056] In the description of this application, it should be understood that the orientation descriptions, such as up, down, left, right, front, and back, are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0057] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0058] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "setting," "installation," and "connection" should be interpreted broadly. Those skilled in the art can reasonably determine the specific meaning of the above terms in this application based on the specific content of the technical solution. Furthermore, the identification of specific steps in the following text does not imply a limitation on the order of steps or execution logic. The execution order and logic between each step should be understood and inferred from the content described in the embodiments.
[0059] A graphics API (Application Programming Interface) is an interface provided by the operating system or graphics driver to send rendering instructions to the graphics processing unit (GPU). Common graphics APIs include Direct3D, Vulkan, Metal, and OpenGL. These APIs provide various functions and tools that allow developers to control the GPU's rendering process, including setting rendering states, compiling and executing shader programs, etc. The main role of graphics APIs is to abstract the complexity of the underlying hardware, providing developers with a unified programming interface so that they can focus on developing games or graphics applications without having to delve into the specific implementation details of different GPUs. Furthermore, graphics APIs are responsible for optimizing the execution of rendering instructions, ensuring the efficiency and performance of graphics rendering.
[0060] Shader programs are small programs that run on the GPU and control various aspects of graphics rendering, such as vertex transformation, fragment shading, and geometry processing. In computer graphics, a "shader program" is often called a "shader program," and sometimes simply a "shader." Shader programs are small programs that run on the GPU and control various aspects of graphics rendering, such as vertex transformation, fragment shading, and geometry processing. Developers write shader programs to implement various visual effects, such as lighting models, texture mapping, and particle systems. Shader programs are written using specific shading languages, such as HLSL (for Direct3D), GLSL (for OpenGL), or Metal Shading Language (for Metal). During rendering, the GPU executes these shader programs, processing each vertex or fragment to generate the final pixel color. Writing shader programs requires consideration of performance and efficiency, as they directly affect the speed and quality of graphics rendering.
[0061] Pipeline State Objects (PSOs) are a mechanism in graphics APIs used to combine all the states and shader procedures required for rendering into a unified object. The creation of a PSO involves specifying shader procedures, rendering states, and input / output layouts. Once created and compiled, a PSO contains all the necessary information and can be efficiently used for multiple rendering operations. The main advantage of PSOs is that they can pre-optimize and verify the compatibility of all rendering states and shaders, reduce runtime state change overhead, and improve the execution efficiency of rendering instructions. By using PSOs, developers can better control the graphics rendering process, enabling more efficient and flexible rendering techniques, especially in complex scenes and high-performance applications.
[0062] Rendering states refer to the various configuration parameters of the GPU when performing rendering operations, including rasterization state, depth testing state, blending mode, texture binding, vertex layout, etc. These rendering states determine how graphics are rendered to the screen, such as whether depth testing is enabled, how colors are blended, and how texture coordinates are handled. Setting rendering states is crucial for achieving specific visual effects and optimizing rendering performance. Different rendering tasks may require different combinations of rendering states, and frequent changes to these states can lead to additional rendering overhead because the GPU needs to reconfigure its internal hardware. Therefore, properly managing rendering states and reducing unnecessary state changes is one of the important means to improve graphics rendering efficiency.
[0063] The graphics API provides a Pipeline State Object (PSO) mechanism to reduce the overhead of hardware changes to the rendering state. The principle of the PSO mechanism is to merge the shader program and rendering state required for a single rendering into a single Pipeline State Object (PSO). The graphics API handles the dependencies and redundancies between various hardware states, provides the optimal set of states and setting methods, which is called compilation, and then uniformly hands it over to the hardware to set the rendering state.
[0064] However, while PSO (Pre-Screen Rendering) can theoretically significantly improve rendering efficiency, it faces a series of technical challenges in practical applications. First, the generation and compilation of PSO is time-consuming. If processed during game runtime, it can cause noticeable stuttering, severely impacting the gaming experience. This is particularly pronounced in complex scenes and large-scale rendering tasks, becoming a problem that urgently needs to be addressed. Second, PSO is device-dependent, meaning it must be compiled for a specific device and cannot be directly reused across platforms. This increases the complexity and workload of game development, as developers need to handle PSO compilation issues separately for different devices and platforms.
[0065] Another significant issue is the limitations of related pre-compilation schemes. Taking UE as an example, although its mechanism of collecting PSOs and pre-compiling them during the testing phase alleviates the pressure of runtime compilation to some extent, the initial pre-compilation process is usually very slow, causing users to wait for extended periods. Furthermore, these schemes lack effective support for dynamic changes; for example, in scenarios such as hot updates, system or driver upgrades, the pre-compiled PSOs cannot be updated or adjusted in a timely manner, leading to a decrease in pre-compilation hit rate and frequent issues with duplicate pre-compilation. Simultaneously, these technologies also have shortcomings in covering high-frequency user scenarios, failing to fully guarantee the smoothness and stability of the game during runtime.
[0066] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method for compiling game rendering resources, a method for rendering game graphics, and related apparatus, which helps to achieve efficient game graphics rendering.
[0067] Reference Figure 1 The game rendering resource compilation method according to the embodiments of this application may include:
[0068] Step S101: Obtain compilation requests for multiple pipeline states corresponding to the target game;
[0069] Step S102: For each pipeline state compilation request, extract the pipeline state metadata corresponding to the target game in different game scenarios;
[0070] Step S103: Obtain pipeline status objects generated based on the metadata of each pipeline status, and generate a precompiled object manifest file based on each pipeline status object; wherein, each pipeline status object is stored in the precompiled object manifest file;
[0071] Step S104: Traverse the precompiled object manifest file to precompile each pipeline state object stored in the precompiled object manifest file and generate game rendering cache resources corresponding to each pipeline state object.
[0072] In game development, the management and optimization of rendering resources are crucial for improving game performance. This application proposes a method for compiling game rendering resources, aiming to optimize the generation and compilation process of Pipeline State Objects (PSOs) to solve the stuttering problem caused by the time-consuming PSO compilation process in existing technologies. This method ensures that the game can efficiently use pre-compiled PSO resources at runtime by pre-processing the compilation of pipeline state objects, thereby improving rendering efficiency and the gaming experience.
[0073] In some embodiments, step S101 involves obtaining multiple pipeline state compilation requests corresponding to the target game;
[0074] It's important to note that this involves obtaining multiple pipeline state build requests (PSOs) for the target game. These PSOs are collected during game development and testing, covering the rendering requirements of the game in different game scenarios. These PSOs contain a wealth of information, such as specific shader program requirements and rendering state configurations, and are crucial for generating pipeline state objects.
[0075] According to some embodiments provided in this application, during game execution, all PSO compilation requests from the upper abstraction layer of RHI (Rendering Hardware Interface) can be dynamically captured. These requests are triggered in different game scenes and rendering tasks and contain rich metadata information, such as shader hash values, rendering state configurations, vertex layout information, and gameplay-related tags. This metadata is crucial for generating accurate PSOs. During game execution, the rendering engine can frequently call RHI's API to set the rendering state and submit rendering commands based on the rendering requirements of the current scene. Each time a compilation request involving a PSO is called, these requests can be captured in real time. These requests can not only contain the shader program and state configuration required for the current rendering task, but also contextual information related to the game scene, enabling the generated PSO to accurately match the rendering requirements of the game in different scenes.
[0076] In step S102 of some embodiments, for each pipeline state compilation request, pipeline state metadata corresponding to the target game in different game scenarios is extracted;
[0077] It should be noted that for each pipeline state compilation request, pipeline state metadata corresponding to different game scenes of the target game is extracted. For each pipeline state compilation request, this embodiment extracts key information as pipeline state metadata (i.e., PSO metadata), such as shader hashes, rendering states, vertex layout information, and gameplay-related tags. This pipeline state metadata is the foundation for generating pipeline state objects; it describes various configurations and states required during the rendering process. For example, shader hashes are used to identify specific shader variants, rendering states include configurations such as depth testing and blending modes, vertex layout information defines how vertex data is organized, and gameplay-related tags may involve the identification of specific game scenes or effects. In this way, this pipeline state metadata provides the necessary details for the subsequent generation of pipeline state objects, ensuring that each pipeline state object accurately reflects the rendering requirements of the game in a specific scene.
[0078] According to some embodiments provided in this application, for each pipeline state compilation request, it is necessary to extract the pipeline state metadata corresponding to the target game in different game scenarios.
[0079] Some implementations can process PSO compilation requests asynchronously after they are captured. This means that the extraction of PSO metadata and subsequent upload operations will not block the game's main running thread, thus avoiding any impact on game smoothness. Asynchronous processing allows data to be collected and processed in the background while the game continues to run normally, ensuring an uninterrupted player experience.
[0080] Some embodiments may perform deduplication on PSO metadata during the extraction process. Deduplication aims to eliminate duplicate PSO compilation requests. This not only reduces the amount of data uploaded and processed subsequently but also avoids unnecessary compilation work, thereby improving overall efficiency. The deduplication mechanism can identify duplicates by comparing various fields of the PSO metadata. For example, if two PSO compilation requests have the same Shader hash, rendering state, and vertex layout information, they may be considered duplicates. It should be understood that the deduplicated PSO metadata is uploaded to the cloud data platform in batches. Batch uploading helps optimize the utilization of network resources, reduces the load of single data transmission, and improves the reliability and efficiency of data transmission. Each batch contains a certain amount of PSO metadata, which is organized and packaged before uploading to ensure data integrity and efficient transmission. In this way, by asynchronously deduplicating and uploading PSO metadata in batches, embodiments of this application can effectively collect and manage PSO compilation requests generated during game runtime. This process not only ensures smooth game operation but also provides an accurate and concise data foundation for subsequent PSO pre-compilation and optimization work. This approach optimizes game rendering performance, reduces runtime compilation overhead, and improves the overall quality and performance of the game.
[0081] In some embodiments, step S103 involves obtaining pipeline state objects generated based on the metadata of each pipeline state, and generating a precompiled object manifest file based on each pipeline state object; wherein each pipeline state object is stored in the precompiled object manifest file.
[0082] It's important to note that after extracting the metadata, this metadata is used as input to generate corresponding pipeline state objects. Each pipeline state object represents a specific combination of rendering states and shader procedures. These generated pipeline state objects are then stored in a precompiled object manifest file. This manifest file acts as a database or index, recording all pipeline state objects that need to be precompiled. The creation of this file is one of the key steps in the entire process, as it lays the foundation for subsequent precompilation work.
[0083] In some implementations of game development, to ensure the comprehensiveness and adaptability of Pipeline State Objects (PSOs), the development server and the online server each play different roles, jointly ensuring PSO coverage throughout the entire game process.
[0084] The development server is primarily used to collect PSO (Profile Requests) generated by new game versions. During game development, as new features, scenes, and effects are continuously added, rendering requirements constantly change and expand. The game version on the development server typically contains the latest code and resources, thus generating many new PSO build requests. By running the game on the development server and capturing these requests, version-specific PSO data can be collected. This data is crucial for early detection and optimization of rendering performance for new content.
[0085] The online server focuses on collecting PSOs (Player Instances) from past game versions. Released game versions encounter various scenarios and player behaviors during actual gameplay, which can lead to the frequent use of specific PSOs. The PSO data collected by the online server reflects the game's performance in real-world environments, including players' actual actions and experiences in various game scenarios. This data helps ensure that important PSOs from past versions are not missed during game updates, thus guaranteeing game stability and compatibility.
[0086] By dividing the work between the development server and the online server, we can ensure that the game's PSO data covers all stages from development to release. The development server's PSO data provides a forward-looking perspective for future version optimizations, while the online server's data ensures the stable operation of the current version. This comprehensive coverage strategy helps maintain good rendering performance and player experience throughout different stages of the game's lifecycle.
[0087] The development server is primarily responsible for collecting new version PSOs to adapt to constantly changing rendering requirements and optimize the performance of new content; the online server collects PSOs from past versions to ensure the stability and compatibility of released content. Together, they guarantee PSO coverage throughout the game's entire lifecycle, providing a solid data foundation for generating efficient and comprehensive pre-compiled object manifest files. This process is a crucial part of game rendering resource management, contributing to improved overall game performance and user experience.
[0088] Reference Figure 2 According to some embodiments of this application, step S103, which involves obtaining pipeline status objects generated based on the metadata of each pipeline status and generating a pre-compiled object manifest file based on each pipeline status object, may include:
[0089] Step S201: Obtain pipeline status objects generated based on the metadata of each pipeline status, and generate a list of pre-compiled objects based on each pipeline status object;
[0090] Step S202: Based on the list of precompiled objects, generate a precompiled object manifest file in a cross-platform compatible format.
[0091] Generating a precompiled object manifest file is a crucial step in the compilation of game rendering resources, ensuring that pipeline state objects (PSOs) can be effectively managed and utilized.
[0092] In some embodiments, step S201 involves obtaining pipeline state objects generated based on the metadata of each pipeline state, and generating a list of precompiled objects based on each pipeline state object.
[0093] It's important to note that this involves obtaining pipeline state objects generated based on the metadata of each pipeline state. This pipeline state metadata is collected during game execution and contains all the information needed to generate a PSO, such as shader hashes, rendering states, vertex layout information, and gameplay-related tags. Each pipeline state object represents a specific combination of rendering states and shader procedures, accurately reflecting the game's rendering requirements in different scenarios.
[0094] Based on these pipeline state objects (PSOs), embodiments of this application can generate a precompiled object list. This precompiled object list contains all PSOs that need to be precompiled, and each PSO is recorded in the list in a structured manner. The generation of the precompiled object list is the foundation of the entire process, ensuring that subsequent precompilation work can be performed on all necessary PSOs, avoiding omissions or duplications.
[0095] In game development, generating a list of precompiled objects is a crucial step that directly impacts the efficiency of subsequent precompilation processes and the game's runtime performance. During the generation of the precompiled object list based on the state objects of each pipeline, multi-dimensional data filtering is used to optimize this list, ensuring its efficiency and usability.
[0096] First, this embodiment of the application can perform a validity analysis on the collected pipeline state objects. This step aims to ensure that each PSO complies with the game's rendering requirements and the specifications of the graphics API. Illegal or invalid PSOs may be caused by incorrect shader code, unsupported rendering state configurations, or incompatible hardware requirements. By filtering out these illegal PSOs, errors or exceptions can be avoided during pre-compilation and game runtime, ensuring the stability and reliability of the game.
[0097] Secondly, this application embodiment can filter PSOs based on their usage frequency. In different game scenarios and gameplay, some PSOs may be used frequently, while others may be rarely invoked. By analyzing the usage frequency of each PSO, this application embodiment can identify the critical PSOs that have the greatest impact on game performance. Prioritizing the inclusion of these frequently used PSOs in the pre-compiled object list ensures that the game can quickly use these pre-compiled resources during runtime, reducing stuttering caused by compilation delays and thus improving the overall smoothness of the game.
[0098] Furthermore, embodiments of this application can also refer to gameplay-related tags for further filtering. These tags may include the game scene to which the PSO belongs, the associated game effects, the corresponding shader variant type, etc. Through these tags, it is possible to more precisely control which PSOs should be pre-compiled and which can be compiled on demand or dynamically generated. For example, in some high-performance competitive scenarios, it may be necessary to pre-compile all relevant PSOs to ensure the highest frame rate; while in some less important cutscenes or menu interfaces, the number of pre-compiled PSOs can be appropriately reduced to balance resource consumption and performance.
[0099] Through the aforementioned multi-dimensional filtering process, this embodiment of the application can generate a concise and efficient PSO pre-compilation list. This list includes the most frequently used, legally valid PSOs that have a significant impact on game performance. By reducing unnecessary PSOs entering the pre-compilation process, the problem of excessive data volume leading to excessively long pre-compilation times is avoided. This not only speeds up the game's construction and release process but also reduces the pre-compilation time at game startup, allowing players to enter the game faster and improving the overall gaming experience.
[0100] As can be seen, the process of generating the precompiled object list employs multi-dimensional filtering, including validity analysis, usage frequency analysis, and gameplay-related tag selection, ensuring the efficiency and relevance of the PSO precompiled list. This optimization step plays a crucial role in improving game rendering performance and player experience.
[0101] In some embodiments, step S202 generates a precompiled object manifest file in a cross-platform compatible format based on the precompiled object list.
[0102] It's important to note that a cross-platform compatible precompiled object manifest file is generated based on the precompiled object list. The purpose of this manifest file is to ensure that the precompiled PSO can be correctly recognized and used on different platforms and hardware configurations. Cross-platform compatibility means that the file follows a unified specification, ensuring consistent behavior and performance of the PSO regardless of the operating system or hardware architecture. Generating a cross-platform compatible precompiled object manifest file involves converting the information in the precompiled object list into a universal format that can be parsed by different platforms. This may include steps such as adjusting data structures, abstracting platform-specific information, and standardizing file storage formats. In this way, precompiled PSO resources can be reused across different game versions and platforms, greatly improving resource utilization efficiency and development convenience.
[0103] It's important to note that the precompiled object list is a temporary data structure generated in memory to store pipeline state objects generated based on the metadata of each pipeline state. This list is an intermediate step in internal processing, primarily used to manage and manipulate pipeline state objects during the current compilation or build process. The precompiled object manifest file, on the other hand, is generated after further processing and formatting the information in the precompiled object list. This file is persistent, typically stored on disk in a specific file format, and can be used in different environments (such as different platforms or devices).
[0104] The precompiled object list is a temporary data structure generated in memory that exists during the game's build or compilation process, while the precompiled object manifest file is a persistent file generated after the build process is complete. It is usually packaged into the game assets and released with the game.
[0105] The precompiled object list may only contain references or identifiers to pipeline state objects, while the precompiled object manifest file contains detailed information about these objects and is stored in a cross-platform compatible format.
[0106] The precompiled object list guides the precompilation work during the current build process and is part of the internal processing; while the precompiled object manifest file guides the precompilation of PSO when the game starts and is a key resource file for the game to start quickly and render efficiently.
[0107] It should be understood that the precompiled object list and the precompiled object manifest file play different roles in the game rendering resource compilation process, being generated at different stages and used for different purposes. The precompiled object list is an intermediate product of internal processing, while the precompiled object manifest file is the final, cross-platform compatible resource file used to ensure efficient rendering and performance of the game on different platforms.
[0108] Reference Figure 3 According to some embodiments of this application, the precompiled object list is configured with corresponding shader variant files. Step S202, based on the precompiled object list, generates a precompiled object manifest file in a cross-platform compatible format, which may include:
[0109] Step S301: Obtain the current shader variant information and update the shader variant file based on the current shader variant information;
[0110] Step S302: Based on the updated precompiled object list and shader variant file, perform binding verification to generate a precompiled object manifest file in a cross-platform compatible format.
[0111] In game development, generating a precompiled object manifest file in a cross-platform compatible format is a crucial step to ensure efficient utilization of rendering resources and cross-platform compatibility. According to some embodiments of this application, this process involves combining a precompiled object list with shader variant files, as well as update and verification mechanisms. The precompiled object list is an intermediate data structure containing references or identifiers of pipeline state objects (PSOs) required by the game in different scenarios. Each PSO corresponds to a specific rendering state and shader variant. The shader variant files record detailed information about the various shader variants generated during game development, including their code, parameter settings, and usage scenarios.
[0112] In some embodiments, step S301 involves obtaining current shader variant information and updating the shader variant file based on the current shader variant information.
[0113] It's important to note that generating the precompiled object manifest file first requires obtaining the current shader variant information. This information reflects the latest state of the shader variants used by the game in its current development stage or build. By incorporating this current information into the shader variant file, it's ensured that the file contains all the latest shader variant data, thus providing an accurate basis for subsequent precompilation work.
[0114] In some embodiments, step S302 involves performing binding verification based on the updated precompiled object list and shader variant files to generate a precompiled object manifest file in a cross-platform compatible format.
[0115] It should be noted that after updating the shader variant file, this embodiment can perform binding verification based on the precompiled object list and the updated shader variant file. The purpose of this step is to verify the compatibility and consistency between each pipeline state object in the precompiled object list and the corresponding shader variant in the shader variant file. This verification ensures that when generating the precompiled object manifest file, all PSOs are associated with the correct shader variant and can be correctly resolved and used on different platforms.
[0116] Finally, based on the verified precompiled object list and shader variant files, this embodiment of the application can generate a precompiled object manifest file in a cross-platform compatible format. This precompiled object manifest file not only contains all the necessary PSO information but also ensures that this information can be correctly read and applied on different operating systems and hardware platforms. In this way, it can be ensured that the target game maintains consistent rendering performance and visual effects across multiple platforms.
[0117] Reference Figure 4 According to some embodiments of this application, after obtaining the current shader variant information in step S301 and updating the shader variant file based on the current shader variant information, the method may further include:
[0118] Step S401: Based on the updated shader variant file, form a pipeline state variant file;
[0119] Step S402: Based on the pipeline status variant file, update the corresponding pipeline status objects to obtain the updated pipeline status objects.
[0120] In game development and optimization, updating shader variant files and pipeline state objects is a crucial step in ensuring rendering efficiency and performance. According to some embodiments of this application, after obtaining the current shader variant information and updating the shader variant file, a pipeline state variant file can be further formed, and the corresponding pipeline state object can be updated accordingly.
[0121] In some embodiments, step S401 involves forming a pipeline state variant file based on the updated shader variant file;
[0122] It's important to note that after obtaining and updating the shader variant file, the next step is to create a pipeline state variant file based on this updated file. The shader variant file contains detailed information about all shader variants in the current game version, such as shader code, parameter configurations, and usage scenarios. The pipeline state variant file, on the other hand, is a comprehensive file generated based on this shader variant information, combined with rendering states and other relevant configurations. It records all possible pipeline state variants, corresponding to the combinations of rendering states required by the game under different scenes and conditions.
[0123] In some embodiments, step S402 involves updating the corresponding pipeline status objects based on the pipeline status variant file to obtain the updated pipeline status objects.
[0124] It's important to note that based on the resulting pipeline state variant files, the corresponding individual pipeline state objects can be updated. This step involves applying the information from the pipeline state variant files to the specific pipeline state objects. Each pipeline state object is adjusted and optimized according to the data in the variant files to ensure that they accurately reflect the game's latest rendering requirements and configurations.
[0125] It should be understood that updating the pipeline state object enables more efficient and accurate rendering services during game runtime. The updated pipeline state object is better adapted to the current version of the game, including new shader effects, modified rendering logic, and optimized graphics configurations. This helps improve the overall rendering efficiency of the game and reduces performance issues caused by pipeline state mismatches.
[0126] In some embodiments, step S104 involves traversing the precompiled object manifest file to precompile each pipeline state object stored in the precompiled object manifest file, generating game rendering cache resources corresponding to each pipeline state object.
[0127] It's important to note that the pre-compiled object manifest file is traversed, and each pipeline state object stored within is pre-compiled. This pre-compilation process involves in-depth processing of the pipeline state objects, including compiling shader programs, verifying the compliance of rendering states, and optimizing pipeline state settings. Through this process, game rendering cache resources corresponding to each pipeline state object are generated. These cached resources can be directly accessed by the rendering engine during game runtime, thus avoiding time-consuming compilation operations at runtime.
[0128] Reference Figure 5 According to some embodiments of this application, step S103, which involves obtaining pipeline status objects generated based on the metadata of each pipeline status and generating a pre-compiled object manifest file based on each pipeline status object, may include:
[0129] Step S501: Build the target game package based on the pre-compiled object manifest file to obtain the target game package.
[0130] In step S104, the precompiled object manifest file is traversed to precompile each pipeline state object stored in the precompiled object manifest file, generating game rendering cache resources corresponding to each pipeline state object, which may include:
[0131] Step S502: Load the target game package to perform the initial startup operation on the target game;
[0132] Step S503: During the execution of the initial startup operation, the precompiled object manifest file is traversed to determine multiple pipeline state objects;
[0133] Step S504: Pre-compile for each pipeline state object to generate game rendering cache resources corresponding to each pipeline state object.
[0134] In some embodiments, step S501 involves constructing the target game package based on the precompiled object manifest file to obtain the target game package.
[0135] It's important to note that the target game's package is built based on a pre-compiled object manifest file. This pre-compiled object manifest file contains information on all pipeline state objects that need to be pre-compiled. Each pipeline state object has been optimized and filtered to ensure its efficiency and necessity in the game. By integrating these pipeline state objects into the game package, it's ensured that the game includes all necessary rendering resources upon release.
[0136] In some embodiments, step S502 involves loading the target game package to perform an initial launch operation on the target game.
[0137] It should be noted that after the game package is built, this embodiment of the application can traverse the pre-compiled object manifest file and pre-compile each pipeline state object stored therein. This process occurs during game installation or updates, with the aim of pre-generating all necessary rendering cache resources before the game actually runs. The pre-compilation process involves converting pipeline state objects into platform-specific rendering cache resources, which will be stored on the device for rapid loading and use during game runtime.
[0138] When the game is launched, this embodiment can load the target game package and begin the initial startup operation. During this stage, the engine of this embodiment initializes various resources and systems, including the rendering engine, audio system, input system, etc. Simultaneously, the rendering engine prepares to load pre-compiled rendering cache resources, preparing for the game's rendering process.
[0139] In some embodiments, step S503 involves traversing the precompiled object manifest file during the execution of the initial startup operation to determine multiple pipeline state objects;
[0140] It should be noted that during the initial startup process, this embodiment of the application can again traverse the pre-compiled object manifest file to identify multiple pipeline state objects that need to be loaded and used. This step ensures that all necessary pipeline state objects have been identified and prepared when the game starts, so that they can be quickly invoked during the rendering process.
[0141] In some embodiments, step S504 involves pre-compiling for each pipeline state object to generate game rendering cache resources corresponding to each pipeline state object.
[0142] It should be noted that, for each specific pipeline state object, this embodiment of the application can perform a pre-compilation operation to generate corresponding game rendering cache resources. These game rendering cache resources are optimized for specific platforms and can be directly used by the game engine at runtime without recompilation. In this way, this embodiment of the application can complete most of the compilation work during the startup phase, reducing runtime loading time and stuttering.
[0143] It should be understood that by building the package based on a pre-compiled object manifest file and pre-compiling it by traversing the manifest file at game startup, developers can ensure that the game can quickly load and use pre-compiled pipeline state objects at runtime. This process not only optimizes game startup time but also improves rendering efficiency.
[0144] Reference Figure 6 According to some embodiments of this application, after pre-compiling for each pipeline state object in step S504 to generate the game rendering cache resource corresponding to each pipeline state object, the process may further include:
[0145] Step S601: Obtain the compilation environment information corresponding to the pre-compilation of each pipeline state object;
[0146] Step S602: Based on the game rendering cache resources and compilation environment information, a local cache directory is generated.
[0147] In some embodiments, step S601 involves obtaining compilation environment information corresponding to the pre-compilation of each pipeline state object.
[0148] It should be noted that during the pre-compilation pipeline state object process, this embodiment of the application can record the compilation environment information for each object during compilation. This compilation environment information includes, but is not limited to, the operating system version, the graphics driver version, the GPU model, and other relevant hardware and software configurations. Compilation environment information is crucial for ensuring the compatibility and performance of the generated rendering cache resources on specific devices.
[0149] In some embodiments, step S602 involves integrating and generating a local cache directory based on game rendering cache resources and compilation environment information.
[0150] It should be noted that after obtaining the compilation environment information, this embodiment of the application can integrate this information with the generated game rendering cache resources to form a local cache directory. This directory not only stores the pre-compiled rendering cache resources but also records the environment configuration at the time of each resource's generation. In this way, the local cache directory can provide complete context information about the cached resources, ensuring that these resources can be correctly used and managed in subsequent game runs.
[0151] By integrating compilation environment information and game rendering cache resources to generate a local cache directory, this embodiment of the application can quickly identify and load cache resources that match the current device environment at startup. This not only speeds up game startup but also ensures the efficiency and stability of the rendering process. If the game detects a mismatch between the current compilation environment and the environment information of the cache resources, it can trigger a recompilation process to generate new cache resources suitable for the current environment, thereby avoiding rendering problems or performance degradation caused by environment inconsistency.
[0152] Reference Figure 7 According to some embodiments of this application, after step S602, which integrates and generates a local cache directory based on game rendering cache resources and compilation environment information, the following may also be included:
[0153] Step S701: Load the target game package to perform subsequent startup operations on the target game;
[0154] Step S702: During the execution of subsequent startup operations, obtain the current game environment information;
[0155] Step S703: Compare the current game environment information with the compilation environment information stored in the local cache directory to obtain the environment determination result;
[0156] Step S704: In response to the environment determination result indicating that the game environment has not changed, continue loading the target game package based on the game rendering cache resources;
[0157] In step S705, in response to the change in the game environment reflected by the environment determination result, pre-compile for each pipeline state object to update the game rendering cache resources corresponding to each pipeline state object, and continue to load the target game package based on the updated game rendering cache resources.
[0158] Ensuring game performance and compatibility under different environments is a significant challenge during game development and optimization. According to some embodiments of this application, after integrating and generating a local cache directory, the game's startup process and rendering performance can be further optimized.
[0159] In some embodiments, step S701 involves loading the target game package to perform subsequent startup operations on the target game.
[0160] It should be noted that when the game is restarted, this embodiment loads the target game package to perform subsequent startup operations. During this stage, the engine initializes various resources and systems, including the rendering engine, audio system, and input system. Simultaneously, the engine prepares to load the game rendering cache resources previously generated in the local cache directory.
[0161] In some embodiments, step S702 involves obtaining current game environment information during the execution of subsequent startup operations;
[0162] It should be noted that during the subsequent startup process, this embodiment of the application will obtain information about the current game runtime environment. This information includes the operating system version, graphics driver version, GPU model, and other relevant hardware and software configurations. Obtaining the current game environment information is for comparison with the compilation environment information stored in the local cache directory to determine whether the pipeline state object needs to be recompiled.
[0163] In some embodiments, step S703 compares the current game environment information with the compilation environment information stored in the local cache directory to obtain an environment determination result.
[0164] It should be noted that the currently acquired game environment information is compared with the compilation environment information stored in the local cache directory to obtain the environment determination result. This comparison process is achieved by checking whether key environment parameters have changed. If key parameters (such as driver version, GPU model, etc.) have not changed, the game environment is considered unchanged; if key parameters have changed, the game environment is considered changed.
[0165] In some embodiments, step S704, in response to the environment determination result reflecting that the game environment has not changed, continues to load the target game package based on the game rendering cache resources;
[0166] It should be noted that different response measures will be taken in this application embodiment based on the environmental determination result. If the determination result shows that the game environment has not changed, this application embodiment will continue to load the target game package based on the previously generated game rendering cache resources. This ensures that the game can start quickly and perform efficient rendering using existing cache resources.
[0167] In some embodiments, step S705, in response to the environment determination result reflecting a change in the game environment, recompiles each pipeline state object to update the game rendering cache resources corresponding to each pipeline state object, and continues to load the target game package based on the updated game rendering cache resources.
[0168] It should be noted that if the determination result indicates that the game environment has changed, this embodiment will recompile for each pipeline state object. This step is to generate game rendering cache resources compatible with the new environment. The recompiling process involves converting pipeline state objects into rendering cache resources suitable for the current environment, ensuring that the game can run normally and maintain high performance in the new environment. After the recompiling is completed, this embodiment will update the local cache directory according to the updated game rendering cache resources. This step ensures that the resources in the local cache directory are always consistent with the current game environment, providing the latest cache resources for subsequent game startup and rendering.
[0169] It should be understood that by loading the target game package, obtaining current game environment information, comparing the environment information, and taking corresponding response measures based on the comparison results, this embodiment of the application can ensure the compatibility and performance of the game in different environments. This process not only optimizes the game's startup time but also improves rendering efficiency, ensuring that players can enjoy a smooth gaming experience. By dynamically adjusting and optimizing cached resources, this embodiment of the application can adapt to different hardware and software environments, providing stable and high-quality visual effects.
[0170] Reference Figure 8 The game screen rendering method according to the embodiments of this application may include:
[0171] Step S801: Load multiple game rendering cache resources generated by the game rendering resource compilation method of this application embodiment;
[0172] Step S802: Obtain the rendering instructions of the target game in the current frame.
[0173] Step S803: Select the target rendering cache resource from multiple game rendering cache resources according to the rendering instructions;
[0174] Step S804: Bind the target rendering cache resource to the rendering pipeline of the preset rendering engine, and perform screen rendering operations through the rendering pipeline to obtain the target game screen.
[0175] The game rendering method according to the embodiments of this application can significantly improve rendering efficiency and reduce runtime stuttering by effectively utilizing pre-compiled game rendering cache resources.
[0176] First, multiple game rendering cache resources generated by the game rendering resource compilation method of this application need to be loaded. These game rendering cache resources are pre-compiled when the game starts or updates, and contain pipeline state objects (PSOs) optimized for specific platforms and other related rendering data. By loading these game rendering cache resources during the game initialization phase, it can be ensured that these game rendering cache resources can be quickly accessed and used during the rendering process, thereby reducing the performance overhead caused by real-time compilation.
[0177] During game execution, the rendering of each frame requires specific instructions to guide the rendering pipeline to perform corresponding operations. These rendering instructions include various rendering parameters and state configurations required for the current frame, such as the shaders used, rendering targets, and transformation matrices. By obtaining these rendering instructions, embodiments of this application can determine which pre-compiled rendering cache resources need to be used for the current frame.
[0178] Based on the obtained rendering instructions, this embodiment selects a target rendering cache resource that matches the rendering requirements of the current frame from a plurality of loaded game rendering cache resources. This step can be achieved by matching the parameters in the rendering instructions with the metadata of the cache resources. For example, if the rendering instructions specify a particular lighting effect and texture map, the system will find resources containing the corresponding pipeline state objects and shader variants from the cache resources.
[0179] After selecting the target render cache resource, it is bound to the render pipeline of the preset render engine. This involves setting the pipeline state object and shader program from the cache resource into the current render pipeline, ensuring that the render engine uses the pre-compiled resource when performing render operations. In this way, the render pipeline can efficiently process vertex data, execute shader programs, and finally output the render results to the screen, generating the target game screen.
[0180] The game rendering method of this application effectively optimizes the rendering process of the target game by loading pre-compiled game rendering cache resources, obtaining the rendering instructions of the current frame, selecting matching cache resources, and implementing them into the rendering pipeline. This method reduces runtime compilation work, lowers the risk of stuttering, and ensures high performance of the target game under various hardware configurations. By pre-compiling and efficiently utilizing cache resources, this application embodiment can present high-quality visual effects in a smoother and more stable manner, thereby improving the overall player experience.
[0181] Reference Figure 9 , Figure 9 This illustration shows the hardware structure of an electronic device according to another embodiment. The electronic device may include:
[0182] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0183] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the game rendering resource compilation method or game screen rendering method of the embodiments of this application.
[0184] The input / output interface 903 is used to implement information input and output;
[0185] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0186] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);
[0187] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0188] This application also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the game rendering resource compilation method or game screen rendering method described in the embodiments of this application.
[0189] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the foregoing drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “including,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.
[0190] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0191] It should be understood that in the description of the embodiments of this application, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.
[0192] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0193] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0194] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0195] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium may include: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code.
[0196] It should also be understood that the various implementation methods provided in this application can be combined arbitrarily to achieve different technical effects.
[0197] The above is a detailed description of the embodiments of this disclosure. However, this disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this disclosure. All such equivalent modifications or substitutions are included within the scope defined by the claims of this disclosure.
Claims
1. A method for compiling game rendering resources, characterized in that, include: Obtain compilation requests for multiple pipeline states corresponding to the target game; For each pipeline state compilation request, pipeline state metadata corresponding to the target game in different game scenarios is extracted; Obtain pipeline state objects generated based on the metadata of each pipeline state, and generate a pre-compiled object manifest file based on each pipeline state object, including: The target game package is constructed based on the precompiled object manifest file to obtain the target game package; wherein, each pipeline state object is stored in the precompiled object manifest file; The process involves traversing the precompiled object manifest file to precompile each pipeline state object stored in the precompiled object manifest file, generating a game rendering cache resource corresponding to each pipeline state object. This includes: loading the target game package to perform an initial startup operation on the target game; during the execution of the initial startup operation, traversing the precompiled object manifest file to determine multiple pipeline state objects; and precompiling for each pipeline state object to generate the game rendering cache resource corresponding to each pipeline state object. Obtain the compilation environment information corresponding to the pre-compilation of each pipeline state object; Based on the game rendering cache resources and the compilation environment information, a local cache directory is generated. Load the target game package to perform subsequent launch operations on the target game; During the subsequent startup process, obtain the current game environment information; The current game environment information is compared with the compilation environment information stored in the local cache directory to obtain the environment determination result; In response to the environment determination result indicating that the game environment has not changed, the target game package continues to be loaded based on the game rendering cache resources; In response to the environment determination result reflecting a change in the game environment, each pipeline state object is recompiled to update the game rendering cache resources corresponding to each pipeline state object, and the target game package is loaded again based on the updated game rendering cache resources.
2. The method according to claim 1, characterized in that, The step of obtaining pipeline state objects generated based on the metadata of each pipeline state, and generating a pre-compiled object manifest file based on each pipeline state object, includes: Obtain pipeline status objects generated based on the metadata of each pipeline status, and generate a list of precompiled objects based on each pipeline status object; Based on the precompiled object list, a precompiled object manifest file in a cross-platform compatible format is generated.
3. The method according to claim 2, characterized in that, The precompiled object list is configured with corresponding shader variant files. The step of generating the precompiled object manifest file in a cross-platform compatible format based on the precompiled object list includes: Obtain the current shader variant information and update the shader variant file based on the current shader variant information; Based on the updated list of precompiled objects and the shader variant file, a binding verification is performed to generate the precompiled object manifest file in a cross-platform compatible format.
4. The method according to claim 3, characterized in that, After obtaining the current shader variant information and updating the shader variant file based on the current shader variant information, the method further includes: Based on the updated shader variant file, a pipeline state variant file is formed; Based on the pipeline status variant file, the corresponding pipeline status objects are updated to obtain the updated pipeline status objects.
5. A method for rendering game graphics, characterized in that, include: Load multiple game rendering cache resources generated by the game rendering resource compilation method according to any one of claims 1 to 4; Obtain the rendering instructions for the target game in the current frame; Select a target rendering cache resource from among the multiple game rendering cache resources according to the rendering instructions; The target rendering cache resource is bound to the rendering pipeline of the preset rendering engine, and the rendering operation is performed through the rendering pipeline to obtain the target game screen.
6. An electronic device, characterized in that, include: The system includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the game rendering resource compilation method as described in any one of claims 1 to 4, or the game screen rendering method as described in claim 5.
7. A computer-readable storage medium, characterized in that, The storage medium stores a program, which is executed by a processor to implement the game rendering resource compilation method as described in any one of claims 1 to 4, or the game screen rendering method as described in claim 5.