HLSL-based multi-platform multi-language cross compiler and compilation method

A cross-compilation, target language technology, applied in the field of shader languages, can solve problems such as inconvenience, achieve the effect of easy setup and reduce development costs

Inactive Publication Date: 2018-11-23
SNAIL GAMES
View PDF6 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The disadvantage of this solution is that D3DCompiler is only available on the Windows platform, and other platforms need to use Wine to call D3DCompiler, which is very inconvenient

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
  • HLSL-based multi-platform multi-language cross compiler and compilation method
  • HLSL-based multi-platform multi-language cross compiler and compilation method
  • HLSL-based multi-platform multi-language cross compiler and compilation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0036] The preferred embodiments of the present invention will be described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described here are only used to illustrate and explain the present invention, and are not intended to limit the present invention.

[0037] figure 1 Be the cross-compiler structure diagram of multi-platform multi-target language based on HLSL according to the present invention, as figure 1 As shown, the cross-compiler 100 of the HLSL-based multi-platform multi-target language of the present invention includes: a code processor 110, a lexical analyzer 120, a syntax analyzer 130 and a code generator 140, wherein,

[0038] The code processor 110 is configured to preprocess the input HLSL code. Among them, the content of preprocessing includes: expanding referenced files, expanding predefined macros, removing comments in codes, and removing useless codes controlled by macros.

[0039] The lexical a...

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

The invention discloses an HLSL-based multi-platform multi-language cross compiler and a compilation method. The compiler comprises a code processor, a lexical analyzer, a syntactic analyzer and a code generator, wherein the code processor is used for preprocessing an HLSL code; the lexical analyzer is used for carrying out lexical analysis on the preprocessed HLSL code so as to generate a mark; the syntactic analyzer is used for carrying out syntactic analysis on the generated mark so as to construct an abstract syntax tree; and the code generator is used for generating an intermediate code unrelated to platforms according to the abstract syntax tree and generating the intermediate code into a target language code. According to the HLSL-based multi-platform multi-language cross compiler and the compilation method, multi-platform multi-language cross compilation can be realized.

Description

technical field [0001] The invention relates to the technical field of shader language, in particular to an HLSL-based multi-platform multi-target language cross compiler and compiling method. Background technique [0002] The shader language is a development language for programmable GPU pipelines. The code written in the shader language will be compiled by the shader compiler into executable instructions for the GPU. Currently common shader languages ​​include HLSL for Direct3D, GLSL for OpenGL, and MSL for Metal. These shader languages ​​are not syntactically compatible with each other and have their own compilers for their respective platforms. [0003] With the development of technology, especially the rise of mobile platforms, large game engines need to support multiple platforms and multiple graphics interfaces. In order to save development and maintenance costs, a common shader language for multiple platforms has become a common requirement. [0004] There are curre...

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 Applications(China)
IPC IPC(8): G06F8/41
CPCG06F8/42
Inventor 翟佳龙
Owner SNAIL GAMES
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