Giter VIP home page Giter VIP logo

dxc's Introduction

Compile DirectX Shaders from Go

dxc is both a library and an executable to compile DirectX shaders and effects. It uses the D3DCompiler_XX.dll DLLs that come with any Windows system.

To install the binary dxc.exe, run

go install github.com/gonutz/dxc/cmd/dxc@latest

See the online documentation for how to use the library.

Command Line Tool

The cmd/dxc folder contains a command line version of this tool.

dxc takes its input from stdin and outputs the shader code to stdout. Errors go to stderr.

Example:

dxc -WX -T vs_2_0 < vertex_shader.hlsl > vertex_shader_blob.bin
Usage of dxc:
  -E string
    	entrypoint name (default "main")
  -Gch
    	compile as a child effect for FX 4.x targets
  -Gdp
    	disable effect performance mode
  -Gec
    	enable backwards compatibility mode
  -Ges
    	enable strict mode
  -Gfa
    	avoid flow control constructs
  -Gfp
    	prefer flow control constructs
  -Gis
    	force IEEE strictness
  -Gpp
    	force partial precision
  -O int
    	optimization level 0..3 (default 1)
  -Od
    	disable optimizations, only use this for debug builds
  -Op
    	disable preshaders
  -T string
    	target profile, e.g. vs_2_0, ps_4_1, fx_5_0 etc.
  -Vd
    	disable validation
  -WX
    	treat warnings as errors
  -Zi
    	enable debug information in output
  -Zpc
    	pack matrices in column-major order
  -Zpr
    	pack matrices in row-major order
  -res_may_alias
    	assume that UAVs/SRVs may alias for cs_5_0+

dxc's People

Watchers

 avatar  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.