Coder Social home page Coder Social logo

djewsbury / hlslcrosscompiler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from james-jones/hlslcrosscompiler

0.0 3.0 0.0 5.61 MB

License: Other

C++ 46.14% C 40.80% CMake 0.23% Makefile 2.78% M4 0.14% Shell 2.10% XSLT 0.03% HTML 0.01% HLSL 1.83% Assembly 2.64% GLSL 3.18% Python 0.03% Objective-C 0.05% Roff 0.02%

hlslcrosscompiler's Introduction

What does this software do?
  Cross compiles HLSL bytecode to GLSL or GLSL ES. It also provides functions to
  decode the reflection information embedded in HLSL bytecode. Both offline and online compiliation
  is supported.

Supported bytecode formats:
  cs_4_0 cs_4_1 cs_5_0
  ds_5_0
  hs_5_0
  gs_4_0 gs_4_1 gs_5_0
  ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3 ps_4_0_level_9_0 ps_4_1 ps_5_0
  vs_4_0_level_9_3 vs_4_0_level_9_0 vs_4_1 vs_5_0   

Work is underway to support the DX9 bytecode formats:
  ps_2_0 ps_2_a ps_2_b ps_3_0
  vs_1_1 vs_2_0 vs_2_a vs_3_0
  
Supported target languages:
  GLSL ES 100
  GLSL ES 300
  GLSL ES 310
  GLSL 120
  GLSL 130
  GLSL 140
  GLSL 150
  GLSL 330
  GLSL 400
  GLSL 410
  GLSL 420
  GLSL 430
  GLSL 440

I have plans to add support for more target languages including:
  ARB assembly (ARB_vertex_program et al.)
  NVIDIA assembly (NV_vertex_program et al.)

If the source shader contains instructions not support by the target language then compilation is allowed
to fail at the GLSL compile stage, i.e. the cross compiler may not generate errors/warnings but an OpenGL
driver will reject the shader.

The tests directory contains HLSL, bytecode and asm versions of some shaders used to verify this decoder.
There are also a few sample applications used to make sure that generated GLSL is correct.

A cmake makefile can be found in the mk directory.

Generating hlsl_opcode_funcs_glsl.h
  Use fwrap.py -f hlsl_opcode_funcs.glsl
  fwrap.py can be found in my Helpful-scripts github repository.

For further information please see the Wiki page for this project at
https://github.com/James-Jones/HLSLCrossCompiler/wiki.

hlslcrosscompiler's People

Contributors

james-jones avatar jpostma avatar djewsbury avatar vk2gpu avatar mrshoor avatar nosferalatu avatar corillian avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.