CN116416355A - Shader script generation method and device, electronic equipment and storage medium - Google Patents

Shader script generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116416355A
CN116416355A CN202111655976.9A CN202111655976A CN116416355A CN 116416355 A CN116416355 A CN 116416355A CN 202111655976 A CN202111655976 A CN 202111655976A CN 116416355 A CN116416355 A CN 116416355A
Authority
CN
China
Prior art keywords
shader
script
statement
programming language
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111655976.9A
Other languages
Chinese (zh)
Inventor
朱辉
周金栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202111655976.9A priority Critical patent/CN116416355A/en
Publication of CN116416355A publication Critical patent/CN116416355A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The embodiment of the disclosure provides a method, a device, electronic equipment and a storage medium for generating a shader script, and relates to the technical field of image processing, wherein the method comprises the steps of obtaining a first shader script based on a first programming language, wherein the first shader script is used for representing rendering logic of a shader; generating a second shader script and shader configuration information based on a second programming language according to the first shader script, wherein the shader configuration information characterizes rendering parameters of a shader; and generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to perform image rendering. Because the programming of the shader script is performed by another programming language different from the shader language, the diversification of the generation mode of the shader script can be realized, and the development flexibility and the development efficiency of the shader script are improved.

Description

Shader script generation method and device, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of image processing, in particular to a method and a device for generating a shader script, electronic equipment and a storage medium.
Background
In the process of controlling the display device to display an image, the obtained image data needs to be rendered on a display interface, and a program for implementing the image rendering process is called a Shader (loader). The shader replaces the conventional fixed rendering pipeline, can implement the related computation in 3D graphics computation, and can implement various image effects due to its editability without being limited by the fixed rendering pipeline of the graphics card.
In the prior art, in a scene of applying a shader to perform 3D image rendering, corresponding shading logic, namely, a shader script, needs to be written for the shader, so as to drive the shader to perform image rendering. Current shader scripts are typically implemented based on the shader language to which the shader corresponds, e.g., high-level shader language (High Level Shader Language, HLSL), openGL shading language (OpenGL Shading Language, GLSL).
However, in the actual development process, the use difficulty is high due to the complex rule of the shader language, so that the problems of low development efficiency, unstable quality of the shader script and the like exist when the shader script is developed based on the shader language.
Disclosure of Invention
The embodiment of the disclosure provides a method, a device, electronic equipment and a storage medium for generating a shader script, which are used for solving the problems of low development efficiency, low script quality and the like of the shader script caused by complex rules of a shader language and high use difficulty.
In a first aspect, an embodiment of the present disclosure provides a shader script generation method, including:
obtaining a first shader script based on a first programming language, the first shader script being used to characterize rendering logic of a shader; generating a second shader script and shader configuration information based on a second programming language according to the first shader script, wherein the shader configuration information characterizes rendering parameters of the shader, and the second programming language is a shader language corresponding to the shader; and generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to perform image rendering.
In a second aspect, embodiments of the present disclosure provide a shader script generation apparatus, including:
an acquisition module for acquiring a first shader script based on a first programming language, the first shader script being used to characterize rendering logic of a shader;
The system comprises a parsing module, a first programming module and a second programming module, wherein the parsing module is used for generating a second shader script and shader configuration information based on a second programming language according to a first shader script, and the shader configuration information characterizes rendering parameters of the shader;
and the generating module is used for generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to render images.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory to implement the shader script generation method as described above in the first aspect and the various possible designs of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer readable storage medium having stored therein computer executable instructions that when executed by a processor implement the shader script generation method described above in the first aspect and the various possible designs of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the shader script generation method of the first aspect and the various possible designs of the first aspect.
The embodiment provides a method, a device, an electronic device and a storage medium for generating a shader script, wherein the method is characterized in that a first shader script based on a first programming language is acquired, and the first shader script is used for representing rendering logic of a shader; generating a second shader script and shader configuration information based on a second programming language according to the first shader script, wherein the shader configuration information characterizes rendering parameters of the shader, and the second programming language is a shader language corresponding to the shader; and generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to perform image rendering. The method has the advantages that the generation mode of the shader script is diversified by writing the shader script in another programming language different from the shader language, the shader script is converted into the shader language, the shader configuration information is combined to generate the target shader script which can be identified by the shader and drive the shader to perform image rendering, so that a developer can develop the shader script in the familiar programming language, the development flexibility and development efficiency of the shader script are improved, and the generation quality of the shader script and the rendering effect of the shader are further improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the description of the prior art, it being obvious that the drawings in the following description are some embodiments of the present disclosure, and that other drawings may be obtained from these drawings without inventive effort to a person of ordinary skill in the art.
FIG. 1 is a schematic diagram illustrating a shader operation according to an embodiment of the disclosure;
FIG. 2 is a flowchart illustrating a method for generating a shader script according to an embodiment of the disclosure;
FIG. 3 is a flowchart illustrating steps for implementing step S102 in the embodiment shown in FIG. 2;
FIG. 4 is a schematic diagram illustrating the conversion of a first shader script and a second shader script according to an embodiment of the disclosure;
FIG. 5 is a second flowchart of a method for generating a shader script according to an embodiment of the disclosure;
FIG. 6 is a flowchart illustrating steps performed in step S211 in the embodiment shown in FIG. 5;
FIG. 7 is a schematic diagram of a target shader script provided by an embodiment of the disclosure;
FIG. 8 is a block diagram of a shader script generation device provided by an embodiment of the disclosure;
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure;
fig. 10 is a schematic hardware structure of an electronic device according to an embodiment of the disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments of the present disclosure, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
The application scenario of the embodiments of the present disclosure is explained below:
fig. 1 is a schematic diagram of a working process of a shader provided by an embodiment of the disclosure, where the shader is a program running in a GPU and is used for setting attributes such as vertices, textures, illumination, and the like in an image, before the shader runs, as shown in fig. 1, a shader script written by a developer needs to be loaded into a pre-generated shader, and configuration steps such as compiling and program linking are performed, so as to generate a shader capable of realizing an image rendering function, and the shader is shown as a configured shader, and the configured shader is capable of receiving primitive information, processing and outputting a rendered image. The method for generating the shader script can be applied to an application scene for generating the shader script before loading the shader script.
In the prior art, before a shader is applied to perform 3D image rendering, corresponding shading logic, namely a shader script, needs to be written for the shader to realize mapping changes of primitive information, such as coordinate space conversion, normal vector space conversion, texture conversion, pixel color calculation, illumination calculation and the like, so as to drive the shader to perform image rendering, and realize the image effect designed by a developer. Current shader scripts are typically implemented based on the shader language to which the shader corresponds, e.g., high-level shader language (High Level Shader Language, HLSL), openGL shading language (OpenGL Shading Language, GLSL). However, in the actual development process, since the shader language mostly uses the independent programming language based on the C language, the difficulty in use is high, so that when the shader script development is performed based on the shader language, the problems of low development efficiency, unstable quality of the shader script and the like exist.
Referring to fig. 2, fig. 2 is a flowchart illustrating a shader script generation method according to an embodiment of the disclosure. The method of the embodiment can be applied to electronic equipment such as terminal equipment, a server and the like, and the method for generating the color script comprises the following steps:
Step S101: a first shader script is obtained that is based on a first programming language, the first shader script being used to characterize rendering logic of a shader.
Illustratively, the first shader script is a script written by a developer in a first programming language according to the specific needs of the image rendering, in particular, the first shader script may be text containing program code that characterizes the rendering logic of the shader. Wherein the first programming language is a different language with respect to a shader language (second programming language) to which the shader corresponds. Further, the first programming language is a programming language with a module loading function, such as a TypeScript language, and the second programming language is a GLSL language. Because of the concept of modules in the TypeScript programming language, the functions of loading and replacing modules can be realized. In particular, the modules are executed in their own scope and not in the global scope, so variables, functions, classes, etc. defined inside the modules are not visible outside the module, they can be exported and imported using export and import, the modules use the module loader to import other modules, and by using a first programming language with module loading functionality, such as the TypeScript language, a more convenient modular management can be achieved with respect to the shader language (the second programming language).
Further, the rendering logic of the shader represented by the first shader refers to information that accords with a development specification (for example, openGL specification) corresponding to the shader, and is capable of implementing an image rendering function corresponding to the shader after being loaded into a shader handle and compiled. According to more specific functions, the Shader may include at least one of a Vertex Shader (Vertex Shader), a Fragment Shader (Fragment), and a geometry Shader (geometry Shader), for implementing functions such as coordinate space conversion, normal vector space conversion, texture conversion, pixel color calculation, and illumination calculation, where rendering logic corresponding to the first Shader script is information characterizing the specific functions implemented by the Shader. Since the first shader script needs to implement the functions of the shader, in a specific implementation, since the first shader script is written by using a first programming language different from the shader language corresponding to the shader, the syntax forms of statements such as variable declarations, assignments and the like in the first shader script are different, but in a specific syntax logic, for example, the procedures of declaration, assignment and operation on three variables A, B, C are included in the shader script (i.e. the target shader script in the subsequent step) which can be loaded by the shader, and are rendering logic, and therefore, in the first shader script, the procedures of declaration, assignment and operation on three variables A, B, C implemented in the first programming language are also included.
Step S102, generating a second shader script and shader configuration information based on a second programming language according to the first shader script, wherein the shader configuration information characterizes rendering parameters of a shader, and the second programming language is a shader language corresponding to the shader.
For example, after the first shader script is obtained, since the first shader script is generated based on the first programming language and cannot be directly loaded to the shader, it needs to be converted to generate information that can be recognized and loaded by the shader to drive the shader to implement the corresponding function. Specifically, the first shader script includes two parts of content, which are respectively used for realizing rendering logic and rendering parameters. After the two parts of content are respectively converted, a second shader script and shader configuration information based on a second programming language are correspondingly generated.
Specifically, in one possible implementation manner, as shown in fig. 3, the implementation step of step S102 includes:
step S1021, analyzing the first shader script, and generating an abstract syntax tree corresponding to the first shader script, wherein the abstract syntax tree characterizes a code syntax structure in the first shader script.
Step S1022, converting the grammar expression of the code in the first shader script according to the abstract grammar tree and the preset conversion rule to generate a second shader script, wherein the conversion rule characterizes the mapping relation between the grammar expression of the first programming language and the grammar expression of the second programming language.
Specifically, an abstract syntax tree (Abstract Syntax Tree, AST) is an abstract representation of the syntax structure of source code, which represents the syntax structure of a programming language in the form of a tree, each node on the tree representing a structure in the source code. The first shader script is text containing program codes, and after steps such as scanning (scanner) and parsing (serving) are performed on the first shader script through a parser, a tree structure converted by the code of the first shader script terminal is output. The specific implementation process of transcoding into an abstract syntax tree is known in the art and will not be described in detail here.
Further, after the abstract syntax tree is generated, the syntax structure of the codes in the first shader script can be determined through the abstract syntax tree, after traversing, the content of each leaf node is obtained, and syntax conversion is performed based on a preset conversion rule, so that a second shader script based on a second programming language corresponding to the first shader script can be obtained.
Fig. 4 is a schematic diagram illustrating conversion between a first shader script and a second shader script according to an embodiment of the disclosure, as shown in fig. 4, the left side is a program code in the first shader script, and the program code defines (type) a data structure SpotLight and declares (let) a variable x based on the data structure. The program code in the first shader script is written based on a first programming language, the first programming language is a Typescript language, the SpotLight comprises two objects of color and position, and the types of the objects are vec3 types. After converting the program code in the first shader script based on the conversion rule, the program code in the second shader script on the right side is obtained, and the second shader script defines a structure body (structure) SpotLight and declares a variable x based on the structure body. The content represented by the second shader script is identical to the content represented by the first shader script, and will not be described in detail herein, but differs only in the syntax expression manner, i.e., the syntax expression is different. That is, the rendering logic of the first shader script and the second shader script are the same.
The preset conversion rule is information representing a mapping relationship between the grammar expressions of the first programming language and the second programming language, and the conversion rule may be set according to specific implementation of the first programming language and the second programming language, which will not be described in detail herein, and in the step of the embodiment, the first programming language TypeScript is exemplified, and the second programming language is GLSL language.
Step S1023, locating a third statement sentence corresponding to a preset keyword in the first shader script according to the abstract syntax tree, wherein the third statement sentence corresponding to the preset keyword is used for representing rendering parameters of the shader.
Step S1024, generating the configuration information of the shader through a third statement sentence corresponding to the preset keyword.
Specifically, the preset keyword refers to a variable declaration statement (i.e., a third declaration statement) for identifying a rendering parameter corresponding to the shader, such as "const". In shader languages, there is a unified (global) variable uniform for storing unchanged rendering parameters. The variable does not change with vertex or fragment changes unless it is updated by the application. The space of a unitorm is shared by vertices and fragment shaders, and unitorm variables are typically used to represent: transformation matrix, material, illumination parameters, color and other rendering parameters. In a different first programming language, there is a corresponding global variable declaration method, for example declaration using the keyword "const". Therefore, the keyword 'const' is located through the abstract syntax tree, so that the statement sentence of the global variable can be obtained, and further, the content in the statement sentence corresponding to the keyword is extracted to be used as the configuration information of the shader. The shader configuration information is used in a subsequent step to generate a unitorm variable in the shader language. More specifically, for example, within the first shader script, the following declarative statements are contained:
const HAS_UV:vec3=addInput(’XXX’);
The meaning of the statement expression is to declare a global variable has_uv of the vec3 type and assign a value to the global variable by loading 'XXX'. After locating the statement by locating key const, the content "has_uv" in the statement: vec3=addinput ('XXX') "extracts and generates shader configuration information.
Optionally, after generating the shader configuration information, the target shader script needs to be built based on the shader configuration information in a subsequent step, and therefore the shader configuration information should also be based on a second programming language of the adapted shader. Therefore, after generating the shader configuration information according to the third statement sentence corresponding to the preset keyword, the shader configuration information based on the first programming language is converted into the shader configuration information based on the second programming language.
Step S103, generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to perform image rendering.
In an exemplary embodiment, after determining the second shader script and the shader configuration information, the target shader script may be formed by combining the program code corresponding to the second shader script and the program code corresponding to the shader configuration information according to a script format required by a development specification corresponding to the shader. If the shader configuration information is based on the first programming language, the shader configuration information based on the first programming language is converted into the shader configuration information based on the second programming language before the target shader script is formed, and then the shader configuration information is processed.
Further, illustratively, depending on the specific rendering function implemented by the shader, other content, such as code referencing other functions, and other fixed header code required by the development specification, such as declarative statements corresponding to the application version, shader precision setting statements, etc., may also be included in the target shader script, together constituting the target shader script. Because the target shader script needs to be loaded to the shader for compiling in the subsequent steps, the development specifications corresponding to the shader need to be adapted, different development specifications corresponding to the shader need to be adapted, the specific implementation modes of the target shader script are different, and the target shader script can be adjusted according to specific needs, and the description is not repeated one by one.
In this embodiment, a first shader script is used to characterize rendering logic of a shader by obtaining the first shader script based on a first programming language; generating a second shader script and shader configuration information based on a second programming language according to the first shader script, wherein the shader configuration information characterizes rendering parameters of a shader; and generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to perform image rendering. The method has the advantages that the generation mode of the shader script is diversified by writing the shader script in another programming language different from the shader language, the shader script is converted into the shader language, the shader configuration information is combined to generate the target shader script which can be identified by the shader and drive the shader to perform image rendering, so that a developer can develop the shader script in the familiar programming language, the development flexibility and development efficiency of the shader script are improved, and the generation quality of the shader script and the rendering effect of the shader are further improved.
Referring to fig. 5, fig. 5 is a second flowchart of a shader script generation method according to an embodiment of the disclosure. The embodiment further refines step S102 on the basis of the embodiment shown in fig. 2, and the shader script generation method includes:
step S201, a first shader script based on a first programming language is acquired, the first shader script being used to characterize rendering logic of a shader.
Step S202, analyzing the first shader script, and generating an abstract syntax tree corresponding to the first shader script, wherein the abstract syntax tree characterizes a code syntax structure in the first shader script.
Step S203, generating the configuration information of the shader according to the abstract syntax tree.
In the embodiment shown in fig. 2, the specific implementation manner of steps S201 to S203 is described in detail, and will not be described here again.
Step S204, locating a first declaration statement based on a first programming language in the first shader script according to the abstract syntax tree.
Step S205, converting the declaration statement based on the first programming language into a second declaration statement based on the second programming language according to the type of the first declaration statement.
Illustratively, the first declarative statement is a statement that characterizes a definition of an internal variable within the first shader script, which is part of code that implements rendering logic of the first shader script. The first declarative statement within the first shader script is based on a first programming language that needs to be converted to a second programming language that can be loaded by the shader, wherein when the types of the first declarative statement are different, the implementation of the conversion to the corresponding second programming language is also different.
Specifically, the types of the first declaration statements include a first type for declaring a variable of a built-in type of the first programming language or a second type for declaring a variable of a custom type of the first programming language. When the type of the first declaration statement is the first type, the first declaration statement is directly rewritten according to a preset conversion rule, for example, the first programming language is TypeScript language, the second programming language is GLSL language, and the first declaration statement of the first type is as follows:
let x:mat;
the meaning of the first declaration statement representation is to declare a variable x of mat type. After conversion according to a preset conversion rule, the generated second sound statement based on GLSG voice is as follows:
mat x;
the meaning of the second sound sentence representation is the same as above, and the rewrite rules between different programming languages are preset, and are not described here.
When the type of the first declaration statement is the second type, firstly judging whether the first declaration statement based on the first programming language is a variable of a custom type, if so, converting the first declaration statement into a structural body (struct), and placing a specific variable in the variable of the custom type into the structural body to generate a second declaration statement based on the GLSG language. If not, the prompt information such as abnormality is output.
Step S206, positioning at least two first logic sentences based on the first programming language in the first shader script according to the abstract syntax tree, wherein the at least two first logic sentences are used for representing script logic corresponding to the first shader script.
Step S207, converting the logic text in each first logic statement into logic text based on the second programming language, and splicing to generate a second logic statement.
Illustratively, in the first shader script, code characterizing an operation process between variables, i.e., a first logic statement, such as an add-subtract multiply-divide operation, a condition judgment, etc., is further included to implement rendering logic such as spatial coordinate translation. After the keyword variable is performed through the abstract syntax tree, at least two first logic statements, such as if statements, assignment statements, and the like, in the first shader script can be determined, and the process is not repeated. Further, the logical text (text) in the first logical sentence is information for representing the specific content of the first logical sentence, the logical text in the first logical sentence is extracted, and text splicing is performed, which is equivalent to putting together the logics represented by the plurality of first logical sentences, and a continuous code text (that is, expressing the plurality of first logical sentences in the form of the second programming language) capable of being recognized and loaded by the shader is generated, that is, the second logical sentence. Specifically, the steps of this embodiment are applicable to the case where the second programming language is GLSL voice, so as to satisfy the coding specification corresponding to the GLSL language. Of course, it will be appreciated that when a first logical statement is included in the first shader script, the first logical statement may be directly converted to generate a second logical statement based on the second programming language without the need for a concatenation process.
Step S208, generating a second shader script according to the second sound statement and the second logic statement.
Further, based on the second programming language-based second declarative sentence and the second logic sentence obtained in the above steps, a second shader script for characterizing rendering logic of the shader can be obtained.
Step S209, according to the abstract syntax tree, obtaining a reference statement corresponding to the first shader script based on the first programming language, wherein the reference statement characterizes the referenced dependency function in the first shader script.
Step S210, generating a reference sentence based on a second programming language according to the reference sentence based on the first programming language.
Illustratively, in the first shader script, in addition to the first declarative statement and the logical statement introduced in the above steps, there is included a referenced dependent function, and before using the function, such referenced dependent function needs to be loaded first, the referenced statement is the code used to load the dependent function. The reference statement may be obtained by abstracting a grammar to determine a keyword to which the reference statement corresponds. For example, the reference statement based on the first programming language is:
import fnA from'./function';
the meaning of the above cited sentence is: the function fnA is loaded from the '/function' position. So that the function fnA can be invoked within the first shader script. The reference statement may be located by the keyword "import".
Further, after the reference sentence is converted based on the preset conversion rule, a reference sentence based on the second programming language may be generated, and a specific implementation form of the reference sentence is set based on a specification corresponding to the second programming language, which is not described herein.
Step S211, generating a target shader script according to the second shader script, the shader configuration information and the reference statement based on the second programming language.
Optionally, the target shader script includes a main function statement, a global variable statement and a dependent function statement, the target shader script includes the main function statement and the global variable statement, the main function statement is used for driving the shader to perform image rendering according to rendering logic, the global variable statement characterizes rendering parameters of the shader when performing image rendering, and the dependent function statement is used for defining a dependent function used in the image rendering process. As shown in fig. 6, step S211 includes three specific implementation steps of steps S2111, S2112, and S2113:
step S2111, a main function statement is generated from the second shader script.
Step S2112, a global variable statement is generated according to the shader configuration information.
Step S2113, generating a dependent function statement according to the reference statement based on the second programming language.
In the above steps, the program codes of the third part of the second shader script, the shader configuration information and the reference sentence are generated based on the first shader script, respectively, and then the target shader script is generated by combining the three parts of the program codes based on the development specifications corresponding to the shaders and splicing codes such as fixed header information. It should be noted that the order of the above three steps is not fixed, and the processing may be performed in parallel or in various orders as needed.
Fig. 7 is a schematic diagram of a target shader script provided by an embodiment of the disclosure, as shown in fig. 7, where the target shader script is composed of a main function statement (i.e. a void main () { } segment in the drawing), a global variable statement (i.e. a uniforms segment in the drawing), a dependent function statement (i.e. a vec2 fnA () { } segment in the drawing), and fixed header information, and contents of the first three statements are respectively generated by a second shader script converted into a second programming language, a shader configuration information, and a reference statement. Thereby completing the conversion process from the first programming language based shader script to the second programming language based target shader script that meets the shader correspondence specification.
Corresponding to the shader script generation method of the above embodiment, fig. 8 is a block diagram of the construction of the shader script generation apparatus provided by the embodiment of the present disclosure. For ease of illustration, only portions relevant to embodiments of the present disclosure are shown. Referring to fig. 8, the shader script generation apparatus 3 includes:
an acquisition module 31 for acquiring a first shader script based on a first programming language, the first shader script being used to characterize the rendering logic of the shader;
a parsing module 32 for generating a second shader script based on a second programming language and shader configuration information according to the first shader script, wherein the shader configuration information characterizes rendering parameters of the shader;
a generating module 33, configured to generate a target shader script according to the second shader script and the shader configuration information, where the target shader script is used to drive the shader to perform image rendering.
In one embodiment of the present disclosure, parsing module 32, when generating a second shader script based on a second programming language, is specifically configured to: analyzing the first shader script to generate an abstract syntax tree corresponding to the first shader script, wherein the abstract syntax tree characterizes a code syntax structure in the first shader script; converting the grammar expression of the code in the first shader script according to the abstract grammar tree and a preset conversion rule to generate a second shader script, wherein the conversion rule represents the mapping relation between the grammar expression of the first programming language and the grammar expression of the second programming language.
In one embodiment of the present disclosure, the parsing module 32 is specifically configured to, when converting a syntax expression of a code in the first shader script according to an abstract syntax tree and a preset conversion rule, generate a second shader script: locating a first declaration statement within the first shader script based on the first programming language according to the abstract syntax tree; converting the first declaration statement based on the first programming language into a second declaration statement based on the second programming language according to the type of the first declaration statement; a second shader script is generated from a second declarative sentence based on a second programming language.
In one embodiment of the present disclosure, the types of the first declaration statements include a first type for declaring a built-in type of variable of the first programming language or a second type for declaring a custom type of variable of the first programming language.
In one embodiment of the present disclosure, the first shader script further includes a first logic statement, and the parsing module 32 is further configured to: positioning at least two first logic sentences based on a first programming language in the first shader script according to the abstract syntax tree, wherein the at least two first logic sentences are used for representing script logic corresponding to the first shader script; converting the logic text in each first logic sentence into a logic text based on a second programming language, and splicing to generate a second logic sentence; the parsing module 32 is specifically configured to, when generating the second shader script according to the declarative statement based on the second programming language: and generating a second shader script according to the second sound statement and the second logic statement.
In one embodiment of the present disclosure, parsing module 32, when generating shader configuration information from a first shader script, is specifically configured to: analyzing the first shader script, and positioning a third declaration statement corresponding to a preset keyword in the first shader script, wherein the third declaration statement corresponding to the preset keyword is used for representing rendering parameters of the shader; and generating the configuration information of the shader through a third statement corresponding to the preset keyword.
In one embodiment of the disclosure, the target shader script includes a main function statement and a global variable statement, the main function statement is used for driving the shader to perform image rendering according to rendering logic, and the global variable statement characterizes rendering parameters of the shader when performing image rendering; the generating module 33 is specifically configured to: generating a main function statement according to the second shader script; and generating a global variable statement according to the shader configuration information.
In one embodiment of the present disclosure, the parsing module 32 is further configured to: analyzing the first shader script, and acquiring a reference statement corresponding to the first shader script and based on a first programming language, wherein the reference statement characterizes a dependent function referenced in the first shader script; generating a reference sentence based on a second programming language according to the reference sentence based on the first programming language; the generating module 33 is specifically configured to: a target shader script is generated from the second shader script, the shader configuration information, and the reference statement based on the second programming language.
In one embodiment of the present disclosure, the first programming language is a programming language with module loading functionality.
The acquiring module 31, the analyzing module 32 and the generating module 33 are sequentially connected. The shader script generating device 3 provided in this embodiment may execute the technical solution of the above method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure, as shown in fig. 9, the electronic device 4 includes
A processor 41 and a memory 42 communicatively connected to the processor 41;
memory 42 stores computer-executable instructions;
processor 41 executes computer-executable instructions stored in memory 42 to implement the shader script generation method in the embodiment shown in fig. 2-7.
Wherein optionally the processor 41 and the memory 42 are connected by a bus 43.
The relevant descriptions and effects corresponding to the steps in the embodiments corresponding to fig. 2 to fig. 7 may be understood correspondingly, and are not described in detail herein.
Referring to fig. 10, there is shown a schematic structural diagram of an electronic device 900 suitable for use in implementing embodiments of the present disclosure, where the electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (Personal Digital Assistant, PDA for short), a tablet (Portable Android Device, PAD for short), a portable multimedia player (Portable Media Player, PMP for short), an in-vehicle terminal (e.g., an in-vehicle navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 10 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 10, the electronic apparatus 900 may include a processing device (e.g., a central processor, a graphics processor, or the like) 901, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage device 908 into a random access Memory (Random Access Memory, RAM) 903. In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
In general, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 907 including, for example, a liquid crystal display (Liquid Crystal Display, LCD for short), a speaker, a vibrator, and the like; storage 908 including, for example, magnetic tape, hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic device 900 to communicate wirelessly or by wire with other devices to exchange data. While fig. 10 shows an electronic device 900 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When executed by the processing device 901, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above-described embodiments.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (Local Area Network, LAN for short) or a wide area network (Wide Area Network, WAN for short), or it may be connected to an external computer (e.g., connected via the internet using an internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In a first aspect, according to one or more embodiments of the present disclosure, there is provided a shader script generation method, including:
obtaining a first shader script based on a first programming language, the first shader script being used to characterize rendering logic of a shader; generating a second shader script and shader configuration information based on a second programming language according to the first shader script, wherein the shader configuration information characterizes rendering parameters of the shader, and the second programming language is a shader language corresponding to the shader; and generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to perform image rendering.
According to one or more embodiments of the present disclosure, the generating a second shader script based on a second programming language according to the first shader script includes: analyzing the first shader script, and generating an abstract syntax tree corresponding to the first shader script, wherein the abstract syntax tree represents a code syntax structure in the first shader script; converting the grammar expression of the codes in the first shader script according to the abstract grammar tree and a preset conversion rule to generate the second shader script, wherein the conversion rule represents the mapping relation between the grammar expression of the first programming language and the grammar expression of the second programming language.
According to one or more embodiments of the present disclosure, converting a syntax expression of code within the first shader script according to the abstract syntax tree and a preset conversion rule, generating the second shader script includes: locating a first declaration statement based on a first programming language within the first shader script according to the abstract syntax tree; converting the first declaration statement into a second declaration statement based on a second programming language according to the type of the first declaration statement; and generating the second shader script according to the second sound sentence.
According to one or more embodiments of the present disclosure, the type of the first declaration statement includes a first type or a second type, the first declaration statement of the first type is used for declaring a variable of a built-in type of the first programming language, and the first declaration statement of the second type is used for declaring a variable of a custom type of the first programming language.
According to one or more embodiments of the present disclosure, the first shader script further includes a first logic statement, the method further comprising: positioning at least two first logic sentences based on the first programming language in the first shader script according to the abstract syntax tree, wherein the at least two first logic sentences are used for representing script logic corresponding to the first shader script; converting the logic text in each first logic statement into logic text based on the second programming language, and splicing to generate a second logic statement; generating the second shader script according to the second sound sentence, including: and generating the second shader script according to the second sound statement and the second logic statement.
According to one or more embodiments of the present disclosure, generating shader configuration information from a first shader script includes: analyzing the first shader script, and positioning a third statement corresponding to a preset keyword in the first shader script, wherein the third statement corresponding to the preset keyword is used for representing rendering parameters of the shader; and generating the configuration information of the shader through a third statement corresponding to the preset keyword.
According to one or more embodiments of the present disclosure, the target shader script includes a main function statement for driving the shader to render an image according to the rendering logic, and a global variable statement characterizing rendering parameters of the shader when rendering the image; the generating a target shader script according to the second shader script and the shader configuration information includes: generating the main function statement according to the second shader script; and generating the global variable statement according to the shader configuration information.
According to one or more embodiments of the present disclosure, the method further comprises: analyzing the first shader script, and acquiring a reference statement corresponding to the first shader script and based on a first programming language, wherein the reference statement characterizes a dependent function referenced in the first shader script; generating a reference sentence based on the second programming language according to the reference sentence based on the first programming language; generating a target shader script according to the second shader script and the shader configuration information, including: generating a target shader script according to the second shader script, the shader configuration information, and a reference statement based on the second programming language.
According to one or more embodiments of the present disclosure, the first programming language is a programming language with module loading functionality.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided a shader script generation apparatus, including:
an acquisition module for acquiring a first shader script based on a first programming language, the first shader script being used to characterize rendering logic of a shader;
the system comprises a parsing module, a first programming module and a second programming module, wherein the parsing module is used for generating a second shader script and shader configuration information based on a second programming language according to a first shader script, and the shader configuration information characterizes rendering parameters of the shader;
and the generating module is used for generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to render images. In accordance with one or more embodiments of the present disclosure,
in accordance with one or more embodiments of the present disclosure, the parsing module, when generating a second shader script based on a second programming language, is specifically configured to: analyzing the first shader script, and generating an abstract syntax tree corresponding to the first shader script, wherein the abstract syntax tree represents a code syntax structure in the first shader script; converting the grammar expression of the codes in the first shader script according to the abstract grammar tree and a preset conversion rule to generate the second shader script, wherein the conversion rule represents the mapping relation between the grammar expression of the first programming language and the grammar expression of the second programming language.
According to one or more embodiments of the present disclosure, the parsing module is specifically configured to, when converting a syntax expression of a code in the first shader script according to the abstract syntax tree and a preset conversion rule, generate the second shader script: locating a first declaration statement based on a first programming language within the first shader script according to the abstract syntax tree; converting the first declaration statement into a second declaration statement based on a second programming language according to the type of the first declaration statement; and generating the second shader script according to the second sound sentence.
According to one or more embodiments of the present disclosure, the type of the first declaration statement includes a first type or a second type, the first declaration statement of the first type is used for declaring a variable of a built-in type of the first programming language, and the first declaration statement of the second type is used for declaring a variable of a custom type of the first programming language.
According to one or more embodiments of the present disclosure, the first shader script further includes a first logic statement, and the parsing module is further configured to: positioning at least two first logic sentences based on the first programming language in the first shader script according to the abstract syntax tree, wherein the at least two first logic sentences are used for representing script logic corresponding to the first shader script; converting the logic text in each first logic statement into logic text based on the second programming language, and splicing to generate a second logic statement; the parsing module is specifically configured to, when generating the second shader script according to the second declarative sentence: and generating the second shader script according to the second sound statement and the second logic statement.
According to one or more embodiments of the present disclosure, the parsing module is specifically configured to, when generating shader configuration information according to a first shader script: analyzing the first shader script, and positioning a third statement corresponding to a preset keyword in the first shader script, wherein the third statement corresponding to the preset keyword is used for representing rendering parameters of the shader; and generating the configuration information of the shader through a third statement corresponding to the preset keyword.
According to one or more embodiments of the present disclosure, the target shader script includes a main function statement for driving the shader to render an image according to the rendering logic, and a global variable statement characterizing rendering parameters of the shader when rendering the image; the generating module is specifically configured to: generating the main function statement according to the second shader script; and generating the global variable statement according to the shader configuration information.
According to one or more embodiments of the present disclosure, the parsing module is further configured to: analyzing the first shader script, and acquiring a reference statement corresponding to the first shader script and based on a first programming language, wherein the reference statement characterizes a dependent function referenced in the first shader script; generating a reference sentence based on the second programming language according to the reference sentence based on the first programming language; the generating module is specifically configured to: generating a target shader script according to the second shader script, the shader configuration information, and a reference statement based on the second programming language.
According to one or more embodiments of the present disclosure, the first programming language is a programming language with module loading functionality.
In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory to implement the shader script generation method as described above in the first aspect and the various possible designs of the first aspect.
In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the shader script generation method of the first aspect and the various possible designs of the first aspect above.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the shader script generation method of the first aspect and the various possible designs of the first aspect.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (12)

1. A method for generating a shader script, comprising:
obtaining a first shader script based on a first programming language, the first shader script being used to characterize rendering logic of a shader;
generating a second shader script and shader configuration information based on a second programming language according to the first shader script, wherein the shader configuration information characterizes rendering parameters of the shader, and the second programming language is a shader language corresponding to the shader;
and generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to perform image rendering.
2. The method of claim 1, wherein generating a second shader script based on a second programming language from the first shader script comprises:
Analyzing the first shader script, and generating an abstract syntax tree corresponding to the first shader script, wherein the abstract syntax tree represents a code syntax structure in the first shader script;
converting the grammar expression of the codes in the first shader script according to the abstract grammar tree and a preset conversion rule to generate the second shader script, wherein the conversion rule represents the mapping relation between the grammar expression of the first programming language and the grammar expression of the second programming language.
3. The method of claim 2, wherein converting the syntax expression of the code within the first shader script according to the abstract syntax tree and a preset conversion rule, generating the second shader script, comprises:
locating a first declaration statement based on a first programming language within the first shader script according to the abstract syntax tree;
converting the first declaration statement into a second declaration statement based on a second programming language according to the type of the first declaration statement;
and generating the second shader script according to the second sound sentence.
4. A method according to claim 3, wherein the type of the first declaration statement comprises a first type or a second type, the first declaration statement of the first type being for declaring a variable of a built-in type of the first programming language, the first declaration statement of the second type being for declaring a variable of a custom type of the first programming language.
5. The method of claim 3, wherein the first shader script further comprises a first logic statement, the method further comprising:
positioning at least two first logic sentences based on the first programming language in the first shader script according to the abstract syntax tree, wherein the at least two first logic sentences are used for representing script logic corresponding to the first shader script;
converting the logic text in each first logic statement into logic text based on the second programming language, and splicing to generate a second logic statement;
generating the second shader script according to the second sound sentence, including:
and generating the second shader script according to the second sound statement and the second logic statement.
6. The method of claim 1, wherein generating shader configuration information from the first shader script comprises:
analyzing the first shader script, and positioning a third statement corresponding to a preset keyword in the first shader script, wherein the third statement corresponding to the preset keyword is used for representing rendering parameters of the shader;
and generating the configuration information of the shader through a third statement corresponding to the preset keyword.
7. The method of claim 1, wherein the target shader script comprises a main function statement and a global variable statement, the main function statement being used to drive the shader to render an image according to the rendering logic, the global variable statement characterizing rendering parameters of the shader when rendering the image;
the generating a target shader script according to the second shader script and the shader configuration information includes:
generating the main function statement according to the second shader script;
and generating the global variable statement according to the shader configuration information.
8. The method according to any one of claims 1-7, further comprising:
Analyzing the first shader script, and acquiring a reference statement corresponding to the first shader script and based on a first programming language, wherein the reference statement characterizes a dependent function referenced in the first shader script;
generating a reference sentence based on the second programming language according to the reference sentence based on the first programming language;
generating a target shader script according to the second shader script and the shader configuration information, including:
generating a target shader script according to the second shader script, the shader configuration information, and a reference statement based on the second programming language.
9. A shader script generation apparatus, comprising:
an acquisition module for acquiring a first shader script based on a first programming language, the first shader script being used to characterize rendering logic of a shader;
the system comprises a parsing module, a first programming module and a second programming module, wherein the parsing module is used for generating a second shader script and shader configuration information based on a second programming language according to a first shader script, and the shader configuration information characterizes rendering parameters of the shader;
and the generating module is used for generating a target shader script according to the second shader script and the shader configuration information, wherein the target shader script is used for driving the shader to render images.
10. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory to implement the shader script generation method of any one of claims 1 to 8.
11. A computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the shader script generation method of any of claims 1 to 8.
12. A computer program product comprising a computer program which, when executed by a processor, implements the shader script generation method of any one of claims 1 to 8.
CN202111655976.9A 2021-12-31 2021-12-31 Shader script generation method and device, electronic equipment and storage medium Pending CN116416355A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111655976.9A CN116416355A (en) 2021-12-31 2021-12-31 Shader script generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111655976.9A CN116416355A (en) 2021-12-31 2021-12-31 Shader script generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116416355A true CN116416355A (en) 2023-07-11

Family

ID=87051594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111655976.9A Pending CN116416355A (en) 2021-12-31 2021-12-31 Shader script generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116416355A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118192952A (en) * 2024-03-29 2024-06-14 摩尔线程智能科技(北京)有限责任公司 Method, device, storage medium and program product for generating shader file

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118192952A (en) * 2024-03-29 2024-06-14 摩尔线程智能科技(北京)有限责任公司 Method, device, storage medium and program product for generating shader file

Similar Documents

Publication Publication Date Title
US8823718B2 (en) Systems and methods for downloading algorithmic elements to a coprocessor and corresponding techniques
CN106415492B (en) Language, function library and compiler for graphics and non-graphics computation on a graphics processor unit
EP1070301B1 (en) System and method for high-speed execution of graphics application programs including shading language instructions
US8462158B2 (en) Translating RenderMan shading language code
US10180825B2 (en) System and method for using ubershader variants without preprocessing macros
CN113342346B (en) Operator registration method, device, equipment and storage medium of deep learning framework
US8402450B2 (en) Map transformation in data parallel code
US20210365277A1 (en) Static reconcilliation of application view hierarchies
CN113626038A (en) Code conversion method, device, equipment and storage medium
CN111078230A (en) Code generation method and device
CN116416355A (en) Shader script generation method and device, electronic equipment and storage medium
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
US20140046984A1 (en) Compact type layouts
CN110033406B (en) Method and apparatus for processing image
CN114169525A (en) Inference framework calling method and device
US11144290B2 (en) Method and apparatus for enabling autonomous acceleration of dataflow AI applications
CN111782196A (en) MVP architecture-based development method and device
CN114428615B (en) CSS compiling method, style updating device, medium and equipment
CN116974646A (en) Plug-in generation method and device, electronic equipment and storage medium
CN116009951A (en) Code processing method, device, equipment and storage medium
CN115908668A (en) Video rendering method, device and system and storage medium
CN114003308A (en) Project text resource loading method and device, electronic equipment and storage medium
CN115878091A (en) Data processing method, device, equipment and storage medium
CN116931934A (en) Method, device, equipment and storage medium for converting shader codes
CN116795371A (en) Condition compiling method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination