Shading language translation method

A language translation and language technology, applied in the field of data processing, can solve problems such as unfavorable optimization and debugging, poor code readability, etc., and achieve the effect of improving readability and scalability

Active Publication Date: 2020-09-22
BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the code translated by the disassembly operation has the defect of poor readability, which is not conducive to optimization and debugging on the target platform

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Shading language translation method
  • Shading language translation method
  • Shading language translation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach D

[0063] Embodiment D: Optionally, if the second node in the subtree uses the first global resource, write the information of the first global resource into the information of the first function; the first global resource includes texture At least one of resources, buffer resources, and sampler resources.

[0064] Continuing with the above HLSL example, you can continue to analyze the subtree with FNode_B_C as the root node, and when it is found that a node in the subtree uses a certain global resource, record the information of this global resource into the information of function F0 . Among them, if the function F0 uses multiple global resources, such as Buffer, Texture and sampler resources, the Buffer, Texture and sampler resources can be recorded respectively.

Embodiment approach E

[0065] Embodiment E: Optionally, if the third node in the subtree uses the first global parameter passing variable, write the information of the first global parameter passing variable into the information of the first function.

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

An embodiment of the present application provides a coloring language translation method. In the coloring language translation method, the abstract syntax tree of the code file of the original coloring language is obtained, and the keywords of the nodes in the abstract syntax tree are analyzed to obtain the coloring language information contained in the code file of the original coloring language. Combined with the set information mapping rules, the coloring language information can be translated to obtain a code file of another coloring language. In this process, the node analysis is performed based on the abstract syntax tree, and the original grammatical structure of the code file of the original coloring language is preserved. At the same time, based on the analysis of node keywords, the corresponding translation between different types of information is realized, which is conducive to improving the readability of translation results; in addition, the information mapping rules can be updated according to actual needs, improving It improves the scalability of the language translation method, and supports the new coloring language syntax conveniently and quickly.

Description

technical field [0001] The present application relates to the technical field of data processing, in particular to a coloring language translation method. Background technique [0002] Shading Language (Shading Language) is a kind of shading language specially used for programming shaders. Currently, a high-level shader language (High Level Shader Language, HLSL) developed and owned by Microsoft is more popular in the industry. However, HLSL can only work on the Windows (an operating system developed by Microsoft) platform, which leads to the problem of limited use of target platforms running other operating systems. [0003] In the prior art, there is a way of translating HLSL codes into codes usable by a target platform through a disassembly operation. However, the code translated by the disassembly operation has the disadvantage of poor readability, which is not conducive to optimization and debugging on the target platform. Therefore, a new solution remains to be prop...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/41G06T15/00
CPCG06F8/42G06T15/005
Inventor 孙思远
Owner BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products