基于对照表的HLSL着色器源码转换为GLSL着色器源码的方法

By generating a lookup table, the HLSL shader source code is aligned and converted with the GLSL shader source code, solving the problem of HLSL to GLSL conversion on domestic platforms. This achieves a flexible and scalable conversion method that is adaptable to various domestic platform architectures.

CN115454438BActive Publication Date: 2026-07-17THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP
Filing Date
2022-08-05
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively convert HLSL shader source code to GLSL shader source code on domestic platforms, especially under various CPU and operating system architectures. The development and maintenance of cross-compilers are difficult, leading to conversion failures.

Method used

By generating a lookup table, the HLSL shader source code is aligned and converted with the GLSL shader source code. The HLSL compiler and GLSL compiler are then used to separate and replace the source code, generating a lookup table to adapt to different domestic platform architectures, including scanners, lexical analyzers, and semantic analyzers, ensuring the correctness of the syntax tree.

Benefits of technology

It enables flexible and scalable conversion from HLSL to GLSL on various domestic platforms, simplifies development and maintenance, supports heterogeneous platforms, and the lookup table can be upgraded independently without recompiling the program, adapting to future technological developments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115454438B_ABST
    Figure CN115454438B_ABST
Patent Text Reader

Abstract

本发明公开了一种基于对照表的HLSL着色器源码转换为GLSL着色器源码的方法,包括步骤1,获取已有HLSL着色器源码和转换后的GLSL着色器源码,生成对照表;步骤2,基于所述对照表,将HLSL着色器源码转换为GLSL着色器源码。本发明在国产平台下基于对照表自动实现HLSL中顶点和像素着色器源码转GLSL中顶点和片段着色器源码,根据建立的HLSL语言顶点和像素着色器与GLSL语言顶点和片段着色器关键字对照表,通过扫描HLSL语言源码,将找到的HLSL关键字转化为GLSL关键字,并补齐GLSL下着色器所具有的语法结构,从而实现顶点和像素着色器算法和处理函数自动翻译为顶点和片段着色器的功能。
Need to check novelty before this filing date? Find Prior Art